Changeset 366 for trunk/export/index.php


Ignore:
Timestamp:
Mar 9, 2010, 1:01:14 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Přejmenovány všechny tabulky textů na názvy s prvními velkými písmeny ve slovech plus pro odlišení s prefixem Text.
  • Upraveno: Další SQL dotazy doplněny o SQL uvozovky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/index.php

    r365 r366  
    127127  if(array_key_exists('ExportId', $_GET))
    128128  {
    129     $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
     129    $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    130130    if(mysql_num_rows($DbRows) > 0)
    131131    {   
     
    148148          if(array_key_exists('sel'.$UserId, $_POST)) $Selected = true;
    149149            else $Selected = false;
    150           $Condition = ' WHERE Export='.$_GET['ExportId'].' AND User='.$UserId;
    151           $DbResult = $Database->SQLCommand('SELECT * FROM ExportUser '.$Condition);
     150          $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `User`='.$UserId;
     151          $DbResult = $Database->SQLCommand('SELECT * FROM `ExportUser` '.$Condition);
    152152          if(mysql_num_rows($DbResult) > 0)
    153153          {
    154             if(!$Selected) $Database->SQLCommand('DELETE FROM ExportUser '.$Condition);
    155               else $Database->SQLCommand('UPDATE ExportUser SET Sequence='.$Value.$Condition);
     154            if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportUser` '.$Condition);
     155              else $Database->SQLCommand('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);
    156156          } else
    157157          {
    158             if($Selected) $Database->SQLCommand('INSERT INTO ExportUser (Export, User, Sequence) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');
     158            if($Selected) $Database->SQLCommand('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');
    159159          }         
    160160        }
     
    163163      // Recalculate sequence number
    164164      $Database->SQLCommand('SET @I = 0');
    165       $Database->SQLCommand('UPDATE ExportUser SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;');
     165      $Database->SQLCommand('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;');
    166166    }
    167167  }
    168168
    169169  $TableColumns = array(
    170     array('Name' => 'user', 'Title' => 'Jméno'),
     170    array('Name' => 'Name', 'Title' => 'Jméno'),
    171171    array('Name' => 'TranslatedCount', 'Title' => 'Překladů'),
    172172    array('Name' => 'XP', 'Title' => 'Úroveň'),
     
    201201  echo($Order['Output']);
    202202
    203   $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit'];
     203  $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit'];
    204204  $Database->SQLCommand('SET @I = 0');
    205205  $DbResult = $Database->SQLCommand($Query);
     
    396396  }
    397397
    398   $Query = 'SELECT `group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`group`.`Id`';
     398  $Query = 'SELECT `Group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `Group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`Group`.`Id`';
    399399
    400400  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
     
    505505  $Export = mysql_fetch_assoc($DbResult);
    506506
    507   $Query = 'SELECT `wow_client_version`.* FROM `ExportVersion` LEFT JOIN `wow_client_version` ON `wow_client_version`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType'];
     507  $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType'];
    508508
    509509  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`');
Note: See TracChangeset for help on using the changeset viewer.