Changeset 33
- Timestamp:
- Mar 12, 2009, 6:01:58 PM (16 years ago)
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
base.php
r31 r33 11 11 global $Database, $Config; 12 12 13 echo($Column.','.$ColumnValue.' ');13 //echo($Column.','.$ColumnValue.' '); 14 14 15 15 if(!CheckPermission('Read', $List['Id'])) … … 25 25 { 26 26 if(($Item['VisibleInList'] == 1) and ($Item['Name'] != $Column)) 27 $Output .= '<th><a href="?OrderColumn='.$Item['Name'].' ">'.$Item['TextBefore'].'</a></th>';27 $Output .= '<th><a href="?OrderColumn='.$Item['Name'].'&OrderDirection='.(($_SESSION['OrderDirection'] + 1) % 2).'">'.$Item['TextBefore'].'</a></th>'; 28 28 } 29 29 $Output .= '<th>Akce</th></tr>'; … … 46 46 if(array_key_exists('OrderColumn', $_GET)) 47 47 { 48 if($_SESSION['OrderColumn'] == $_GET['OrderColumn']) // Same column => reverse order49 $_SESSION['OrderDirection'] = ($_SESSION['OrderDirection'] + 1) % 2;50 48 if($_SESSION['OrderTable'] != $List['Id']) // Different table => set ascending order 51 49 $_SESSION['OrderDirection'] = 0; 52 50 $_SESSION['OrderColumn'] = $_GET['OrderColumn']; 53 51 $_SESSION['OrderTable'] = $List['Id']; 54 } 52 $_SESSION['OrderDirection'] = $_GET['OrderDirection']; 53 } 54 //echo(';'.$_SESSION['OrderTable'].','.$_SESSION['OrderColumn']); 55 55 if(array_key_exists('OrderColumn', $_SESSION) and ($_SESSION['OrderTable'] == $List['Id'])) 56 56 { … … 58 58 $Order = 'ORDER BY `'.$_SESSION['OrderColumn'].'` '.$OrderDirection[$_SESSION['OrderDirection']]; 59 59 } else $Order = ''; 60 61 60 if(array_key_exists('Page', $_GET)) $Page = $_GET['Page']; else $Page = 0; 62 61 //$Where .= ' AND (ValidFromTime <= NOW()) AND ((ValidToTime >= NOW()) OR (ValidToTime IS NULL))'; … … 558 557 if(!array_key_exists($Id, $Lists)) 559 558 { 560 $DbResult = $Database->query('SELECT * FROM `SystemList` WHERE Id='.$Id);559 $DbResult = $Database->query('SELECT * FROM `SystemList` WHERE `Id`='.$Id); 561 560 if($DbResult->num_rows > 0) 562 561 { 563 562 $DbRow = $DbResult->fetch_assoc(); 564 563 $Items = array(); 565 $DbResult2 = $Database->query('SELECT * FROM `SystemListItem` WHERE List='.$DbRow['Id']);564 $DbResult2 = $Database->query('SELECT * FROM `SystemListItem` WHERE `List`='.$DbRow['Id'].' ORDER BY `Sequence`'); 566 565 while($DbRow2 = $DbResult2->fetch_assoc()) 567 566 { … … 569 568 } 570 569 $List = array( 571 'Id' => $DbRow['Id'],572 'TableName' => $DbRow['TableName'],573 'Database' => $DbRow['Database'],574 'Title' => $DbRow['Title'],575 'IdName' => $DbRow['IdName'],576 'Items' => $Items,570 'Id' => $DbRow['Id'], 571 'TableName' => $DbRow['TableName'], 572 'Database' => $DbRow['Database'], 573 'Title' => $DbRow['Title'], 574 'IdName' => $DbRow['IdName'], 575 'Items' => $Items, 577 576 ); 578 577 //if(!array_key_exists($List['ItemId'], $TypeDefinitionList)) … … 594 593 if(!array_key_exists($Id, $Types)) 595 594 { 596 $DbResult = $Database->query('SELECT * FROM `SystemType` WHERE Id='.$Id);595 $DbResult = $Database->query('SELECT * FROM `SystemType` WHERE `Id`='.$Id); 597 596 if($DbResult->num_rows > 0) 598 597 { … … 601 600 if(($DbRow['ParentType'] == TypePointerOneToOneId) or ($DbRow['ParentType'] == TypePointerOneToManyId)) 602 601 { 603 $DbResult2 = $Database->query('SELECT * FROM `SystemList` WHERE TableName="'.$DbRow['Parameters'][0].'"');602 $DbResult2 = $Database->query('SELECT * FROM `SystemList` WHERE `TableName`="'.$DbRow['Parameters'][0].'"'); 604 603 $DbRow2 = $DbResult2->fetch_assoc(); 605 604 //echo($DbRow['ParentType'].'-'.$DbRow['Parameters'][0].'='.$DbRow2['ItemId'].'<br>'); -
config.sample.php
r32 r33 22 22 'AdminEmail' => 'admin@localhost', 23 23 'ItemsPerPage' => 20, 24 'ShowSQLQuery' => true, 24 25 'ShowSQLError' => true, 25 26 'ShowPHPError' => true, -
database.php
r30 r33 8 8 var $Prefix = ''; 9 9 var $LastQuery = ''; 10 var $ShowError = 0;11 10 12 11 function query($Query) 13 12 { 14 $this->LastQuery = $Query; 13 global $Config; 14 15 if($Config['Web']['ShowSQLQuery'] == true) 16 echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: silver; padding-bottom: 2px; padding-top: 2px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'); 17 $this->LastQuery = $Query; 15 18 $DbResult = parent::query($Query); 16 if(($this-> ShowError == TRUE) and ($this->error != ''))19 if(($this->error != '') and ($Config['Web']['ShowSQLError'] == true)) 17 20 { 18 21 echo('<strong>Database error:</strong> '.$this->error.'<br />'); … … 70 73 $Value = strtr($Value, '"', '\"'); 71 74 if($Value != 'NOW()') $Value = "'".$Value."'"; 72 $Values .= ", ".$Key."=".$Value;75 $Values .= ", `".$Key."`=".$Value; 73 76 } 74 77 $Values = substr($Values, 2); -
global.php
r21 r33 5 5 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 6 6 7 session_start();7 if(!isset($SessionDisable)) session_start(); 8 8 include('config.php'); 9 include('error.php'); 9 10 include('database.php'); 10 include _once('code.php');11 include('code.php'); 11 12 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 12 13 $Database->Prefix = $Config['Database']['Prefix']; 13 14 $Database->charset($Config['Database']['Charset']); 14 15 $Database->ShowError = TRUE; 15 include _once('module.php');16 include _once('page.php');17 include _once('forms.php');18 include _once('types/include.php');19 include _once('lists/include.php');20 include _once('base.php');16 include('module.php'); 17 include('page.php'); 18 include('forms.php'); 19 include('types/include.php'); 20 include('lists/include.php'); 21 include('base.php'); 21 22 22 23 class System extends Module
Note:
See TracChangeset
for help on using the changeset viewer.