summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorSimon2011-04-04 17:09:57 +0200
committerSimon2011-04-04 17:09:57 +0200
commit6511fb075385b9fc25ade2d4bd331e742193960e (patch)
tree5659fd268ad03c1064d4ee7a00b62545e878822d /library
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-6511fb075385b9fc25ade2d4bd331e742193960e.tar.gz
pbs2-6511fb075385b9fc25ade2d4bd331e742193960e.tar.xz
pbs2-6511fb075385b9fc25ade2d4bd331e742193960e.zip
client-suche verändert
Diffstat (limited to 'library')
-rw-r--r--library/Pbs/Search.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/library/Pbs/Search.php b/library/Pbs/Search.php
index 7f6dfa7..e642d66 100644
--- a/library/Pbs/Search.php
+++ b/library/Pbs/Search.php
@@ -6,6 +6,25 @@ class Pbs_Search{
private $searcha;
private $searchb;
+ public function searchForm(){
+ $str = "<form style='text-align:right;' action='/user/client/search'>
+ <input type='text' name='search' ".(($this->searchTerm != '')?'value="'.$this->searchTerm.'"':'').">
+ <button type='submit' class='searchbutton' value='search'> Search</button>";
+ if($this->searchTerm != ''){
+ $str .= "<a href='/user/client/'><img src='/media/img/delete.png' alt='Delete Client'/></a>
+ <script type='text/javascript' src='/media/js/jquery.highlight-3.js'></script>
+ <script>
+ $(document).ready(function(){";
+ foreach($this->getSearchTerms() as $term){
+ $str .= "$('table').highlight('".$term."');";
+ }
+ $str .= "});
+ </script>";
+ }
+ $str .= "</form>";
+ return $str;
+ }
+
public function setSearchTerm($search){
$this->searchTerm = $search;
@@ -62,7 +81,8 @@ class Pbs_Search{
}
if (count($this->searcha) > 0 && count($this->searchb) > 0){
$data = array_intersect($com1,$com2);
- }
+ }
+ $data = array_unique($data);
foreach( $data as $c)
$ges[] = $array[$c];
return $ges;