From 4ace8344cfd8769ef059ec5c920ac663c8c1d4ce Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 27 Jan 2011 18:18:23 +0000 Subject: improved search and impagination with CSS --- .../Application/Controllers/SearchController.php | 29 +++++++++++++++++++-- h-source/Application/Include/languages.php | 2 ++ h-source/Application/Include/myFunctions.php | 5 ++++ h-source/Application/Views/Search/form.php | 30 ++++++++++++++++++---- h-source/Application/Views/header.php | 19 ++++++++------ 5 files changed, 70 insertions(+), 15 deletions(-) (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php index f2f2abc..6f96595 100644 --- a/h-source/Application/Controllers/SearchController.php +++ b/h-source/Application/Controllers/SearchController.php @@ -67,8 +67,6 @@ class SearchController extends BaseController '-deleted' => "no", ); -// echo $this->viewArgs['type']; - $recordNumber = $this->m['HardwareModel']->clear()->where($whereClause)->orderBy("id_hard desc")->rowNumber(); $data['recordNumber'] = $recordNumber; @@ -91,4 +89,31 @@ class SearchController extends BaseController } + public function pciid($lang = 'en') + { + if (isset($_POST['pciid'])) + { + $clean['pciid'] = $this->request->post('pciid','','sanitizePciid'); + $data['table'] = $this->m['HardwareModel']->clear()->select()->where(array('pci_id'=>$clean['pciid']))->send(); + $data['recordNumber'] = 0; + + $this->append($data); + $this->cleverLoad('results'); + $this->right(); + } + } + + public function lspci($lang = 'en') + { + if (isset($_POST['lspci'])) + { +// $clean['pciid'] = $this->request->post('lspci','','sanitizePciid'); +// $data['table'] = $this->m['HardwareModel']->clear()->select()->where(array('pci_id'=>$clean['pciid']))->send(); +// $data['recordNumber'] = 0; +// +// $this->append($data); +// $this->cleverLoad('results'); +// $this->right(); + } + } } \ No newline at end of file diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 2dbc5fa..602e13d 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -145,6 +145,8 @@ class Lang "No sound cards found" => "Non รจ stata trovata alcuna scheda audio", "LAST UPDATE" => "ULTIMA MODIFICA", "search by" => "cerca per", + "analyze the output of the lspci command" => "analizza l'output del comando lscpi", + "paste the output of the lspci command" => "incolla l'output del comand lspci", ), 'es' => array ( diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 5c64317..55fbd9b 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -60,6 +60,11 @@ function sanitizeAlphanum($string) return $string; } +function sanitizePciid($string) +{ + $string = preg_match('/^[a-zA-Z0-9]{4}(\:)[a-zA-Z0-9]{4}$/',$string) ? sanitizeAll($string) : '0'; + return $string; +} function getOrderByClause($string) { diff --git a/h-source/Application/Views/Search/form.php b/h-source/Application/Views/Search/form.php index 9303b81..cd5b00a 100644 --- a/h-source/Application/Views/Search/form.php +++ b/h-source/Application/Views/Search/form.php @@ -54,7 +54,7 @@
- +