<?php $this->load->view('admin/sidebar.php');?>
</div>
<div class="content-right">
<?php $this->load->view('admin/header.php');?>
<div class="main-content">
<div class="dash-block1">
<div class="row">
<div class="box box-primary direct-chat direct-chat-primary">
<!-- /.box-header -->
<div class="box-body">
<div class="col-md-12">
<h2>Customer Details</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>SNo </th>
<th>Name</th>
<th>Mobile</th>
<th>Email</th>
<th>Status</th>
<th>D.O.B.</th>
<th>Reg. Date</th>
</tr>
</thead>
<tbody>
<?php
$this->db->where('id',$user_id);
$query2 = $this->db->get('tb_user');
if($query2->num_rows()>0) {
foreach($query2->result() as $row2){ ?>
<tr>
<td>1 </td>
<td><?php echo $row2->first_name." ".$row2->last_name;?></td>
<td><?php echo $row2->mobile;?></td>
<td><?php echo $row2->email;?></td>
<td><?php
if($row2->status==0){ echo "Inactive"; }else { echo "Active";} ?></td>
<td><?php echo $row2->birthdate;?></td>
<td><?php echo $row2->created;?></td>
</tr>
<?php } }?>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-primary direct-chat direct-chat-primary">
<div class="box-body">
<h2>Address List</h2>
<div class="col-md-12">
<table class="table table-bordered" >
<thead>
<tr>
<th>SNo </th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
<th>Landmark</th>
<th>State</th>
<th>City</th>
<th>Pincode</th>
<th>GST No.</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<?php
$this->db->where('user_id',$user_id);
$query = $this->db->get('tb_delivery_address');
$tt=1;
if($query->num_rows()>0) {
foreach($query->result() as $row){ ?>
<tr>
<td><?php echo $tt++;?> </td>
<td><?php echo $row->full_name;?></td>
<td><?php echo $row->mobile;?></td>
<td><?php echo $row->address;?></td>
<td><?php echo $row->landmark;?></td>
<td><?php echo $row->state;?></td>
<td><?php echo $row->city;?></td>
<td><?php echo $row->pincode;?></td>
<td><?php echo $row->GSTNo;?></td>
<td><?php echo $row->type;?></td>
</tr>
<?php } }?>
</tbody>
</table>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/footer');?>
</div>
</div>
<div class="modal fade address-detail">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delivery Detail</h5>
<button class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<table id="data" class="TableStyle">
</table>
</div>
</div>
</div>
</div>
<!-- eyemodel Modal -->
<div class="modal" id="eyemodel">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Cancel Description</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<h5 id="cancel_desc_data"></h5>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/bootstrap.min.js')?>"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/select2.min.js')?>"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/custom.js')?>"></script>
<script src="<?=base_url('admin_assets/js/css3-animate-it.js')?>"></script>
<!--<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>-->
<!--<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>-->
<!--<script src="<?=base_url('admin_assets/js/tableHTMLExport.js')?>"></script>-->
<script type="text/javascript">
$(document).ready(function() {
// $(".table-bordered").wrapAll("<div class='table-responsive'></div>");
});
$(document).ready(function () {
$('#example').DataTable();
});
// $('#csv').on('click',function(){
// $("#example").tableHTMLExport({type:'csv',filename:'OrderReport.csv'});
// })
</script>
<script type="text/javascript">
$(".order_status").click(function() {
var con = confirm("Are you sure ");
var order_id=$(this).attr("id");
var status = $(this).closest("tr").find('select#status').val();
if(con==true){
$.ajax({
url:"<?=base_url('admin/order_status_changer')?>",
method:"post",
data:{"order_id_for_status":order_id,"status":status},
success: function(res){//for response
if(res==1){
alert("Sucess! Status Update Successfully");
}else if(res==0){
alert("Select Next Order Status");
return false;
}else if(res==2){
alert("No Cancel After Complete");
return false;
}
}
});
}else{
alert("Internal Problem");
return false;
}
});
$(".address-view").click(function(){
var order_id = $(this).attr("id");
if(order_id!=""){
$.ajax({
method:"post",
url:"<?=base_url('admin/view_order_address')?>",
data:{"order_id":order_id},
success:function(res){
$("#data").html(res);
}
})
}
})
$(function(){
$("#checkbox").click(function(){
if($('input:checkbox').prop('checked')){
$('input:checkbox').prop('checked',true);
} else{
$('input:checkbox').prop('checked',false);
}
});
});
$(".app").click(function(){
if (!$('.checkbox').is(':checked')) {
alert('not checked');
return false;
}else{
var values = new Array();
var bulkstatus = $("#bulkstatus").val();
$.each($("input[name='tablerecords[]']:checked"), function() {
var data = $(this).parents('tr:eq(0)');
var status = $(this).closest("tr").find('select#status').val();
/*values.push({ 'callphone':$(data).find('td:eq(0)').text(), 'rating':$(data).find('td:eq(2)').text() , 'location':$(data).find('td:eq(3)').text()}); */
values.push({'callphone':$(this).val(),'mult_status':status});
});
$.ajax({
method:"POST",
url:"<?=base_url('admin/bulk_order_status_changer')?>",
data:{"data":values,"bulkstatus":bulkstatus},
success:function(res){
//$(".reload_block").html(res);
alert(res);
}
});
}
//console.log(values);
});
$(document).ready(function() {
$('.js-example-basic-multiple').select2();
});
$("#pincode_filter").change(function(){
var pincode = $(this).val();
$(".data").html("");
if(pincode!=""){
$.ajax({
type:"post",
data:{"pincode":pincode},
url:"pincode_filter_ajax",
success:function(res){
$(".data").html(res);
}
})
}
})
$("#city_filter").change(function(){
var city = $(this).val();
$(".data").html("");
if(city!=""){
$.ajax({
type:"post",
data:{"city":city},
url:"pincode_filter_ajax",
success:function(res){
$(".data").html(res);
}
})
}
})
$("#state_filter").change(function(){
var state = $(this).val();
$(".data").html("");
if(state!=""){
$.ajax({
type:"post",
data:{"state":state},
url:"pincode_filter_ajax",
success:function(res){
$(".data").html(res);
}
})
}
})
$(".eyemodel").click(function(){
var desc = $(this).data("desc");
if(desc==""){
$("#cancel_desc_data").text("No Cancel Description");
}else{
$("#cancel_desc_data").text(desc);
}
})
</script>
</body>
</html>