-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathresident_update_record.php
36 lines (33 loc) · 1.33 KB
/
resident_update_record.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
<?php include 'server/server.php' ?>
<?php
$id = $_POST['id'];
$first_name = strtoupper($_POST['first_name']);
$middle_name = strtoupper($_POST['middle_name']);
$last_name = strtoupper($_POST['last_name']);
$age = strtoupper($_POST['age']);
$birthdate = strtoupper($_POST['birthdate']);
$civil_status = strtoupper($_POST['civil_status']);
$gender = strtoupper($_POST['gender']);
$purok = strtoupper($_POST['purok']);
$voterstatus = strtoupper($_POST['voterstatus']);
$first_name = strtoupper($_POST['first_name']);
$query = "UPDATE tblresident
SET firstname ='$first_name',
middlename ='$middle_name',
lastname ='$last_name',
age ='$age',
birthdate ='$birthdate',
civilstatus='$civil_status',
gender ='$gender',
purok ='$purok',
voterstatus='$voterstatus'
WHERE id='$id'";
$result = $conn->query($query);
$_SESSION['message'] = 'Failed to update resident!';
$_SESSION['success'] = 'danger';
if($result){
$_SESSION['message'] = 'Successfully updated resident!';
$_SESSION['success'] = 'success';
}
header('location: resident.php');
?>