beginnings of view calls
[scannr.git] / viewcalls.php
blob:a/viewcalls.php -> blob:b/viewcalls.php
--- a/viewcalls.php
+++ b/viewcalls.php
@@ -1,6 +1,11 @@
+<?php
+include('common.inc.php');
+$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;
@@ -15,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) {
        
@@ -48,9 +53,9 @@
         
         });
                
-        getData('<?php echo $sensorID; ?>','<?php echo strtotime("12/1/2010") ?>','<?php echo strtotime("12/2/2010") ?>');
+        getData('<?php echo $tgid; ?>','<?php echo strtotime("10/10/2012") ?>','<?php echo strtotime("12/10/2012") ?>');
         
-    };
+    });
     
     function onDataReceived(series) {
         data =[]
@@ -60,7 +65,7 @@
     }
     function getData(sensorID,from,to) {
         $.ajax({
-            url: "<?php echo base_url(); ?>/sensor/json_graph/"+sensorID+"/"+from+"/"+to,
+            url: "<?php echo $basePath; ?>calls.json.php?action=graph&tgid="+sensorID+"&from="+from+"&to="+to,
             method: 'GET',
             dataType: 'json',
             success: onDataReceived
@@ -83,3 +88,6 @@
 
 </script>
 </div>
+<?php
+include_footer();
+?>