forked from aemunahmar/DBProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditCustomer.html
More file actions
138 lines (119 loc) · 7.67 KB
/
editCustomer.html
File metadata and controls
138 lines (119 loc) · 7.67 KB
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
136
137
138
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Local Manager Account">
<title>Edit Customer Info</title>
<link rel="icon" type="image/png" href="images/caricon.png">
<link rel="stylesheet" type=text/css href="styles/main.css">
<link rel="stylesheet" type="text/css" href="styles/bootstrap4/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styles/util.css">
<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>
<?php session_start(); ?>
<header>
<div id="logo"><a><img src="images/logo.png"></a></div>
<nav>
<ul>
<?php
if(isset($_SESSION['customer']))
{
echo '<li><a href="logout.php">Logout</a></li>';
echo '<li><a href="custAccount.html" style=text-decoration:none;>Welcome ' . $_SESSION['fname'] . '</a></li>';
} else if(isset($_SESSION['wsmanager']) || isset($_SESSION['ldmanager1']) || isset($_SESSION['ldmanager2']) || isset($_SESSION['salesrep1']) || isset($_SESSION['salesrep2']))
{
echo '<li><a href="logout.php">Logout</a></li>';
echo '<li><a href="empAccount.html" style=text-decoration:none;>Welcome ' . $_SESSION['fname'] . '</a></li>';
} else
{
echo '<li>';
echo '<a style=color:red;>Sign In</a>';
echo '<ul class="dropdown">';
echo '<li><a href="signIn.html">Customers</a></li>';
echo '<li><a href="empSignin.html">Employees</a></li>';
echo '</ul>';
echo '</li>';
echo '<li><a href="registerPage.html">Register</a></li>';
}
?>
<li><a>|</a></li>
<li><a href="tabVehicles.html">Vehicles</a></li>
<li><a href="tabPackages.html">Packages</a></li>
<li><a href="tabRebates.html">Rebates</a></li>
<li><a href="index.html">Home</a></li>
</ul>
</nav>
<div class="services">
<div class="container">
<div class="row">
<div class="col text-center">
<div class="section_title">Edit Customer Info</div>
<div class="section_subtitle">Make sure everything is correct</div>
</div>
</div>
</div>
</div>
</header>
<?php
if(isset($_SESSION['ldmanager1']))
{
$dbconnect = mysqli_connect("127.0.0.1", "root", "", "dealer_one");
$cust_no = $_GET['customer_no'];
} else if (isset($_SESSION['ldmanager2']))
{
$dbconnect = mysqli_connect("127.0.0.1", "root", "", "dealer_two");
$cust_no = $_GET['buyer_no'];
}
$query1 = "SELECT * FROM customer_d1 WHERE customer_no = '$cust_no'";
$output1 = $dbconnect->query($query1);
$query2 = "SELECT * FROM customer_d2 WHERE buyer_no = '$cust_no'";
$output2 = $dbconnect->query($query2);
?>
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-50">
<form class="login100-form validate-form" action=updateCustomer.php method=POST>
<?php if(($output1)){
while($result = mysqli_fetch_assoc($output1)){ ?>
<span class="login100-form-title p-b-33" style="text-align:center; font-size:25px;">My Information</span>
<tr class="row100 body">
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;"> Customer No:<?php echo "<input style=text-align:center; type=text name=customer_no value='".$result['customer_no']."'>"?></div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;">Name: <?php echo "<input style=text-align:center;type=text name=name
value='".$result['name']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;">Address: <?php echo "<input style=text-align:center;type=text name=address
value='".$result['address']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;">Phone Number: <?php echo "<input style=text-align:center;type=text name=phone value='".$result['phone']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<td><?php echo "<input class=info_form_button type=submit name=submit value=Update>"?></td>
</tr>
<?php } } else if(($output2)){
while($result = mysqli_fetch_assoc($output2)){ ?>
<span class="login100-form-title p-b-33" style="text-align:center; font-size:25px;">My Information</span>
<tr class="row100 body">
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;"> Buyer No: <?php echo "<input style=text-align:center; type=text name=buyer_no value='".$result['buyer_no']."'>"?></div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;"> Name: <?php echo "<input style=text-align:center;type=text name=name value='".$result['name']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;">Address: <?php echo "<input style=text-align:center;type=text name=address
value='".$result['address']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<div class="wrap-input100" style="text-align:center;font-family:Montserrat;font-size:18px;font-weight:500;">Phone Number: <?php echo "<input style=text-align:center;type=text name=phone value='".$result['phone']."'>"?> </div>
<span class="login100-form-title p-b-33"> </span>
<td><?php echo "<input class=info_form_button type=submit name=submit value=Update>"?></td>
</tr>
<?php } } else{ echo '<span class=login100-form-title p-b-33>Record Not Available </span><br><br>'; } ?>
</form>
</div>
</div>
</div>
<footer>
<h3>All Rights Reserved, Copyright © 2020</h3>
</footer>
</body>
</html>