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/ |
Upload File : |
<div class="container"> <!-- <div class="table-responsive"> --> <div class="myCart"> <?php $grand_total = 0; ?> <?php if ($cart = $this->cart->contents()): ?> <table class="table" style="border-top:1px solid #999999; border-bottom:1px solid #999999; width: 100%;"> <thead> <tr> <!-- <th style="width:13%"></th> --> <th style="width:36%">PRODUCT</th> <th class="hidden-xs-down" style="width:15%; text-align: left;">PRICE</th> <th class="hidden-xs-down" style="width:15%; text-align: center;">QUANTITY</th> <th class="hidden-xs-down" style="width:15%; text-align: left;">SUB TOTAL</th> <th class="hidden-xs-down" style="width:6%">REMOVE</th> </tr> </thead> <tbody> <?php $count = 0; ?> <?php $grand_total = 0; ?> <?php foreach ($cart as $item): ?> <?php $count = $count + 1; ?> <?php //get product image //$image_thumb = $this->product_m->get_image($item['id']); //get product alias $this->db->select('alias')->from('products')->where('id_products', $item['id']); $product_alias = $this->db->get()->row()->alias; ?> <tr> <!-- <td style="padding-bottom: 0px"> <p style="padding-right: 10px;margin-bottom: 0px !important"> <a href="<?= base_url() . 'product/' . $product_alias; ?>"> <?php if($image_thumb->image != null): ?> <?php if (file_exists(FCPATH.'/uploads/product/thumbnail/' . $image_thumb->image)):?> <img src="<?= base_url('uploads/product/thumbnail') .'/'. $image_thumb->image; ?>"> <?php else: ?> <img src="<?= base_url('uploads/product/thumbnail/placeholder.jpg'); ?>"> <?php endif; ?> <?php else: ?> <img src="<?= base_url('uploads/product/thumbnail/placeholder.jpg'); ?>"> <?php endif; ?> </a> </p> </td> --> <td> <a style="color:black; text-decoration: none;" href="<?= base_url() . 'product/' . $product_alias; ?>"><?= strtoupper($item['name']); ?></a> <div class="row hidden-sm-up"> <div class="col-12">IDR <?= number_format($item['price']); ?></div> <div class="col-6" style="top: 10px;"> <a title="Hapus" href="<?= base_url('cart/remove') . '/' . $item['rowid']; ?>"> <i class="fa fa-trash"></i> </a> </div> <div class="col-6" style="text-align: right;"> <?php error_reporting(0); $fs_cek_product = $this->db->select('id')->from('flashsale_products')->where('product_id',$item['id'])->where('flashsale_id',$this->session->userdata('flashsale_id_active'))->get()->row()->id; if($fs_cek_product != null): ?> <div class="count-input space-bottom" style="display: inline-block;"> <input class="quantity productQuantity<?= $count; ?>" type="text" name="quantity" value="<?= $item['qty']; ?>"/> </div> <?php else: ?> <div class="count-input space-bottom" style="display: inline-block;"> <a class="incr-btn btnMin<?= $count; ?>" data-action="decrease" href="#">–</a> <input class="quantity productQuantity<?= $count; ?>" type="text" name="quantity" value="<?= $item['qty']; ?>"/> <a class="incr-btn btnAdd<?= $count; ?>" data-action="increase" href="#">+</a> </div> <?php endif; ?> <p class="noStock<?= $count; ?>" style="color:red;"><?= $this->session->flashdata('no_stock' . $item['id']); ?></p> </div> </div> </td> <td class="hidden-xs-down">IDR <?= number_format($item['price']); ?></td> <td class="hidden-xs-down"> <?php if($fs_cek_product != null): ?> <div class="count-input space-bottom" style="display: inline-block;"> <input readonly="readonly" class="quantity productQuantity<?= $count; ?>" type="text" name="quantity" value="<?= $item['qty']; ?>"/> </div> <?php else: ?> <div class="count-input space-bottom" style="display: inline-block;"> <a class="incr-btn btnMin<?= $count; ?>" data-action="decrease" href="#">–</a> <input readonly="readonly" class="quantity productQuantity<?= $count; ?>" type="text" name="quantity" value="<?= $item['qty']; ?>"/> <a class="incr-btn btnAdd<?= $count; ?>" data-action="increase" href="#">+</a> </div> <?php endif; ?> <p class="noStock<?= $count; ?>" style="color:red;"><?= $this->session->flashdata('no_stock' . $item['id']); ?></p> </td> <td class="hidden-xs-down" id="subTotal<?= $count; ?>">IDR <?php echo number_format($item['price'] * $item['qty']); ?></td> <?php if($fs_cek_product == null): ?> <script> $('.btnMin<?= $count; ?>').click(function() { var qty = $('.productQuantity<?= $count; ?>').val(); qty--; if(qty == 0) { qty = 1; } $('.productQuantity<?= $count; ?>').val(qty); ajax_check_stock<?= $count; ?>(qty); ajax_set_subtotal<?= $count; ?>(qty); }); $('.btnAdd<?= $count; ?>').click(function() { var qty = $('.productQuantity<?= $count; ?>').val(); qty++; $('.productQuantity<?= $count; ?>').val(qty); ajax_check_stock<?= $count; ?>(qty); ajax_set_subtotal<?= $count; ?>(qty); }); function ajax_check_stock<?= $count; ?>(qty) { $.ajax({ 'url' : '<?= base_url(); ?>' + 'ajax/ajax_check_stock', 'type' : 'POST', 'data' : { 'qty' : qty, 'row_id': '<?= $item['rowid']; ?>', 'sub_total': <?= $item['subtotal']; ?>, 'product_id' : <?= $item['id']; ?>, '<?= $this->security->get_csrf_token_name(); ?>' : '<?= $this->security->get_csrf_hash(); ?>' }, 'success' : function(data) { if (data) { /*---if stock not enough----*/ $('.noStock<?= $count; ?>').html(data); }; } }); } function ajax_set_subtotal<?= $count; ?>(qty){ $.ajax({ 'url' : '<?= base_url(); ?>' + 'ajax/ajax_set_subtotal', 'type' : 'POST', 'data' : { 'qty' : qty, 'row_id': '<?= $item['rowid']; ?>', 'price': <?= $item['price']; ?>, 'product_id' : <?= $item['id']; ?>, '<?= $this->security->get_csrf_token_name(); ?>' : '<?= $this->security->get_csrf_hash(); ?>' }, 'success' : function(data) { if (data) { var hasil = JSON.parse(data); $('#subTotal<?= $count; ?>').html(hasil.subtotal); $('#totalAmount').html(hasil.grand_total); }; } }); } </script> <?php endif; ?> <td class="hidden-xs-down" style="padding-left: 30px;"> <a title="Hapus" href="<?= base_url('cart/remove') . '/' . $item['rowid']; ?>"> <i class="fa fa-trash-alt"></i> </a> </td> </tr> <?php $grand_total = $grand_total + $item['subtotal']; ?> <?php endforeach; ?> </form> </tbody> </table> <?php else : ?> <p style="margin-top: 25px; margin-bottom: 100px; font-size: 15px; font-weight: bold;" class="clearfix"> <!-- <a style="color:black;" id="button_continue" href="<?= $this->session->userdata('productpage_to_cart'); ?>"> <i class="fa fa-chevron-left" aria-hidden="true"></i> LANJUT BELANJA </a> --> YOUR CART IS EMPTY... </p> <?php endif; ?> </div><!-- end myCart --> <!-- </div> --><!-- end tableResponsive --> <p style="text-align: right; border-bottom:1px solid #999999; padding-bottom: 10px; font-weight: bold;"> <span style="font-size:120%; display: none;" id="totalAmount">TOTAL: IDR <?= number_format($grand_total); ?></span> </p> <p style="margin-top: 25px; margin-bottom: 100px; font-size: 15px; font-weight: bold;" class="clearfix"> <?php if($this->session->userdata('productpage_to_cart')) : ?> <a class="btn btn-primary btn-buy" id="button_continue" href="<?= $this->session->userdata('productpage_to_cart'); ?>" style="width: 200px;float: none; background-color:<?= $primary_colortheme;?>;"> <i class="fa fa-chevron-left" aria-hidden="true"></i> CONTINUE SHOPPING </a> <?php else : ?> <a class="btn btn-primary btn-buy" id="button_continue" href="<?= base_url(); ?>" style="width: 200px;float: none; background-color:<?= $primary_colortheme;?>;"> <i class="fa fa-chevron-left" aria-hidden="true"></i> CONTINUE SHOPPING </a> <?php endif; ?> <!-- <a style="float:right; color:black; text-decoration: none;" id="button_checkout" href="https://www.canvaswebdesign.com/farmaku.com/login">CHECKOUT <i class="fa fa-chevron-right" aria-hidden="true"></i> </a> --> <style> .btn-buy{ width:250px; float: right; margin-right: 0px; margin-top: 0px; } </style> <?php if ($cart = $this->cart->contents()): ?> <a href="<?= base_url('shipping'); ?>" class="btn btn-primary buyButton btn-buy hidden-xs-down"><i class="fa fa-shopping-cart"></i> CHECKOUT <i class="fa fa-chevron-right" aria-hidden="true"></i></a> <?php endif; ?> </p> </div> <!-- product buy botton --> <?php if ($cart = $this->cart->contents()): ?> <div class="fixed-bottom hidden-sm-up" style="height: 60px;background-color: white;text-align: center;border-top: 1px solid #999999"> <a href="<?= base_url('shipping'); ?>" style="width:250px;" class="btn btn-primary buyButton"> <i class="fa fa-shopping-cart"></i> CHECKOUT <i class="fa fa-chevron-right" aria-hidden="true"></i> </a> </div> <?php endif; ?>