-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_contact.php
executable file
·123 lines (92 loc) · 2.74 KB
/
edit_contact.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
<?php
include('config.php');
include('masterpage/dashboard_header.php');
include('masterpage/dashboard_navbar.php');
include('masterpage/dashboard_sidebar.php');
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Dashboard</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">About Us</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Quick Example</h3>
</div>
<?php
$fetchAboutUs = mysqli_query($config,"SELECT * FROM user_contact");
while($row = mysqli_fetch_assoc($fetchAboutUs))
{
$mail = $row['email'];
$Pnumber = $row['phone_number'];
$adress = $row['user_address'];
$udate = $row['unboarding_date'];
}
?>
<form>
<div class="card-body">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="useremail"name = "useremail" value="<?php echo $mail;?>">
</div>
<div class="form-group">
<label for="number">Phone number</label>
<input type="number" class="form-control" id="userphoneno" name ="userphoneno" value="<?php echo $Pnumber;?>">
</div>
<div class="form-group">
<label for="Address"id="Address">Address</label>
<input type="text" class="form-control" id="user_address"name = "user_address" value="<?php echo $adress;?>">
</div>
</div>
<div class="card-footer">
<button type="submit" name="update" class="btn btn-primary form-control">Edit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<?php
$mail = $_POST['useremail'];
$Pnumber = $_POST['userphoneno'];
$adress = $_POST['user_address'];
$udate = $_POST['unboarding_date'];
if(isset($_POST['update']))
{
$updateQuery = mysqli_query($config,"UPDATE user_contact SET
mail = '$mail', phone_no = '$Pnumber', udate = '$udate', adress = '$adress'");
if($updateQuery)
{
echo "<script>alert('Data Updated Successfully')</script>";
redirect('edit_contact.php');
}
else
{
echo "<script>alert('Update Failed')</script>";
redirect('edit_contact.php');
}
}
?>
<?php
include('masterpage/dashboard_footer.php');
?>