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/kanvakanva.com/public_html/application/views/ |
Upload File : |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <div class="container"> <div class="row"> <div class="col-sm-12"> <div style="color:#F00; text-transform:uppercase; font-weight: bold;" ><?php echo $message?></div> <?php if ($cart = $this->cart->contents()): ?> <br> <h4><strong></strong>YOUR ORDER SUMMARY</h4> <div class="table-responsive"> <table class="table" style="border-bottom:1px solid #999999; width: 100%;"> <thead> <tr > <th style="width:13%">IMAGE</th> <th style="width:36%">PRODUCT NAME</th> <th style="width:15%; text-align: left;">UNIT PRICE</th> <th style="width:15%; text-align: left;">QUANTITY</th> <th style="width:15%; text-align: left;">SUB TOTAL</th> <th style="width:6%">DELETE</th> </tr> </thead> <tbody> <?php $product_grand_total = 0; foreach ($cart as $item): ?> <tr> <td> <?php //get product image $image_thumb = $this->product_m->get_image($item['id']); ?> <p style="padding-right: 10px;"><img src="<?= base_url('uploads/product/thumbnail') .'/'. $image_thumb->image1; ?>" alt="" title="" /></p> </td> <td><?php echo strtoupper($item['name']); ?></td> <td>IDR <?php echo number_format($item['price']); ?></td> <td style="padding-left: 28px;"><?php echo number_format($item['qty']); ?></td> <?php $product_grand_total = $product_grand_total + $item['subtotal']; ?> <td>IDR <?php echo number_format($item['subtotal']); ?></td> <td style="padding-left: 30px;"><a title="Delete Item" href="<?= base_url('summary/remove') . '/' . $item['rowid']; ?>">X</a></td> </tr> <?php endforeach; ?> </tbody> </table> </div><!-- end table-responsive --> <?php if ($shipping->country == 'IDN') : ?> <?php //calculate shipping fee //get total weight $total_weight_gram = 0; $cart = $this->cart->contents(); //check for sale items to inclue only anteraja $has_sale_items = 'no'; foreach ($cart as $item) { $sale_category_id = 68; $item_id = (int) $item['id']; $product_categories = $this->db->select('id_category')->from('category_product')->where('id_product', $item_id)->get()->result(); foreach($product_categories as $item) { if($item->id_category == $sale_category_id) { $has_sale_items = 'yes'; break; } } } foreach ($cart as $item) { $item_id = (int) $item['id']; //get product weight $this->db->select('weight')->from('stocks')->where('product_id', $item_id)->where('size_id', $item['options']['size_id']); $item_weight = $this->db->get()->row()->weight * $item['qty']; $total_weight_gram = $total_weight_gram + $item_weight; } $total_weight_kg = ceil($total_weight_gram / 1000); //get city origin ID from configuration table $this->db->select('shop_district_id')->from('configuration')->where('id_configuration', 1); $shop_origin_city_id = (int) $this->db->get()->row()->shop_district_id; //get subdistrict origin ID from configuration table $this->db->select('shop_subdistrict_id')->from('configuration')->where('id_configuration', 1); $shop_origin_subdistrict_id = (int) $this->db->get()->row()->shop_subdistrict_id; //get destination IDs $destination_city_id = (int) $shipping->id_district; $destination_subdistrict_id = $shipping->id_subdistrict; //get carrier $carrier = $this->session->userdata('carrier'); $carrier_name = $this->session->userdata('carrier_name'); $total_shipping_fee = 0; if($total_weight_gram > 0) { //get shipping cost from RajaOngkir API for 1 ikg $rajaongkir_cost = get_rajaongkir_ongkos($shop_origin_city_id, $destination_city_id, 1000, $carrier); //get shipping cost from Anteraja API //find origin code for anteraja $origin_subdistrict = 'jagakarsa'; $anteraja_origin_code = '31.74.09'; $destination_subdistrict = $shipping->subdistrict; $anteraja_destination_code = $this->db->select('kode_kecamatan')->from('anteraja_subdistricts')->like('kecamatan', $destination_subdistrict)->get()->row()->kode_kecamatan; // echo $anteraja_origin_code . '<br>'; // echo $anteraja_destination_code . '<br>'; // echo $total_weight_gram . '<br>'; $anteraja_cost = get_anteraja_cost($anteraja_origin_code, $anteraja_destination_code, $total_weight_gram); // echo '<pre>'; // print_r($rajaongkir_cost); // echo '</pre>'; if ($carrier_name == 'ANTERAJA REG') { // echo '<pre>'; // print_r($anteraja_cost); // echo '</pre>'; foreach($anteraja_cost['content']['services'] as $key => $result) { if($result['product_name'] == 'Regular') { $total_shipping_fee = $result['rates']; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif ($carrier_name == 'ANTERAJA NEXTDAY') { foreach($anteraja_cost['content']['services'] as $key => $result) { if($result['product_name'] == 'Next Day') { $total_shipping_fee = $result['rates']; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } else if($carrier_name == 'TIKI REG') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'REG') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif($carrier_name == 'TIKI ONS') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'ONS') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif($carrier_name == 'TIKI ECO') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'ECO') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif ($carrier_name == 'JNE REGULER') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'REG' || $result['service'] == 'CTC') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif ($carrier_name == 'JNE YES') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'YES' || $result['service'] == 'CTCYES') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } elseif ($carrier_name == 'JNE OKE') { foreach($rajaongkir_cost['rajaongkir']['results'][0]['costs'] as $key => $result) { if($result['service'] == 'OKE') { $total_shipping_fee = $result['cost'][0]['value']; $total_shipping_fee = $total_shipping_fee * $total_weight_kg; break; } else { $total_shipping_fee = NULL; //service is not available } } if($this->session->userdata('chosen_voucher_type') == 'free shipping') { $total_shipping_fee = 0; } } } else { $total_shipping_fee = 0; } ?> <?= form_open('summary/get_vouchers'); ?> <p style="text-align: left; float:left; width:280px;"><input style="font-size: 14px;" type="text" name="voucher_code" placeholder="Voucher Code"> <input style="position:relative; top:-2px; background:#000; color:white; border:none; padding:4px 12px;" type="submit" name="submit_voucher_code" value="REDEEM" class="btn"><br> <?= form_error('voucher_code'); ?> <span style="padding-top: 2px; padding-bottom: 2px; float:left"> <?php //Display promo name if the promo is set to display /* if ($this->session->userdata('chosen_voucher_code')) { $this->db->select('display_at_checkout, voucher_name')->from('vouchers')->where('voucher_code', $this->session->userdata('chosen_voucher_code')); $display_at_checkout = $this->db->get()->row(); if ($display_at_checkout->display_at_checkout == 1) { echo ucwords($display_at_checkout->voucher_name); } } */ ?> </span> <?= form_close(); ?> <p style="text-align: right;"><strong> <?= $this->session->userdata('carrier_name'); ?> <?php //get free shipping min purchase amount from configuration table $this->db->select('free_shipping')->from('configuration')->where('id_configuration', 1); $free_shipping = $this->db->get()->row()->free_shipping; if ($free_shipping != NULL) { if ($product_grand_total >= $free_shipping) { $total_shipping_fee = 0; } } ?> <?php if ($total_shipping_fee == 0 && $free_shipping != NULL) : ?> Free Shipping</strong></p> <?php elseif ($total_shipping_fee == 0 && $free_shipping == NULL) : ?> carrier not available</strong></p> <?php else : ?> IDR <?= number_format($total_shipping_fee); ?></strong></p> <?php endif; ?> <?php endif; ?> <?php if ($this->session->userdata('chosen_voucher_code')) : ?> <p style="text-align: right;"><strong> <?= 'PROMO CODE ' . strtoupper($this->session->userdata('chosen_voucher_code')); ?> <?php $discount_voucher = $this->session->userdata('chosen_voucher_discount'); ?> <?php if ($this->session->userdata('chosen_voucher_type') == 'amount') : ?> <?= '(- IDR ' . number_format($discount_voucher); ?>)</strong></p> <?php $grand_total = $product_grand_total + $total_shipping_fee - $discount_voucher; ?> <?php else : ?> <?= '(- ' . number_format($discount_voucher); ?> %)</strong></p> <?php $grand_total = $product_grand_total + $total_shipping_fee - ($discount_voucher * $product_grand_total /100); ?> <?php endif; ?> <?php else : ?> <?php $grand_total = $product_grand_total + $total_shipping_fee; ?> <?php endif; ?> <?php if($grand_total < 0) { $grand_total = 0; } ?> <p style="text-align: right; border-bottom:1px solid #999999; padding-bottom: 10px; margin-bottom: 10px; font-weight: bold; "><span style="font-size:120%;">GRAND TOTAL: IDR <?php echo number_format($grand_total); ?></span></p> <?php //to store total amount in session $this->session->set_userdata('grand_total', $grand_total); //to store subtotal for products only amount in session, will be used in payment controller for veritrans $this->session->set_userdata('product_grand_total', $product_grand_total); //to get grand total without shipping fee, inorder to check for voucher $this->session->set_userdata('grand_total_without_shipping', $grand_total - $total_shipping_fee); //store total shipping fee into session $this->session->set_userdata('total_shipping_fee', $total_shipping_fee); ?> </div><!-- end col-sm-12 --> <div class="col-sm-6" style="border-right:1px solid #e8e8e9;"> <br> <h4>1. SHIPPING ADDRESS</h4> <p><?= ucwords($shipping->recipient_name); ?></p> <p><?= ucwords($shipping->address); ?></p> <p><?= ucwords($shipping->district); ?></p> <p><?= ucwords($shipping->subdistrict); ?></p> <p><?= ucwords($shipping->province); ?></p> <p><?php if ($shipping->country == 'IDN') { echo 'Indonesia ' . $shipping->postcode; } ?> <p>Phone: <?= $shipping->phone; ?></p> <?php //to store current shipping details in session $this->session->set_userdata('recipient_name', $shipping->recipient_name); $this->session->set_userdata('address', $shipping->address); $this->session->set_userdata('country', $shipping->country); $this->session->set_userdata('postcode', $shipping->postcode); $this->session->set_userdata('phone', $shipping->phone); $this->session->set_userdata('id_district', $shipping->id_district); $this->session->set_userdata('id_province', $shipping->id_province); ?> <p> <?= form_open('account/shipping'); ?> <input type="hidden" name="shipping_summarypage"> <?php if(empty($shipping->subdistrict) || $shipping->subdistrict == null) : ?> <input type="submit" name="submit" value="PLEASE FILL IN SUBDISTRICT" style="background:#443d41; color: white; height: 29px; margin-top: 25px; border:none; cursor: pointer; width:200px; padding:7px; font-size: 12px"> <?php elseif(!empty($shipping->subdistrict) && $shipping->subdistrict !== null) : ?> <input type="submit" name="submit" value="CHANGE SHIPPING ADDRESS" style="background:#443d41; color: white; height: 29px; margin-top: 25px; border:none; cursor: pointer; width:200px; padding:7px; font-size: 12px"> <?php endif; ?> <?= form_close(); ?> </p> <br><br> <h4>2. CHOOSE SHIPPING CARRIER</h4> <p>Click on logo to choose carrier</p><br> <?php //if($has_sale_items == 'no' || ($has_sale_items == 'yes' && count($anteraja_cost['content']['services']) ===0)) : ?> <div class="row"> <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/tiki_reguler'); ?>" title="Tiki Reguler"><img src="<?= base_url('assets/frontend/img/tikiregular.jpg'); ?>"></a><br> TIKI REGULER (2-3 DAYS)</p> <br> </div> <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/tiki_eco'); ?>" title="Tiki Eco"><img src="<?= base_url('assets/frontend/img/tikieco.jpg'); ?>"></a><br> TIKI ECO (3-5 DAYS)</p> <br> </div> <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/tiki_ons'); ?>" title="Tiki Ons"><img src="<?= base_url('assets/frontend/img/tikions.jpg'); ?>"></a><br> TIKI ONS (1 DAY)</p> <br> </div> <?php //endif; ?> <div class="row"> <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/anteraja_reg'); ?>" title="anteraja_reg"><img src="<?= base_url('assets/frontend/img/antaraja.jpeg'); ?>"></a><br> ANTERAJA (REG)</p> <br> </div> <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/anteraja_nextday'); ?>" title="anteraja_nextday"><img src="<?= base_url('assets/frontend/img/antaraja.jpeg'); ?>"></a><br> ANTERAJA (NEXTDAY)</p> <br> </div> </div> <!-- <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/jne_reguler'); ?>" title="JNE Reguler"><img src="<?= base_url('assets/frontend/img/jneregular.jpg'); ?>"></a><br> JNE REGULER (2-3 DAYS)</p> <br> </div> --> <!-- <div class="col-sm-4 col-xs-6"> <p><a href="<?= base_url('summary/index/jne_yes'); ?>" title="JNE Yes"><img src="<?= base_url('assets/frontend/img/jneyes.jpg'); ?>"></a><br> JNE YES (1 DAY)</p> <br> </div> --> </div> <br> </div><!-- end col-sm-6--> <div class="col-sm-6"> <br> <h4>3. TERMS & CONDITIONS</h4> <p><strong>You must agree to Terms and Conditions</strong></p> <div style="height: 200px; overflow-y: scroll; border:1px solid #cccccc; padding:5px;"> <?= ucfirst($toc->toc); ?> </div> <br> <p><input style="color:black; border:1px solid black !important;" type="checkbox" name="toc" id="toc_checkbox"/><strong> <span style="font-size:120%;">I AGREE TO YOUR TERMS & CONDITIONS</span></strong></p><br> <?= form_open('payment/process_payment'); ?> <h4>4. CHOOSE PAYMENT METHOD</h4> <p style="margin-bottom:10px;"> <?php $data = array( 'name' => 'payment_type', 'class' => 'payment_type', 'value' => 'bank_transfer', 'checked' => TRUE, 'style' => '', ); echo form_radio($data); ?> <img style="position:relative; top:5px;" src="<?= base_url('assets/frontend/img/banktransfer.jpg'); ?>"> Bank Transfer</p> <p style="margin-bottom:10px;"> <?php $data = array( 'name' => 'payment_type', 'class' => 'payment_type', 'value' => 'veritrans', 'style' => '', ); echo form_radio($data); ?> <img style="position:relative; top:5px;" src="<?= base_url('assets/frontend/img/creditcard.jpg'); ?>"> Credit Card</p> <p style="margin-bottom:10px;"> <!-- <?php $data = array( 'name' => 'payment_type', 'class' => 'payment_type', 'value' => '4kali', 'style' => '', ); echo form_radio($data); ?> <img style="position:relative; top:5px; height: 28px;" src="<?= base_url('assets/frontend/img/logo-4kali.png'); ?>"> Cicilan 4X</p> --> <p style="margin-bottom:30px;"></p> <h4 style="border-bottom:1px solid #ddd; padding-bottom:10px;">Customer Note</h4> <?php $data = array( 'name' => 'customer_note', 'rows' => '3', 'cols' => '10', 'style' => 'max-width:100%', 'class' => 'form-control', 'placeholder' => 'Write your note for us if any...' ); echo form_textarea($data); ?> <p style="margin-bottom:20px;"></p> <?php if($total_shipping_fee == 0 && $free_shipping == NULL) : ?> <p><input disabled readonly type="submit" name="process_payment" value="PROCESS PAYMENT" style="background:#443d41; border: medium none; color: white; cursor: pointer; font-size: 14px; height: 49px; margin-top: 15px; padding: 12px; width: 180px;" id="process_payment"></p> <p>Please choose other carrier</p> <?php else : ?> <p><input type="submit" name="process_payment" value="PROCESS PAYMENT" style="background:#443d41; border: medium none; color: white; cursor: pointer; font-size: 14px; height: 49px; margin-top: 15px; padding: 12px; width: 180px;" id="process_payment"></p> <?php endif; ?> <?= form_close(); ?> <br> </div><!-- end col-sm-6--> <?php else : ?> <div class="col-sm-12"> <p><a id="button_continue" style="float:left;" href="<?= base_url(); ?>"><< CONTINUE SHOPPING</a><br></p> </div> <?php endif; ?> </div><!-- end row --> </div><!-- end container --> <div id="footer" > <script type="text/javascript"> $( document ).ready(function() { //disable button on initial page load /* $('#process_payment').prop('disabled', true); $('#process_payment').css('background-color', 'grey'); $('#process_payment').css('opacity', '0.5'); $('#toc_checkbox').change(function() { alert('clicked'); if($('#toc_checkbox').prop('checked') == true){ $('#process_payment').prop('disabled', false); $('#process_payment').css('background-color', '#0B4DA2'); $('#process_payment').css('opacity', '1'); } if($('#toc_checkbox').prop('checked') == false){ $('#process_payment').prop('disabled', true); $('#process_payment').css('background-color', 'grey'); $('#process_payment').css('opacity', '0.5'); } }); */ }); </script>