-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-profile-alumni.php
280 lines (242 loc) · 14.1 KB
/
update-profile-alumni.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?php include "include/middleware.php"; ?>
<?php
include("include/connection.php");
$id=$_SESSION['id'];
$qry = "SELECT * FROM alumni where id=$id ";
$res = mysqli_query($conn, $qry);
$a = mysqli_fetch_array($res);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Arid Alumni | Update Profile</title>
<?php include "include/link.php"; ?>
</head>
<body>
<?php include "include/navbar.php"; ?>
<!-- Page Header Start -->
<div class="page-header mb-0">
<div class="container">
<div class="row">
<div class="col-12" data-aos="fade-up">
<h2>Update Profile</h2>
</div>
<div class="col-12" data-aos="fade-up">
<a href="">Home</a>
<a href="">Update Profile</a>
</div>
</div>
</div>
</div>
<!-- Page Header End -->
<!-- Form-Start -->
<section class="sec-std-form">
<div class="wrapper">
<div class="title" data-aos="fade-down">Update Profile</div>
<form id="register_process" enctype="multipart/form-data" data-netlify="true">
<div class="form">
<div class="inputfield">
<label>Full Name</label>
<input type="text" class="input" value="<?php echo $a['FullName'] ?>" id="name" name="FullName"
placeholder="Enter Full Name" maxlength="30" title="Enter only alphabets" />
</div>
<span style="color:red;" class="null-FullName null"></span>
<div class="inputfield">
<label>Registration No.</label>
<input type="text" class="input" value="<?php echo $a['RegistrationNo'] ?>" id="name"
name="RegistrationNo" placeholder="Enter Registration No." maxlength="20"
title="Enter Registration No." />
</div>
<span style="color:red;" class="null-RegistrationNo null"></span>
<div class="inputfield">
<label>CNIC No.</label>
<input type="text" class="input" value="<?php echo $a['CNIC_no'] ?>" id="name" name="CNIC_no"
placeholder="Enter CNIC No." maxlength="20" title="Enter only numbers" />
</div>
<span style="color:red;" class="null-CNIC_no null"></span>
<div class="inputfield">
<label>Email Address</label>
<input type="email" class="input" value="<?php echo $a['Email'] ?>" name="Email"
placeholder="Enter your email" />
</div>
<span style="color:red;" class="null-Email null"></span>
<div class="inputfield">
<label for="">Phone Number</label>
<input type="tel" class="input" value="<?php echo $a['PhoneNumber'] ?>" name="PhoneNumber"
maxlength="15" id="phone-number" placeholder="Enter phone number"
title="Please enter valid phone number" />
</div>
<span style="color:red;" class="null-PhoneNumber null"></span>
<div class="inputfield">
<label>Passout Year</label>
<div class="custom_select">
<select id="state" name="Passoutyear">
<option value="">Select Passout Year</option>
<option <?php if ($a['Passoutyear'] == '2018') echo 'selected'; ?>>2018</option>
<option <?php if ($a['Passoutyear'] == '2019') echo 'selected'; ?>>2019</option>
<option <?php if ($a['Passoutyear'] == '2020') echo 'selected'; ?>>2020</option>
<option <?php if ($a['Passoutyear'] == '2021') echo 'selected'; ?>>2021</option>
<option <?php if ($a['Passoutyear'] == '2022') echo 'selected'; ?>>2022</option>
<option <?php if ($a['Passoutyear'] == '2023') echo 'selected'; ?>>2023</option>
<option <?php if ($a['Passoutyear'] == '2024') echo 'selected'; ?>>2024</option>
</select>
</div>
</div>
<span style="color:red;" class="null-Passoutyear null"></span>
<div class="inputfield">
<label>Department of Graduation</label>
<div class="custom_select">
<select id="state" name="DepartmentofGraduation">
<option value="">Select Department</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BSCS') echo 'selected'; ?>>BSCS
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BSIT') echo 'selected'; ?>>BSIT
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BBA') echo 'selected'; ?>>BBA
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BS-SE') echo 'selected'; ?>>BS-SE
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BS-HND') echo 'selected'; ?>>BS-HND
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BS-FST') echo 'selected'; ?>>BS-FST
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BS-MLT') echo 'selected'; ?>>BS-MLT
</option>
<option <?php if ($a['DepartmentofGraduation'] == 'BBA 2 Year') echo 'selected'; ?>>BBA
2 Year</option>
<option
<?php if ($a['DepartmentofGraduation'] == 'BS-Microiblology') echo 'selected'; ?>>
BS-Microiblology</option>
</select>
</div>
</div>
<span style="color:red;" class="null-DepartmentofGraduation null"></span>
<div class="inputfield">
<label>Session</label>
<div class="custom_select">
<select id="state" name="Session">
<option value="">Select Session</option>
<option <?php if ($a['Session'] == '2014-2018') echo 'selected'; ?>>2014-2018</option>
<option <?php if ($a['Session'] == '2015-2019') echo 'selected'; ?>>2015-2019</option>
<option <?php if ($a['Session'] == '2016-2020') echo 'selected'; ?>>2016-2020</option>
<option <?php if ($a['Session'] == '2017-2021') echo 'selected'; ?>>2017-2021</option>
<option <?php if ($a['Session'] == '2018-2022') echo 'selected'; ?>>2018-2022</option>
<option <?php if ($a['Session'] == '2019-2023') echo 'selected'; ?>>2019-2023</option>
<option <?php if ($a['Session'] == '2020-2024') echo 'selected'; ?>>2020-2024</option>
<option <?php if ($a['Session'] == '2021-2025') echo 'selected'; ?>>2021-2025</option>
<option <?php if ($a['Session'] == '2022-2026') echo 'selected'; ?>>2022-2026</option>
<option <?php if ($a['Session'] == '2023-2027') echo 'selected'; ?>>2023-2027</option>
</select>
</div>
</div>
<span style="color:red;" class="null-Session null"></span>
<div class="inputfield">
<label>Current Employement Status</label>
<input type="text" class="input" value="<?php echo $a['CurrentEmployementStatus'] ?>" id="name"
name="CurrentEmployementStatus" placeholder="Enter Current Employement Status"
maxlength="30" title="Enter only alphabets" />
</div>
<span style="color:red;" class="null-CurrentEmployementStatus null"></span>
<div class="inputfield">
<label>Designation (If Employed)</label>
<input type="text" class="input" value="<?php echo $a['Designation'] ?>" id="name"
name="Designation" placeholder="Enter Designation (If Employed)" maxlength="30"
title="Enter only alphabets" />
</div>
<span style="color:red;" class="null-Designation null"></span>
<div class="inputfield">
<label>Organization Name</label>
<input type="text" class="input" value="<?php echo $a['OrganizationName'] ?>" id="name"
name="OrganizationName" placeholder="Enter Organization Name" maxlength="30"
title="Enter only alphabets" />
</div>
<span style="color:red;" class="null-OrganizationName null"></span>
<div class="inputfield">
<label>Office Email</label>
<input type="email" class="input" value="<?php echo $a['OfficeEmail'] ?>" name="OfficeEmail"
placeholder="Enter Office Email" />
</div>
<span style="color:red;" class="null-OfficeEmail null"></span>
<div class="inputfield">
<label for="">Office Phone No.</label>
<input type="tel" class="input" value="<?php echo $a['OfficePhNo'] ?>" name="OfficePhNo"
maxlength="15" id="phone-number" placeholder="Enter Office Phone No."
title="Please enter Office Phone No." />
</div>
<span style="color:red;" class="null-OfficePhNo null"></span>
<div class="inputfield" id="gender">
<label for="">Gender</label>
<input type="radio" <?php if ($a['gender'] == 'Male') echo 'checked'; ?> name="gender" checked
value="Male" id="dot-1">Male
<input type="radio" <?php if ($a['gender'] == 'Female') echo 'checked'; ?> name="gender"
value="Female" id="dot-2">Female
</div>
<span style="color:red;" class="null-gender null"></span>
<span style="color:red;" class="null-ConfirmPassword null"></span>
<div class="inputfield">
<label>Upload CNIC / Student Card</label>
<!-- <p id="file-size">* Max size 100kb.</p> -->
<input type="file" name="CNIC_img" accept="image/*" id="myfile" placeholder="Upload your photo"
rows="7" />
</div>
<span style="color:red;" class="null-CNIC_img null"></span>
<!-- <div class="inputfield terms" >
<label class="check">
<input type="checkbox" name="check" value="Declared" />
<span class="checkmark"></span>
</label>
<p>
I hereby declare that the above information provided is correct.
</p>
</div> -->
<!-- <div class="inputfield" >
<div data-netlify-recaptcha="true"></div>
</div> -->
<div class="inputfield btns" id="btn">
<button type="submit" value="Register" class="btn">
Submit
</button>
</div>
</div>
</form>
</div>
</section>
<!-- Form-End -->
<script>
$(document).ready(function() {
$('#register_process').submit(function(event) {
event.preventDefault();
$('.null').html('');
// Create a FormData object to handle the form data
var formData = new FormData(this);
// Append additional data to the FormData object
formData.append('type', 'alumniupdate');
$.ajax({
type: 'POST',
url: 'backend.php',
data: formData,
processData: false, // Prevent jQuery from processing the data
contentType: false, // Set content type to false
dataType: 'json',
success: function(response) {
// Handle the response from the server
if (response.success) {
toastr.success(response.message);
// $('#register_process').find('input, select, textarea').val('');
} else {
// Display error message(s) here
var errors = response.message;
$.each(errors, function(key, value) {
// key is the name of the field that has the error
$('.null-' + key).html(value);
});
}
}
});
});
});
</script>
<?php include "include/footer.php"; ?>
<?php include "include/script.php"; ?>
</body>
</html>