Файл: moduls/loads/search.php
Строк: 27
<?php
/**
* @package Prime Social
* @link http://primesocial.ru
* @copyright Copyright (C) 2016 Prime Social
* @author BoB | http://primesocial.ru/about
*/
require_once('../../core/start.php');
require_once('func.php');
check_auth();
head('Fayllarni izlash');
echo DIV_AUT;
echo '<form action="'.HOME.'/loads/search/" enctype="multipart/form-data" method="POST">';
echo '<b>Fayl nomi:</b><br/> <input type="text" name="q" />';
echo '<input type="submit" name="search" value="Izlash" /></form>';
echo CLOSE_DIV;
if (!empty($_POST['search'])) {
$q = html($_POST['q']);
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".LOADS_FILE." WHERE `name` LIKE '%".$q."%' || `info` LIKE '%".$q."%'");
echo DIV_LI . 'Topilgan o`xshashliklar: <b>' . $all . '</b>' . CLOSE_DIV;
$n = new Navigator($all,5,'');
$sql = DB::$dbs->query("SELECT * FROM ".LOADS_FILE." WHERE `name` LIKE '%".$q."%' || `info` LIKE '%".$q."%' LIMIT {$n->start()}, 5");
while($file = $sql -> fetch()) {
echo DIV_LI . '<a href="'.HOME.'/loads/'.$file['folder_id'].'/'.$file['folderc_id'].'/'.$file['id'].'/">'.$file['name'].'</a>' . CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/loads/">Yuklamalar</a> / <b>Fayllarni izlash</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
?>