Changeset 15 for database_list.php


Ignore:
Timestamp:
Oct 19, 2008, 8:16:37 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Mezitabulkovéí odkazy na položky jsou nyní realizovány jako odkazy na id položky(ItemId) namísto id řádku v tabulce(Id).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • database_list.php

    r13 r15  
    1515    $Values['ItemId'] = $AutoincrementId + 1;
    1616    $this->Database->insert($TableName, $Values);
     17    return($Values['ItemId']);
    1718  }
    1819
    1920  function DeleteItem($TableName, $Id)
    2021  {
    21     $this->Database->update($TableName, 'Id='.$Id, array('DeletionTime' => 'NOW()'));
     22    $DbResult = $this->Database->select($TableName, 'Id', 'ItemId='.$Id.' ORDER BY Id DESC LIMIT 1');
     23    $DbRow = $DbResult->fetch_assoc();
     24    $this->Database->update($TableName, 'Id='.$DbRow['Id'], array('DeletionTime' => 'NOW()'));
    2225  }
    2326
    2427  function EditItem($TableName, $Values, $Id)
    2528  {
    26     $DbResult = $this->Database->select($TableName, 'ItemId', 'Id='.$Id);
    27     $DbRow = $DbResult->fetch_assoc();
    28     $Values['ItemId'] = $DbRow['ItemId'];
     29    $this->DeleteItem($TableName, $Id);
     30    $Values['ItemId'] = $Id;
    2931    $Values['Author'] = $this->System->Modules['User']->User['Id'];
    3032    $Values['CreationTime'] = 'NOW()';
Note: See TracChangeset for help on using the changeset viewer.