Changeset 8
- Timestamp:
- Sep 29, 2008, 2:35:42 PM (16 years ago)
- Files:
-
- 9 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
base.php
r6 r8 1 1 <?php 2 include('database.php');3 include('common.php');4 2 5 3 // Include type definitions … … 15 13 include('types/Hyperlink.php'); 16 14 17 function ShowList($List, $Column = '', $ColumnValue = 0 )15 function ShowList($List, $Column = '', $ColumnValue = 0, $Title = '') 18 16 { 19 17 global $Database, $Types, $Config; 20 18 21 $Output = '<div>'.$List['Title'].'</div><table class="WideTable"><tr>'; 19 if($Title == '') $Output = '<div>'.$List['Title'].'</div>'; 20 else $Output = '<div>'.$Title.'</div>'; 21 $Output .= '<table class="WideTable"><tr>'; 22 22 foreach($List['Items'] as $Item) 23 23 { … … 52 52 { 53 53 $OrderDirection = array('ASC', 'DESC'); 54 $ Where .= 'ORDER BY `'.$_SESSION['OrderColumn'].'` '.$OrderDirection[$_SESSION['OrderDirection']];55 } 54 $Order = 'ORDER BY `'.$_SESSION['OrderColumn'].'` '.$OrderDirection[$_SESSION['OrderDirection']]; 55 } else $Order = ''; 56 56 57 57 if(array_key_exists('Page', $_GET)) $Page = $_GET['Page']; else $Page = 0; 58 //$Where .= ' AND (ValidFromTime <= NOW()) AND ((ValidToTime >= NOW()) OR (ValidToTime IS NULL))'; 59 $Where .= ' '.$Order; 58 60 $DbResult = $Database->select($List['TableName'], 'COUNT(*)', $Where); 59 61 //echo($Database->LastQuery); … … 71 73 $ItemType = explode(':', $Item['Type']); 72 74 $Type = $Types[$ItemType[0]]; 73 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1];74 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $ DbRow[$Index], $List['TableName'], $DbRow['Id']);75 $ItemDefinition = array('Name' => $Index, 'Value' => $DbRow[$Index], 'SourceTable' => $List['TableName'], 'SourceItemId' => $DbRow['Id'], 'Type' => $Item['Type']); 76 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $ItemDefinition); 75 77 else $Value = $Type['CallbackView']; 76 $Value = str_replace('%value%', $DbRow[$Index], $Value);77 78 $Output .= '<td>'.$Value.'</td>'; 78 79 } … … 101 102 { 102 103 $Type = $Types[$ItemType[0]]; 103 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1];104 if(is_callable($Type['CallbackEdit'])) $Value = $Type['CallbackEdit']($Type, $ DbRow[$Index], $List['TableName'], $DbRow['Id']);104 $ItemDefinition = array('Name' => $Index, 'Value' => $DbRow[$Index], 'SourceTable' => $List['TableName'], 'SourceItemId' => $DbRow['Id'], 'Type' => $Item['Type']); 105 if(is_callable($Type['CallbackEdit'])) $Value = $Type['CallbackEdit']($Type, $ItemDefinition); 105 106 else $Value = $Type['CallbackEdit']; 106 $Value = str_replace('%value%', $DbRow[$Index], $Value); 107 $Value = str_replace('%name%', $Index, $Value); 108 if($Item['Required'] == 1) $Required = ' *'; else $Required = ''; 107 if($Item['Required'] == 1) $Required = '*'; else $Required = ''; 109 108 $Output .= '<tr><td>'.$Item['TextBefore'].':'.$Required.'</td><td title="'.$Item['Help'].'">'.$Value.'</td></tr>'; 110 109 } … … 147 146 global $Database, $Types; 148 147 149 $Output = '<form action="?Action=AddItemFinish" method="post"><table class="WideTable">'; 150 $Output .= '<tr><th>Jméno položky</th><th>Hodnota</th></tr>'; 148 $DefinitionItems = array(); 151 149 $AfterTableOutput = ''; 152 150 foreach($List['Items'] as $Index => $Item) … … 155 153 if(($ItemType[0] != 'PointerOneToMany') and ($Item['Name'] != $Column)) 156 154 { 157 $Type = $Types[$ItemType[0]]; 158 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1]; 159 if(is_callable($Type['CallbackEdit'])) $Value = $Type['CallbackEdit']($Type, $Type['InitValue'], $List['TableName'], 0); 160 else $Value = $Type['CallbackEdit']; 161 $Value = str_replace('%value%', $Type['InitValue'], $Value); 162 $Value = str_replace('%name%', $Index, $Value); 163 if($Item['Required'] == 1) $Required = ' *'; else $Required = ''; 164 $Output .= '<tr><td>'.$Item['TextBefore'].':'.$Required.'</td><td title="'.$Item['Help'].'">'.$Value.'</td></tr>'; 155 if($Item['Required'] == 1) $Required = '*'; else $Required = ''; 156 $DefinitionItems[] = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'].$Required, 'Value' => '', 'SourceTable' => $List['TableName'], 'SourceItemId' => 0); 165 157 } else 166 158 if($Item['Name'] == $Column) 167 159 { 168 $AfterTableOutput = '<input type="hidden" name="'.$Column.'" value="'.$ColumnValue.'" />'; 169 } 170 } 171 $Output .= '</table>'.$AfterTableOutput.'<input type="submit" value="Přidat"></form>'; 160 $DefinitionItems[] = array('Name' => $Column, 'Type' => 'String', 'Caption' => '', 'Value' => $ColumnValue); 161 } 162 } 163 $Form = new Form(); 164 $Form->Definition = array 165 ( 166 'Title' => 'Titulek', 167 'SubmitBuffonText' => 'Přidat', 168 'Items' => $DefinitionItems, 169 ); 170 $Form->OnSubmit = '?Action=AddItemFinish'; 171 $Output .= $Form->ShowEditForm().$AfterTableOutput; 172 172 if(($Column != '') and ($ColumnValue != 0)) 173 173 { … … 216 216 { 217 217 $Type = $Types[$ItemType[0]]; 218 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1];219 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $ DbRow[$Index], $List['TableName'], $DbRow['Id']);218 $ItemDefinition = array('Name' => $Index, 'Value' => $DbRow[$Index], 'SourceTable' => $List['TableName'], 'SourceItemId' => $DbRow['Id'], 'Type' => $Item['Type']); 219 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $ItemDefinition); 220 220 else $Value = $Type['CallbackView']; 221 $Value = str_replace('%value%', $DbRow[$Index], $Value);222 221 $Output .= '<tr><td>'.$Item['TextBefore'].':</td><td title="'.$Item['Help'].'">'.$Value.'</td></tr>'; 223 222 } … … 241 240 { 242 241 $SubList = $Lists[$ItemType[1]]; 243 $Output .= ShowList($SubList, $ItemType[2], $DbRow['Id'] ).'<br /><br />';242 $Output .= ShowList($SubList, $ItemType[2], $DbRow['Id'], $Item['TextBefore']).'<br /><br />'; 244 243 } 245 244 } -
index.php
r5 r8 1 1 <?php 2 2 3 include('config.php'); 4 session_start(); 3 include_once('global.php'); 5 4 include('base.php'); 6 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);7 $Database->Prefix = $Config['Database']['Prefix'];8 $Database->charset($Config['Database']['Charset']);9 5 10 $Output = '<?xml version="1.0" encoding="utf-8"?>'."\n". 11 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'. 12 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'. 13 '<head><link rel="stylesheet" href="style.css" type="text/css" media="all" />'. 14 //'<script type="text/javascript" src="global.js"></script>'. 15 '<title>IS</title> 16 </head><body><table class="base"><tr><td class="menu">'; 6 class IndexPage extends Page 7 { 8 var $Dependencies = array('News'); 9 var $FullTitle = ''; 10 var $ShortTitle = ''; 17 11 18 LoadTypeDefinition(); 19 LoadListDefinition(); 20 $Output .= $Output; 21 $Output .= TableList(1); 22 $Output .= TableList(0); 23 $Output .= '</td><td class="main">'; 24 $Output .= Output(); 25 $Output .= '</td></tr></table></body></html>'; 26 echo($Output); 27 //echo(phpinfo()); 12 function Show() 13 { 14 $FormUserLogin = array( 15 'Title' => 'Přihlášení', 16 'SubmitBuffonText' => 'Přihlásit', 17 'Items' => array( 18 array('Name' => 'UserName', 'Type' => 'String', 'Caption' => 'Jméno', 'Value' => ''), 19 array('Name' => 'Password', 'Type' => 'Password', 'Caption' => 'Heslo', 'Value' => ''), 20 ), 21 ); 22 $FormUserRegister = array 23 ( 24 'Title' => 'Registrace uživatele', 25 'Table' => 'User', 26 'SubmitBuffonText' => 'Registrovat', 27 'Items' => array( 28 array('Name' => 'UserName', 'Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Value' => ''), 29 array('Name' => 'Password', 'Type' => 'Password', 'Caption' => 'Heslo', 'Value' => ''), 30 array('Name' => 'Password2', 'Type' => 'Password', 'Caption' => 'Potvrzení hesla', 'Value' => ''), 31 array('Name' => 'Email', 'Type' => 'String', 'Caption' => 'E-mail', 'Value' => ''), 32 array('NAme' => 'FirstName', 'Type' => 'String', 'Caption' => 'Křestní jméno', 'Value' => ''), 33 array('Name' => 'SecondName', 'Type' => 'String', 'Caption' => 'Příjmení', 'Value' => ''), 34 ), 35 ); 36 37 $Output = '<table class="base"><tr><td class="menu">'; 38 if(array_key_exists('Action', $_GET)) 39 { 40 if($_GET['Action'] == 'Login') 41 { 42 $Output .= $this->SystemMessage('Přihlášení', $this->System->Modules['User']->Login($_POST['UserName'], $_POST['Password'])); 43 } else 44 if($_GET['Action'] == 'Logout') 45 { 46 $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 47 } else 48 if($_GET['Action'] == 'UserRegister') 49 { 50 $Form = new Form(); 51 $Form->Definition = $FormUserRegister; 52 $Form->OnSubmit = '?Action=UserRegisterSave'; 53 $Output .= $Form->ShowEditForm(); 54 } else 55 if($_GET['Action'] == 'UserRegisterConfirm') 56 { 57 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 58 } else 59 if($_GET['Action'] == 'UserRegisterSave') 60 { 61 $Form = new Form(); 62 $Form->Definition = $FormUserRegister; 63 $Form->LoadValuesFromForm(); 64 $Output .= $this->SystemMessage('Registrace', $this->System->Modules['User']->Register($Form->Values['Name'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['FirstName'], $Form->Values['SecondName'])); 65 } 66 } 67 if($this->System->Modules['User']->User['Id'] == 0) 68 { 69 if(!array_key_exists('Action', $_GET)) 70 { 71 $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=LoginForm">Přihlášení</a> <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserRegister">Registrace</a>'; 72 $Form = new Form(); 73 $Form->Definition = $FormUserLogin; 74 $Form->OnSubmit = '?Action=Login'; 75 $Output .= $Form->ShowEditForm(); 76 } 77 } 78 else 79 { 80 $Output .= $this->System->Modules['User']->User['UserName'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>'; 81 $Output .= '<br /><br />'; 82 LoadTypeDefinition(); 83 LoadListDefinition(); 84 $Output .= TableList(1); 85 $Output .= TableList(0); 86 $Output .= '</td><td class="main">'; 87 $Output .= Output(); 88 $Output .= '</td></tr></table></body></html>'; 89 } 90 return($Output); 91 } 92 } 93 94 $System->AddModule(new IndexPage()); 95 $System->Modules['IndexPage']->GetOutput(); 96 28 97 ?> -
sql/demo_database.sql
r7 r8 1 1 -- phpMyAdmin SQL Dump 2 -- version 2.11.9 2 -- version 2.11.9.1 3 3 -- http://www.phpmyadmin.net 4 4 -- 5 5 -- Počítač: localhost 6 -- Vygenerováno: Úterý 16. září 2008, 09:166 -- Vygenerováno: Pondělí 29. září 2008, 14:31 7 7 -- Verze MySQL: 5.0.51 8 8 -- Verze PHP: 5.2.6 … … 31 31 `Workgroup` varchar(255) collate utf8_czech_ci NOT NULL, 32 32 `WINS` varchar(255) collate utf8_czech_ci NOT NULL, 33 `HostList` int(11) NOT NULL, 33 34 PRIMARY KEY (`Id`) 34 35 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=5 ; … … 38 39 -- 39 40 40 INSERT INTO `Area` (`Id`, `Name`, `NetworkIPAddress`, `IPAddressMask`, `DNSPrimary`, `DNSSecondary`, `DHCP`, `Domain`, `Workgroup`, `WINS` ) VALUES41 (1, 'Bytovky dolní konec', '192.168.12.0', '255.255.255.0', '192.168.0.22', '46.33.1.2', '192.168.12.1', 'freenet.cz', 'FREENET', '192.168.0.23' ),42 (2, 'Centrum Komořany', '192.168.10.0', '255.255.255.0', '192.168.0.22', '', '192.168.10.1', 'centrum.freenet.cz', 'CENTRUM', '192.168.0.23' ),43 (3, 'Serverovna', '192.168.0.0', '255.255.255.0', '192.168.0.22', '44.55.22.34', '19ě.168.0.1', 'freenet.cz', 'FREENET', '192.168.0.23' ),44 (4, 'Kůlna', '10.198.0.0', '255.255.0.0', '192.168.0.1', '129.168.0.22', '10.198.0.1', 'kulna.freenet.cz', 'KULNA', '192.168.0.23' );41 INSERT INTO `Area` (`Id`, `Name`, `NetworkIPAddress`, `IPAddressMask`, `DNSPrimary`, `DNSSecondary`, `DHCP`, `Domain`, `Workgroup`, `WINS`, `HostList`) VALUES 42 (1, 'Bytovky dolní konec', '192.168.12.0', '255.255.255.0', '192.168.0.22', '46.33.1.2', '192.168.12.1', 'freenet.cz', 'FREENET', '192.168.0.23', 0), 43 (2, 'Centrum Komořany', '192.168.10.0', '255.255.255.0', '192.168.0.22', '', '192.168.10.1', 'centrum.freenet.cz', 'CENTRUM', '192.168.0.23', 0), 44 (3, 'Serverovna', '192.168.0.0', '255.255.255.0', '192.168.0.22', '44.55.22.34', '19ě.168.0.1', 'freenet.cz', 'FREENET', '192.168.0.23', 0), 45 (4, 'Kůlna', '10.198.0.0', '255.255.0.0', '192.168.0.1', '129.168.0.22', '10.198.0.1', 'kulna.freenet.cz', 'KULNA', '192.168.0.23', 0); 45 46 46 47 -- -------------------------------------------------------- … … 139 140 140 141 -- 142 -- Struktura tabulky `History` 143 -- 144 145 CREATE TABLE IF NOT EXISTS `History` ( 146 `Id` int(11) NOT NULL auto_increment, 147 `Author` int(11) NOT NULL, 148 `TimeValidFrom` datetime NOT NULL, 149 `TimeValidTo` datetime NOT NULL, 150 `PermanentId` int(11) NOT NULL, 151 `ListId` int(11) NOT NULL, 152 `TimeCreation` datetime NOT NULL, 153 PRIMARY KEY (`Id`) 154 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; 155 156 -- 157 -- Vypisuji data pro tabulku `History` 158 -- 159 160 161 -- -------------------------------------------------------- 162 163 -- 141 164 -- Struktura tabulky `Host` 142 165 -- … … 153 176 `ParentHost` int(11) NOT NULL, 154 177 `Member` int(11) NOT NULL, 178 `Area` int(11) NOT NULL, 155 179 PRIMARY KEY (`Id`) 156 180 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=10 ; … … 160 184 -- 161 185 162 INSERT INTO `Host` (`Id`, `DomainName`, `NetBIOSName`, `LocalIPAddress`, `PublicIPAddress`, `LastOnlineDate`, `Type`, `Interface`, `ParentHost`, `Member` ) VALUES163 (1, 'george', 'GEORGE', '192.168.0.23', '', '0000-00-00', 1, 0, 4, 0 ),164 (2, 'stroj', 'STROJ', '192.168.1.44', '33.66.44.77', '0000-00-00', 5, 0, 0, 0 ),165 (3, 'telefon', 'TELEFON', '192.168.1.45', '', '0000-00-00', 2, 0, 0, 0),166 (4, 'router-inet', 'ROUTER-INET', '192.168.0.2', '77.33.55.12', '0000-00-00', 4, 0, 0, 0),167 (5, 'muhehe', 'MUHEHE', '192.168.0.4', '', '0000-00-00', 1, 0, 0, 0),168 (6, 'jonny', 'JONNY', '192.168.0.6', '', '0000-00-00', 1, 0, 0, 0),169 (7, 'laserovka-samsung', 'LASEROVKA-SAMSUNG', '192.168.12.4', '', '0000-00-00', 6, 0, 0, 0 ),170 (8, 'www', 'WWW', '192.168.0.7', '34.22.1.4', '0000-00-00', 5, 0, 0, 0 ),171 (9, 'peklo', 'PEKLO', '192.168.66.66', '', '0000-00-00', 7, 0, 4, 2 );186 INSERT INTO `Host` (`Id`, `DomainName`, `NetBIOSName`, `LocalIPAddress`, `PublicIPAddress`, `LastOnlineDate`, `Type`, `Interface`, `ParentHost`, `Member`, `Area`) VALUES 187 (1, 'george', 'GEORGE', '192.168.0.23', '', '0000-00-00', 1, 0, 4, 0, 0), 188 (2, 'stroj', 'STROJ', '192.168.1.44', '33.66.44.77', '0000-00-00', 5, 0, 0, 0, 0), 189 (3, 'telefon', 'TELEFON', '192.168.1.45', '', '0000-00-00', 2, 0, 4, 1, 2), 190 (4, 'router-inet', 'ROUTER-INET', '192.168.0.2', '77.33.55.12', '0000-00-00', 4, 0, 1, 1, 4), 191 (5, 'muhehe', 'MUHEHE', '192.168.0.4', '', '0000-00-00', 1, 0, 1, 1, 2), 192 (6, 'jonny', 'JONNY', '192.168.0.6', '', '0000-00-00', 1, 0, 1, 1, 1), 193 (7, 'laserovka-samsung', 'LASEROVKA-SAMSUNG', '192.168.12.4', '', '0000-00-00', 6, 0, 0, 0, 0), 194 (8, 'www', 'WWW', '192.168.0.7', '34.22.1.4', '0000-00-00', 5, 0, 0, 0, 0), 195 (9, 'peklo', 'PEKLO', '192.168.66.66', '', '0000-00-00', 7, 0, 4, 2, 0); 172 196 173 197 -- -------------------------------------------------------- … … 214 238 `HostList` int(11) NOT NULL, 215 239 `Tariff` int(11) NOT NULL, 240 `UserList` int(11) NOT NULL, 241 `ValidFromTime` datetime default NULL, 242 `ValidToTime` datetime default NULL, 216 243 PRIMARY KEY (`Id`) 217 244 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ; … … 221 248 -- 222 249 223 INSERT INTO `Member` (`Id`, `Subject`, `ResponsibleUser`, `MapPositionX`, `MapPositionY`, `FamilyMemberCount`, `MembershipDate`, `MemberState`, `HostList`, `Tariff` ) VALUES224 (1, 2, 1, 123, 567, 3, '0000-00-00', 2, 0, 3 ),225 (2, 3, 6, 123, 123, 2, '0000-00-00', 2, 0, 4 ),226 (3, 7, 8, 0, 0, 0, '0000-00-00', 2, 0, 2 ),227 (4, 8, 11, 0, 0, 0, '0000-00-00', 2, 0, 3 ),228 (5, 10, 1, 32423, 21, 2, '0000-00-00', 1, 0, 3 ),229 (6, 12, 12, 12, 2, 1, '0000-00-00', 3, 0, 1 );250 INSERT INTO `Member` (`Id`, `Subject`, `ResponsibleUser`, `MapPositionX`, `MapPositionY`, `FamilyMemberCount`, `MembershipDate`, `MemberState`, `HostList`, `Tariff`, `UserList`, `ValidFromTime`, `ValidToTime`) VALUES 251 (1, 2, 1, 123, 567, 3, '0000-00-00', 2, 0, 3, 0, '2008-09-01 00:00:00', NULL), 252 (2, 3, 6, 123, 123, 2, '0000-00-00', 2, 0, 4, 0, '2008-09-01 00:00:00', NULL), 253 (3, 7, 8, 0, 0, 0, '0000-00-00', 2, 0, 2, 0, '2008-09-01 00:00:00', NULL), 254 (4, 8, 11, 0, 0, 0, '0000-00-00', 2, 0, 3, 0, '2008-09-01 00:00:00', NULL), 255 (5, 10, 1, 32423, 21, 2, '0000-00-00', 1, 0, 3, 0, '2008-09-01 00:00:00', NULL), 256 (6, 12, 12, 12, 2, 1, '0000-00-00', 3, 0, 1, 0, '2008-09-01 00:00:00', NULL); 230 257 231 258 -- -------------------------------------------------------- … … 312 339 `VisibleInMenu` int(11) NOT NULL default '1', 313 340 PRIMARY KEY (`Id`) 314 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 5;341 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17 ; 315 342 316 343 -- … … 332 359 (12, 'FinanceTransaction', 'Platební operace', 0, '', 1), 333 360 (13, 'SystemList', 'Definice tabulek', 1, '', 1), 334 (14, 'SystemListItem', 'Definice položek formulářů', 1, '', 0); 361 (14, 'SystemListItem', 'Definice položek formulářů', 1, '', 0), 362 (15, 'UserOnline', 'Přihlášení uživatelé', 1, '', 1), 363 (16, 'History', 'Historie záznamů', 1, '', 0); 335 364 336 365 -- -------------------------------------------------------- … … 354 383 `List` int(11) NOT NULL, 355 384 PRIMARY KEY (`Id`) 356 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 10;385 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=131 ; 357 386 358 387 -- … … 387 416 (25, 'Phone', 'Telefón', '', 'String', '', '', 0, 1, 0, 0, 1), 388 417 (26, 'Notice', 'Poznámka', '', 'String', '', '', 0, 1, 0, 0, 3), 389 (27, 'MemberState', 'Stav připojení :', '', 'MemberState', '', '', 1, 1, 1, 0, 4),418 (27, 'MemberState', 'Stav připojení', '', 'MemberState', '', '', 1, 1, 1, 0, 4), 390 419 (28, 'HostList', 'Registrované zařízení', '', 'PointerOneToMany:Host:Member', '', '', 0, 1, 0, 0, 4), 391 420 (29, 'Name', 'Označení', '', 'String', '', '', 1, 1, 1, 1, 5), … … 414 443 (52, 'PurcheasedFrom', 'Zakoupeno od', '', 'PointerOneToOne:Subject', '', '', 0, 1, 0, 0, 7), 415 444 (53, 'PurcheasedAsset', 'Nakoupené zboží', '', 'PointerOneToMany:Asset:PurcheasedFrom', '', '', 0, 1, 0, 0, 3), 416 (54, ' Subject', 'Subjekt', '', 'PointerOneToOne:Subject', '', '', 0, 1, 0, 0, 1),417 ( 55, 'UserList', 'Seznam uživatelů', '', 'PointerOneToMany:User:Subject', '', '', 0, 1, 0, 0, 3),445 (54, 'Member', 'Člen', '', 'PointerOneToOne:Member', '', '', 0, 1, 0, 0, 1), 446 (113, 'ValidFromTime', 'Platnost od', '', 'Date', '', '', 1, 1, 0, 0, 4), 418 447 (57, 'Price', 'Cena', '', 'Integer', '', '', 1, 1, 1, 0, 8), 419 448 (56, 'Name', 'Označení', '', 'String', '', '', 1, 1, 1, 1, 8), … … 440 469 (78, 'User', 'Registroval', '', 'PointerOneToOne:User', '', '', 0, 1, 0, 0, 10), 441 470 (79, 'Type', 'Typ', '', 'BankAccountType', '', '', 1, 1, 1, 0, 10), 442 (80, 'MemberList', 'Členství', '', 'PointerOneToMany:Member: ResponsibleUser', '', '', 0, 1, 0, 0, 3),471 (80, 'MemberList', 'Členství', '', 'PointerOneToMany:Member:Subject', '', '', 0, 1, 0, 0, 3), 443 472 (81, 'Name', 'Systémové jméno typu', '', 'String', 'Jméno by mělo obsahovat pouze velké a malé písmena. V podsložece types projektu jsou umístěny výkonné soubory pro jednotlivé typy.', 'Name', 1, 1, 1, 1, 11), 444 473 (82, 'ParentType', 'Rodičovský typ', '', 'String', '', '', 1, 1, 1, 0, 11), … … 469 498 (107, 'Editable', 'Editovatelné', '', 'Boolean', 'Určuje zda je možné danou položku ručně editovat nebo zda je měněna automaticky systémem.', '', 1, 1, 0, 0, 14), 470 499 (108, 'VisibleInList', 'Viditelné v seznamu', '', 'Boolean', 'Určuje viditelnost této položky v seznamu', '', 1, 1, 0, 0, 14), 471 (109, 'VisibleInPointer', 'Viditelné v odkazech', '', 'Boolean', 'Určuje viditelnost této položky v názvech odkazů na tuto položku', '', 1, 1, 0, 0, 14); 500 (109, 'VisibleInPointer', 'Viditelné v odkazech', '', 'Boolean', 'Určuje viditelnost této položky v názvech odkazů na tuto položku', '', 1, 1, 0, 0, 14), 501 (110, 'Area', 'Umístění', '', 'PointerOneToOne:Area', 'Vyberte oblast, do které toto zařízení patří.', '', 0, 1, 0, 0, 2), 502 (111, 'HostList', 'Seznam zařízení', '', 'PointerOneToMany:Host:Area', '', '', 0, 1, 0, 0, 5), 503 (112, 'UserList', 'Uživatelů', '', 'PointerOneToMany:User:Member', '', '', 0, 1, 0, 0, 4), 504 (114, 'ValidToTime', 'Platnost do', '', 'Date', '', '', 1, 1, 0, 0, 4), 505 (115, 'User', 'Uživatel', '', 'PointerOneToOne:User', '', '', 1, 0, 1, 1, 15), 506 (116, 'LoginTime', 'Čas přihlášení', '', 'Date', '', '', 0, 0, 0, 0, 15), 507 (117, 'ActivityTime', 'Naposledy aktivní', '', 'Date', '', '', 0, 0, 0, 0, 15), 508 (118, 'SessionId', 'Identifikace spojení', '', 'String', '', '', 0, 0, 0, 0, 15), 509 (119, 'IpAddress', 'IP adresa', '', 'String', '', '', 0, 0, 0, 0, 15), 510 (120, 'HostName', 'Jméno počítače', '', 'String', '', '', 0, 0, 1, 0, 15), 511 (121, 'Locked', 'Zamčeno', '', 'Boolean', '', '', 0, 0, 0, 0, 1), 512 (122, 'RegistrationTime', 'Čas registrace', '', 'Date', '', '', 0, 0, 0, 0, 1), 513 (123, 'LastLoginTime', 'Čas posledního přihlášení', '', 'Date', '', '', 0, 0, 0, 0, 1), 514 (124, 'LastIpAddress', 'Poslední IP adresa', '', 'String', '', '', 0, 0, 0, 0, 1), 515 (125, 'Author', 'Autor', '', 'PointerOneToOne:User', '', '', 1, 0, 0, 0, 16), 516 (126, 'TimeCreation', 'Čas vytvoření', '', 'Date', '', '', 1, 0, 0, 0, 16), 517 (127, 'TimeValidFrom', 'Platnost od', '', 'Date', '', '', 1, 1, 0, 0, 16), 518 (128, 'TimeValidTo', 'Platnost do', '', 'Date', '', '', 1, 1, 0, 0, 16), 519 (129, 'ListId', 'Odkazovaná tabulka', '', 'PointerOneToOne:SystemList', '', '', 1, 1, 0, 0, 16), 520 (130, 'PermanentId', 'Trvalá identifikace', '', 'Integer', '', '', 1, 1, 0, 0, 16); 472 521 473 522 -- -------------------------------------------------------- … … 490 539 PRIMARY KEY (`Id`), 491 540 UNIQUE KEY `Name` (`Name`) 492 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT= 19;541 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=20 ; 493 542 494 543 -- … … 514 563 (16, 'Float', 'Desetinné číslo', '', '', 1, 'FLOAT', 'TypeFloatViewHtml', 'TypeFloatEditHtml', ''), 515 564 (17, 'FinanceTransactionType', 'Typ finanční transakce', 'Enumeration', 'Bankovní převod|Osobní platba', 0, '', '', '', ''), 516 (18, 'Hyperlink', 'Internetový odkaz', '', '', 0, 'VARCHAR(255)', 'TypeHyperlinkViewHtml', 'TypeHyperlinkEditHtml', ''); 565 (18, 'Hyperlink', 'Internetový odkaz', '', '', 0, 'VARCHAR(255)', 'TypeHyperlinkViewHtml', 'TypeHyperlinkEditHtml', ''), 566 (19, 'IPv4Address', 'IP adresa v4', '', '', 0, 'VARCHAR(16)', 'TypeIPv4AddressView', 'TypeIPv4AddressEdit', 'TypeIPv4AddressCheck'); 517 567 518 568 -- -------------------------------------------------------- … … 562 612 `BirthDay` date NOT NULL, 563 613 `Phone` varchar(255) collate utf8_czech_ci NOT NULL, 564 `Subject` int(11) NOT NULL, 614 `Member` int(11) NOT NULL, 615 `RegistrationTime` datetime NOT NULL, 616 `LastLoginTime` datetime NOT NULL, 617 `Locked` tinyint(1) NOT NULL, 618 `LastIpAddress` varchar(255) collate utf8_czech_ci NOT NULL, 565 619 PRIMARY KEY (`Id`) 566 620 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=13 ; … … 570 624 -- 571 625 572 INSERT INTO `User` (`Id`, `UserName`, `Password`, `FirstName`, `SecondName`, `Email`, `ICQ`, `Sex`, `BirthDay`, `Phone`, `Subject`) VALUES 573 (1, '', 'fdsfsdfsd', 'Alfons', 'Much', 'mucha@all.cz', 89, 0, '0000-00-00', '', 7), 574 (2, '', '', 'Petr', 'Hrubý', 'hrubos@nevim.cz', 23, 0, '0000-00-00', '123456789', 0), 575 (4, 'ferda', '123', 'Ferda', 'Mravenec', 'ferda@mraveniste.cz', 1, 0, '0000-00-00', '', 2), 576 (5, '', '', 'Obivan', 'Kenoby', 'kenoby@mail.universe', 233, 0, '0000-00-00', '', 0), 577 (6, '', '', 'Mistr', 'Joda', 'joda@mistr.shadow', 300, 0, '0000-00-00', '', 0), 578 (7, '', '', 'Petr', 'Slovák', 'slovak@zdarma.cz', 34, 0, '0000-00-00', '', 0), 579 (8, '', '', 'Alena', 'Kocourková', 'alena.kocourkova@centrum.cz', 32, 1, '0000-00-00', '223344556', 7), 580 (9, '', '', 'Jonny', 'Hurikán', 'storm@atlas.cz', 16, 0, '0000-00-00', '224556778', 0), 581 (10, '', '', 'Smrťák', 'Krutý', 'smrt@peklo.cz', 111222333, 0, '0000-00-00', '', 5), 582 (11, '', '', 'Karel', 'Nejedlý', 'starosta@obec-milosice.cz', 0, 0, '0000-00-00', '443666333', 8), 583 (12, 'fantomas', 'dsds', 'Fantomas', 'Tajemný', 'fantom@fantom.com', 0, 0, '0000-00-00', '', 12); 626 INSERT INTO `User` (`Id`, `UserName`, `Password`, `FirstName`, `SecondName`, `Email`, `ICQ`, `Sex`, `BirthDay`, `Phone`, `Member`, `RegistrationTime`, `LastLoginTime`, `Locked`, `LastIpAddress`) VALUES 627 (1, '', 'fdsfsdfsd', 'Alfons', 'Much', 'mucha@all.cz', 89, 0, '0000-00-00', '', 7, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 628 (2, '', '', 'Petr', 'Hrubý', 'hrubos@nevim.cz', 23, 0, '0000-00-00', '123456789', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 629 (4, 'ferda', '123', 'Ferda', 'Mravenec', 'ferda@mraveniste.cz', 1, 0, '0000-00-00', '', 2, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 630 (5, 'obivan', '4217be89cdd8f9dbb59fa5851dd3a0408b9a5a81', 'Obivan', 'Kenoby', 'kenoby@mail.universe', 233, 0, '0000-00-00', '', 6, '0000-00-00 00:00:00', '2008-09-29 12:50:38', 0, ''), 631 (6, '', '', 'Mistr', 'Joda', 'joda@mistr.shadow', 300, 0, '0000-00-00', '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 632 (7, '', '', 'Petr', 'Slovák', 'slovak@zdarma.cz', 34, 0, '0000-00-00', '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 633 (8, '', '', 'Alena', 'Kocourková', 'alena.kocourkova@centrum.cz', 32, 1, '0000-00-00', '223344556', 7, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 634 (9, '', '', 'Jonny', 'Hurikán', 'storm@atlas.cz', 16, 0, '0000-00-00', '224556778', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 635 (10, '', '', 'Smrťák', 'Krutý', 'smrt@peklo.cz', 111222333, 0, '0000-00-00', '', 5, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 636 (11, '', '', 'Karel', 'Nejedlý', 'starosta@obec-milosice.cz', 0, 0, '0000-00-00', '443666333', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''), 637 (12, 'fantomas', 'dsds', 'Fantomas', 'Tajemný', 'fantom@fantom.com', 0, 0, '0000-00-00', '', 12, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, ''); 638 639 -- -------------------------------------------------------- 640 641 -- 642 -- Struktura tabulky `UserOnline` 643 -- 644 645 CREATE TABLE IF NOT EXISTS `UserOnline` ( 646 `User` int(11) NOT NULL, 647 `LoginTime` datetime NOT NULL, 648 `ActivityTime` datetime NOT NULL, 649 `SessionId` varchar(255) collate utf8_czech_ci NOT NULL, 650 `IpAddress` varchar(16) collate utf8_czech_ci NOT NULL, 651 `HostName` varchar(255) collate utf8_czech_ci NOT NULL, 652 `Id` int(11) NOT NULL auto_increment, 653 PRIMARY KEY (`Id`), 654 KEY `User` (`User`) 655 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ; 656 657 -- 658 -- Vypisuji data pro tabulku `UserOnline` 659 -- 660 661 INSERT INTO `UserOnline` (`User`, `LoginTime`, `ActivityTime`, `SessionId`, `IpAddress`, `HostName`, `Id`) VALUES 662 (0, '2008-09-29 09:33:17', '2008-09-29 11:07:24', '96bhsqoheu6feqh7rmpa30ak92', '192.168.0.23', 'george-nb.zdechov.net', 1), 663 (5, '2008-09-29 11:07:29', '2008-09-29 14:29:45', 'ectsef5epcsgtcb4mpscq3kk84', '192.168.0.23', 'george-nb.zdechov.net', 2); -
style.css
r4 r8 39 39 .WideTable 40 40 { 41 border-width: 2px; 42 border-style: solid; 41 43 border-color: black; 42 border-style: solid; 43 border-width: 1px 1px 0px 0px; 44 border-spacing: 0px; 45 margin: 3px 3px 3px 3px; 44 border-collapse: collapse; 45 background-color: white; 46 margin: 0px 0px 5px 0px; 46 47 } 47 48 48 49 .WideTable th 49 50 { 50 border-color: black;51 border-color: gray; 51 52 border-style: solid; 52 border-width: 0px 0px 1px1px;53 padding: 3px 3px 3px 3px;53 border-width: 1px; 54 padding: 3px; 54 55 background-color: #E0E0E0; 55 56 } … … 58 59 { 59 60 text-align: left; 60 border-color: black;61 border-color: gray; 61 62 border-style: solid; 62 border-width: 0px 0px 1px1px;63 padding: 3px 3px 3px 3px;63 border-width: 1px; 64 padding: 3px; 64 65 } 65 66 … … 97 98 border-left:1px #CCCCCC solid; 98 99 } 100 101 .SystemMessage 102 { 103 background: #FFEDED; 104 border: 1px solid #992A2A; 105 border-top: 0; 106 margin: 5px; 107 padding: 0; 108 width: auto; 109 text-align: center; 110 } 111 112 113 .SystemMessage h3 114 { 115 background: #E39090; 116 border: 1px solid #992A2A; 117 border-left: 0; 118 border-right: 0; 119 color: white; 120 font-size: small; 121 font-weight: bold; 122 margin: 0; 123 padding: 5px; 124 } 125 126 .SystemMessage div 127 { 128 background: transparent; 129 border: 0; 130 color: #992A2A; 131 margin: 0; 132 padding: 8px; 133 } -
types/Boolean.php
r5 r8 1 1 <?php 2 2 3 function TypeBooleanViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeBooleanViewHtml($Type, $Item) 4 4 { 5 return('<input type="checkbox" name=" %name%" value="%value%" disabled="1">');5 return('<input type="checkbox" name="'.$Item['Name'].'" value="'.$Item['Value'].'" disabled="1">'); 6 6 } 7 7 8 function TypeBooleanEditHtml($Type, $ Parameter, $Table, $Id)8 function TypeBooleanEditHtml($Type, $Item) 9 9 { 10 return('<input type="checkbox" name=" %name%" value="%value%">');10 return('<input type="checkbox" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'); 11 11 } 12 12 -
types/Date.php
r5 r8 3 3 $MonthList = array('0', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); 4 4 5 function TypeDateViewHtml($Type, $ Parameter, $Table, $Id)5 function TypeDateViewHtml($Type, $Item) 6 6 { 7 7 global $MonthList; 8 8 9 $Parts = explode('-', $ Parameter);9 $Parts = explode('-', $Item['Value']); 10 10 11 11 $Output = ($Parts[2] * 1).'.'.$MonthList[$Parts[1] * 1].'.'.$Parts[0]; … … 13 13 } 14 14 15 function TypeDateEditHtml($Type, $ Parameter, $Table, $Id)15 function TypeDateEditHtml($Type, $Item) 16 16 { 17 17 global $MonthList; 18 18 19 $Parts = explode('-', $ Parameter);19 $Parts = explode('-', $Item['Value']); 20 20 21 21 // Day 22 $Output = '<select name=" %name%-day">';22 $Output = '<select name="'.$Item['Name'].'-day">'; 23 23 for($I = 1; $I <= 31; $I++) 24 24 { … … 28 28 $Output .= '</select>'; 29 29 // Month 30 $Output .= '<select name=" %name%-month">';30 $Output .= '<select name="'.$Item['Name'].'-month">'; 31 31 for($I = 1; $I <= 12; $I++) 32 32 { … … 36 36 $Output .= '</select>'; 37 37 // Year 38 $Output .= '<select name=" %name%-month">';38 $Output .= '<select name="'.$Item['Name'].'-month">'; 39 39 for($I = 1900; $I < 2100; $I++) 40 40 { -
types/Enumeration.php
r5 r8 1 1 <?php 2 2 3 function TypeEnumerationViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeEnumerationViewHtml($Type, $Item) 4 4 { 5 $Output = $Type['Parameters'][$ Parameter];5 $Output = $Type['Parameters'][$Item['Value']]; 6 6 return($Output); 7 7 } 8 8 9 function TypeEnumerationEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeEnumerationEditHtml($Type, $Item) 10 10 { 11 $Output = '<select name=" %name%">';11 $Output = '<select name="'.$Item['Name'].'">'; 12 12 foreach($Type['Parameters'] as $Index => $StateName) 13 13 { -
types/Float.php
r6 r8 1 1 <?php 2 2 3 function TypeFloatViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeFloatViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeFloatEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeFloatEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Hyperlink.php
r6 r8 1 1 <?php 2 2 3 function TypeHyperlinkViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeHyperlinkViewHtml($Type, $Item) 4 4 { 5 $Output = '<a href=" %value%">%value%</a>';5 $Output = '<a href="'.$Item['Name'].'">'.$Item['Value'].'</a>'; 6 6 return($Output); 7 7 } … … 9 9 function TypeHyperlinkEditHtml($Type, $Parameter, $Table, $Id) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Integer.php
r5 r8 1 1 <?php 2 2 3 function TypeIntegerViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeIntegerViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeIntegerEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeIntegerEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Password.php
r5 r8 3 3 function TypePasswordViewHtml($Type, $Parameter, $Table, $Id) 4 4 { 5 $Output = '%value%'; 5 $Output = ''; 6 for($I = 0; $I < strlen($Item['Value']); $I++) 7 $Output .= '*'; 6 8 return($Output); 7 9 } … … 9 11 function TypePasswordEditHtml($Type, $Parameter, $Table, $Id) 10 12 { 11 $Output = '<input type="password" name=" %name%" value="%value%">';13 $Output = '<input type="password" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 14 return($Output); 13 15 } -
types/PointerOneToMany.php
r5 r8 1 1 <?php 2 2 3 function TypePointerOneToManyViewHtml($Type, $ Parameter, $Table, $Id)3 function TypePointerOneToManyViewHtml($Type, $Item) 4 4 { 5 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$ Table.'&ParentColumn='.$Id.'">Seznam</a>';5 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 6 6 return($Output); 7 7 } 8 8 9 function TypePointerOneToManyEditHtml($Type, $ Parameter, $Table, $Id)9 function TypePointerOneToManyEditHtml($Type, $Item) 10 10 { 11 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$ Table.'&ParentColumn='.$Id.'">Seznam</a>';11 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 12 12 return($Output); 13 13 } -
types/PointerOneToOne.php
r6 r8 1 1 <?php 2 2 3 function TypePointerOneToOneViewHtml($Type, $ Parameter, $Table, $Id)3 function TypePointerOneToOneViewHtml($Type, $Item) 4 4 { 5 5 global $Database, $Lists; 6 6 7 //print_r($Type); 7 8 $Output = ''; 8 9 $Columns = ''; 9 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 10 $ItemType = explode(':', $Item['Type']); 11 $TargetTable = $ItemType[1]; 12 13 foreach($Lists[$TargetTable]['Items'] as $ListItem) 10 14 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 11 15 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 12 $DbResult = $Database->select($T ype['Parameter'], $Columns, 'Id='.$Parameter);16 $DbResult = $Database->select($TargetTable, $Columns, 'Id='.$Item['Value']); 13 17 //echo($Database->LastQuery); 14 18 if($DbResult->num_rows > 0) 15 19 { 16 20 $DbRow = $DbResult->fetch_array(); 17 $Output = '<a href="?Action=ViewItem&Table='.$T ype['Parameter'].'&Item='.$DbRow['Id'].'">'.$DbRow['Name'].'</a>';21 $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$DbRow['Id'].'">'.$DbRow['Name'].'</a>'; 18 22 } 19 23 return($Output); 20 24 } 21 25 22 function TypePointerOneToOneEditHtml($Type, $ Parameter, $Table, $Id)26 function TypePointerOneToOneEditHtml($Type, $Item) 23 27 { 24 28 global $Database, $Lists; 25 29 26 $Output = '<select name=" %name%">';30 $Output = '<select name="'.$Item['Name'].'">'; 27 31 $Columns = ''; 28 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 32 $ItemType = explode(':', $Item['Type']); 33 $TargetTable = $ItemType[1]; 34 foreach($Lists[$TargetTable]['Items'] as $ListItem) 29 35 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 30 36 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 31 $DbResult = $Database->select($T ype['Parameter'], $Columns);37 $DbResult = $Database->select($TargetTable, $Columns); 32 38 //echo($Database->LastQuery); 33 39 while($DbRow = $DbResult->fetch_array()) -
types/String.php
r5 r8 1 1 <?php 2 2 3 function TypeStringViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeStringViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeStringEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeStringEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 }
Note:
See TracChangeset
for help on using the changeset viewer.