-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy_games.php
44 lines (41 loc) · 1.62 KB
/
my_games.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
<?php
session_start();
if(isset($_SESSION['pid'])) #checking if session already exists
{
include "connect.php";
$pid = $_SESSION['pid'];
$game_res=mysqli_query($conn, "SELECT g.gid, DATE_FORMAT(schedule, '%M %e [%W]') as dt, DATE_FORMAT(schedule, '%h:%i %p') as tm, status, cost FROM games g, player_games p where g.gid=p.gid and p.pid='$pid' order by schedule desc limit 3;");
if(mysqli_num_rows($game_res)>0)
{
while($row=mysqli_fetch_array($game_res))
{
$gid2=$row['gid'];
echo "<li class='blue'><span class='title'><a href='game.php?gid=$gid2'>Game #$gid2 - ";
if($row['status'] == 3)
{
echo "<small>Game Scheduled</small>";
}
else if($row['status'] == 0)
{
echo "<span style='color:red'><small>Game Completed</small></span>";
}
else if($row['status'] == 1)
{
echo "<small>Game In Progress</small>";
}
else if($row['status'] == 2)
{
echo "<small>Game Paused</small>";
}
echo "</a></span>";
echo "<small><span class='description truncate'></span>".$row[1]."-".$row['tm']."</li></small>";
}
//echo "<div align='right'><a href=''>More...</a></div>";
}
else
{
echo "<li class='red' style='padding-bottom:100px;margin-top:20px;'><span class='title'>Not Joined Any Game Yet!</span>";
echo "<span class='description truncate'></span>View Schedule & Join </li>";
}
}
?>