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/rabbithabit.com/public_html/application/views/admin/product_attributes/ |
Upload File : |
<div class="row"> <div class="col-sm-12"> <p><a href="<?= base_url('admin/product_index'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Produk</a></p> <h2>Varian & Atribut Produk</h2> <?= $this->session->flashdata('success'); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <p><?= anchor('admin/product_attributes/edit', '<i class="fa fa-plus" aria-hidden="true"></i> <strong>Buat Varian Baru</strong>', array('class' => 'btn btn-primary')); ?></p> </div> </div> <div class="row"> <div class="col-sm-12"> <h5> <b> Only one color variant, if you want to change or make a color variant<br> please delete the previous color variant first or change the option to non-color variant </b> </h5> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>Nama Varian (id)</th> <th>Nama Varian (en)</th> <th>Is Color ?</th> <th>Urutan Tampilan</th> <th>Edit Varian</th> <th>Edit Atribut</th> <th>Hapus Varian</th> </tr> </thead> <tbody> <?php if(count($attributes)) : ?> <?php foreach($attributes as $attribute): ?> <tr> <td><?= ucfirst($attribute->product_attribute); ?></td> <td><?= ucfirst($attribute->product_attribute_en); ?></td> <td> <?php if ($attribute->is_color == 'yes'): ?> <!-- <span style="color:green;"> <?= ucwords($attribute->is_color); ?> </span> --> <button data-id="<?= $attribute->id; ?>" type="button" class="btn_switch_color btn btn-sm btn-success"> <?= ucwords($attribute->is_color); ?> </button> <?php else: ?> <button data-id="<?= $attribute->id; ?>" type="button" class="btn_switch_color btn btn-sm btn-danger"> <?= ucwords($attribute->is_color); ?> </button> <?php endif ?> </td> <td><?= $attribute->priority; ?></td> <td><?= bt_edit('admin/product_attributes/edit/' . $attribute->id); ?></td> <td><?= bt_edit('admin/product_attributes/view_detail/' . $attribute->id); ?></td> <td><?= bt_delete('admin/product_attributes/delete/' . $attribute->id); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">Varian produk tidak ditemukan.</td> </tr> <?php endif; ?> </tbody> </table> </div> </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> $(document).ready(function(){ var csrfHash = '<?= $this->security->get_csrf_hash(); ?>'; $(".btn_switch_color").click(function(){ var id = $(this).data('id'); if (confirm('Change this variant into a color variant?')) { $.ajax({ 'url' : "<?= base_url('admin/product_attributes/change_variant_color'); ?>", 'type' : 'POST', 'dataType' :'json', 'data' : { 't_id' : id, 'csrftestname' : csrfHash }, 'success' : function(res) { // console.log(res); if (res.res == 'success') { // window.location.href="<?= base_url('admin/product_attributes'); ?>"; window.location.reload(); } } }); } }); }); </script>