Changeset 30 for database_list.php


Ignore:
Timestamp:
Dec 16, 2008, 8:15:34 AM (16 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro určování v definicích krom tabulky také jméno databáze a jméno primárního identifikačního sloupce.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • database_list.php

    r28 r30  
    77  function AddItem($TableId, $Values)
    88  {
    9     $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);
     9    $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId);
    1010    $DbRow = $DbResult->fetch_assoc();
    1111    $TableName = $DbRow['TableName'];
    1212
    13     $this->Database->insert($TableName, $Values);
     13    $this->Database->insert(array('Table' => $TableName), $Values);
    1414    return($this->Database->insert_id);
    1515  }
     
    1717  function DeleteItem($TableId, $ItemId)
    1818  {
    19     $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);
     19    $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId);
    2020    $DbRow = $DbResult->fetch_assoc();
    2121    $TableName = $DbRow['TableName'];
    22     $this->Database->delete($TableName, 'Id='.$ItemId, array('DeletionTime' => 'NOW()'));
     22    $this->Database->delete(array('Table' => $TableName, 'Condition' => 'Id='.$ItemId), array('DeletionTime' => 'NOW()'));
    2323  }
    2424
    2525  function EditItem($TableId, $Values, $ItemId)
    2626  {
    27     $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);
     27    $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId);
    2828    $DbRow = $DbResult->fetch_assoc();
    2929    $TableName = $DbRow['TableName'];
    3030    $this->DeleteItem($TableId, $ItemId);
    3131    $Values['Id'] = $ItemId;
    32     $this->Database->replace($TableName, $Values);
     32    $this->Database->replace(array('Table' => $TableName), $Values);
    3333  }
    3434}
Note: See TracChangeset for help on using the changeset viewer.