aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-01-27 18:18:23 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-01-27 18:18:23 +0000
commit4ace8344cfd8769ef059ec5c920ac663c8c1d4ce (patch)
tree14427de964a8a0abb2596e97c50a37d5d979f16e /h-source/Application
parent4e4b0e82b62d9a5bdce92b3caa2ab18e16122ba0 (diff)
improved search and impagination with CSS
Diffstat (limited to 'h-source/Application')
-rw-r--r--h-source/Application/Controllers/SearchController.php29
-rw-r--r--h-source/Application/Include/languages.php2
-rw-r--r--h-source/Application/Include/myFunctions.php5
-rw-r--r--h-source/Application/Views/Search/form.php30
-rw-r--r--h-source/Application/Views/header.php19
5 files changed, 70 insertions, 15 deletions
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 @@
<div class="search_form">
<div class="search_form_label">
- <?php echo gtext("search by");?> <b><?php echo gtext("model name");?></b>
+ <img class="search_img" src="<?php echo $this->baseUrl;?>/Public/Img/Glaze/viewmag.png"> <span class="span_search_desc"><?php echo gtext("search by");?> <b><?php echo gtext("model name");?></b></span>
</div>
<noscript>
<div class="noscript_notice">
@@ -75,15 +75,35 @@
</form>
</div>
- <div class="search_form_2">
+ <div class="search_form_pciid">
<div class="search_form_label">
- <?php echo gtext("search by");?> <b>vendorid:productid</b>
+ <img class="search_img" src="<?php echo $this->baseUrl;?>/Public/Img/Glaze/viewmag.png"> <span class="span_search_desc"><?php echo gtext("search by");?> <b>vendorid:productid</b></span>
</div>
- <form method="GET">
+ <form action="<?php echo $this->baseUrl."/search/pciid/".Lang::$current;?>" method="POST">
<table>
<tr>
<td><?php echo gtext("VendorID:ProductID code of the device");?>:</td>
- <td><?php echo Html_Form::input('vendorid','','input_entry_search',"search_model_input");?></td>
+ <td><?php echo Html_Form::input('pciid','','input_entry_search');?></td>
+ </tr>
+ <tr>
+ <td><input type="submit" name="search_pci" value="search"></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+
+ <div class="search_form_lspci">
+ <div class="search_form_label">
+ <img class="search_img" src="<?php echo $this->baseUrl;?>/Public/Img/Glaze/viewmag.png"> <span class="span_search_desc"><?php echo gtext("analyze the output of the lspci command");?></span>
+ </div>
+ <form action="<?php echo $this->baseUrl."/search/lspci/".Lang::$current;?>" method="POST">
+ <table>
+ <tr>
+ <td valign="top"><?php echo gtext("paste the output of the lspci command");?>:<div class="lspci_notice">lspci -vmmnn</div></td>
+ <td><?php echo Html_Form::textarea('lspci','insert the output of lspci -vmmnn','textarea_entry_search');?></td>
+ </tr>
+ <tr>
+ <td><input type="submit" name="search_pci" value="search"></td>
</tr>
</table>
</form>
diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php
index b7f094d..6b20ccc 100644
--- a/h-source/Application/Views/header.php
+++ b/h-source/Application/Views/header.php
@@ -1,5 +1,6 @@
<?php if (!defined('EG')) die('Direct access not allowed!'); ?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//IT">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//IT" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
<?php
// h-source, a web software to build a community of people that want to share their hardware information.
// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt)
@@ -10,17 +11,16 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-//
+//
// h-source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with h-source. If not, see <http://www.gnu.org/licenses/>.
?>
<?php $u = new UsersModel();?>
-<html>
<head>
<title><?php echo $title;?></title>
@@ -30,10 +30,13 @@
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl?>/Public/Css/website.css">
<link rel="Shortcut Icon" href="<?php echo $this->baseUrl?>/Public/Img/tab_icon_2.ico" type="image/x-icon">
-
- <!--[if IE]>
- <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl?>/Public/Css/explorer.css">
- <![endif] -->
+ <!--[if IE 6]>
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Css/explorer6.css">
+ <![endif]-->
+
+ <!--[if IE 7]>
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Css/explorer7.css">
+ <![endif]-->
<script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/functions.js"></script>