Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | |
| 5 | <meta charset="UTF-8" /> |
| 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | <% include ../partials/head %> |
| 8 | <% include ../partials/header %> |
| 9 | <script type="text/javascript" src="/javascripts/admportal.js" async></script> |
| 10 | <title>SDN-FC AdminPortal</title> |
| 11 | <script class="init"> |
| 12 | $(document).ready(function() { |
| 13 | $('#viewTables').DataTable( { |
| 14 | "order": [[ 0, "asc" ]] |
| 15 | } ); |
| 16 | } ); |
| 17 | </script> |
| 18 | </head> |
| 19 | |
| 20 | <body> |
| 21 | |
| 22 | <div class="well well-sm"> |
| 23 | <h3>View Database Tables |
| 24 | </div> |
| 25 | |
| 26 | <% if ( typeof result != 'undefined' ) { |
| 27 | if (result.code.length > 0) { |
| 28 | if ( result.code == 'success' ) { %> |
| 29 | <div class='alert alert-success' role='alert'> |
| 30 | <% |
| 31 | for ( x in result.msg ){ %> |
| 32 | <div><%= result.msg[x] %></div> |
| 33 | <% } %> |
| 34 | </div> |
| 35 | <% } else { %> |
| 36 | <div class='alert alert-danger' role='danger'> |
| 37 | <% |
| 38 | for ( x in result.msg ){ %> |
| 39 | <div><%= result.msg[x] %></div> |
| 40 | <% } %> |
| 41 | </div> |
| 42 | <% } %> |
| 43 | <% } %> |
| 44 | <% } %> |
| 45 | |
| 46 | <% if( typeof privilege != 'undefined'){ |
| 47 | var priv = privilege.privilege; |
| 48 | } else { |
| 49 | var priv = 'A'; |
| 50 | } %> |
| 51 | |
| 52 | <!-- Single button --> |
| 53 | <nav class="navbar navbar-default"> |
| 54 | <div class="container-fluid"> |
| 55 | <div class="navbar-header"> |
| 56 | |
| 57 | <div class="btn-group"> |
| 58 | <button type="button" class="btn btn-primary dropdown-toggle navbar-btn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 59 | Table <span class="caret"></span> |
| 60 | </button> |
| 61 | <ul class="dropdown-menu" role="menu"> |
| 62 | <% for ( var i in vtables ){ %> |
| 63 | <li><a href="/sdnfc/getTables?tableName=<%= vtables[i] %>"><%= vtables[i] %></a></li> |
| 64 | <% } %> |
| 65 | </ul> |
| 66 | </div> |
| 67 | </div> |
| 68 | </div> |
| 69 | </nav> |
| 70 | |
| 71 | <% if (displayTable) { %> |
| 72 | <div class="container-fluid"> |
| 73 | <table id="viewTables" class="table table-hover table-condensed"> |
| 74 | <caption class="text-primary"><%= fields[0].table %></caption> |
| 75 | <thead> |
| 76 | <tr> |
| 77 | <% fields.forEach( function(field) { %> |
| 78 | <th><%= field.name %></th> |
| 79 | <% }); %> |
| 80 | </tr> |
| 81 | </thead> |
| 82 | |
| 83 | <tbody> |
| 84 | <% for ( var x in rows ){ %> |
| 85 | <tr> |
| 86 | <% for ( var j in rows[x] ){ %> |
| 87 | <td><%= rows[x][j] %></td> |
| 88 | <% } %> |
| 89 | </tr> |
| 90 | <% } %> |
| 91 | </tbody> |
| 92 | </table> |
| 93 | </div> |
| 94 | <% } %> |
| 95 | |
| 96 | <footer> |
| 97 | <% include ../partials/footer %> |
| 98 | </footer> |
| 99 | |
| 100 | </body> |
| 101 | </html> |
| 102 | |