-
Notifications
You must be signed in to change notification settings - Fork 0
/
managing_report_reject.php
80 lines (52 loc) · 1.94 KB
/
managing_report_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
71
72
73
74
75
76
77
78
79
80
<?php
session_start();
if (isset($_GET['uid'])) {
$uid = $_GET['uid'];
$rid = $_GET['rid'];
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "";
$dbname = "ewed";
$con = mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname);
$k = 0;
echo " / data /";
// get status value
$query_status_value = "SELECT report from status where cid = $uid";
$result_query_status_value = mysqli_query($con, $query_status_value);
$data_result_query_status_value = mysqli_fetch_array($result_query_status_value);
echo $data_result_query_status_value['report'];
$data1 = $data_result_query_status_value['report'];
$data1 = $data1 + 1;
echo " = " . $data1;
// update
$query1 = "UPDATE status SET report = $data1 WHERE cid = $uid ";
$query2 = "UPDATE tbl_report SET status = 1 WHERE cid = $uid and r_id = $rid ";
$result2 = mysqli_query($con, $query2);
if ($result2) {
$result1 = mysqli_query($con, $query1);
if ($result1) {
echo "data updated";
// header("Location: managing_reports.php");
$k = 1;
}
}
$query_status_value = "SELECT report from status where cid = $uid";
$result_query_status_value = mysqli_query($con, $query_status_value);
$data_result_query_status_value = mysqli_fetch_array($result_query_status_value);
echo $data_result_query_status_value['report'];
$data1 = $data_result_query_status_value['report'];
echo " = " . $data1;
if ($data1 >= 10) {
$query = "UPDATE status SET profilestatus = 4 WHERE cid = $uid ";
$result = mysqli_query($con, $query);
if ($result) {
// header("Location: managing_reports.php");
$k = 1;
}
}
if ($k == 1) {
header("Location: managing_reports.php");
}else {
echo "error";
}
}