Changeset 365 for trunk/export/index.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/index.php
r357 r365 42 42 echo($Order['Output']); 43 43 44 $DbResult = $Database->SQLCommand('SELECT ` user`.`user` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM ExportGroup WHERE ExportGroup.Export=Export.Id) AS GroupCount, (SELECT COUNT(*) FROM ExportUser WHERE ExportUser.Export=Export.Id) AS UserCount FROM `Export` LEFT JOIN `user` ON `user`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);44 $DbResult = $Database->SQLCommand('SELECT `User`.`Name` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, (SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']); 45 45 while($Export = mysql_fetch_assoc($DbResult)) 46 46 { … … 178 178 else $InitialOrder = ''; 179 179 180 $Query = 'SELECT (@I := @I + 1) AS Sequence2, TT.* FROM (SELECT ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, TranslatedCount FROM `user`) AS T';181 $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';182 $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(ExportUser.Sequence, 100000000)'.$InitialOrder.') AS TT';183 184 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');180 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `TT`.* FROM (SELECT `ExportUser`.`Sequence`, `T`.`ID`, `T`.`TranslatedCount`, `T`.`Name`, `T`.`XP` FROM (SELECT `User`.`ID`, `User`.`Name`, `User`.`XP`, `TranslatedCount` FROM `User`) AS T'; 181 $Query .=' LEFT JOIN `ExportUser` ON `ExportUser`.`Export` = '.$_GET['ExportId'].' AND `ExportUser`.`User`=`T`.`ID`'; 182 $Query .=' WHERE `T`.`TranslatedCount` > 0 ORDER BY COALESCE(`ExportUser`.`Sequence`, 100000000)'.$InitialOrder.') AS `TT`'; 183 184 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 185 185 $DbRow = mysql_fetch_row($DbResult); 186 186 $PageList = GetPageList($DbRow[0]); … … 210 210 $Sequence = '<input type="text" name="seq'.$User['ID'].'" style="text-align: center; width: 40px;" value="'.$User['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 211 211 echo('<tr> 212 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User[' user'].'</a></td>212 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['Name'].'</a></td> 213 213 <td>'.$User['TranslatedCount'].'</td> 214 <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User[' user'].'/level.png" alt="Úroveň uživatele" /></td>214 <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['Name'].'/level.png" alt="Úroveň uživatele" /></td> 215 215 <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'); 216 216 } … … 269 269 if(array_key_exists('ExportId', $_GET)) 270 270 { 271 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);271 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 272 272 if(mysql_num_rows($DbRows) > 0) 273 273 { … … 289 289 if(array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true; 290 290 else $Selected = false; 291 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND Language='.$LanguageId;292 $DbResult = $Database->SQLCommand('SELECT * FROM ExportLanguage'.$Condition);291 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND `Language`='.$LanguageId; 292 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportLanguage` '.$Condition); 293 293 if(mysql_num_rows($DbResult) > 0) 294 294 { 295 if(!$Selected) $Database->SQLCommand('DELETE FROM ExportLanguage'.$Condition);296 else $Database->SQLCommand('UPDATE ExportLanguage SET Sequence='.$Value.$Condition);295 if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportLanguage` '.$Condition); 296 else $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition); 297 297 } else 298 298 { 299 if($Selected) $Database->SQLCommand('INSERT INTO ExportLanguage (Export, Language, Sequence) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');299 if($Selected) $Database->SQLCommand('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')'); 300 300 } 301 301 } … … 304 304 // Recalculate sequence number 305 305 $Database->SQLCommand('SET @I = 0'); 306 $Database->SQLCommand('UPDATE ExportLanguage SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;');306 $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;'); 307 307 } 308 308 } 309 309 310 $Query = 'SELECT (@I := @I + 1) AS Sequence2, Sequence, language.Id, Name FROM language';311 $Query .=' LEFT JOIN ExportLanguage ON ExportLanguage.Export = '.$_GET['ExportId'].' AND ExportLanguage.Language=language.Id';312 $Query .=' WHERE language.Enabled = 1 ORDER BY COALESCE(Sequence, 100)';310 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `Sequence`, `Language`.`Id`, `Name` FROM `Language`'; 311 $Query .=' LEFT JOIN `ExportLanguage` ON `ExportLanguage`.`Export` = '.$_GET['ExportId'].' AND `ExportLanguage`.`Language`=`Language`.`Id`'; 312 $Query .=' WHERE `Language`.`Enabled` = 1 ORDER BY COALESCE(`Sequence`, 100)'; 313 313 314 314 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); … … 451 451 if(array_key_exists('ExportId', $_GET)) 452 452 { 453 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);453 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 454 454 if(mysql_num_rows($DbRows) > 0) 455 455 { … … 463 463 } 464 464 465 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);465 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 466 466 $Export = mysql_fetch_assoc($DbResult); 467 467 … … 473 473 '<br />'); 474 474 } 475 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType ORDER BY Name');475 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 476 476 while($ExportFormat = mysql_fetch_assoc($DbResult)) 477 477 { … … 490 490 if(array_key_exists('ExportId', $_GET)) 491 491 { 492 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);492 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 493 493 if(mysql_num_rows($DbRows) > 0) 494 494 { … … 499 499 if(array_key_exists('ClientVersion', $_POST)) 500 500 { 501 $Database->SQLCommand('UPDATE Export SET ClientVersion='.$_POST['ClientVersion'].' WHERE Id='.$_GET['ExportId']);502 } 503 504 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);501 $Database->SQLCommand('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']); 502 } 503 504 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 505 505 $Export = mysql_fetch_assoc($DbResult); 506 506 507 $Query = 'SELECT wow_client_version.* FROM ExportVersion LEFT JOIN wow_client_version ON wow_client_version.Id=ExportVersion.ClientVersion WHERE ExportType='.$Export['OutputType'];508 509 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');507 $Query = 'SELECT `wow_client_version`.* FROM `ExportVersion` LEFT JOIN `wow_client_version` ON `wow_client_version`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 508 509 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 510 510 $DbRow = mysql_fetch_row($DbResult); 511 511 $PageList = GetPageList($DbRow[0]); … … 532 532 echo($Order['Output']); 533 533 534 $Query = 'SELECT * FROM ('.$Query.') AS TX'.$Order['SQL'].$PageList['SQLLimit'];534 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 535 535 $DbResult = $Database->SQLCommand($Query); 536 536 while($Version = mysql_fetch_assoc($DbResult)) … … 551 551 global $Database; 552 552 553 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);553 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 554 554 $Export = mysql_fetch_assoc($DbResult); 555 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType WHERE Id='.$Export['OutputType']);555 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 556 556 if(mysql_num_rows($DbResult) > 0) 557 557 { 558 $DbResult = $Database->SQLCommand('SELECT * FROM ExportVersion WHERE ExportType='.$Export[ 'OutputType'].' AND ClientVersion='.$Export['ClientVersion']);558 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportVersion` WHERE `ExportType`='.$Export[ 'OutputType'].' AND `ClientVersion`='.$Export['ClientVersion']); 559 559 if(mysql_num_rows($DbResult) > 0) 560 560 { … … 569 569 global $Database; 570 570 571 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);571 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 572 572 $Export = mysql_fetch_assoc($DbResult); 573 $DbResult = $Database->SQLCommand('SELECT * FROM user WHERE ID='.$Export['User']);573 $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID`='.$Export['User']); 574 574 $User = mysql_fetch_assoc($DbResult); 575 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User[' user'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');575 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>'); 576 576 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Výstup')); 577 577 echo('<div id="content">');
Note:
See TracChangeset
for help on using the changeset viewer.