-
Notifications
You must be signed in to change notification settings - Fork 0
/
advancedsearch.php
79 lines (70 loc) · 1.55 KB
/
advancedsearch.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* add.php
*
* Creates the form and searches the database for the specified contact
*
* @author Angus Vine <[email protected]>
* @version 1.0
* @since 5.5 (The php version used)
*/
require_once 'core/init.php';
include 'includes/head.inc.php';
?>
<script type="text/javascript">
/**
* removeEmptyInput
*
* Removes any empty search fields from the POST before it is sent
*/
function removeEmptyInput()
{
var form = document.getElementById('contact-form');
var allInputs = form.getElementsByTagName('input');
var select = document.getElementById('state');
var input, i;
if(!select.options[select.selectedIndex].value) {
select.setAttribute('name', '');
}
for(i = 0; input = allInputs[i]; i++) {
if(input.getAttribute('name') && !input.value) {
input.setAttribute('name', '');
}
}
}
</script>
<div class="sub-headerContainer">
<div class="sub-header">
<h2>Advanced Search</h2>
</div>
</div>
<?php
$form = array(
'action' => 'advresults.php',
'method' => 'get',
'id' => '',
'band' => '',
'first_name' => '',
'last_name' => '',
'email' => '',
'phone' => '',
'mobile' => '',
'company' => '',
'add_line_1' => '',
'add_line_2' => '',
'show_state' => true,
'state' => '',
'city' => '',
'post_code' => '',
'show_notes' => false,
'notes' => '',
'show_button' => true,
'button' => 'Search',
'read_only' => false
);
if(Session::exists('back')) {
echo '<ul class ="error"><li>' . Session::flash('back') . '</li></ul>';
}
include 'includes/contact-form.php';
include 'includes/foot.inc.php';
?>