-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindVendor.php
26 lines (23 loc) · 1007 Bytes
/
FindVendor.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
<script>
function SendVend(str) {
$.post("NewDeal.php", {$vendor = 'str'} );
$.post("NewDeal.php", 'submit')
}
</script>
<?php
include_once 'Dbconnect.php';
if (isset($_GET["q"])){
$q = strip_tags($_GET["q"]);
if (strlen($q)>0) {
$vendSearch = mysqli_query($dbconnect, "SELECT * FROM vendor WHERE VendName LIKE '%{$q}%' LIMIT 5");
if (mysqli_num_rows($vendSearch)!= 0){
while ($row = mysqli_fetch_assoc($vendSearch)){
echo "<a href = '#' onlick = 'SendVend(this.value)'><h6>".$row['VendName']."</h6></a>";
}
} else {
echo "<h4>Vendor not Recognized</h4><h6><br />You may Submit a New Vendor for Confirmation</h6><h6><br />Or Continue with an Unconfirmed Vendor</h6>";
echo "<br /><form method = 'POST' action='NewDeal.php'><input type= 'submit' name= 'NewVendor' value='New Vendor'> <input type= 'submit' name= 'Unconfvend' value='Unconfirmed'></form>";
}
}
}
?>