oyazhuryachna

list_file_upload

Mar 30th, 2018
3,787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.41 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. ?>
  4.         <h2>Daftar File</h2>
  5.         <p>Berikut adalah daftar file yang sudah ada di server untuk di di-download oleh user public.</p>
  6.        
  7.         <p><a href="<?php echo base_url();?>upload/form"><button class="btn btn-primary"><span class="glyphicon glyphicon-cloud-upload"></span> Upload File</button></a></p>
  8.        
  9. <div class="table-responsive">
  10. <table class="table table-bordered table-striped">
  11.     <thead>
  12.         <tr>
  13.             <th>No</th>
  14.             <th>Nama File</th>
  15.             <th>Ukuran File</th>
  16.             <th>Tanggal Upload</th>
  17.             <th>Download</th>
  18.         </tr>
  19.     </thead>
  20.     <tbody>
  21. <?php
  22. $no=null;
  23. $dir = "uploaded_file/";
  24.  
  25. if(isset($daftar_file)){
  26.     for($a=0;$a<count($daftar_file);$a++) {
  27.         if($daftar_file[$a]!='.' && $daftar_file[$a]!='..'){
  28.         $no++;
  29.         $file=$daftar_file[$a];
  30.         ?>
  31.     <tr>
  32.         <td align="center"><?php echo $no;?></td>
  33.         <td><?php echo $file;?></td>
  34.         <td align="right"><?php echo number_format(filesize($dir.$daftar_file[$a])/1024,2,',','.');?> Kb</td>
  35.         <td><?php echo date ("d-M-Y H:i:s", filemtime($dir.$daftar_file[$a]));?></td>
  36.         <td align="center">
  37.             <a href="<?php echo $dir.$daftar_file[$a];?>"><span class="glyphicon glyphicon-cloud-download"></span></a>
  38.             <a href="<?php echo base_url().'upload/hapus/'.$daftar_file[$a];?>"><span class="glyphicon glyphicon-trash"></span></a>
  39.             </td>
  40.     </tr>
  41.     </tbody>
  42.     <?php
  43.          }
  44.         }  
  45.     }
  46.     ?>
  47. </table>
  48. </div>
Add Comment
Please, Sign In to add comment