1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
2  <thead>
3    <tr>
4      <th class="nd_center-cell">Date Added</th>
5      <th class="nd_center-cell">MAC Address</th>
6      <th class="nd_center-cell">Match OUI</th>
7      <th class="nd_center-cell">Enabled</th>
8      <th class="nd_center-cell">Reason</th>
9      <th class="nd_center-cell">Email</th>
10      <th class="nd_center-cell">Action</th>
11    </tr>
12  </thead>
13  <tbody>
14    <tr>
15      <td class="nd_center-cell"></td>
16      <td class="nd_center-cell"><input data-form="add" name="mac" type="text"></td>
17      <td class="nd_center-cell"><input data-form="add" name="matchoui" type="checkbox"></td>
18      <td class="nd_center-cell"><input data-form="add" name="active" type="checkbox" checked></td>
19      <td class="nd_center-cell"><input data-form="add" name="why" type="text"></td>
20      <td class="nd_center-cell"><input data-form="add" name="cc"  type="email"></td>
21      <td class="nd_center-cell">
22        <button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
23      </td>
24    </tr>
25
26    [% SET count = 0 %]
27    [% WHILE (row = results.next) %]
28    [% SET count = count + 1 %]
29    <tr>
30      <td class="nd_center-cell">[% row.date | html_entity %]</td>
31      <td class="nd_center-cell">
32        <input data-form="update" name="mac" type="text" value="[% row.mac | html_entity %]">
33      </td>
34      <td class="nd_center-cell">
35        <input data-form="update" name="matchoui" type="checkbox" [% ' checked="checked"' IF row.matchoui %]>
36      </td>
37      <td class="nd_center-cell">
38        <input data-form="update" name="active" type="checkbox" [% ' checked="checked"' IF row.active %]>
39      </td>
40      <td class="nd_center-cell">
41        <input data-form="update" name="why" type="text" value="[% row.why | html_entity %]">
42      </td>
43      <td class="nd_center-cell">
44        <input data-form="update" name="cc" type="email" value="[% row.cc | html_entity %]">
45      </td>
46
47      <td class="nd_center-cell">
48        <button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
49
50        <button class="btn" data-toggle="modal"
51          data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button>
52
53        <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
54          role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true">
55          <div class="modal-header">
56            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
57            <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3>
58          </div>
59          <div class="modal-body">
60            <blockquote>
61              <p class="text-info">Monitor for &quot;[% row.mac | html_entity %]&quot; will be removed.</p>
62            </blockquote>
63            <input data-form="del" name="mac" type="hidden" value="[% row.mac | html_entity %]">
64          </div>
65          <div class="modal-footer">
66            <button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
67            <button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button>
68          </div>
69        </div>
70      </td>
71    </tr>
72    [% END %]
73  </tbody>
74</table>
75
76<script>
77$(document).ready(function() {
78  $('#data-table').dataTable({
79    "columnDefs": [
80      {
81        "targets": [ 0, 2, 3, 6 ],
82        "searchable": false
83      },
84      {
85        "targets": [ 0, 2, 3, 6 ],
86        "orderable": false
87      }
88    ],
89[% INCLUDE 'ajax/datatabledefaults.tt' -%]
90  } );
91} );
92</script>
93
94