Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/blue-sky.co.id/public_html/application/views/admin/home_slideshow_hotel/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/hotels/landing_page/' . $this->session->userdata('hotel_id')); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke beranda</a></p> <h2>Home Slideshow Banner</h2> <p style="text-transform:uppercase;"><?= $this->session->userdata('hotel_name'); ?></p> <?= $this->session->flashdata('success'); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <p><?= anchor('admin/home_slideshow_hotel/add', '<i class="fa fa-plus" aria-hidden="true"></i> <strong>Buat Slideshow Baru</strong>', array('class' => 'btn btn-primary')); ?></p> </div> </div> <div class="row"> <div class="col-sm-12"> <table class="table table-striped"> <thead> <tr> <th>Slideshow Banner</th> <th> Urutan <button style="font-weight: bold;" onclick="refreshDisplayPriority();" class="btn btn-sm btn-success" type="button">Ubah</button> </th> <th>Aktif?</th> <th>Edit</th> <th>Hapus</th> </tr> </thead> <tbody> <?php if(count($home_slideshow_hotel)) : ?> <?php foreach($home_slideshow_hotel as $item): ?> <tr> <td><img style="width:200px;" src="<?= base_url() . 'uploads/banners/' . $item->image; ?>"></td> <td> <input data-id="<?= $item->id_home_slideshow_hotel; ?>" class="inp_change_priority" type="text" style="border: 0;outline: 0;background: transparent;border-bottom: 1px solid gray; text-align: center; width: 40px;" value="<?= $item->priority; ?>"> </td> <td> <?php if ($item->status == 1) { ?> <button onclick="exchangeStatusAct('tidak',<?= $item->id_home_slideshow_hotel; ?>);" type="button" style="border:none; background: transparent;"> <span style="padding: 5px; border-radius: 5px; background: silver;">Ya</span> <span style="padding: 5px; border-radius: 5px; ">Tidak</span> </button> <?php } else { ?> <button onclick="exchangeStatusAct('ya',<?= $item->id_home_slideshow_hotel; ?>);" type="button" style="border:none; background: transparent;"> <span style="padding: 5px; border-radius: 5px; ">Ya</span> <span style="padding: 5px; border-radius: 5px; background: silver;">Tidak</span> </button> <?php } ?> </td> <td><?= bt_edit('admin/home_slideshow_hotel/edit/' . $item->id_home_slideshow_hotel); ?></td> <td><?= bt_delete('admin/home_slideshow_hotel/delete/' . $item->id_home_slideshow_hotel); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">Banner tidak ditemukan.</td> </tr> <?php endif; ?> </tbody> </table> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <?php //create pagination... echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>'; ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <script> function exchangeStatusAct(earlyStat,this_id){ var toStat = ''; var csrfHash = '<?= $this->security->get_csrf_hash(); ?>'; if (earlyStat == 'ya') { toStat = 'Ya'; }else{ toStat = 'Tidak'; } $.ajax({ 'url' : "<?= base_url('admin/home_slideshow_hotel/changeStatusAct'); ?>", 'type' : 'POST', 'dataType' :'json', 'data' : { 'this_id' : this_id, 'toStat' : toStat, 'csrftestname' : csrfHash }, 'success' : function(res) { if (res.res == 'sukses') { // alert('Successfully'); location.reload(); } } }); } function refreshDisplayPriority(){ if (confirm("Are you sure?")==true) { var inp_change_priority = jQuery("input.inp_change_priority"); var csrfHash = '<?= $this->security->get_csrf_hash(); ?>'; var data = [[]]; jQuery.each(inp_change_priority,function(idx,key){ data[idx] = { id : jQuery(this).data('id'), val : jQuery(this).val(), }; }); $.ajax({ 'url' : "<?= base_url('admin/home_slideshow_hotel/refreshDisplayPriority'); ?>", 'type' : 'POST', 'dataType' :'json', 'data' : { 'this_data' : data, 'case_detail' : 'true', 'csrftestname' : csrfHash }, 'success' : function(res) { if (res.res == 'sukses') { // console.log(res.data); // alert('Successfully'); location.reload(); } } }); } } </script>