-
Notifications
You must be signed in to change notification settings - Fork 0
/
business_search_results.php
106 lines (97 loc) · 6.93 KB
/
business_search_results.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
<!DOCTYPE html>
<html>
<head>
<style>
.frm-group form {
background-color: #C1B7BB; /* Gray background */
border: 1px solid black; /* black border */
color: white; /* White text */
padding: 10px 24px; /* Some padding */
cursor: pointer; /* Pointer/hand icon */
float: left; /* Float the buttons side by side */
}
/* Clear floats (clearfix hack) */
.frm-group:after {
content: "";
clear: both;
display: table;
}
.frm-group form:not(:last-child) {
border-right: none; /* Prevent double borders */
}
/* Add a background color on hover */
.frm-group form:hover {
background-color: #0045B0;
}
</style>
<script type="text/javascript">
function ClearPlaceHolder (input) {
input.defaultValue==""
if (input.value == input.defaultValue) {
input.value = "";
}
}
function SetPlaceHolder (input) {
if (input.value == "") {
input.value = input.defaultValue;
}
}
function submitForm(action) {
var form = document.getElementById('form1');
form.action = action;
form.submit();
</script>
<title>Business Customer Information Screen</title>
</head>
<body bgcolor="#C3B7BC">
<h1><font color="071D49"><center>Business Customer Information Screen</center></font></h1>
<?php
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$db = mysqli_connect('localhost:3306', 'staffmember', 'Customer1');
mysqli_select_db($db, 'business_info');
if (mysqli_connect_errno()) {
echo '<p>Error: Could not connect to database.<br/>
Please try again later.</p>';
exit;
}
$query = "SELECT * FROM clientinfo WHERE firstname LIKE '$firstname' AND lastname LIKE '$lastname'";
$result = mysqli_query($db, $query);
while($row=mysqli_fetch_assoc($result))
{
echo "<form action='business_update_record.php' method=post>";
echo '<p><strong><label for="PersonID">Person ID:</label> <input name="PersonID" type="text" size="3" value="'.$row['PersonID'].'"></strong></p>';
echo '<p><strong><label for="salut">Salut:</label> <input name="salut" type="text" size="5" value="'.$row['salut'].'">
<label for="firstname">First Name:</label> <input name="firstname" type="text" size="15" value="'.$row['firstname'].'">
<label for="mid_init">Mid Init:</label> <input name="mid_init" type="text" size="5" value="'.$row['mid_init'].'">
<label for="lastname">Last Name:</label> <input name="lastname" type="text" size="15" value="'.$row['lastname'].'">
<label for="suffix">Suffix:</label> <input name="suffix" type="text" size="5" value="'.$row['suffix'].'"></strong></p>';
echo '<p><strong><label for="title">Job Title:</label> <input name="title" type="text" size="40" value="'.$row['title'].'"></p></strong>';
echo '<p><strong><label for="company_name">Company Name:</label> <input name="company_name" type="text" size="50" value="'.$row['company_name'].'"><label for="department">Department:</label> <input name="department" type="text" size="40" value="'.$row['department'].'"></strong></p>';
echo '<p><strong><label for="address1">Address1:</label> <input name="address1" type="text" size="40" value="'.$row['address1'].'">
<label for="address2">Address2:</label> <input name="address2" type="text" size="25" value="'.$row['address2'].'">
<label for="suite_no">Suite No.:</label> <input name="suite_no" type="text" size="15" value="'.$row['suite_no'].'"></strong></p>';
echo '<p><strong><label for="city">City:</label> <input name="city" type="text" size="25" value="'.$row['city'].'">
<label for="state">State:</label> <input name="state" type="text" size="5" value="'.$row['state'].'">
<label for="postal_code">Postal Code:</label> <input name="postal_code" type="text" size="15" value="'.$row['postal_code'].'">
<label for="zip_code">Zip Code:</label> <input name="zip_code" type="text" size="15" value="'.$row['zip_code'].'"></strong></p>';
echo '<p><strong><label for="mobile_phone">Mobile Phone:</label> <input name="mobile_phone" type="text" size="15" value="'.$row['mobile_phone'].'">
<label for="office_phone">Office Phone:</label> <input name="office_phone" type="text" size="15" value="'.$row['office_phone'].'">
<label for="home_phone">Home Phone:</label> <input name="home_phone" type="text" size="15" value="'.$row['home_phone'].'">
<label for="fax_phone">Fax Phone:</label> <input name="fax_phone" type="text" size="15" value="'.$row['fax_phone'].'"></strong></p>';
echo '<p><strong><label for="office_email">Office Email:</label> <input name="office_email" type="text" size="50" value="'.$row['office_email'].'"><label for="home_email">Home Email:</label> <input name="home_email" type="text" size="50" value="'.$row['home_email'].'"></strong></p></p><strong><label for="company_website">Company Website:</label> <input name="company_website" type="text" size="60" value="'.$row['company_website'].'"></strong></p><p><strong><label for="gender">Gender:</label> <input name="gender" type="text" size="10" value="'.$row['gender'].'"><label for="age">Age:</label> <input name="age" type="text" size="5" value="'.$row['age'].'"><label for="notes">Comments/Notes:</label> <input name="notes" type="text" size="100" value="'.$row['notes'].'"></strong></p>';
echo '<div class="frm-group">
<input type="submit" name="Update Record" value="Update Record"></form>
<form action="business_add_new_record.php" method=post><input type="submit" name="submit" value="Add New Record"></button></form>
<form action="business_first_record.php" method="post"><input type="submit" name="submit" value="First Record"></form>
<form action="business_previous_record.php" method="post"><input name="searchterm" type="hidden" size="5" value='.$row['PersonID'].'><input type="submit" name="submit" value="Previous Record"></form>
<form action="business_next_record.php" method="post"><input name="searchterm" type="hidden" size="5" value='.$row['PersonID'].'><input type="submit" name="Next Record" value="Next Record"></form>
<form action="business_last_record.php" method="post"><input type="submit" name="submit" value="Last Record"></form>
<form action="business_search.php" method=post><input type="submit" name="submit" value="Find Record"></button></form>
<form action="business_delete_record.php" method="post"><input name="searchterm" type="hidden" size="5" value='.$row['PersonID'].'><input type="submit" name="submit" value="Delete Record"></form></div>';
}
/* $result->free_result();
$db->close(); */
?>
</body>
</html>