log.html 5.75 KB
<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>