added beta version of time details.

This commit is contained in:
2018-12-06 10:10:41 -05:00
parent cf9deb1bc2
commit 33976ab0d7
2 changed files with 19 additions and 1 deletions

View File

@@ -32,6 +32,24 @@ class ps4 {
} }
} }
function gameTimeDetails($gameid) {
$result = $this->mysql_conn("SELECT * FROM game_time WHERE game_id = '". $gameid ."';");
if ($result->num_rows > 0) {
$i=0;
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/>";
}
}
}
function playtime($seconds, $text=false) { function playtime($seconds, $text=false) {
$playtime = null; $playtime = null;
$label = null; $label = null;

View File

@@ -93,7 +93,7 @@ foreach ($games as $key => $value) {
echo "</div></div>"; echo "</div></div>";
if ($details == $games[$key]["game_id"]) { if ($details == $games[$key]["game_id"]) {
echo "<br/><br/>Soon, we show details."; $ps4->gameTimeDetails($games[$key]["game_id"]);
} }
echo "</div>"; // info echo "</div>"; // info
echo "</div>"; // game echo "</div>"; // game