Changeset 80 for trunk/www/Base
- Timestamp:
- Oct 21, 2009, 10:24:50 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Base/Table.php
r78 r80 2 2 3 3 include_once(dirname(__FILE__).'/Types/Type.php'); 4 include_once(dirname(__FILE__).'/Types/Module.php'); 4 5 5 class Table 6 class Table extends Module 6 7 { 7 8 var $Id; … … 13 14 var $TotalRowCount; 14 15 15 function __construct($FormClass )16 function __construct($FormClass, $System) 16 17 { 18 parent::__construct($System); 17 19 $this->Definition = $FormClass; 18 20 $this->QueryParameters = array(); … … 39 41 function Show() 40 42 { 41 global $Config;42 43 43 $this->CheckOrder(); 44 44 $Header = array(); … … 61 61 $Html = new Html(); 62 62 $Output = $Html->Table($Table, 'WideTable'); 63 $Output .= '<div class="Pager">'.$Html->PageList('Page', $this->Page, $this->TotalRowCount, $ Config['Web']['TableRowPerPage']).'</div>';63 $Output .= '<div class="Pager">'.$Html->PageList('Page', $this->Page, $this->TotalRowCount, $this->Config['Web']['TableRowPerPage']).'</div>'; 64 64 return($Output); 65 65 } … … 67 67 function LoadValuesFromDatabase($Database) 68 68 { 69 global $Config;70 71 69 $this->CheckOrder(); 72 70 $OrderType = array('ASC', 'DESC'); … … 85 83 if(array_key_exists('Page', $_GET)) $this->Page = $_GET['Page']; else $this->Page = 0; 86 84 if($this->Page > ($this->TotalRowCount / $Config['Web']['TableRowPerPage'])) $this->Page = 0; 87 $DbResult = $Database->query('SELECT * FROM '.$Table.' AS T ORDER BY T.'.$_GET['Column'].' '.$OrderType[$_GET['Order']].' LIMIT '.($this->Page * $ Config['Web']['TableRowPerPage']).', '.$Config['Web']['TableRowPerPage']);85 $DbResult = $Database->query('SELECT * FROM '.$Table.' AS T ORDER BY T.'.$_GET['Column'].' '.$OrderType[$_GET['Order']].' LIMIT '.($this->Page * $this->Config['Web']['TableRowPerPage']).', '.$this->Config['Web']['TableRowPerPage']); 88 86 while($DbRow = $DbResult->fetch_assoc()) 89 87 {
Note:
See TracChangeset
for help on using the changeset viewer.