forked from saivinayb/Online_Movie_Gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomer_edit.php
84 lines (70 loc) · 1.73 KB
/
customer_edit.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
<!DOCTYPE html>
<html>
<head>
<title>Account Details</title>
</head>
<body>
<style type="text/css">
.block0 {
padding: 6px 12px;
margin-bottom: 3px;
}
body
{
background-image: url('clou.jpeg');
}
h3
{
font-family: cambria;
}
button
{
border: 2.5px solid darkgrey;
border-radius: 8px;
font-size: 16px;
font-family: cambria;
}
button:hover
{
transform: scale(1.02);
background-color: #E3E3E3;
}
</style>
<?php
session_start();
$x=$_SESSION["id"];
$y=$_SESSION["name"];
$con = new mysqli('localhost', 'root', '', 'mov_gallery');
$query="select * from customer where c_id='".$x."'";
$result=mysqli_query($con,$query);
$row = mysqli_fetch_assoc($result);
{
echo'<form method="post">';
echo'<h3>CUSTOMER NAME:</h3><input type="text" class=block0 name="new_cname" value='.$row['c_name'].'></input>';
echo'<br>';
echo'<h3>ADDRESS:</h3><input type="text" class=block0 name="new_address" value='.$row['address'].'></input>';
echo'<br>';
echo'<h3>PHONE NUMBER:</h3><input type="text" class=block0 name="new_phone" value='.$row['phone'].'></input>';
echo'<br>';
echo'<br>';
echo'<input class=block0 name="sub" type="submit">';
echo'</form>';
}
?>
<?php
if(isset($_POST['sub']))
{
$new_cname=$_POST['new_cname'];
$new_address=$_POST['new_address'];
$new_phone=$_POST['new_phone'];
$query2="update customer set c_name='$new_cname',address='$new_address',phone='$new_phone' where c_id='$x'";
$result2=mysqli_query($con,$query2);
if($result2)
{
header("refresh:0.01; url=customer_lobby.php?x=$x&y=$new_cname");
echo'<script>alert("Details successfully updated!")</script>';
}
}
?>
</body>
</html>