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 $CI =& get_instance(); $CI->load->model('Ecomm_model'); $settings_row = $CI->Ecomm_model->get_settings(); //define('APP_CURRENCY', $this->db->get_where('tbl_gf_ecomm_settings', array('id' => '1'))->row()->app_currency_code); define('CURRENCY_CODE', getusercurrency2()); //d($order_data); ?> <!-- 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"> <?php $j = 0 ; foreach ($order_data->result() as $value){ ?> <div class="card"> <div class="card-body CollapsedCardBody" style="display: block;"> <div class="row"> <div class="col-xl-12"> <div class="form-group row"> <h4 style="margin-top:0px;font-weight: 600;margin-bottom: 15px">Order Details</h4> <div class="col-md-12 col-12 text-right"> <!-- <div class="search_list"> <div class="add_btn_primary"><a href="<?php //echo ($value->order_status!=5) ? base_url($this->config->item('apanel_name')."/ecomm/orders/print/".$value->order_unique_id) : 'javascript:void(0)';?>" class="btn btn-success" <?php //echo ($value->order_status!=5) ? 'target="_blank"' : 'disabled' ?>><i class="fa fa-print"></i> Print</a> </div> </div> --> </div> <div class="col-md-6 col-12"> <div style="font-size: 14px"> <strong style="font-weight: 500;color: #575757">Order ID</strong>: <?=$value->id?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Order Status:</strong> <?php switch ($value->order_status) { case '1': echo '<span style="color:orange;font-size:14px">Order Placed</span>'; break; case '2': echo '<span style="color:orange;font-size:14px">InProcess</span>'; break; case '3': echo '<span style="color:orange;font-size:14px">Shipped</span>'; break; case '4': echo '<span style="color:green;font-size:14px">Completed</span>'; break; case '5': echo '<span style="color:red;font-size:14px">Rejected</span>'; break; case '6': echo '<span style="color:red;font-size:14px">Cancelled</span>'; break; } ?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Payment Status:</strong> <?php switch ($value->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> <div class="col-md-6 col-12"> <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',$value->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 . ' '; if(!empty($value->new_payable_amt)){echo ($value->new_payable_amt+$value->delivery_charge);}else{echo ($value->payable_amt+$value->delivery_charge);} ?> </div> <!--<div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Tracking History:</strong> <?php /*for($i=0; $i<= count($status); $i++){ if($status[$j][0]->order_id == $value->id){ $title = array(); foreach($status[$j] as $key => $val){ $title[$key] = $val->title; } print_r(implode(', ' , $title)); break; } }*/ ?> </div>--> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Tracking Details:</strong> <?php echo ($value->tracking_data);?> </div> </div> <!--<div class="col-md-12 col-12"> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Tracking Details:</strong> <?php //echo ($value->tracking_data);?> </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 $value->building_name;?> </div> <div style="font-size: 14px;margin-top: 5px"> <strong style="font-weight: 500;color: #575757">Phone:</strong> <?php echo $value->mobile_no;?> </div> <div style="font-size: 14px;margin-top: 5px"> <?php //print_r($this->Ecomm_model->selectByidParam($value->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"> <?php if($value->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 $value->tracking_id?></span> </div> <?php } ?> <input type="hidden" name="order_unique_id" value="<?php echo $value->order_unique_id; ?>"> <input type="hidden" name="order_id" value="<?php echo $value->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().'uplds'.$rowSettings->Theme.'/ecomm/images/products/'); $items_arr=$CI->Ecomm_model->selectByids(array('order_id' => $value->id), 'tbl_gf_ecomm_order_items'); $user_cart = $CI->Ecomm_model->get_order_var($value->user_id,$value->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 = $CI->Ecomm_model->selectByid($val->product_id,'tbl_gf_ecomm_product'); ?> <tr> <td class="thick-line bdr_left"> <img src="<?=IMG_PATH.$CI->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"> <?php echo $val->product_qty;?> <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?></td> <td class="text-center thick-line"><?=CURRENCY_CODE.' '.$val->total_price?></td> <!-- <td class="text-center thick-line"> <?php switch ($value->order_status) { case '1': echo '<span style="color:orange;font-size:14px">Order Placed</span>'; break; case '2': echo '<span style="color:orange;font-size:14px">InProcess</span>'; break; case '3': echo '<span style="color:orange;font-size:14px">Shipped</span>'; break; case '4': echo '<span style="color:green;font-size:14px">Completed</span>'; break; case '5': echo '<span style="color:red;font-size:14px">Rejected</span>'; break; case '6': echo '<span style="color:red;font-size:14px">Cancelled</span>'; 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?></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.' '.$value->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><?=$value->delivery_charge ? '+ '.$value->delivery_charge : 'Free';?></span></td> <?php } else if($settings_row->delivery_field == 0){ if(($finalTotal-$value->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><?=$value->delivery_charge ? '+ '.$value->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> <?php $f_total = $value->new_payable_amt ?: $finalTotal;?> <td class="text-center thick-line" style="font-weight: 600"><?=CURRENCY_CODE.' '.($f_total+$value->delivery_charge) ?></td> </tr> </tbody> </table> </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> </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> <?php $j++; } ?> </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>