db fixes
[scannr.git] / viewcalls.php
blob:a/viewcalls.php -> blob:b/viewcalls.php
--- a/viewcalls.php
+++ b/viewcalls.php
@@ -1,10 +1,11 @@
 <?php
 include('common.inc.php');
-$tgid = 1;
+$tgid = 44028;
+include_header("fdds");
 ?>
 <div class="span12">
 
-<table width="100%" height="375px"><tr><td valign="middle"><span class="arrow-w" style="font-size:2em;"></span></td><td width="95%"><div id="placeholder" style="width:100%;height:375px;"></div></td><td valign="middle"><span class="arrow-e" style="font-size:2em;"></span></td></tr></table>
+<table width="100%" height="375px"><tr><td valign="middle"><span class="arrow-w" style="font-size:2em;">&lt;</span></td><td width="95%"><div id="placeholder" style="width:100%;height:375px;"></div></td><td valign="middle"><span class="arrow-e" style="font-size:2em;">&gt;</span></td></tr></table>
 <script>
         var data = [];
         var plot;
@@ -19,13 +20,13 @@
             },
             grid: { hoverable: true, clickable: true }
         };
-    window.onload = function() {
+        $(function () {
         // graph
      
         
-        var placeholder = $("#placeholder");
+        var placeholder = document.getElementById("placeholder");
     
-        var plot = $.plot(placeholder, data, options);
+        var plot = Flotr.draw(placeholder, data, options);
 
         $("#placeholder").bind("plothover", function (event, pos, item) {
        
@@ -54,7 +55,7 @@
                
         getData('<?php echo $tgid; ?>','<?php echo strtotime("10/10/2012") ?>','<?php echo strtotime("12/10/2012") ?>');
         
-    };
+    });
     
     function onDataReceived(series) {
         data =[]
@@ -64,7 +65,7 @@
     }
     function getData(sensorID,from,to) {
         $.ajax({
-            url: "<?php echo $basePath; ?>/calls.json.php?"+sensorID+"/"+from+"/"+to,
+            url: "<?php echo $basePath; ?>calls.json.php?action=graph&tgid="+sensorID+"&from="+from+"&to="+to,
             method: 'GET',
             dataType: 'json',
             success: onDataReceived
@@ -87,3 +88,6 @@
 
 </script>
 </div>
+<?php
+include_footer();
+?>