Changeset 24 for database_list.php
- Timestamp:
- Oct 27, 2008, 5:10:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
database_list.php
r19 r24 5 5 var $Dependencies = array('Log', 'User'); 6 6 7 function AddItem($Table Name, $Values)7 function AddItem($TableId, $Values) 8 8 { 9 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE ItemId='.$TableId.' ORDER BY Id DESC LIMIT 1'); 10 $DbRow = $DbResult->fetch_assoc(); 11 $TableName = $DbRow['TableName']; 12 9 13 $Values['Author'] = $this->System->Modules['User']->User['ItemId']; 10 14 $Values['CreationTime'] = 'NOW()'; … … 18 22 } 19 23 20 function DeleteItem($Table Name, $Id)24 function DeleteItem($TableId, $ItemId) 21 25 { 22 $DbResult = $this->Database->select($TableName, 'Id', 'ItemId='.$Id.' ORDER BY Id DESC LIMIT 1'); 26 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE ItemId='.$TableId.' ORDER BY Id DESC LIMIT 1'); 27 $DbRow = $DbResult->fetch_assoc(); 28 $TableName = $DbRow['TableName']; 29 30 $DbResult = $this->Database->select($TableName, 'Id', 'ItemId='.$ItemId.' ORDER BY Id DESC LIMIT 1'); 23 31 $DbRow = $DbResult->fetch_assoc(); 24 32 $this->Database->update($TableName, 'Id='.$DbRow['Id'], array('DeletionTime' => 'NOW()')); 25 33 } 26 34 27 function EditItem($Table Name, $Values, $Id)35 function EditItem($TableId, $Values, $ItemId) 28 36 { 29 $this->DeleteItem($TableName, $Id); 30 $Values['ItemId'] = $Id; 37 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE ItemId='.$TableId.' ORDER BY Id DESC LIMIT 1'); 38 $DbRow = $DbResult->fetch_assoc(); 39 $TableName = $DbRow['TableName']; 40 $this->DeleteItem($TableId, $ItemId); 41 $Values['ItemId'] = $ItemId; 31 42 $Values['Author'] = $this->System->Modules['User']->User['ItemId']; 32 43 $Values['CreationTime'] = 'NOW()';
Note:
See TracChangeset
for help on using the changeset viewer.