-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
101 lines (92 loc) · 3.19 KB
/
update.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
<?php
require("config.php");
// update faculty
if (isset($_POST['faculty-submit'])) {
$firstname = secure($_POST['firstname']);
$lastname = secure($_POST['lastname']);
$contact = secure($_POST['contact']);
$email = secure($_POST['email']);
$address = secure($_POST['address']);
$qualification = secure($_POST['qualification']);
$experience = secure($_POST['experience']);
// $picture = secure($_POST['picture']);
$about = secure($_POST['about']);
$doj = secure($_POST['doj']);
$id = secure($_GET['fid']);
$string = "UPDATE `faculty` SET `F_fname`='$firstname',`F_lname`='$lastname',`F_contact`='$contact',`F_email`='$email',`F_address`='$address',`F_qualification`='$qualification',`F_experience`='$experience',`F_picture`='',`F_about`='$about',`F_DOJ`='$doj' WHERE `F_ID`=$id AND D_flag=0";
$temp = $sql->query($string);
if ($temp) {
header("location:faculty.php?update-success");
}
else{
header("location:faculty.php?update-failed");
}
}
// update batch
if (isset($_POST['batch-submit'])) {
$name = secure($_POST['name']);
$venue = secure($_POST['venue']);
$fees = secure($_POST['fees']);
$fid = secure($_POST['id']);
$startdate = secure($_POST['startdate']);
$enddate = secure($_POST['enddate']);
$duration = secure($_POST['duration']);
$status = secure($_POST['status']);
$id = secure($_GET['bid']);
$string = "UPDATE `batch` SET `B_name`='$name',`B_venue`='$venue',`B_fees`='$fees',`B_F_ID`='$fid',`B_startdate`='$startdate',`B_enddate`='$enddate',`B_duration`='$duration',`B_status`='$status' WHERE `B_ID`=$id AND D_flag=0";
$temp = $sql->query($string);
if ($temp) {
header("location:batch.php?update-success");
}
else{
header("location:batch.php?update-failed");
}
}
// update support staff
if (isset($_POST['ss-submit'])) {
$firstname = SECURE($_POST['firstname']);
$lastname = SECURE($_POST['lastname']);
$contact = SECURE($_POST['contact']);
$email = SECURE($_POST['email']);
$address = SECURE($_POST['address']);
$doj = SECURE($_POST['doj']);
$id = SECURE($_GET['ssid']);
$string = "UPDATE `supportstaff` SET `SS_fname`='$firstname',`SS_lname`='$lastname',`SS_contact`='$contact',`SS_email`='$email',`SS_address`='$address',`SS_DOJ`='$doj' WHERE `SS_ID`=$id AND D_flag=0";
$temp = $sql->query($string);
if($temp){
header("location:staff.php?update-success");
}
else{
header("location:staff.php?update-failed");
}
}
//update admission table
if (isset($_POST['adm-submit'])) {
$fees = secure($_POST['fees']);
$date = secure($_POST['date']);
$status = secure($_POST['status']);
$id = secure($_GET['admid']);
$string = "UPDATE `admission` SET `A_fees`='$fees',`A_date`='$date' WHERE `A_ID`=$id AND D_flag=0";
$temp = $sql->query($string);
if($temp){
header("location:admission.php?update-success");
}
else{
header("location:admission.php?update-failed");
}
}
// update expense table
if (isset($_POST['exp-submit'])) {
$eid = secure($_GET['eid']);
$reason = secure($_POST['reason']);
$amount = secure($_POST['amount']);
$string = "UPDATE `expense` SET `E_reason`='$reason',`E_amount`='$amount' WHERE `E_ID`=$eid";
$temp = $sql->query($string);
if ($temp) {
header("location:expense.php?update-success");
}
else{
header("location:expense.php?update-failed");
}
}
?>