-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.php
51 lines (40 loc) · 1.95 KB
/
message.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
<?php
include ("db.php");
$pagename="Message"; //Create and populate a variable called $pagename
echo "<link rel=stylesheet type=text/css href=mystylesheet.css>";//Call in stylesheet
echo "<title>".$pagename."</title>";//display name of the page as window title
echo "<body>";
include ("headfile.html");//include headerlayoutfile
include ("detectlogin.php");
echo "<h4>".$pagename."</h4>";//display name of thepageon the web page
$sender=$_SESSION['userId'];
$SQL2="select userId,userFName,userSName,userType from users";
$exeSQL2=mysqli_query($GLOBALS['conn'], $SQL2) or die (mysqli_error());
while($arrayd=mysqli_fetch_array($exeSQL2)){
if($arrayd['userType']=="A"){
$type="Administrator";
}else if($arrayd['userType']=="C"){
$type="Customer";
}
echo "<a href=message_process.php?rid=".$arrayd['userId'].">";
echo "<b>".$arrayd['userFName']." ". $arrayd['userSName']."</b> (".$type.")<br>";
echo "</a>";
}
$SQL="select receiverId,senderId from messgae where (senderId=$sender OR receiverId=$sender) order by messageId DESC";
$exeSQL=mysqli_query($GLOBALS['conn'], $SQL) or die (mysqli_error());
while($arrayp=mysqli_fetch_array($exeSQL)){
}
include("footfile.html");
echo "</body>";
// if(isset($POST['rid'])){
// //$_SESSION['receiverId']=$_POST['rid'];
// echo "<form action=message_process.php method=POST>";
// echo "<p>ID selected :".$_POST['rid']."</p>";
// echo "<th><input type=submit name=button value='Are you sure'></button></th>";
// echo "</form>";
// }
// echo "<form action=message_process.php method=POST>";
// echo "Receiver's ID : <input type='text' id='rid' name='rid'><br>";
// echo "<th><input type=submit name=button value='Search'></button></th>";
// echo "</form>";
?>