Formatted the "sessions details".

This commit is contained in:
2018-12-20 23:21:16 -05:00
parent 33976ab0d7
commit 6098bb9acc
5 changed files with 59 additions and 13 deletions

View File

@@ -33,20 +33,26 @@ class ps4 {
}
function gameTimeDetails($gameid) {
$result = $this->mysql_conn("SELECT * FROM game_time WHERE game_id = '". $gameid ."';");
$result = $this->mysql_conn("SELECT * FROM game_time WHERE game_id = '". $gameid ."' ORDER BY game_start DESC;");
if ($result->num_rows > 0) {
$i=0;
echo '<div class="PlaytimeDetails FontSmaller">';
echo '<div class="row"><div class="head PlaytimeStart">Start</div><div class="head PlaytimeEnd">End</div><div class="head PlaytimeTotal">Time Played</div></div>';
while ($row = $result->fetch_assoc()) {
$i++;
echo "<br/>";
echo $row["id"] ." : ";
echo $this->secondsToDate($row["game_start"]);
echo " / ";
echo $this->secondsToDate($row["game_end"]);
echo " = ";
echo $this->playtime((($row["game_end"]-$row["game_start"])/1000),true);
echo "<br/>";
echo '<div class="row">';
$i++;
echo '<div class="PlaytimeStart">'. $this->secondsToDate($row["game_start"]) .'</div>';
echo '<div class="PlaytimeEnd">'. $this->secondsToDate($row["game_end"]) .'</div>';
echo '<div class="PlaytimeTotal">';
if ($row["game_end"] == "") {
echo "<strong>now playing</strong>";
} else {
echo $this->playtime((($row["game_end"]-$row["game_start"])/1000),true);
}
echo '</div>';
echo '</div>';
}
echo '</div>';
}
}