-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventPlannerUpdate.php
More file actions
178 lines (158 loc) · 7.39 KB
/
EventPlannerUpdate.php
File metadata and controls
178 lines (158 loc) · 7.39 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
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
172
173
174
175
176
177
<?php
session_start();
require 'eventClass.php';
$id = $_SESSION['epId'];
$obj = new db();
$r = $obj->fetch_epinfo($id);
?>
<?php
$studentnameerror = "";
$studentPhoneerror = "";
$usernameerror = "";
$passworderror = "";
$flag = 0;
if(isset($_REQUEST['update']))
{
$obj = new db();
$password = $_REQUEST['password'];
$cpass = $_REQUEST['confirm_password'];
if($password=== $cpass)
{
$ep_id = $_REQUEST['studentId'];
$ep_name = $_REQUEST['name'];
$gender = $_REQUEST['gender'];
$department = $_REQUEST['department'];
$phonenumber = $_REQUEST['phoneNumber'];
$email = $_REQUEST['email'];
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
if(is_numeric($ep_name)){
$studentnameerror = "Name Can't have numbers";
}else{
if(!is_numeric($phonenumber) or strlen($phonenumber)>10 or strlen($phonenumber)<10){
$studentPhoneerror = "Enter valid phone number";
}else{
$r = $obj->updateEventPlannerInfo($id,$ep_id,$ep_name,$gender,$department,$phonenumber,$email,$username,$password);
if($r!= 0){
header('location:EventPlannerProfile.php');
exit;
}
}
}
}else{
$passworderror = "Password Should match";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Update - Event Hive</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
font-family: 'Arial', sans-serif;
margin: 0;
}
.navbar {
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
}
.navbar a {
color: #000;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="registration.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">Event Hive</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="userProfileDisp.php"><i class="fas fa-user"></i> Back to User Profile</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<div class="card">
<div class="card-header bg-primary text-white">
<h2 class="text-center">Sign Up</h2>
</div>
<div class="card-body">
<form method="POST">
<div class="mb-3">
<label for="studentId" class="form-label">Student ID</label>
<input type="text" class="form-control" id="studentId" name="studentId" required value= <?php echo $r['studentId']?> >
</div>
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name" required value= <?php echo $r['name']?> >
<span style="color: red;"> <?php echo $studentnameerror; ?> </span>
</div>
<div class="mb-3">
<label class="form-label">Gender</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="male" name="gender" value="male" required default>
<label class="form-check-label" for="male">Male</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="female" name="gender" value="female" required>
<label class="form-check-label" for="female">Female</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="other" name="gender" value="other" required>
<label class="form-check-label" for="other">Other</label>
</div>
</div>
<div class="mb-3">
<label for="department" class="form-label">Department</label>
<select class="form-select" id="department" name="department" required>
<option value="CMPICA">CMPICA</option>
<option value="PDPIAS">PDPIAS</option>
<option value="MTIN">MTIN</option>
<option value="CSPIT">CSPIT</option>
<option value="DEPSTAR">DEPSTAR</option>
<option value="ARIP">ARIP</option>
<option value="IIIM">IIIM</option>
</select>
</div>
<div class="mb-3">
<label for="phoneNumber" class="form-label">Phone Number</label>
<input type="tel" class="form-control" id="phoneNumber" name="phoneNumber" value= <?php echo $r['phonenumber']?> required>
<span style="color: red;"> <?php echo $studentPhoneerror; ?> </span>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" value= <?php echo $r['email']?> required>
</div>
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" value= <?php echo $r['username']?> required readonly>
<span style="color: red;"> <?php echo $usernameerror; ?> </span>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" value= <?php echo $r['password']?> required>
</div>
<div class="form-group">
<label for="confirm_password">Confirm Password:</label>
<input type="password" id="confirm_password" name="confirm_password" class="form-control">
<span style="color: red;"> <?php echo $passworderror; ?> </span>
</div>
<button type="submit" class="btn btn-primary" name="update">Update</button>
</form>
</div>
</div>
<!-- Bootstrap JS and Popper.js (jQuery is no longer required) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</div>
</body>
</html>