-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
114 lines (74 loc) · 3.98 KB
/
Copy pathprocess.php
File metadata and controls
114 lines (74 loc) · 3.98 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
<?php
//start session
session_start();
require_once('database.php');
$action = $_GET['action'];
switch($action) {
case 'add-fir':
addfir();
break;
case 'close':
markClose();
break;
case 'update-status':
updateStatus();
break;
case 'change-pass':
changePass();
break;
case 'logOut':
logOut();
break;
}//switch
function addfir(){
//$complainername = $_POST['complainername'];
$cphone = $_POST['complainerphone'];
$add = $_POST['complaineraddress'];
$dt_occur = $_POST['occurred'];
$FirNo = $_POST['FirNo'];
$cr_type = $_POST['crtype'];
$pstn = $_POST['Stnname'];
$status = $_POST['status'];
$discription = $_POST['disc'];
$complainer_id = (int)$_SESSION['user_id'];
$complainer_name = $_SESSION['user_name'];
$sql="INSERT INTO fir( cid, cname, c_phone, co_id, cr_type, cr_desc, dt_occurrence, address, status, pid, pname, pstn, comment, create_date)
VALUES ('$complainer_id','$complainer_name','$cphone','$FirNo','$cr_type','$discription','$dt_occur','$add','$status','','','$pstn','',NOW())";
//echo $sql;
dbQuery($sql);
header('Location: fir-add-success.php');
//echo $Ship;
}//addComplain
function markClose(){
$cons= $_POST['Consignment'];
$sql = "UPDATE fir
SET status ='Close'
WHERE co_id= '$cons'";
dbQuery($sql);
header('Location:closing-success.php');
}
function updateStatus() {
//$OfficeName = $_POST['pstn'];
$status = $_POST['status'];
$comments = $_POST['comments'];
$cid = (int)$_POST['cid'];
$sql_1 = "UPDATE fir
SET status = '$status'
WHERE fid = $cid";
dbQuery($sql_1);
$sql_2 = "UPDATE fir
SET comment = '$comments'
WHERE fid = $cid";
dbQuery($sql_2);
header('Location: update-success.php');
}
function logOut(){
if(isset($_SESSION['user_name'])){
unset($_SESSION['user_name']);
}
if(isset($_SESSION['user_type'])){
unset($_SESSION['user_type']);
}
session_destroy();
header('Location: loginf.php');
}//logOut