Changeset 155 for trunk/action.php


Ignore:
Timestamp:
Mar 12, 2009, 1:27:34 PM (16 years ago)
Author:
maron
Message:

Globální hledání

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r154 r155  
    88$Table = $TranslationTree[$GroupId]['TablePrefix'];
    99if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = '';
     10
     11if(($Action == 'search'))
     12{
     13  if(array_key_exists('search', $_GET)) $Search = $_GET['search'];
     14  else $Search = $_POST['search'];
     15
     16  echo('<table class="BaseTable"><tr><th>Skupina</th><th>Výsledků</th></tr>');
     17  foreach($TranslationTree as $Group) {
     18        $Table = $Group['TablePrefix'];
     19 
     20        $sql = 'SELECT count(*) FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"
     21        OR `entry` LIKE "%'.$Search.'%"
     22        OR `User` LIKE "%'.$Search.'%"
     23        OR `Complete` LIKE "%'.$Search.'%"';
     24        foreach($Group['Items'] as $Item) {
     25                if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"';
     26        }
     27        $Line = mysql_fetch_row($Database->SQLCommand($sql));
     28        echo('<tr><td><a href="TranslationList?group='.$Group['Id'].'&amp;action=search&amp;search='.$Search.'">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>');
     29  }
     30 
     31        $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `user` WHERE `user` LIKE "%'.$Search.'%"'));
     32        echo('<tr><td><a href="userlist?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>');
     33        $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `team` WHERE `name` LIKE "%'.$Search.'%" OR `description` LIKE "%'.$Search.'%"'));
     34        echo('<tr><td><a href="team?search='.$Search.'">Týmy</a></td><td>'.$Line[0].'</td></tr>');
     35        $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `verseclient` WHERE `text` LIKE "%'.$Search.'%"'));
     36        echo('<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>');
     37 
     38  echo('</table>');
     39}
    1040
    1141
Note: See TracChangeset for help on using the changeset viewer.