Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: view_order.php
<style> .page-title { padding: 2rem 0 !important;} .onoffswitch { position: relative; width: 56px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; } .onoffswitch-checkbox { display: none; } .onoffswitch-label { display: block; overflow: d-none; cursor: pointer; border: 2px solid #FFFFFF; border-radius: 20px; } .onoffswitch-inner { display: block; width: 200%; margin-left: -100%; transition: margin 0.3s ease-in 0s; } .onoffswitch-inner:before, .onoffswitch-inner:after { display: block; float: left; width: 50%; height: 22px; padding: 0; line-height: 22px; font-size: 12px; color: black; font-family: Trebuchet, Arial, sans-serif; font-weight: bold; box-sizing: border-box; } .onoffswitch-inner:before { content: "ON"; padding-left: 0; background-color: #26a69a; color: #FFFFFF; } .onoffswitch-inner:after { content: "OFF"; padding-right: 6px; background-color: rgb(38 50 56); color: #FFFFFF; text-align: right; } .onoffswitch-switch { display: block; width: 12px; margin: 5px; background: #FFFFFF; position: absolute; top: 0; bottom: 0; right: 30px; border: 2px solid #FFFFFF; border-radius: 20px; transition: all 0.3s ease-in 0s; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { margin-left: 0; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { right: 0px; } </style> <?php define('APP_CURRENCY', $this->db->get_where('tbl_gf_ecomm_settings', array('id' => '1'))->row()->app_currency_code); define('CURRENCY_CODE', getusercurrencyforadmin($order_data[0]->user_id)); ?> <!-- Page header --> <div class="page-header border-bottom-0 mt-3 service_top_links ml-2"></div> <div class="page-header border-bottom-0 services_header"> <div class="page-header-content header-elements-md-inline"> <div class="page-title d-flex"> <h4><a href="javascript:void(0)" class="BackButton-Link" onclick="goBack()"><i class="icon-arrow-left52 mr-2"></i></a> <?=$current_page?></h4> </div> </div> </div> <!-- /page header --> <!-- Content area --> <div class="content pt-0"> <div class="card"> <div class="card-body CollapsedCardBody" style="display: block;"> <div class="row"> <div class="col-xl-12"> <div class="form-group row"> <div class="col-md-12 col-12 text-right"> <div class="search_list"> <div class="add_btn_primary"> <?php if($order_data[0]->complain_type == 1){ echo '<span class="btn btn-warning" style="margin-right: 10px;">Pending Complain</span>'; } if($order_data[0]->complain_type == 2){ echo '<span class="btn btn-primary" style="margin-right: 10px;">In-process Complain </span>'; } if($order_data[0]->complain_type == 3){ echo '<span class="btn btn-green" style="margin-right: 10px;">Resolved Complain</span>'; } ?> <?php echo ($order_data[0]->is_duplicate == 1 ? '<span class="btn btn-danger" style="margin-right: 10px;">Duplicate Order</span>' : ''); ?> </div> <div class="add_btn_primary"><a href="<?php echo ($order_data[0]->order_status!=5) ? base_url($this->config->item('apanel_name')."/ecomm/orders/print/".$order_data[0]->order_unique_id) : 'javascript:void(0)';?>" class="btn btn-success" <?php echo ($order_data[0]->order_status!=5) ? 'target="_blank"' : 'disabled' ?>><i class="fa fa-print"></i> Print</a> </div> </div> </div> <div class="col-md-4 col-12"> <h4 style="margin-top:0px;font-weight: 600;margin-bottom: 15px">Order Details</h4> <div style="font-size: 14px"> <strong style="font-weight: 500;color: #575757">Order ID</strong>: <?=$order_data[0]->id?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Order Date:</strong> <?php echo date('d-m-Y h:i A',$order_data[0]->order_date);?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Payable Amount:</strong> <?php echo CURRENCY_CODE.' '.$order_data[0]->new_payable_amt;?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Order Status:</strong> <?php switch ($order_data[0]->order_status) { case '-1': echo '<span style="color:darkgray;font-size:14px">Order Placed</span>'; break; case '1': echo '<span style="color:orange;font-size:14px">'.get_status_title($order_data[0]->order_status).'</span>'; break; case '2': echo '<span style="color:orange;font-size:14px">'.get_status_title($order_data[0]->order_status).'</span>'; break; case '3': echo '<span style="color:orange;font-size:14px">'.get_status_title($order_data[0]->order_status).'</span>'; break; case '4': echo '<span style="color:green;font-size:14px">'.get_status_title($order_data[0]->order_status).'</span>'; break; default: echo '<span style="color:red;font-size:14px">'.get_status_title($order_data[0]->order_status).'</span>'; break; } ?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Payment Status: </strong> <?php switch ($order_data[0]->payment_status) { case '1': echo '<span style="color:red;font-size:14px">Unpaid</span>'; break; case '2': echo '<span style="color:green;font-size:14px">Paid</span>'; break; case '3': echo '<span style="color:red;font-size:14px">Cancel</span>'; break; case '4': echo '<span style="color:green;font-size:14px">Refunded</span>'; break; case '5': echo '<span style="color:blue;font-size:14px">Review</span>'; break; } ?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Payment Method: </strong> <?php echo $order_data[0]->payment_method ?: 'Cash on Delivery';?> </div> </div> <div class="col-md-4 col-12"> <h4 style="margin-top:0px;font-weight: 600;margin-bottom: 15px">Billing Details</h4> <div style="font-size: 14px"> <strong style="font-weight: 500;color: #575757">Name:</strong> <?php echo $users_name;?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Phone:</strong> <?php echo $user_contact;?> </div> <div style="font-size: 14px;margin-top: 5px"> <?php //print_r($this->Ecomm_model->selectByidParam($order_data[0]->user_id, 'tbl_gf_users','UserName')); ?> <br> <strong style="font-weight: 500;color: #575757">Address:</strong><br> <?php if(!empty($address_arr_1->building_name)){echo $address_arr_1->building_name.', ';} if(!empty($address_arr_1->road_area_colony)){echo $address_arr_1->road_area_colony.', <br/>';} if(!empty($address_arr_1->city)){echo $address_arr_1->city.', ';} if(!empty($address_arr_1->district)){echo $address_arr_1->district.', ';} if(!empty($address_arr_1->state)){echo $address_arr_1->state.', ';} if(!empty($address_arr_1->pincode)){echo $address_arr_1->pincode.', ';} ?> </div> </div> <div class="col-md-4 col-12"> <h4 style="margin-top:0px;font-weight: 600;margin-bottom: 15px">Shipping Details</h4> <div style="font-size: 14px"> <strong style="font-weight: 500;color: #575757">Name:</strong> <?php echo $users_name;?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Phone:</strong> <?php echo $user_contact;?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Address:</strong><br> <?php if(!empty($address_arr_1->building_name)){echo $address_arr_1->building_name.', ';} if(!empty($address_arr_1->road_area_colony)){echo $address_arr_1->road_area_colony.', <br/>';} if(!empty($address_arr_1->city)){echo $address_arr_1->city.', ';} if(!empty($address_arr_1->district)){echo $address_arr_1->district.', ';} if(!empty($address_arr_1->state)){echo $address_arr_1->state.', ';} if(!empty($address_arr_1->pincode)){echo $address_arr_1->pincode.', ';} ?> </div> </div> </div> <br/> <?php if($this->session->flashdata('response_msg')) { $message = $this->session->flashdata('response_msg'); ?> <div class="<?=$message['class']?> alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <?=$message['message']?> </div> <?php } ?> </div> </div> </div> </div> <div class="card"> <div class="row"> <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> <div class="col-md-12 clearfix"> <div class="add_btn_primary mt-3"><a href="javascript:void(0)" class="btn btn-success pull-right" data-toggle="modal" data-target="#addProduct"><i class="fa fa-plus"></i> Add Product</a> </div> </div> <?php if($order_data[0]->tracking_id != null){ ?> <div class="col-md-12 clearfix" style="margin-top: 1.5em; padding-bottom: 10px"> <span style="color: #ff0000;">This Product Has Been Booked. Tracking ID : <?php echo $order_data[0]->tracking_id?></span> </div> <?php } ?> <form action="<?php echo base_url($this->config->item('apanel_name').'/ecomm/orders/updateOrder');?>" method="post" class="form form-horizontal" enctype="multipart/form-data"> <input type="hidden" name="order_unique_id" value="<?php echo $order_data[0]->order_unique_id; ?>"> <input type="hidden" name="order_id" value="<?php echo $order_data[0]->id; ?>"> <div class="card-body"> <div class="form-group row"> <div class="clearfix"></div> <div class="col-lg-12"> <div class="table-responsive"> <table class="table table-striped table-bordered table-advance table-hover" width="100%"> <thead> <tr class="top_bdr"> <td class="rank_item text-center bdr_left bdr_right"></td> <td class="bdr_right" width="300px"><strong>Product</strong></td> <td class="text-center bdr_right"><strong>Quantity</strong></td> <td class="text-center bdr_right"><strong>SKU</strong></td> <!-- <td class="text-center bdr_right"><strong>Variations</strong></td> --> <td class="text-center bdr_right"><strong>Price</strong></td> <td class="text-center bdr_right"><strong>Total Price</strong></td> <!-- <td class="text-center bdr_right" width="100px"><strong>Status</strong></td> --><!-- <td class="text-center bdr_right"><strong>Update</strong></td> --> </tr> </thead> <tbody> <?php define('IMG_PATH', base_url().'uplds1/ecomm/images/products/'); $items_arr=$this->Ecomm_model->selectByids(array('order_id' => $order_data[0]->id), 'tbl_gf_ecomm_order_items'); $user_cart = $this->Ecomm_model->get_order_var($order_data[0]->user_id,$order_data[0]->id); $_total_amt=$_total_price=$_total_qty=$finalTotal=0; $i = 0; foreach ($items_arr as $key => $val) { $finalTotal+=$val->total_price; $_total_price+=$val->total_price; $product_details = ''; $product_details = $this->Ecomm_model->selectByid($val->product_id,'tbl_gf_ecomm_product'); ?> <tr> <td class="thick-line bdr_left"> <img src="<?=IMG_PATH.$this->Ecomm_model->selectByidParam($val->product_id, 'tbl_gf_ecomm_product','featured_image')?>" style="height: 60px;width: 60px;border: 2px solid #ddd"/> </td> <td class="thick-line bdr_left"><?=$val->product_title?></td> <td class="thick-line text-center bdr_left"> <input type="number" class="form-control" value="<?php echo $val->product_qty;?>" name="quantity[]"/> <input type="hidden" class="form-control" value="<?php echo $val->id;?>" name="record_ids[]"/> <input type="hidden" class="form-control" value="<?php echo $val->product_id;?>" name="products_ids[]"/> </td> <!--<td class="thick-line text-center bdr_left"> <?php /* $htmlSizes = ''; if(isset($product_details->product_size) && $product_details->product_size != ''){ $firstProductSize = $product_details->product_size; $sizes = explode(',',$firstProductSize); $htmlSizes.='<select name="sizes_ids[]" id="sizes_ids" class="select2 form-control">'; foreach($sizes AS $singleSize) { if($singleSize){ $selected = ''; if($val->product_size == $singleSize){ $selected = 'selected=selected'; } $htmlSizes.= '<option '.$selected.' value="'.$singleSize.'">'.$singleSize.'</option>'; } } $htmlSizes.= '</select>'; } else{ $htmlSizes.='<input type="hidden" name="sizes_ids[]" id="sizes_ids" value="0">'; } echo $htmlSizes; */?> </td>--> <td class="thick-line bdr_left"><?=$product_details->product_sku?></td> <!-- <td class="thick-line text-center bdr_left"> <?php if($user_cart[$key]->variation_one) { echo $user_cart[$key]->variation_one . ': ' . $user_cart[$key]->variation_one_value . '<br>'; } ?> <?php if($user_cart[$key]->variation_two) { echo $user_cart[$key]->variation_two . ': ' . $user_cart[$key]->variation_two_value . '<br>'; } ?> <?php if($user_cart[$key]->variation_three) { echo $user_cart[$key]->variation_three . ': ' . $user_cart[$key]->variation_three_value . '<br>'; } ?> </td> --> <td class="text-center thick-line"><?=CURRENCY_CODE.' '.($val->product_price* get_USER_CURRENCY_RATE($order_data[0]->user_id))?></td> <td class="text-center thick-line"><?=CURRENCY_CODE.' '.($val->total_price* get_USER_CURRENCY_RATE($order_data[0]->user_id))?></td> <!-- <td class="text-center thick-line"> <?php switch ($val->pro_order_status) { case '1': echo '<span style="color:orange;font-size:14px">'.get_status_title($val->pro_order_status).'</span>'; break; case '2': echo '<span style="color:orange;font-size:14px">'.get_status_title($val->pro_order_status).'</span>'; break; case '3': echo '<span style="color:orange;font-size:14px">'.get_status_title($val->pro_order_status).'</span>'; break; case '4': echo '<span style="color:green;font-size:14px">'.get_status_title($val->pro_order_status).'</span>'; break; default: echo '<span style="color:red;font-size:14px">'.get_status_title($val->pro_order_status).'</span>'; $_total_price-=$val->total_price; break; } ?> </td> --> <!-- <td> <a href="" class="btn btn-primary btn_edit btn_status" data-toggle="tooltip" data-order="<?=$val->order_id?>" data-product="<?=$val->product_id?>" data-tooltip="Update Status"><i class="fa fa-wrench"></i></a> </td> --> </tr> <?php } ?> <tr> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line text-right bdr_left"><strong>Total</strong></td> <td class="text-center thick-line" style="font-weight: 600"><?=CURRENCY_CODE.' '.($finalTotal*get_USER_CURRENCY_RATE($order_data[0]->user_id))?></td> </tr> <tr> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line text-right bdr_left"><strong>Discount Amount</strong></td> <td class="text-center thick-line" style="font-weight: 600"><?=CURRENCY_CODE.' '.$order_data[0]->discount_amt?></td> </tr> <tr> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line text-right bdr_left"><strong>Delivery Charge</strong></td> <?php echo $total_cart_amt; ?> <?php if($settings_row->delivery_field == 1){ ?> <td class="text-center thick-line" style="font-weight: 600"><span><?=$order_data[0]->delivery_charge ? '+ '.$order_data[0]->delivery_charge : 'Free';?></span></td> <?php } else if($settings_row->delivery_field == 0){ if(($finalTotal-$order_data[0]->delivery_charge) <= $settings_row->cart_amount_for_free_delivery){ ?> <td class="text-center thick-line" style="font-weight: 600"><span><?=($settings_row->default_delivery_charges!=0)?'+'.CURRENCY_CODE.' '.Currency_Formator($settings_row->default_delivery_charges):'Free';?></span></td> <?php }else{ ?> <td class="text-center thick-line" style="font-weight: 600"><span><?=$order_data[0]->delivery_charge ? '+ '.$order_data[0]->delivery_charge : 'Free';?></span></td> <?php } } ?> </tr> <tr> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line bdr_left"></td> <td class="thick-line text-right bdr_left"><strong>Payable Amount</strong></td> <td class="text-center thick-line" style="font-weight: 600"><?=CURRENCY_CODE?> <?php echo $order_data[0]->new_payable_amt ? ($order_data[0]->new_payable_amt+$order_data[0]->delivery_charge) : ($finalTotal+$order_data[0]->delivery_charge) ?></td> </tr> </tbody> </table> <?php if($order_data[0]->order_status!=5){ ?> <div class="add_btn_primary pull-right"><input type="submit" class="btn btn-success pull-right" value="Update Order"></div> <?php } ?> </div> </div> </div> <?php if(!empty($links)){ ?> <div class="form-group row"> <div class="col-12"> <div class="pagination_item_block"> <nav> <?php echo $links; ?> </nav> </div> </div> </div> <?php } ?> </div> </form> </div> </div> </div> </div> <div id="orderStatus" class="modal fade" role="dialog" style=""> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header d-block"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-titl">Update Order Status</h4> </div> <div class="modal-body" style="padding-top: 0px"> </div> </div> </div> </div> <div class="modal" id="addProduct" tabindex="-1" role="dialog"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <form action="<?php echo base_url($this->config->item('apanel_name').'/ecomm/orders/addOrderProduct').get_query_string();?>" method="post" class="form form-horizontal" enctype="multipart/form-data"> <div class="modal-header"> <h4 class="modal-title">Add New Product in Order</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="form-group mt-20"> <div class="input_fields_wrap clearfix"> <div class="clearfix"> <input type="hidden" name="order_id_single" value="<?php echo $order_data[0]->id; ?>"> <label class="col-md-2 control-label">Product :-</label> <div class="col-md-6 select2Custom"> <select name="product_id_single" id="product_id_single" class="select2 form-control product_id"> <?php $products= get_products(); $firstProductSize = 0; $j = 0; foreach ($products AS $key => $value) { if($j == 0){ if($value->product_size != ''){ $firstProductSize = $value->product_size; } } ?> <option value="<?php echo $value->id;?>"><?php echo stripslashes($value->product_title);?> </option> <?php $j++; } ?> </select> </div> <div class="col-md-2"> <input type="number" placeholder="Quantity" id="quantity_single" name="quantity_single" value="1" class="form-control" value=""> </div> <div class="col-md-2 sizesChartViewProduct"> <?php $htmlSizes = ''; if($firstProductSize){ $sizes = explode(',',$firstProductSize); $htmlSizes.='<select name="size_single" id="size_single" class="select2 form-control">'; foreach($sizes AS $singleSize) { $singleSize = cleanText($singleSize); $htmlSizes.= '<option value="'.$singleSize.'">'.$singleSize.'</option>'; } $htmlSizes.= '</select>'; } else{ $htmlSizes.='<input type="hidden" name="size_single" id="size_single" value="0">'; } echo $htmlSizes; ?> </div> </div> </div> <div class="clearfix"></div> </div> <div class="clearfix"></div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary">Add Product</button> </div> </div> </form> </div> </div> <script type="text/javascript"> $(".btn_status").click(function(e){ e.preventDefault(); $("#orderStatus").modal("show"); var _id=$(this).data("order"); var _product_id=$(this).data("product"); var href='<?= base_url($this->config->item('apanel_name').'/ecomm/orders/order_status_form');?>/'+_id+'/'+_product_id; $("#orderStatus .modal-body").load(href); }); $("#status_form").submit(function (e) { e.preventDefault(); var _btn=$(this).find(".btn_save"); _btn.attr("disabled", true); href = $(this).attr("action"); $(this).find("button[name='btn_submit']").text("Please wait..."); var data = new FormData($(this)[0]); $.ajax({ url:href, data: data, processData: false, contentType: false, type:'post', success:function(res){ //alert(res); _btn.attr("disabled", false); if($.trim(res)=='true'){ alert('Order status is successfully updated...'); location.reload(); }else{ alert("Oops ! there is error in updating status..."); } }, error : function(res) { alert("error"); } }); }); $(document).on('click','.addNote',function(){ $('.addNote').prop('disabled', true); //var product = $(this); var note=$('#note').val(); if(note){ var order_id=$('#order_id_hidden').val(); $.ajax ({ type: "POST", url: '<?php echo base_url($this->config->item('apanel_name')."/ecomm/orders/addNote"); ?>', data: {note: note,order_id: order_id}, success: function(response) { $('.addNote').prop('disabled', false); $('#note').val(''); var json = jQuery.parseJSON(response); //var json = jQuery.parseJSON(response); $('.success_notes').html(json.message); $(".timeline_notes").find('li:last').after(json.note); setTimeout(function(){ $('.success_notes').fadeOut('slow'); }, 3000); } }); } else{ alert('Please write comment.') } }); $(document).on('click','.addComment',function(){ $('.addComment').prop('disabled', true); var comment=$('#comment').val(); if(comment){ var order_id=$('#order_id_hidden').val(); $.ajax ({ type: "POST", url: '<?php echo base_url($this->config->item('apanel_name')."/ecomm/orders/addComment"); ?>', data: {comment: comment,order_id: order_id}, success: function(response) { $('.addComment').prop('disabled', false); $('#comment').val(''); var json = jQuery.parseJSON(response); //var json = jQuery.parseJSON(response); $('.success_comments').html(json.message); $(".timeline_feedback").find('li:last').after(json.feedback); setTimeout(function(){ $('.success_comments').fadeOut('slow'); }, 3000); } }); } else{ alert('Please write comment.') } }); $(document).on('change','#complain_status',function(){ var complain_status = $('#complain_status').val(); if(complain_status){ var order_id=$('#order_id_hidden').val(); $.ajax ({ type: "POST", url: '<?php echo base_url($this->config->item('apanel_name')."/ecomm/orders/complainStatusChange"); ?>', data: {complain_status: complain_status,order_id: order_id}, success: function(response) { var json = jQuery.parseJSON(response); $('.success_complain').html(json.message); setTimeout(function(){ $('.success_complain').html(''); }, 3000); } }); } }); $('#trax_radio').on("click",function(e){ if($(this).is(":checked")){ $(".trax").show(); $(".call_courier").hide(); $('[name="action_for"]').val('trax'); } }); $('#callcourier_radio').on("click",function(e){ if($(this).is(":checked")){ $(".call_courier").show(); $(".trax").hide(); } }); </script>