-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
171 lines (148 loc) · 7.27 KB
/
profile.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
session_start();
include('includes\header.php');
include('includes\sidebar.php');
include('Config/db_config.php');
if(!isset($_SESSION['name'])){
header( "Location:http://localhost/food-call/index.php");
//echo "sesion is set";
}
$email=$_SESSION['name'];
$query = "SELECT * from login where email_id = '$email';";
$query_run = mysqli_query($con,$query);
if($query_run) $row = mysqli_fetch_array($query_run);
if(isset($_POST['save']))
{
$name = $_POST['name'];
$regno = $_POST['regno'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$query = "UPDATE login set regno = '$regno', name = '$name', DOB = '$dob' where email_id = '$email';";
$query_run=mysqli_query($con,$query);
if($query_run){
echo '<script>alert("Changes Saved successfully");</script>';
}
else{
echo '<script>alert("DB error");</script>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Profile</title>
<link rel="stylesheet" href="CSS/card.css">
<link rel="stylesheet" href="CSS/button.css">
<link rel="stylesheet" href="CSS/cart.css">
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<!-- Title Page-->
<title>Profile</title>
<!-- Icons font CSS-->
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<!-- Font special for pages-->
<link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Vendor CSS-->
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/datepicker/daterangepicker.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="CSS/main.css" rel="stylesheet" media="all">
</head>
<body>
<div id="maincontent">
<div class="card card-4" style="width: fit-content; margin:10px;position: relative;left: 300px;">
<div class="card-body">
<h2 class="title">Profile</h2>
<form action="" method="post">
<div class="row row-space">
<div class="col-2">
<div class="input-group">
<label class="label">Name</label>
<input class="input--style-4" type="text" name="name" value="<?php echo $row['name'];?>" required="required">
</div>
</div>
<div class="col-2">
<div class="input-group">
<label class="label">Reg.No</label>
<input class="input--style-4" type="text" name="regno" value="<?php echo $row['regno'];?>" required="required">
</div>
</div>
</div>
<div class="row row-space">
<div class="col-2">
<div class="input-group">
<label class="label">Birthday</label>
<div class="input-group-icon">
<input class="input--style-4 js-datepicker" type="text" name="dob" value="<?php echo $row['DOB'];?>" required="required">
<i class="zmdi zmdi-calendar-note input-icon js-btn-calendar"></i>
</div>
</div>
</div>
<div class="col-2">
<div class="input-group">
<label class="label">Gender</label>
<div class="p-t-10">
<label class="radio-container m-r-45">Male
<input type="radio" checked="checked" name="gender">
<span class="checkmark"></span>
</label>
<label class="radio-container">Female
<input type="radio" name="gender">
<span class="checkmark"></span>
</label>
</div>
</div>
</div>
</div>
<div class="row row-space">
<div class="col-2">
<div class="input-group">
<label class="label">Email</label>
<input class="input--style-4" type="email" name="email" value="<?php echo $row['email_id'];?>" disabled="">
</div>
</div>
<div class="col-2">
<div class="input-group">
<label class="label">Phone Number</label>
<input class="input--style-4" type="text" name="phno" value="<?php echo $row['phno'];?>" disabled="">
</div>
</div>
</div>
<div class="row row-space">
<div class="col-2">
<div class="input-group">
<label class="label">Hostel Block</label>
<input class="input--style-4" type="text" name="hostel" value="<?php echo $row['name'];?>">
</div>
</div>
<div class="col-2">
<div class="input-group">
<label class="label">Account Balance</label>
<input class="input--style-4" type="text" name="accbal">
</div>
</div>
</div>
<div class="p-t-15">
<button class="btn btn--radius-2 btn--blue" name="save" type="submit">Save Changes</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Vendor JS-->
<script src="vendor/select2/select2.min.js"></script>
<script src="vendor/datepicker/moment.min.js"></script>
<script src="vendor/datepicker/daterangepicker.js"></script>
<!-- Main JS-->
<script src="JS/global.js"></script>
</body>
</html>