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 : /proc/self/root/var/www/blue-sky.co.id/public_html/application/views/admin/products/ |
Upload File : |
<div class="row"> <div class="col-sm-6"> <p><a href="<?= base_url('admin/dashboard'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke beranda</a></p> <h2>Airport Lounge</h2> <?= $this->session->flashdata('success'); ?> <?= $this->session->flashdata('error'); ?> </div> </div> <div> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="<?=$this->session->userdata('banner')=='active' ? '' : 'active'?>"> <a aria-controls="search" href="#search" role="tab" data-toggle="tab">Cari Lounge</a> </li> <!-- <li role="presentation" class="<?=$this->session->userdata('banner')=='active' ? 'active' : ''?>"> <a aria-controls="banner" href="#banner" role="tab" data-toggle="tab">Edit Banner</a> </li> --> </ul> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane <?=$this->session->userdata('banner')=='active' ? '' : 'active'?>" id="search"> <div class="row"> <div class="col-sm-4"> <?= form_open('admin/products'); ?> <div class="col-sm-8 col-xs-6"> <input class="form-control" type="text" placeholder="Cari Nama Lounge..." name="product" required <?php if (isset($keyword)) : ?> value="<?= ucwords($keyword); ?>" <?php endif; ?>> </div><!-- end class="col-sm-8" --> <div class="col-sm-4 col-xs-6"> <input class="btn btn-default form-control" type="submit" name="search_product" value="CARI" style="background: #ddd;"> </div><!-- end class="col-sm-6" --> <?= form_close(); ?> </div> <div class="col-sm-4"> <?= form_open('admin/products/search_category'); ?> <div class="col-sm-8 col-xs-6"> <?php //get parent category id and name and parent from categories table $this->db->select('id_categories, category')->from('categories')->where('parent', NULL)->order_by('priority', 'ASC'); $categories = $this->db->get()->result(); ?> <select name="category" class="form-control"> <option value="">Pilih Kategori...</option> <?php foreach ($categories as $category) : ?> <option value="<?= $category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?> ><?= ucwords($category->category); ?></option> <?php //check if the current id does have child $this->db->select('*')->from('categories')->where('parent', $category->id_categories); $count_child_category = $this->db->get()->num_rows(); ?> <?php if ($count_child_category > 0): ?> <?php //get all existing child categories $this->db->select('id_categories, category')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC'); $child_categories = $this->db->get()->result(); ?> <?php foreach ($child_categories as $child_category) : ?> <option style="margin-left: 10px;" value="<?= $child_category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($child_category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?> >- <?= ucwords($child_category->category); ?></option> <?php //check if the current id does have child $this->db->select('*')->from('categories')->where('parent', $child_category->id_categories); $count_child2_category = $this->db->get()->num_rows(); ?> <?php if ($count_child2_category > 0): ?> <?php //get all existing child categories $this->db->select('id_categories, category')->from('categories')->where('parent', $child_category->id_categories)->order_by('priority', 'ASC'); $child2_categories = $this->db->get()->result(); ?> <?php foreach ($child2_categories as $child2_category) : ?> <option style="margin-left: 10px;" value="<?= $child2_category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($child2_category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?> >-- <?= ucwords($child2_category->category); ?></option> <?php endforeach; ?> <?php endif ?> <?php endforeach; ?> <?php endif ?> <?php endforeach; ?> </select> </div><!-- end class="col-sm-5" --> <div class="col-sm-4 col-xs-6"> <input class="btn btn-default form-control" type="submit" name="search_category" value="CARI" style="background: #ddd;"> </div><!-- end class="col-sm-3" --> <?= form_close(); ?> </div> </div><!-- end row --> </div> <div role="tabpanel" class="tab-pane <?=$this->session->userdata('banner')=='active' ? 'active' : ''?>" id="banner"> <?= form_open_multipart(); ?> <div class="row"> <div class="col-sm-12"> <?php echo $this->session->userdata('success_banner'); ?> </div> </div> <div class="row" > <div class="col-sm-2"> <p>Banner<br> <?php if (!empty($ide_produk->produk_banner)) : ?> <img style="width:200px; height:auto;" src="<?= base_url() . 'uploads/blog/' . $ide_produk->produk_banner; ?>" alt="" /> <br><i class="fa fa fa-trash-o" aria-hidden="true"></i> <a href="<?= base_url() . 'admin/products/delete_produk_banner'; ?>">Hapus</a> <?php endif; ?></p> </div><!-- end class="col-sm-4" --> <div class="col-sm-8"> <input type="file" name="userfile" size="20" class="btn btn-default btn-file form-control" /> <?php //get max image width and height from configuration table $this->db->select('*')->from('configuration')->where('id_configuration', 1); $image_dimension = $this->db->get()->row(); ?> <span style="font-size:12px; font-style: italic;">Ukuran gambar harus maksimal <?= $image_dimension->image_banner_width;?> lebar piksel. <?= $image_dimension->image_banner_height;?> tinggi piksel, jpg / png, maks 1MB</span> <span style="color:#F7931E;"><?php echo $this->session->userdata('banner_msg'); ?></span> </div><!-- end class="col-sm-8" --> <div class="col-sm-2"> <p> <?= form_submit('banner', 'Update Banner', 'class="btn btn-success"'); ?></p> </div><!-- end class="col-sm-8" --> </div> <!-- end row --> <?php form_close(); ?> </div> <div role="tabpanel" class="tab-pane" id="settings"> <div class="row" style="border:1px solid #ddd;"> <div class="col-sm-12"> <h3>Upload Produk Microsoft Excel</h3> <p>DOWNLOAD CONTOH FILE EXCEL <a target="_blank" style="color:brown; font-weight: bold;" href="https://www.tokodaku.com/store-shared/assets/frontend/product_import.xls">DISINI</a>. IKUTI PENGISIAN SESUAI CONTOH.</p> <p>Maksimal 50 item per file excel. Produk dengan Nama produk dan/atau SKU (Kode produk) yang sama akan diupdate. Produk dengan nama baru dan/atau SKU yang baru akan didaftarkan baru.</p> <?php $attributes = array( 'name' => 'uploadexcel', 'id' => 'uploadexcel' ); ?> <?= form_open_multipart('admin/products/upload_products', $attributes); ?> <table> <tr> <td> ULPLOAD PRODUK EXCEL: </td> <td> <div class="form-group"> <input style="float:left; width:60%;" type="file" class="form-control" name="" id="userfile" align="center"/><input type="submit" name="upload_excel" class="btn btn-info" value="UPLOAD"> </div> </td> </tr> </table> </form> <p>Note: Saat proses upload, mohon menunggu saampai proses selesai.</p> </div><!-- end class="col-sm-12" --> <?= form_close(); ?> </div> <!-- end row; --> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <p><?= anchor('admin/products/edit', '<i class="fa fa-plus" aria-hidden="true"></i> <strong>Buat Lounge baru</strong>', array('class' => 'btn btn-primary')); ?></p> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <?= form_open(base_url('admin/products/delete_all'),array('id'=>'frm_delete_all')); ?> <table class="table table-striped"> <thead> <tr> <th style="text-align: center;"> <button type="submit" id="delall_slc_checkbox" style="background: transparent;border: none;font-size: 23px;cursor: pointer;"> <i class="fa fa fa-trash-o"></i> </button> <input id="slcall_checkbox" type="checkbox"> </th> <th>Nama Lounge</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>Produk Trending?</th> --> <th>Edit</th> <th>Foto Lounge</th> <!-- <th>Foto Testimonial</th> --> <th>Preview</th> <th>Hapus</th> </tr> </thead> <tbody> <?php if(count($products)) : ?> <?php foreach($products as $product): ?> <tr> <td style="text-align: center;"> <input class="checkbox_for_del" name="checkbox_for_del[]" value="<?= $product->id_products; ?>" type="checkbox"> </td> <td><?= ucfirst($product->title); ?></td> <td> <input data-id="<?= $product->id_products; ?>" class="inp_change_priority" type="text" style="border: 0;outline: 0;background: transparent;border-bottom: 1px solid gray; text-align: center; width: 40px;" value="<?= $product->priority; ?>"> </td> <td> <?php if ($product->product_status == 1) : ?> <button onclick="exchangeStatusAct('tidak',<?= $product->id_products; ?>);" 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',<?= $product->id_products; ?>);" 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 endif; ?> </td> <!-- <td> <?php if ($product->best_seller == 'yes') : ?> <button onclick="exchangeStatusAct('tidak',<?= $product->id_products; ?>,1);" 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',<?= $product->id_products; ?>,1);" 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 endif; ?> </td> --> <td><?= bt_edit('admin/products/edit/' . $product->id_products); ?></td> <td><a href="<?= base_url('admin/products/product_images/' . $product->id_products); ?>"><i class="fa fa-file-image-o" aria-hidden="true"></i> Edit</a></td> <!-- <td><a href="<?= base_url('admin/products/testi_images/' . $product->id_products); ?>"><i class="fa fa-file-image-o" aria-hidden="true"></i> Edit</a></td> --> <td><a href="<?= base_url() . 'product/' . $product->alias; ?>"><i class="fa fa-eye" aria-hidden="true"></i></a></td> <td><?= bt_delete('admin/products/delete/' . $product->id_products); ?></td> </tr> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="3">Produk tidak ditemukan.</td> </tr> <?php endif; ?> </tbody> </table> <?= form_close(); ?> </div><!-- end class responsive--> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <?php if(isset($use_pagination)) : ?> <div style="text-align:center;"><?= $this->pagination->create_links(); ?></div> <?php endif; ?> </div><!-- end class="col-sm-12" --> </div> <!-- end row --> <script> jQuery(document).ready(function($){ $("form#frm_delete_all").submit(function(ev){ ev.preventDefault(); var csrfHash = '<?= $this->security->get_csrf_hash(); ?>'; if(confirm('Are you sure?')==true){ var input_check = $( "input[type='checkbox'].checkbox_for_del:checked" ); var checkbox_del = [[]]; $.each(input_check,function(idx,key){ checkbox_del[idx]=$(this).val(); }); $.ajax({ 'url' : "<?= base_url('admin/products/delete_all'); ?>", 'type' : 'POST', 'dataType' :'json', 'data' : { 'checkbox_del' : checkbox_del, 'csrftestname' : csrfHash }, 'success' : function(res) { // console.log(res); if (res.result == 'sukses') { window.location.href="<?= base_url('admin/products'); ?>"; } } }); } }); $("input#slcall_checkbox").click(function(){ var input_check = $( "input[type='checkbox'].checkbox_for_del" ); if($(this).is(':checked')){ input_check.prop('checked',false); input_check.prop('checked',true); }else{ input_check.prop('checked',false); } }); }); function exchangeStatusAct(earlyStat,this_id,trend){ trend = trend || 0; var toStat = ''; var csrfHash = '<?= $this->security->get_csrf_hash(); ?>'; if (earlyStat == 'ya') { toStat = 'Ya'; }else{ toStat = 'Tidak'; } $.ajax({ 'url' : "<?= base_url('admin/products/changeStatusAct/'); ?>"+trend, '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/products/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>