ajax table
[dcaas.git] / table.php
blob:a/table.php -> blob:b/table.php
--- a/table.php
+++ b/table.php
@@ -1,56 +1,40 @@
 <?php
-include ("config.php");
-include ("lib/tag-cloud/src/lotsofcode/TagCloud/TagCloud.php");
+include("config.php");
+include("lib/tag-cloud/src/lotsofcode/TagCloud/TagCloud.php");
 
 includeHeader("title");
 ?>
 
-    <div class="starter-template">
-        <br/>
-        <br/>
+<div class="starter-template">
+    <br/>
+    <br/>
 
-        <h1>Bootstrap starter template</h1>
+    <h1>Bootstrap starter template</h1>
 
-        <p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a
-            mostly barebones HTML document.</p>
+    <p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a
+        mostly barebones HTML document.</p>
 
-        <div id="search-example-year-filter" style="float: left;">
-            Year:
-            <select id="search-year" name="year">
-                <option></option>
-                <option>2001</option>
-                <option>2003</option>
-                <option>2008</option>
-                <option>2013</option>
-            </select>
-        </div>
+    <!--<div id="search-example-year-filter" style="float: left;">
+        Year:
+        <select id="search-year" name="year">
+            <option></option>
+            <option>2001</option>
+            <option>2003</option>
+            <option>2008</option>
+            <option>2013</option>
+        </select>
+    </div>
 
-        <div id="search-function-example-price-filter" style="float: left; margin-bottom: 1em;">
-            Max Price:
-            $<input id="max-price" type="number" step="1000" data-dynatable-query="max-price">
-        </div>
+    <div id="search-function-example-price-filter" style="float: left; margin-bottom: 1em;">
+        Max Price:
+        $<input id="max-price" type="number" step="1000" data-dynatable-query="max-price">
+    </div>-->
 
 
-        <table id="my-table">
-            <thead>
-            <?php
-            $row = 0;
-            $csvfile = './data/DCaaS+Catalogue+September+2013 PublicDCaaS_AFI_Part_3_Sec_5_Service_.csv';
-            if (($handle = fopen($csvfile, "r")) !== FALSE) {
-                while (($data = fgetcsv($handle, 4096, ",")) !== FALSE) {
-                    if ($row == 0) {
-                        echo "<thead><th>" . implode($data, "</th><th>") . "</th></thead> \n";
-                    } else {
-                        echo "<tr><td>" . implode($data, "</td><td>") . "</td></tr> \n";
-                    }
-                    $row++;
-                }
-                fclose($handle);
-            }
-            ?>
-        </table>
-    </div>
-
+    <table id="my-table">
+                 <thead><th>acnabn</th><th>service_name</th></thead>
+    </table>
+</div>
 
 
 <!-- Bootstrap core JavaScript
@@ -60,9 +44,16 @@
 <script src="js/bootstrap.min.js"></script>
 <script src="js/dynatable/jquery.dynatable.js"></script>
 <script>
-    $('#my-table').dynatable();
+    $('#my-table').dynatable({
+        dataset: {
+            ajax: true,
+            ajaxUrl: 'data.json.php',
+            ajaxOnLoad: true,
+            records: []
+        }
+    });
 
-    $('#search-example').dynatable({
+   /* $('#search-example').dynatable({
         features: {
             paginate: false,
             recordCount: false,
@@ -89,7 +80,7 @@
             inputs: {
                 queries: $('#max-price')
             }
-        });
+        }); */
 
 </script>