forked from delpino73/Blue-Smiley-Organizer
/
search-links.php
48 lines (30 loc) · 1.22 KB
/
search-links.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require 'class.base.php';
require 'class.html.php';
$base_instance=new base();
$html_instance=new html();
$userid=$base_instance->get_userid();
$category_id=isset($_GET['category_id']) ? $_GET['category_id'] : '';
$html_instance->add_parameter(
array('ACTION'=>'show_form',
'HEADER'=>'Link Search',
'FORM_ACTION'=>'show-links.php',
'BODY'=>'onLoad="javascript:document.form1.text_search.focus()"',
'TD_WIDTH'=>'35%',
'BUTTON_TEXT'=>'Search Links'
));
# build category select box
$select_box=' <select name="category_id"><option><All>';
$data=$base_instance->get_data("SELECT * FROM {$base_instance->entity['LINK']['CATEGORY']} WHERE user='$userid' ORDER BY title");
for ($index=1; $index <= sizeof($data); $index++) {
$category_title=$data[$index]->title;
$ID=$data[$index]->ID;
if ($ID==$category_id) { $select_box.="<option selected value=$ID>$category_title"; }
else { $select_box.="<option value=$ID>$category_title"; }
}
$select_box.='</select>';
#
$html_instance->add_form_field(array('TYPE'=>'text','NAME'=>'text_search','VALUE'=>'','SIZE'=>30,'TEXT'=>'Text'));
$html_instance->add_form_field(array('TYPE'=>'label','TEXT1'=>'Category:','TEXT2'=>"$select_box",'SECTIONS'=>2));
$html_instance->process();
?>