-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.php
135 lines (88 loc) · 3.21 KB
/
form.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<?php require 'db_connect.php'; ?>
</head><center><h1> Please Select Your Search Criteria</h1></center>
<body><center>
<div class="frmSearch" id="search_form" name="search_form" method="post" action="../results.php">
<p>
<?php
$sql = "select State from ZIPCodes GROUP BY State ASC";
$result = $conn->query($sql);
$num_rows = mysqli_num_rows($result);
if ($result->num_rows > 0) {
echo '<span class="label" for="city">State: </span>';
echo '<select name="State" size="1" id="city" form="search_form">';
echo '<option value="" selected="selected">Please Select</option>';
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<option value="'.$row["State"].'">'.$row["State"];
echo '</option>';
}
echo '</select>';
}
$state = $_POST["State"];
$sql = "select City from ZIPCodes where State = '$state' Group BY City ASC";
$result = $conn->query($sql);
$num_rows = mysqli_num_rows($result);
if ($result->num_rows > 0) {
echo '<span class="label" for="City">City: </span>';
echo '<select name="City" size="1" id="City" form="search_form">';
echo '<option value="" selected="selected">Please Select</option>';
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<option value="'.$row["City"].'">'.$row["City"];
echo '</option>';
}
echo '</select>';
}
$sql = "select ZipCode from ZIPCodes where City = 'The Villages' Group BY ZipCode ASC";
$result = $conn->query($sql);
$num_rows = mysqli_num_rows($result);
if ($result->num_rows > 0) {
echo '<span class="label" for="zipcodes">Zip Codes: </span>';
echo '<select name="zipcodes" size="1" id="zipcodes" form="search_form">';
echo '<option value="" selected="selected">Please Select</option>';
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<option value="'.$row["ZipCode"].'">'.$row["ZipCode"];
echo '</option>';
}
echo '</select>';
echo '<br>';
}
$sql = "select code, description from naics";
$result = $conn->query($sql);
$num_rows = mysqli_num_rows($result);
if ($result->num_rows > 0) {
echo '<span class="label" for="naics">NAICS: </span>';
echo '<select name="naic" size="1" id="naics" form="search_form">';
echo '<option value="" selected="selected">Please Select</option>';
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<option value="'.$row["code"].'">'.$row["code"];
echo " | ".$row['description'];
echo '</option>';
}
echo '</select>';
}
echo '<br>';
?>
<span class="label" for="setaside">Set-Aside:</span>
<select name="setaside" size="1" id="setaside" form="search_form" tabindex="0">
<option value="" selected="selected">Please Select One</option>
<option value="A6">SBA Certified 8A Program Participant</option>
<option value="JT">SBA Certified 8A Joint Venture</option>
<option value="XX">SBA Certified HUBZone Firm</option>
</select>
</p>
<p>
<input type="submit">
</p>
</div>
</form> </center>
</body>
</html>