Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / www / html / sman1baleendahoppppppp / views / themes / blue_sky / | server ip : 104.21.89.46 your ip : 172.70.126.89 H O M E |
Filename | /var/www/html/sman1baleendahoppppppp/views/themes/blue_sky/loop-files.php |
Size | 2.69 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 04-May-2025 17:23 |
Last modified | 04-May-2025 17:23 |
Last accessed | 08-Jul-2025 17:57 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php defined('BASEPATH') OR exit('No direct script access allowed');?>
<script type="text/javascript">
var page = 1;
var total_page = "<?=$total_page;?>";
console.log(total_page);
$(document).ready(function() {
if (parseInt(total_page) == page || parseInt(total_page) == 0) {
$('.more-files').remove();
}
});
function get_files() {
page++;
var data = {
page_number: page,
slug: '<?=$this->uri->segment(2)?>'
};
if ( page <= parseInt(total_page) ) {
_H.Loading( true );
$.post( _BASE_URL + 'public/download/get_files', data, function( response ) {
_H.Loading( false );
var res = _H.StrToObject( response );
var rows = res.rows;
var str = '';
var no = parseInt($('.number:last').text()) + 1;
for (var z in rows) {
var row = rows[ z ];
str += '<tr>';
str += '<td class="number">' + no + '</td>';
str += '<td>' + row.file_title + '</td>';
str += '<td>' + (_H.FormatBytes(row.file_size * 1024)) + '</td>';
str += '<td>' + row.file_ext + '</td>';
str += '<td>' + row.file_counter + '</td>';
str += '<td>';
str += '<a href="' + _BASE_URL + 'public/download/force_download/' + row.id + '"><i class="fa fa-download"></i></a>';
str += '</td>';
str += '</tr>';
no++;
}
var elementId = $("tbody > tr:last");
$( str ).insertAfter( elementId );
if ( page == parseInt(total_page) ) $('.more-files').remove();
});
}
}
</script>
<div class="col-lg-12 col-md-12 col-sm-12 ">
<h5 class="page-title mb-3"><?=strtoupper($page_title)?></h5>
<div class="card rounded-0 border border-secondary mb-3">
<div class="card-body p-2 mb-0">
<table class="table table-striped table-bordered mb-0">
<thead>
<tr>
<th width="40px">NO</th>
<th>NAMA FILE</th>
<th>UKURAN</th>
<th>TIPE</th>
<th>DIUNDUH</th>
<th width="40px" class="text-center"><i class="fa fa-download"></i></th>
</tr>
</thead>
<tbody>
<?php $no = 1; foreach($query->result() as $row) { ?>
<tr>
<td class="number"><?=$no?></td>
<td><?=$row->file_title?></td>
<td><?=filesize_formatted($row->file_size * 1024)?></td>
<td><?=$row->file_ext?></td>
<td><?=$row->file_counter?> Kali</td>
<td class="text-center">
<a href="<?=site_url('public/download/force_download/'.$row->id)?>"><i class="fa fa-download"></i></a>
</td>
</tr>
<?php $no++; } ?>
</tbody>
</table>
</div>
</div>
<div class="justify-content-between align-items-center float-right mb-3 w-100 more-files">
<button type="button" onclick="get_files()" class="btn action-button rounded-0 float-right"><i class="fa fa-refresh"></i> File Lainnya</button>
</div>
</div>
<script type="text/javascript">
var page = 1;
var total_page = "<?=$total_page;?>";
console.log(total_page);
$(document).ready(function() {
if (parseInt(total_page) == page || parseInt(total_page) == 0) {
$('.more-files').remove();
}
});
function get_files() {
page++;
var data = {
page_number: page,
slug: '<?=$this->uri->segment(2)?>'
};
if ( page <= parseInt(total_page) ) {
_H.Loading( true );
$.post( _BASE_URL + 'public/download/get_files', data, function( response ) {
_H.Loading( false );
var res = _H.StrToObject( response );
var rows = res.rows;
var str = '';
var no = parseInt($('.number:last').text()) + 1;
for (var z in rows) {
var row = rows[ z ];
str += '<tr>';
str += '<td class="number">' + no + '</td>';
str += '<td>' + row.file_title + '</td>';
str += '<td>' + (_H.FormatBytes(row.file_size * 1024)) + '</td>';
str += '<td>' + row.file_ext + '</td>';
str += '<td>' + row.file_counter + '</td>';
str += '<td>';
str += '<a href="' + _BASE_URL + 'public/download/force_download/' + row.id + '"><i class="fa fa-download"></i></a>';
str += '</td>';
str += '</tr>';
no++;
}
var elementId = $("tbody > tr:last");
$( str ).insertAfter( elementId );
if ( page == parseInt(total_page) ) $('.more-files').remove();
});
}
}
</script>
<div class="col-lg-12 col-md-12 col-sm-12 ">
<h5 class="page-title mb-3"><?=strtoupper($page_title)?></h5>
<div class="card rounded-0 border border-secondary mb-3">
<div class="card-body p-2 mb-0">
<table class="table table-striped table-bordered mb-0">
<thead>
<tr>
<th width="40px">NO</th>
<th>NAMA FILE</th>
<th>UKURAN</th>
<th>TIPE</th>
<th>DIUNDUH</th>
<th width="40px" class="text-center"><i class="fa fa-download"></i></th>
</tr>
</thead>
<tbody>
<?php $no = 1; foreach($query->result() as $row) { ?>
<tr>
<td class="number"><?=$no?></td>
<td><?=$row->file_title?></td>
<td><?=filesize_formatted($row->file_size * 1024)?></td>
<td><?=$row->file_ext?></td>
<td><?=$row->file_counter?> Kali</td>
<td class="text-center">
<a href="<?=site_url('public/download/force_download/'.$row->id)?>"><i class="fa fa-download"></i></a>
</td>
</tr>
<?php $no++; } ?>
</tbody>
</table>
</div>
</div>
<div class="justify-content-between align-items-center float-right mb-3 w-100 more-files">
<button type="button" onclick="get_files()" class="btn action-button rounded-0 float-right"><i class="fa fa-refresh"></i> File Lainnya</button>
</div>
</div>