Skip to content

Commit

Permalink
Fix added for 32bit system integer problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt committed Aug 15, 2014
1 parent 84260a2 commit e4fc4b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions web/get_sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// Drop sessions smaller than 60 data points
if ($session_size >= 60) {
$sid = $row["session"];
$sids[] = intval($sid);
$seshdates[$sid] = date("F d, Y h:ia", intval(substr($sid, 0, -3)));
$sids[] = preg_replace('/\D/', '', $sid);
$seshdates[$sid] = date("F d, Y h:ia", substr($sid, 0, -3));
}
else {}
}
Expand Down
2 changes: 1 addition & 1 deletion web/plot.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Grab the session number
if (isset($_GET["id"]) and in_array($_GET["id"], $sids)) {
$session_id = intval(mysql_real_escape_string($_GET['id']));
$session_id = mysql_real_escape_string($_GET['id']);

// Get the torque key->val mappings
$js = CSVtoJSON("./data/torque_keys.csv");
Expand Down
40 changes: 19 additions & 21 deletions web/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
mysql_select_db($db_name, $con) or die(mysql_error());

if (isset($_POST["id"])) {
$getid = mysql_real_escape_string($_POST['id']);
$session_id = intval($getid);
$session_id = preg_replace('/\D/', '', $_POST['id']);

// Get GPS data for session
$sessionqry = mysql_query("SELECT kff1006, kff1005
Expand Down Expand Up @@ -44,8 +43,7 @@
}

elseif (isset($_GET["id"])) {
$getid = mysql_real_escape_string($_GET['id']);
$session_id = intval($getid);
$session_id = preg_replace('/\D/', '', $_GET['id']);

// Get data for session
$sessionqry = mysql_query("SELECT kff1006, kff1005
Expand Down Expand Up @@ -100,6 +98,23 @@
<link rel="stylesheet" href="static/css/torque.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
if("<?php echo $timezone; ?>".length==0){
var visitortime = new Date();
var visitortimezone = "GMT " + -visitortime.getTimezoneOffset()/60;
var timezoneurl = $(location).attr('href').split('?')[0].replace('session', 'timezone');
$.ajax({
type: "GET",
url: timezoneurl,
data: 'time='+ visitortimezone,
success: function(){
location.reload();
}
});
}
});
</script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script language="javascript" type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script language="javascript" type="text/javascript" src="static/js/jquery.peity.min.js"></script>
Expand Down Expand Up @@ -416,22 +431,5 @@ function doPlot(position) {
</div>
</div>

<script language="javascript" type="text/javascript">
$(document).ready(function() {
if("<?php echo $timezone; ?>".length==0){
var visitortime = new Date();
var visitortimezone = "GMT " + -visitortime.getTimezoneOffset()/60;
var timezoneurl = $(location).attr('href').split('?')[0].replace('session', 'timezone');
$.ajax({
type: "GET",
url: timezoneurl,
data: 'time='+ visitortimezone,
success: function(){
location.reload();
}
});
}
});
</script>
</body>
</html>

0 comments on commit e4fc4b6

Please sign in to comment.