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>');
Note:
See TracChangeset
for help on using the changeset viewer.