fixed the bugs with "details button"... even if it's not working yet.
This commit is contained in:
11
index.php
11
index.php
@@ -4,7 +4,10 @@ ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$rootpage = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : "index.php";
|
||||
$orderby = isset($_GET['orderby']) ? $_GET['orderby'] : "lastplayed_desc";
|
||||
$details = isset($_GET['details']) ? $_GET['details'] : "";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -16,8 +19,14 @@ $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : "lastplayed_desc";
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function(){
|
||||
$("#page").load('page.php?orderby=<?php echo $orderby ?>');
|
||||
update();
|
||||
});
|
||||
function update() {
|
||||
$.get('page.php?rootpage=<?php echo $rootpage ?>&orderby=<?php echo $orderby ?>&details=<?php echo $details ?>', function(data) {
|
||||
$("#page").html(data);
|
||||
window.setTimeout(update, 10000); // 10 secondes
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
14
page.php
14
page.php
@@ -6,13 +6,15 @@ $ps4 = new ps4();
|
||||
$sql = "SELECT * FROM game_time";
|
||||
$result = $ps4->mysql_conn($sql);
|
||||
|
||||
$rootpage = $_GET['rootpage'];
|
||||
$orderby = $_GET['orderby'];
|
||||
$details = $_GET['details'];
|
||||
|
||||
?>
|
||||
|
||||
<strong>Last Updated : </strong> <?php echo date(DATE_RFC2822) ?><br/><br/>
|
||||
|
||||
Order by (<?php echo $orderby; ?>) : Total Time <a href="index.php?orderby=totaltime_asc">ASC</a> <a href="index.php?orderby=totaltime_desc">DESC</a> - First Played <a href="index.php?orderby=firstplayed_asc">ASC</a> <a href="index.php?orderby=firstplayed_desc">DESC</a> - Last Played <a href="index.php?orderby=lastplayed_asc">ASC</a> <a href="index.php?orderby=lastplayed_desc">DESC</a>
|
||||
Order by (<?php echo $orderby; ?>) : Total Time <a href="<?php echo $rootpage ?>?orderby=totaltime_asc">ASC</a> <a href="<?php echo $rootpage ?>?orderby=totaltime_desc">DESC</a> - First Played <a href="<?php echo $rootpage ?>?orderby=firstplayed_asc">ASC</a> <a href="<?php echo $rootpage ?>?orderby=firstplayed_desc">DESC</a> - Last Played <a href="<?php echo $rootpage ?>?orderby=lastplayed_asc">ASC</a> <a href="<?php echo $rootpage ?>?orderby=lastplayed_desc">DESC</a>
|
||||
<br/><br/>
|
||||
|
||||
<?php
|
||||
@@ -56,7 +58,11 @@ foreach ($games as $key => $value) {
|
||||
echo "<div class=\"info\">";
|
||||
echo "<strong>". $games[$key]["game_name"] ."</strong> (". $games[$key]["game_id"] .")";
|
||||
echo "<br/>";
|
||||
echo "Total Time Played : <a href=\"".$_SERVER['PHP_SELF']."?details=".$games[$key]["game_id"]."\">". $ps4->playtime($games[$key]["game_total_time"],true) ."</a>";
|
||||
echo "Total Time Played : <a href=\"".$rootpage."?orderby=".$orderby."&details=";
|
||||
if ($details != $games[$key]["game_id"]) {
|
||||
echo $games[$key]["game_id"];
|
||||
}
|
||||
echo "\">". $ps4->playtime($games[$key]["game_total_time"],true) ."</a>";
|
||||
echo "<br/>First Played on : ". $ps4->secondsToDate($games[$key]["game_played_first"]);
|
||||
echo "<br/>Last Played on : ";
|
||||
|
||||
@@ -65,6 +71,10 @@ foreach ($games as $key => $value) {
|
||||
} else {
|
||||
echo $ps4->secondsToDate($games[$key]["game_played_last"]);
|
||||
}
|
||||
|
||||
if ($details == $games[$key]["game_id"]) {
|
||||
echo "<br/><br/>Soon, we show details.";
|
||||
}
|
||||
echo "</div>"; // info
|
||||
echo "</div>"; // game
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user