- Timestamp:
- Dec 4, 2008, 12:31:09 PM (16 years ago)
- Location:
- types
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
types/PointerOneToOne.php
r24 r26 11 11 $List = GetListDefinition($Type['Parameters'][0]); 12 12 $TargetTable = $List['TableName']; 13 foreach($List['Items'] as $ListItem) 14 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 13 foreach($List['Items'] as $Index => $ListItem) 14 { 15 //echo('ListItem'); 16 //print_r($ListItem); 17 $Type = GetTypeDefinition($ListItem['Type']); 18 if($ListItem['VisibleInPointer'] == 1) 19 { 20 if($Type['ParentType'] == TypePointerOneToOneId) 21 { 22 //print_r($Type); 23 $DbResult = $Database->select($List['TableName'], '*', 'ItemId='.$Item['Value'].' ORDER BY Id DESC LIMIT 1'); 24 $DbRow = $DbResult->fetch_assoc(); 25 $DefinitionItem = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['ItemId'], 'SourceItemId' => 0); 26 $SubTarget = $this->GetTablePointerName($Type, $DefinitionItem); 27 $Columns .= '"'.$SubTarget['Name'].' ",'; 28 } else $Columns .= '`'.$ListItem['Name'].'`," ",'; 29 } 30 } 15 31 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, ItemId, Id'; 16 32 $DbResult = $Database->select($TargetTable, $Columns, 'ItemId='.$Item['Value'].' AND (DeletionTime IS NULL) ORDER BY Id DESC LIMIT 1'); 17 //echo($Database->LastQuery);33 echo($Database->LastQuery); 18 34 if($DbResult->num_rows > 0) 19 35 { … … 36 52 if($DbResult->num_rows > 0) 37 53 { 54 38 55 $Result = array(array('Name' => 'Žádný', 'Id' => 0, 'ItemId' => 0)); 39 56 while($DbRow = $DbResult->fetch_assoc()) -
types/include.php
r24 r26 16 16 include('types/File/File.php'); 17 17 include('types/GPS.php'); 18 include('types/IPv4Address.php'); 18 19 19 20 define("TypeIntegerId", 1);
Note:
See TracChangeset
for help on using the changeset viewer.