Documentation is available at basic_view_search.php
1 <?php
2 /**
3 * @author Jan H. Andersen <jha@ipwsystems.dk>
4 * @author Martin R. Larsen <mrl@ipwsystems.dk>
5 * @copyright {@link http://www.ipwsystems.dk/ IPW Systems a.s}
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @package METAjour
8 * @subpackage view
9 * $Id: basic_view_search.php,v 1.6 2005/02/15 12:18:10 jan Exp $
10 */
11
12 require_once('basic_view_list.php');
13
14 class basic_view_search extends basic_view_list {
15
16 function loadLanguage() {
17 parent::loadLanguage();
18 $this->loadLangFile('basic_view_search');
19 }
20
21 function categoryBar() {
22 }
23
24 function searchBar($index=0,$colfname='searchcol', $compfname='searchtype', $textfname='search') {
25
26 echo $this->makeField($this->gl('sttext_1'),parent::searchBar(0,'searchcol[]','searchtype[]','search[]'));
27 echo $this->makeField($this->gl('sttext_2'),parent::searchBar(1,'searchcol[]','searchtype[]','search[]'));
28 echo $this->makeField($this->gl('sttext_3'),parent::searchBar(2,'searchcol[]','searchtype[]','search[]'));
29 echo $this->makeField($this->gl('sttext_4'),parent::searchBar(3,'searchcol[]','searchtype[]','search[]'));
30 echo $this->makeField($this->gl('sttext_5'),parent::searchBar(4,'searchcol[]','searchtype[]','search[]'));
31 echo $this->makeField($this->gl('sttext_6'),parent::colsBar());
32 echo $this->makeField($this->gl('sttext_7'),'<input type="text" style="width: 152px" name="createdfrom" id="createdfrom" value="'.$_SESSION['gui'][$this->otype]['createdfrom'].'" readonly> '
33 . '<img src="image/cal/cal.gif" id="button_cal1" onmouseover="this.className=\'mButtonOver\'" onmouseout="this.className=\'mButton\'"class="mButton">');
34 echo $this->makeField($this->gl('sttext_8'),'<input type="text" style="width: 152px" name="createdto" value="'.$_SESSION['gui'][$this->otype]['createdto'].'"> '
35 . '<img src="image/cal/cal.gif" id="button_cal2" onmouseover="this.className=\'mButtonOver\'" onmouseout="this.className=\'mButton\'"class="mButton">');
36
37 }
38
39 function toolBar() {
40 ob_start();
41 echo '<table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top">';
42 echo '<form name="listsearch" method="POST" style="margin:0px; spacing:0px; clear: none;" action="'.$this->ReturnMeUrl().'">';
43
44 $this->categoryBar();
45
46 echo $this->searchBar();
47
48 echo '<input type="hidden" name="otype" value="'.$this->otype.'">';
49 echo '</form>';
50 echo '</td><td valign="top" style="padding-left: 5px;">';
51 echo $this->buttonOnClick('search_small.png',$this->gl('img_search'),'document.listsearch.submit()');
52 echo $this->button('list_small.png',$this->gl('img_listall'),$this->ReturnMeUrl().'&clearall=1');
53 if ($this->offset > 0) echo $this->button('prev_small.png', 'prev', $this->returnMeUrl() . '&offset=' . ($this->offset - LIMIT) . '&count=' . LIMIT);
54 if ($this->offset + LIMIT < $this->totalcount) echo $this->button('next_small.png', 'next', $this->returnMeUrl() . '&offset=' . ($this->offset + LIMIT) . '&count=' . LIMIT);
55 echo '</td></tr></table>';
56 $result = ob_get_contents();
57 ob_end_clean();
58 return $result;
59 }
60
61
62 function view() {
63 $this->context->addHeader("<style type=\"text/css\">@import url(js/calendar/calendar-system.css);</style>");
64 $this->context->addHeader("<script type=\"text/javascript\" src=\"js/calendar/calendar.js\"></script>\n");
65 $this->context->addHeader("<script type=\"text/javascript\" src=\"js/calendar/lang/calendar-da.js\"></script>\n");
66 $this->context->addHeader("<script type=\"text/javascript\" src=\"js/calendar/calendar-setup.js\"></script>\n");
67 parent::view();
68 $this->context->addFooter("<script type=\"text/javascript\">
69 Calendar.setup(
70 {
71 inputField : \"createdfrom\",
72 ifFormat : \"%Y-%d-%m\",
73 button : \"button_cal1\"
74 }
75 );
76 Calendar.setup(
77 {
78 inputField : \"createdto\",
79 ifFormat : \"%Y-%d-%m\",
80 button : \"button_cal2\"
81 }
82 );
83 </script>\n");
84 }
85
86 }
87 ?>
Documentation generated on Thu, 9 Jun 2005 06:51:32 +0200 by phpDocumentor 1.2.3