]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<?php include_once("header.php"); /*============= Offers Discount Function =============*/ function offers_discount($p_id='', $qty=''){ $sel_obj = new config(); $p_cond="`p_id`=".$p_id; $p_qu=$sel_obj->display_rcd("product",$p_cond); if(is_array($p_qu) AND !empty($p_qu)) { foreach($p_qu as $p_da) { } } $offer_array = array( 'offer_discount_amount' => 0 , 'offer_name' => NULL, 'shipping_price' => $p_da['shipping_price'], 'packaging_price' => $p_da['packaging_price'] ); $total_amount = $p_da['d_price']*$qty; $offers = json_decode($p_da['offers'], true); if (!empty($offers)) { foreach ($offers as $offer) { if ($qty >= $offer['offer_qty']) { if ($offer['offer_discount_type']=="percent") { $offer_discount_amount = ($offer['offer_discount']*$total_amount)/100; } if ($offer['offer_discount_type']=="flat") { $offer_discount_amount = $offer['offer_discount']; } if ($offer['free_delivery']==1) { $shipping_price = 0; }else{ $shipping_price = $p_da['shipping_price']; } if ($offer['free_packaging']==1) { $packaging_price = 0; }else{ $packaging_price = $p_da['packaging_price']; } $offer_array = array( 'offer_discount_amount' => round($offer_discount_amount) , 'offer_name' => $offer['offer_title'], 'shipping_price' => $shipping_price, 'packaging_price' => $packaging_price ); } } return $offer_array; }else { $offer_array = array( 'offer_discount_amount' => 0 , 'offer_name' => NULL, 'shipping_price' => $p_da['shipping_price'], 'packaging_price' => $p_da['packaging_price'] ); return $offer_array; } } // $off_array = offers_discount(1050, 8); // print_r($off_array); // die(); /*====================================================*/ /*----- Back Url ----*/ if ($_SERVER['HTTP_REFERER']) { $back_url = $_SERVER['HTTP_REFERER']; } else{ $back_url = "#"; } ?> <div class="my_load"> <div id="full_load"> <!-- Header End --> <!-- Breadcrumb Area start --> <section class="breadcrumb-area"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="breadcrumb-content"> <h1 class="breadcrumb-hrading">Saved items</h1> <ul class="breadcrumb-links"> <li><a href="index.php">Home</a></li> <li><a href="<?php echo $back_url; ?>">Back</a></li> <li>Saved items</li> </ul> </div> </div> </div> </div> </section> <!-- Breadcrumb Area End --> <!-- cart area start --> <div class="cart-main-area mtb-60px"> <div class="container"> <div class="text-right"><b class="text-right"><a href="cart.php">Go to cart</a></b></div> </div> <?php if(isset($checksession) and !empty($checksession)) { $where_con="`user_id`="."'$checksession' AND `status`= 2"; $count = $sel_obj->all_count_row('temp_cart',$where_con); } else { $where_con="`temp_id`="."'$temp_session_id' AND `status`= 2"; $count = $sel_obj->all_count_row('temp_cart',$where_con); } if($count>=1) { ?> <div class="container"> <h3 class="cart-page-title">Your saved items</h3> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-12" > <form action="#"> <div class="table-content table-responsive cart-table-content"> <table class="table table-bordered"> <thead> <tr> <th>Image</th> <th>Product Name</th> <th style="padding:4px;">Unit Price</th> <th style="padding:4px;">Qty</th> <th>Subtotal</th> <th>GST</th> <th>total</th> <th style="padding:4px;">Weight</th> <th style="padding:4px!important;">Remove</th> <th style="padding:4px!important;">Move</th> </tr> </thead> <tbody> <?php if(isset($checksession) and !empty($checksession)) { $where_con="`user_id`="."'$checksession' AND `status`= 2"; $fetch_temp_cart = $sel_obj->display_rcd('temp_cart',$where_con); } else { $where_con="`temp_id`="."'$temp_session_id' AND `status`= 2"; $fetch_temp_cart = $sel_obj->display_rcd('temp_cart',$where_con); } if(is_array($fetch_temp_cart) || is_object($fetch_temp_cart)) { $total_gst = 0; $sub_total=""; $shipping_charge = 0; $packaging_charge = 0; foreach($fetch_temp_cart as $temp_items) { /*----Product Info ------*/ $p_id = $temp_items['p_id']; $get_product_condition="`p_id`="."'$p_id'"; $get_product_query=$sel_obj->display_rcd("product",$get_product_condition); foreach($get_product_query as $get_product) { } /*---- check Quantity -------*/ if ($get_product['quan_available']<1) { $where = array( 'id' => $temp_items['id'], 'status' => 2 ); $sel_obj->delete("temp_cart", $where); } if ($temp_items['quantity'] > intval($get_product['quan_available'])) { $quantity = intval($get_product['quan_available']); }else{ $quantity = $temp_items['quantity']; } /*----Update Cart Values ----*/ $check_data = array( 'id' => $temp_items['id'], ); $update_data = array( 'p_name' => $get_product['p_name'], 'p_code' => $get_product['p_code'], 'img' => $get_product['p_img'], 'price' => $get_product['price'], 'd_price' => $get_product['d_price'], 'gst' => $get_product['gst'], 'quantity' => $quantity, // 'shipping_price' => $get_product['shipping_price'], // 'packaging_price' => $get_product['packaging_price'] ); /*---------- Check Offer Discount -------------*/ $off_array = offers_discount($temp_items['p_id'], $quantity); $update_data['shipping_price'] = $off_array['shipping_price']; $update_data['packaging_price'] = $off_array['packaging_price']; $update_data['offer_discount'] = $off_array['offer_discount_amount']; $update_data['offer_name'] = $off_array['offer_name']; /*---------------------------------------------*/ $update_rating=$sel_obj->update('temp_cart', $update_data, $check_data); /*---------------------------*/ if($temp_items['d_price']!='') { $price=$temp_items['d_price']; } else { $price=$temp_items['price']; } $gst=str_replace("%"," ",$temp_items['gst']); ?> <tr> <td class="product-thumbnail"> <a href="product_details.php?p_id=<?php echo $temp_items['p_id'];?>"><img class="img-responsive" src="admin/upload/<?php echo $temp_items['img'];?>" alt="" /></a> </td> <td class="product-name"> <a href="product_details.php?p_id=<?php echo $temp_items['p_id'];?>"><?php echo $temp_items['p_name'];?></a> <input type="hidden" value="<?php echo $temp_items['p_id'];?>" id="p_id<?php echo $temp_items['id'];?>"> </td> <td class="product-price-cart3"> <span class="amount">₹<?php echo round($price, 2);?></span> </td> <script> $(document).ready(function(){ var aValue = $('#qtn<?php echo $temp_items['id'];?>').val(); if (aValue == 0) { $('#qtn<?php echo $temp_items['id'];?>').val('1'); } }); </script> <td class="product-quantity"> <div class="cart-plus-minus"> <?php echo $temp_items['quantity'];?> </div> </td> <td class="product-subtotal"> <?php $totalamount=($temp_items['quantity']*$price); echo "₹". round($totalamount,'2');?> </td> <td> <?php if ($gst!="") { echo $gst."%"; }else{ echo "0%"; } ?> </td> <td class="product-subtotal"> <?php $finalgst=$sel_obj->get_percentage($totalamount,$gst); $finaltotal=$finalgst+$totalamount; echo "₹". round($finaltotal,'2'); $total_gst+=$finalgst; $sub_total+=$totalamount; $packaging_charge += $temp_items['packaging_price']*$temp_items['quantity']; /*------ Offer DIscount ---------*/ $offer_discount += $temp_items['offer_discount']; /*---------------------------------*/ ?> </td> <td> <!-- ---- Weight ------- --> <?php $sum_weight = $get_product['weight']*$temp_items['quantity']; ?> <?php if($get_product['weight']!=0){ ?> <span ><?php echo round($sum_weight, 2);?>Kg</span> <?php } ?> <!-- --------------------- --> </td> <td class="product-remove"> <a href="javascript:;" style="color:#fff;" id="update<?php echo $temp_items['id'] ?>" data-id="<?php echo $temp_items['id'];?>" class="btn btn-primary btn-xs qtybuttonupdate d-none"><i class="fa fa-refresh" aria-hidden="true"></i> update</a> <a class="btn btn-danger btn-xs" style="color:#fff;" href="action.php?removesaveditem=<?php echo base64_encode($temp_items['id']);?>" onclick="return confirm('Do you want to delete..?');"><i class="fa fa-times"></i></a> </td> <td class=""> <a class="btn btn-primary btn-xs" style="color:#fff;" href="action.php?movetocart=<?php echo base64_encode($temp_items['id']);?>">Move to cart</a> </td> </tr> <script> $(document).ready(function(){ $("#qtn<?php echo $temp_items['id'];?>").change(function() { var aValue = $('#qtn<?php echo $temp_items['id'];?>').val(); if (aValue < 0 || aValue == 0) { $('#qtn<?php echo $temp_items['id'];?>').val('1'); } // alert("UDIT"); $("#update<?php echo $temp_items['id'] ?>").trigger('click'); }); /*----------- + Button ---------------*/ $("#qty_inc<?php echo $temp_items['id'] ?>").on("click", function() { var $button = $(this); var oldValue = $button.parent().find("input").val(); if ($button.text() === "+") { var newVal = parseFloat(oldValue) + 1; } else { // Don't allow decrementing below zero if (oldValue > 1) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 1; } } $button.parent().find("input").val(newVal); $("#update<?php echo $temp_items['id'] ?>").trigger('click'); }); /*----------- - Button ---------------*/ $("#qty_dec<?php echo $temp_items['id'] ?>").on("click", function() { var $button = $(this); var oldValue = $button.parent().find("input").val(); if ($button.text() === "+") { var newVal = parseFloat(oldValue) + 1; } else { // Don't allow decrementing below zero if (oldValue > 1) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 1; } } $button.parent().find("input").val(newVal); $("#update<?php echo $temp_items['id'] ?>").trigger('click'); }); /*-------------------------------------*/ }); </script> <?php $total_weight += $sum_weight; } } ?> </tbody> </table> </div> <div class="row"> <div class="col-lg-12"> <div class="cart-shiping-update-wrapper"> <div class="cart-shiping-update"> <a href="index.php" style="background: #0090f0; color: #fff;">Continue Shopping</a> </div> <div class="cart-clear"> </div> </div> </div> </div> </form> </div> </div> </div> <?php } else { ?> <div class="container"> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-12 text-center"> <h5 class="text-danger">No items saved for later</h5> </div> </div> </div> <?php } ?> </div> <!-- cart area end --> <!-- Footer Area start --> </div> </div> <?php include_once("footer.php");?>