aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application')
-rw-r--r--h-source/Application/Controllers/SearchController.php15
-rw-r--r--h-source/Application/Views/Search/results.php17
-rw-r--r--h-source/Application/Views/header.php4
3 files changed, 22 insertions, 14 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index 9633a0e..9e7cb68 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -60,11 +60,18 @@ class SearchController extends BaseController
if (strcmp($this->viewArgs['action'],'search') === 0)
{
Params::$whereClauseSymbolArray = array('like');
+
+ $this->m['HardwareModel']->logicalOperators = array('AND','OR');
$whereClause = array(
- 'type' => $this->viewArgs['type'],
- 'model' => "like '%".$this->viewArgs['model']."%'",
- '-deleted' => "no",
+ 'type' => $this->viewArgs['type'],
+ 'level1' => array(
+ 'model' => "like '%".$this->viewArgs['model']."%'",
+ 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ ),
+// 'model' => "like '%".$this->viewArgs['model']."%'",
+// 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ '-deleted' => "no",
);
$recordNumber = $this->m['HardwareModel']->clear()->where($whereClause)->orderBy("id_hard desc")->rowNumber();
@@ -77,7 +84,7 @@ class SearchController extends BaseController
//set the limit clause
$limit = $this->h['Pages']->getLimit($page,$recordNumber,10);
- $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
+ $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year,other_names')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
// echo $this->m['HardwareModel']->getQuery();
$data['pageList'] = $this->h['Pages']->render($page-3,7);
diff --git a/h-source/Application/Views/Search/results.php b/h-source/Application/Views/Search/results.php
index dfe0ab9..2bc14f4 100644
--- a/h-source/Application/Views/Search/results.php
+++ b/h-source/Application/Views/Search/results.php
@@ -38,14 +38,19 @@
?>
<div class="search_result_item">
- <div>
- <?php echo gtext("model name");?>: <b><a href="<?php echo $this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model']);?>"><?php echo $row['hardware']['model'];?></a></b>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("model name");?>:</div> <div class="search_result_item_right"><b><a href="<?php echo $this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model']);?>"><?php echo $row['hardware']['model'];?></a></b></div>
</div>
- <div>
- <?php echo gtext("model type");?>: <b><?php echo $row['hardware']['type'];?></b>
+ <?php if ( strcmp($row['hardware']['other_names'],'') !== 0 ) { ?>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("possible other names of the device");?>:</div> <div class="search_result_item_right"><b><?php echo nl2br($row['hardware']['other_names']);?></b></div>
</div>
- <div>
- <?php echo gtext("year of commercialization");?>: <b><?php echo $row['hardware']['comm_year'];?></b>
+ <?php } ?>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("model type");?>: </div> <div class="search_result_item_right"><b><?php echo $row['hardware']['type'];?></b></div>
+ </div>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("year of commercialization");?>: </div> <div class="search_result_item_right"><b><?php echo $row['hardware']['comm_year'];?></b></div>
</div>
</div>
diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php
index e86006b..5247659 100644
--- a/h-source/Application/Views/header.php
+++ b/h-source/Application/Views/header.php
@@ -36,10 +36,6 @@ $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index';
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl?>/Public/Css/main.css">
<link rel="Shortcut Icon" href="<?php echo $this->baseUrl?>/Public/Img/tab_icon_2.ico" type="image/x-icon">
- <!--[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]-->