-
Notifications
You must be signed in to change notification settings - Fork 0
/
reject.php
70 lines (56 loc) · 1.41 KB
/
reject.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
<?php
session_start();
if (!isset($_SESSION['lawyer'])) {
echo "You are logged out!";
header('location:index.php');
}
// Username is root
$user = 'root';
$password = '';
// Database name is gfg
$database = 'INDIAN_JUDICIARY';
// Server is localhost with
// port number 3308
$servername = 'localhost';
$mysqli = new mysqli(
$servername,
$user,
$password,
$database
);
// Checking for connections
if ($mysqli->connect_error) {
die('Connect Error (' .
$mysqli->connect_errno . ') ' .
$mysqli->connect_error);
}
$login_lawyerId = $_SESSION['lawyer'];
if (isset($_POST['submit1'])) {
$current_lawyer = $_SESSION['lawyer'];
$current_case = $_POST['reject1'];
$sql = "SELECT * FROM CASE_DETAILS where CASE_ID = '$current_case';";
$result = $mysqli->query($sql);
$row = $result->fetch_assoc();
$req_pros = $row['Request_Pros'];
$req_accs = $row['Request_Accs'];
if($req_pros==$current_lawyer)
{
$sql1 = "UPDATE CASE_DETAILS SET Request_Pros='NULL' WHERE Case_ID='$current_case';";
$result1 = $mysqli->query($sql1);
}
else if ($req_accs==$current_lawyer)
{
$sql1 = "UPDATE CASE_DETAILS SET Request_Accs='NULL' WHERE Case_ID='$current_case';";
$result1 = $mysqli->query($sql1);
}
else
{
echo "Error1";
}
}
else{
echo "Error2";
}
header("Location: client_case_confirm.php");
exit();
?>