-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessagestyle.php
35 lines (32 loc) · 1012 Bytes
/
messagestyle.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
<?php
require 'DBconnect.php';
$tmpusrid=$_SESSION['ID'];
$ID=$_SESSION['ID'];
$ID=substr($ID,0,1);
if($ID=='A')
$sql="SELECT DISTINCT subject FROM messages WHERE too='admin' and status_admin=1";
else
$sql="SELECT DISTINCT subject FROM messages WHERE too='$tmpusrid' and status_user=1";
$result=mysqli_query($con,$sql);
if(! $result )
die('Could not get data: ' . mysqli_error($con));
else
$count=mysqli_num_rows($result);
if($count>0)
{
?>
<div id="noti_Container" style=" width: 30px; height: 19px; text-align: center; margin-left: auto; margin-right: auto;">
<img src="images/message.png" alt="notification icon" style="width: 100%; height: 100%; " />
<div class="noti_bubble"><?php echo $count; ?></div>
</div>
<?php
}
else
{
?>
<div id="noti_Container" style=" width: 30px; height: 19px; text-align: center; margin-left: auto; margin-right: auto;">
<img src="images/message.png" alt="notification icon" style="width: 100%; height: 100%; " />
</div>
<?php
}
?>