Blame view

view/log.html 5.75 KB
cf76164e6   Ting Chan   20190709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  				<link href="js/datatables/css/jquery.dataTables.css" rel="stylesheet">
                   <link rel="stylesheet" type="text/css" href="css/select.dataTables.min.css" rel="stylesheet">
                      <style type="text/css">
                          
                          .btn{
                              border-radius:4px;
                              text-align:center;
                          }
                          .selection{
                              text-align:center;
                          }
                          table.dataTable tr th.select-checkbox.selected::after {
                           content: "✔";
                           margin-top: -11px;
                           margin-left: -4px;
                           text-align: center;
                           text-shadow: rgb(176, 190, 217) 1px 1px, rgb(176, 190, 217) -1px -1px, rgb(176, 190, 217) 1px -1px, rgb(176, 190, 217) -1px 1px;
                       }
                        table.dataTable tr th.select-checkbox.selected::before {
                           content: " ";
                           margin-top: -11px;
                           margin-left: -4px;
                           text-align: center;
                           text-shadow: rgb(176, 190, 217) 1px 1px, rgb(176, 190, 217) -1px -1px, rgb(176, 190, 217) 1px -1px, rgb(176, 190, 217) -1px 1px;
                       }
                      .not-active {
                          pointer-events: none;
                          cursor: default;
                          text-decoration:none;
                          color:black;
                          }
                      </style>					
                      <?php
                       $dir='/home/pi/Desktop/vAlert/log/';
                       $files=scandir($dir,1);
                       
                      
  
                       ?>
                      <main class="mn-inner">
  						<div class="row">
                          <div class="col s12" style="text-align:center;">
                              <div class="page-title"></div>
                           </div>
                        <div>	
  						<div class="card">
                                 <table class="display" id="example" cellspacing="20" width="100%" >
                                  <thead>
                                      
                                      <tr>
                                          <th style="text-align:center;">File Name</th>
                                          <th> File Size</th>
                                          <th></th>
                                      </tr>
                                  </thead>
                                  <tfoot>
                                     <tr>
  										<th style="text-align:center;">File Name</th>
                                          <th> File Size</th>
                                          <th></th>
                                      </tr> 
                                  </tfoot>
  
                                  <tbody>
                                  <?php
                                     foreach($files as $key=>$value){
                                     if(is_file($dir.$value)){
                                     ?>
                                      <tr>
                                          <td style="text-align: center;"><?=$value?></td>
                                          <td> <?= filesize($dir.'/'.$value)/1000?> KB</td>
                                          <td><a href="view/downloadFile.php?path=<?=$dir.$value?>">Dowload</a></td>
                                      </tr>
  
                                   <?php 
                                      }
                                     }?>
  
                                  </tbody>
                                     
  
  
                                 </table>
                             
   
                              </div>
                          </div>
                          </div>
  						</div>
  					</main>
  				</div>
          <div class="left-sidebar-hover"></div>
          
          <!-- Javascripts -->
          <script src="js/dataTables.bootstrap.min.js"></script>
          <script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
          <script src="assets/plugins/materialize/js/materialize.min.js"></script>
          <script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
          <script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
          <script src="assets/plugins/select2/js/select2.min.js"></script>
          <script src="assets/js/alpha.min.js"></script>
          <script src="assets/js/pages/form-select2.js"></script>
          <script src="js/datatables/js/jquery.dataTables.min.js"></script>
          <script type="text/javascript" src="js/dataTables.select.min.js"></script>
  
          <script type="text/javascript">
              
          
   $(document).ready(function() {
       var content=new Array();
     var table=$('#example').DataTable( {
          colReorder: true,
          dom: 'Blfrtip',
          language: {
                      searchPlaceholder: '<?=KEY_WORD;?>',
                      sInfo: "<?=STARTTOEND;?>",
                      sSearch: '',
                      sLengthMenu: 'Log List',
                      sLength: 'dataTables_length',
                       oPaginate: {
                              sFirst: '<i class="material-icons">chevron_left</i>',
                              sPrevious: '<i class="material-icons">chevron_left</i>',
                              sNext: '<i class="material-icons">chevron_right</i>',
                              sLast: '<i class="material-icons">chevron_right</i>' 
                          }
                      },
          order: [[ 1, 'asc' ]]
      });
  });
          </script>
      </body>
  </html>