first commit
This commit is contained in:
109
admin/search.php
Normal file
109
admin/search.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
class Search extends Window
|
||||
{
|
||||
protected $defaults = ['', ''];
|
||||
|
||||
public function get_vars()
|
||||
{
|
||||
$vars = @parent::get_vars();
|
||||
$pageVars = getVal('body', $vars);
|
||||
if (empty($_GET['type'])) {
|
||||
$type = 'user';
|
||||
} else {
|
||||
$type = trim($_GET['type']);
|
||||
}
|
||||
|
||||
$pageVars['customer'] = getVal('customer');
|
||||
$pageVars['function'] = getVal('function');
|
||||
$pageVars['selector'] = getVal('selector');
|
||||
|
||||
switch ($type) {
|
||||
case 'user':
|
||||
$pageTitle = 'Vyhledávání uživatelů';
|
||||
break;
|
||||
case 'product':
|
||||
$pageTitle = 'Vyhledávání zboží';
|
||||
break;
|
||||
case 'link':
|
||||
$pageTitle = 'Vyhledávání odkazu v E-shopu';
|
||||
break;
|
||||
case 'photo':
|
||||
$pageTitle = 'Vyhledávání obrázku';
|
||||
break;
|
||||
case 'article':
|
||||
$pageTitle = 'Vyhledávání článku';
|
||||
break;
|
||||
case 'page':
|
||||
$pageTitle = 'Vyhledávání stránky';
|
||||
break;
|
||||
case 'storesProducts':
|
||||
$pageTitle = 'Vyhledávání zboží';
|
||||
break;
|
||||
default:
|
||||
$pageTitle = 'Vyhledávání';
|
||||
break;
|
||||
}
|
||||
$pageVars['type'] = $type;
|
||||
$pageVars['page_title'] = $pageTitle;
|
||||
|
||||
switch ($type) {
|
||||
case 'user':
|
||||
$iframeUrl = 'launch.php?s=list.php&type=users&searchWnd=1';
|
||||
break;
|
||||
case 'article':
|
||||
$iframeUrl = 'launch.php?s=list.php&type=articles&searchWnd=1';
|
||||
break;
|
||||
case 'page':
|
||||
$iframeUrl = 'launch.php?s=list.php&type=pages&searchWnd=1';
|
||||
break;
|
||||
case 'slider':
|
||||
$iframeUrl = 'launch.php?s=list.php&type=sliders&searchWnd=1';
|
||||
break;
|
||||
case 'product':
|
||||
$iframeUrl = 'launch.php?s=list.php&type=products&searchWnd=1&showOld=1';
|
||||
break;
|
||||
case 'link':
|
||||
$iframeUrl = $GLOBALS['cfg']['Addr']['full'];
|
||||
break;
|
||||
case 'photo':
|
||||
$this->setTemplate('window/search_photos.tpl');
|
||||
$iframeUrl = 'launch.php?s=list.php&type=photos&searchWnd=1';
|
||||
break;
|
||||
case 'storesProducts':
|
||||
$storeID = getVal('storeID');
|
||||
$inStore = getVal('inStore', null, 'inStore');
|
||||
$iframeUrl = 'launch.php?s=list.php&type=storesProducts&&showOld=1&storeID='.$storeID.'&inStore='.$inStore;
|
||||
break;
|
||||
case 'orders':
|
||||
$customer = getVal('customer', null, '');
|
||||
$filters = getVal('filters', null, []);
|
||||
$iframeUrl = 'launch.php?s=list.php&type=orders&searchWnd=1&customer='.urlencode($customer).'&'.http_build_query($filters);
|
||||
break;
|
||||
default:
|
||||
$filters = getVal('filters');
|
||||
$iframeUrl = 'launch.php?s=list.php&type='.urlencode($type).'&searchWnd=1&'.http_build_query($filters);
|
||||
break;
|
||||
}
|
||||
|
||||
if (getVal('multiSelect')) {
|
||||
$iframeUrl .= '&multiSelect=1';
|
||||
}
|
||||
$pageVars['iframe_url'] = $iframeUrl;
|
||||
$vars['body'] = $pageVars;
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$search = new Search();
|
||||
$search->run();
|
||||
Reference in New Issue
Block a user