-
Notifications
You must be signed in to change notification settings - Fork 46
/
rmsg.php
47 lines (36 loc) · 931 Bytes
/
rmsg.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
<?php
session_start();
include('includes/conn.php');
if(!isset($_SESSION['useremail'])){
echo "Access Denied";
}
else{
if(isset($_POST['reply'])){
$sid = $_POST['getsid'];
$recid = $_POST['getrid'];
$resub = $_POST['resub'];
$msg = $_POST['msg'];
$msgid = $_POST['getmid'];
$status = "unread";
$status2 = "read";
$dt = date('Y-m-d');
$tm = date('H:i');
$q2 = "UPDATE sentmsg set status ='$status2' where mid = '$msgid' ";
mysqli_query($con,$q2);
$q = "INSERT INTO rmsg VALUES ('','$recid','$sid','$resub','$msg','$status','$dt','$tm');";
if($r = mysqli_query($con,$q)){
echo '<script>';
echo 'alert("Replay Sent");';
echo 'window.location.href="doctor.php"';
echo '</script>';
}else{
echo '<script>';
echo 'alert("Replay Not Sent");';
echo 'window.location.href="doctor.php"';
echo '</script>';
}
}else{
echo "Invalid Action";
}
}
?>