<?php include 'include/header.php';?>

    <body class="fixed-left">

        <!-- Begin page -->
        <div id="wrapper">
        
       <?php include 'include/side_menu.php';
$this->db->order_by("id", "asc");


?>


            <div class="content-page">           
            <div class="loading"></div>

                <!-- Start content -->
                <div class="content">
                    <div class="container">

                        <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="pull-left page-title" >Welcome</h4>&nbsp;	&nbsp;	
      <a href="<?=base_url('admin/view_page/add_banner');?>">
                             <ol class="breadcrumb pull-right">
  <li><a href="<?=base_url('admin/view_page/dashboard');?>"><?php $fetch_app_name = $this->admin_common_model->get_where('admin',['id'=>'1']);
                                echo $fetch_app_name[0]['app_name']; ?></a></li>                             
                                
                                </ol>
                            </div>
                        </div>

                        <!-- Start Widget -->
                
<div class="row">
                            <div class="col-md-12">
                                <div class="panel panel-default">
                                    
                                    
                                    
                                    <div class="panel-body">
                                        
                                        
                                    
                                        
                               
<body class="hold-transition skin-blue sidebar-mini" id="" ng-app="myApp">

<div class="wrapper" >
<?php include 'include/header.php';
            $this->db->order_by('id','ASC');


?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    
    <!-- Main content -->
    <section class="content">
    
<div class="pageheader notab">
            <h1 class="pagetitle">item XLSX File   <a href="<?=base_url('admin/view_page/lots_list');?>"><button type="button" class=" btn  btn-info-add btn-md mt-10 ml10" > Back </button></a></h1>
              

        </div>





<div class="box box-info">
            
<div id="contentwrapper" class="contentwrapper" style="background: #ffffff;padding: 15px;">
            <p class="res-msg">
                            <?php if($this->session->flashdata('msg')){echo $this->session->flashdata('msg');} ?>
                            <span style="float: right; text-align: center; padding: 5px; border-radius: 5px; background: #30a5ff;"><a href="<?= base_url('lots.xlsx') ?>" style="color:#fff">Download Sample File</a></span>
           </p>
            
            
            
            
          
         <div class="subcontent">         




            <br><br>
            
         

       <form class="form-inline" method="POST" enctype="multipart/form-data" action="<?= base_url('admin/upload_user') ?>" >

   
   
                                            <div class="form-group">
                                                <label>Lot Number *</label>
                                                <input type="text" class="form-control" name="lot_id" required value="<?=$row['lot_id'];?>">
                                            </div>
         

                                               <div class="form-group">
                                                <label>Warranty (in month) *</label>
                                                <input type="number" class="form-control" name="warranty_month" required value="<?=$row['warranty_month'];?>">
                                            </div>
                                            
                      <br><br>


  <div class="form-group">
    <label for="exampleInputName2" style="padding-left: 100px;">Upload XLSX file</label>
    <input required type="file" name="user_file" class="form-control" id="exampleInputName2">
  </div>

<div class="" style="margin-top: 18px;
    margin-left: 10%;">
 <button class="submit radius2" type="upload" style='    border: 1px solid #f0882c;
    background: #fb9337;
    color: #fff;
    cursor: pointer;
    padding: 2px 24px;
    font-weight: bold;'>Upload File</button>
</div>
 
</form>


              

            </div><!--subcontent-->
          
          
               
    </div>
            
</div>


    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->


</div>
<!-- ./wrapper -->



 </body>
                                    </div>
                                </div>
                            </div>
                            
                        </div> <!-- End Row -->

                    </div> <!-- container -->
                               
                </div> <!-- content -->

             
            </div>
          
        </div>
        <!-- END wrapper -->
        
        
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        
<script>
$('select').change(function () { 
       //for open loader gif
       $(document).on({
         ajaxStart: function() { $(".loading").show(); },
         ajaxStop: function() { $(".loading").hide(); }    
       });

       var getId = $(this).attr('getId');
       var available_status = $(this).val();
    // alert(getId);
        url = "<?php echo base_url().'admin/upt_driver_stts'?>"; 
                $.ajax({
                  type:"POST",
                  url: url, 
                  data: {"id":getId,"available_status":available_status}, 
                  success: function(data) { 
                     
                  location.reload();
            } });

    }); 

</script>


      
<script>
$('select').change(function () { 
       //for open loader gif
       $(document).on({
         ajaxStart: function() { $(".loading").show(); },
         ajaxStop: function() { $(".loading").hide(); }    
       });

       var getId1 = $(this).attr('getId1');
       var status = $(this).val();
    // alert(getId);
        url = "<?php echo base_url().'admin/update_category_status'?>"; 
                $.ajax({
                  type:"POST",
                  url: url, 
                  data: {"id":getId1,"status":status}, 
                  success: function(data) { 
                     
                  location.reload();
            } });

    }); 

</script>


<script>
// delete function
function deleteUsers(id)
{
  swal({
  title: "Are you sure?",
  text: "You want to permanently remove this item!",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "Yes, delete it!",
  closeOnConfirm: false
},
function(){



        $.ajax({
          url: "<?=base_url('admin/delete_data');?>",
          data: {'table': 'banner', 'id': id}, // change this to send js object
          type: "POST",
          success: function(result){
            //alert(result);
            swal("Deleted!", "Your selected item has been deleted.", "success");
  
            $('.confirm').click(function(){
               location.reload();
            });
             

          }
        });

  

});

} 
// end delete function

</script>


 <?php include 'include/footer.php';?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>



<script>
     $(document).ready(function(){
        $.fn.dataTable.ext.search.push(
        function (settings, data, dataIndex) {
            var min = $('#min').datepicker("getDate");
            var max = $('#max').datepicker("getDate");
            var startDate = new Date(data[4]);
            if (min == null && max == null) { return true; }
            if (min == null && startDate <= max) { return true;}
            if(max == null && startDate >= min) {return true;}
            if (startDate <= max && startDate >= min) { return true; }
            return false;
        }
        );

       
            $("#min").datepicker({ dateFormat: 'dd-mm-yy' },{ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
            $("#max").datepicker({ dateFormat: 'dd-mm-yy' },{ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
            var table = $('#datatable').DataTable({
                "ordering": false,
                "overflow": false,
                "scrollX": true
            });


                       // var table = $('#datatable').DataTable();

            // Event listener to the two range filtering inputs to redraw on input
            $('#min, #max').change(function () {
                table.draw();
            });
        });
</script>


