Changeset 577 for trunk/action.php
- Timestamp:
- Sep 11, 2013, 10:37:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r569 r577 1 1 <?php 2 2 3 $InitSystem = true; 3 4 include_once('includes/global.php'); 4 5 function Search()6 {7 global $System, $TranslationTree, $Config;8 9 if(array_key_exists('search', $_GET)) $Search = $_GET['search'];10 else if(array_key_exists('search', $_POST)) $Search = $_POST['search'];11 else $Search = '';12 13 $Output = '<table class="BaseTable"><tr><th>Skupina</th><th>Výsledků</th></tr>';14 foreach($TranslationTree as $Group)15 {16 $Table = $Group['TablePrefix'];17 18 $sql = 'SELECT COUNT(*) FROM `'.$Table.'` WHERE '.19 ' (`ID` LIKE "%'.$Search.'%")'.20 ' OR (`Entry` LIKE "%'.$Search.'%")';21 foreach($Group['Items'] as $Item)22 {23 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"';24 }25 $DbResult = $System->Database->query($sql);26 $Line = $DbResult->fetch_row();27 $Output .= '<tr><td><a href="TranslationList.php?group='.$Group['Id'].'&user=0&state=0&text='.$Search.'&entry=">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>';28 }29 30 $DbResult = $System->Database->query('SELECT count(*) FROM `User` WHERE `Name` LIKE "%'.$Search.'%"');31 $Line = $DbResult->fetch_row();32 $Output .= '<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>';33 34 $DbResult = $System->Database->query('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"');35 $Line = $DbResult->fetch_row();36 $Output .= '<tr><td><a href="team/?search='.$Search.'">Týmy</a></td><td>'.$Line[0].'</td></tr>';37 38 $DbResult = $System->Database->query('SELECT count(*) FROM `CzWoWPackageVersion` WHERE `Text` LIKE "%'.$Search.'%"');39 $Line = $DbResult->fetch_row();40 $Output .= '<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>';41 $Output .= '<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>';42 43 $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = '.$Config['OriginalLanguage']);44 $Line = $DbResult->fetch_row();45 $Output .= '<tr><td><a href="dictionary/?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>';46 47 $Output .= '</table>';48 return($Output);49 }50 5 51 6 function DatabaseKit() … … 190 145 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; 191 146 192 if($Action == 'search') $Output = Search();193 147 else if($Action == 'dbkit') $Output = DatabaseKit(); 194 148 else $Output = ShowMessage('Nebyla zadána žádná akce.', MESSAGE_CRITICAL);
Note:
See TracChangeset
for help on using the changeset viewer.