                <style>
.content{position: relative;}
.overlay{position: absolute;left: 0; top: 0; right: 0; bottom: 0;z-index: 2;background-color: rgba(255,255,255,0.8);position: fixed;   overflow-y: scroll;}
.overlay-content {
    position: absolute;
    transform: translateY(-50%);
     -webkit-transform: translateY(-50%);
     -ms-transform: translateY(-50%);
    top: 50%;
    left: 15%;
    right: 0;
    text-align: center;
    color: #555; 
    position: fixed; 
   overflow-y: scroll;
}

</style>  

<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/lib/chosen/chosen.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery-datepicker.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css">   
                                                                
    
  
                <div class="content">
            <div class="animated fadeIn">
       <div class="overlay" style="display:block" id="load"><div class="overlay-content"><img src="<?php echo base_url(); ?>assets/images/loader.gif" alt="Loading..." style="width: 60px;"/></div></div>       

                 <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Item Summery</strong>
                            </div>
                            <div class="card-body">
                               <div class="row">
                           <?php echo validation_errors(); ?>
           
                   <div class="container">
                       
                         <form id="frm1" action="<?php echo site_url('allitem_detail_pdf');?>" method="post" target="_blank">
                        <div class="row">

                                                      <div class="col-sm-4">  
                                                       Item
                                                        <select class="standardSelect form-control" id="aitem" data-placeholder="Choose a cat..." name="aitem">
							<option value="0"> Select Item</option>
                                                                                                                  
                                                        </select>                          
                                                    </div>
                                                    
                                                       <div class="col-sm-2">  
                                                       Depot
                                                        <select class="standardSelect form-control" id="adop" data-placeholder="Choose a cat..." name="adop">
							<option value="0"> Select Depot</option>
                                                         <?php 
                                                         foreach ($dop as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->dep_id; ?>"><?php echo $itm->dep_name?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                
                          
                                    <div class="col-sm-2">  
                                                       From Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="afrm_date" id="afrm_date">                         
                                                    </div>
                                                    
                                                    <div class="col-sm-2">  
                                                       To Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="ato_date" id="ato_date">                         
                                                    </div>
                                   
                                                    
                                            <div class="col-sm-1">   
                                                <br>
                                                 <?php
                                                if($this->session->userdata['login_data']['userlevel']<6){?>
                                                        
                                                             <button type="submit" class="btn btn-secondary btn-sm" id="update_data">All Item Report</button>  
                                                            
                                                       <?php } ?>
                                                
                                                               
                                        </div>         
                                     </div>
                    </form> 
            </div>
             <div class="container">
                       
                         <form id="frm1" action="<?php echo site_url('item_detail_pdf');?>" method="post" target="_blank">
                        <div class="row">

                                                      <div class="col-sm-4">  
                                                       Item
                                                        <select class="standardSelect form-control" id="item" data-placeholder="Choose a cat..." name="item">
							<option value="0"> Select Item</option>
                                                         <?php 
                                                         foreach ($item_list as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->item_id; ?>"><?php echo $itm->cat_shortcode.'-'.$itm->brand_shordcode.'-'.$itm->item_catcount.'-'.$itm->itm_name; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                                    
                                                       <div class="col-sm-2">  
                                                       Depot
                                                        <select class="standardSelect form-control" id="dop" data-placeholder="Choose a cat..." name="dop">
							<option value="0"> Select Depot</option>
                                                         <?php 
                                                         foreach ($dop as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->dep_id; ?>"><?php echo $itm->dep_name?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                
                          
                                    <div class="col-sm-2">  
                                                       From Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="frm_date" id="frm_date">                         
                                                    </div>
                                                    
                                                    <div class="col-sm-2">  
                                                       To Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="to_date" id="to_date">                         
                                                    </div>
                                   
                                                    
                                            <div class="col-sm-1">   
                                                <br>
                                                 <?php
                                                if($this->session->userdata['login_data']['userlevel']<6){?>
                                                        
                                                             <button type="submit" class="btn btn-secondary btn-sm" id="update_data">Print</button>  
                                                            
                                                       <?php } ?>
                                                
                                                               
                                        </div>         
                                     </div>
                    </form> 
            </div>
            </div>
                            </div>
                        </div>
                
                
   
   
    <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Sale Summery Batch Wise</strong>
                            </div>
                            <div class="card-body">
                                  <div class="row">
                           <?php echo validation_errors(); ?>
           
                   <div class="container">
                       
                         <form id="frm2" action="<?php echo site_url('itembatch_detail_pdf');?>" method="post" target="_blank">
                        <div class="row">

                                                      <div class="col-sm-4">  
                                                       Item
                                                        <select class="standardSelect form-control" id="batchitem" data-placeholder="Choose a cat..." name="batchitem" onchange="selectitem()">
							<option value="0"> Select Item</option>
                                                         <?php 
                                                         foreach ($item_list as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->item_id; ?>"><?php echo $itm->cat_shortcode.'-'.$itm->brand_shordcode.'-'.$itm->item_catcount.'-'.$itm->itm_name; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                                     
                                 <div class="col-sm-4">  
                                                       Batch
                                                       <select class="form-control standardSelect choosen-select" id="batchselect" data-placeholder="Choose a Batch..." name="batchselect">
    							                                <option value="0"> Batch </option>
                                                                                                                      
                                                       </select>                           
                                                    </div>
                                                    
                                            <div class="col-sm-4">  
                                                       Rep
                                                       <select class="standardSelect form-control" id="ref" data-placeholder="Choose a cat..." name="ref">
							<option value="0"> Select Rep </option>
                                                         <?php 
                                                         foreach ($ref as $rf) {            
                                                          ?>
							<option value="<?php echo $rf->user_id; ?>"><?php echo $rf->user_fname.' '.$rf->user_lname; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                              
                                                    </div>
                                
                          
                                    <div class="col-sm-3">  
                                                       From Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="frm_bdate" id="frm_bdate">                         
                                                    </div>
                                                    
                                                    <div class="col-sm-3">  
                                                       To Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="to_bdate" id="to_bdate">                         
                                                    </div>
                                   
                                                    
                                            <div class="col-sm-2">   
                                                <br>
                                                  <?php
                                                if($this->session->userdata['login_data']['userlevel']!=20 ){?>
                                                        
                                                           <button type="submit" class="btn btn-secondary btn-sm" id="update_data">Print</button>    
                                                            
                                                       <?php } ?>
                                                
                                                              
                                        </div>         
                                     </div>
                    </form> 
            </div>
            </div>
                            </div>
                        </div>
   
     <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Batch Editing Details</strong>
                            </div>
                            <div class="card-body">
                                <div class="row">
                           <?php echo validation_errors(); ?>
           
                   <div class="container">
                       
                         <form id="frm3" action="<?php echo site_url('itembatch_edit_pdf');?>" method="post" target="_blank">
                        <div class="row">

                                                      <div class="col-sm-4">  
                                                       Item
                                                        <select class="standardSelect form-control" id="logbatchitem" data-placeholder="Choose a cat..." name="logbatchitem" onchange="logselectitem()">
							<option value="0"> Select Item</option>
                                                         <?php 
                                                         foreach ($item_list as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->item_id; ?>"><?php echo $itm->cat_shortcode.'-'.$itm->brand_shordcode.'-'.$itm->item_catcount.'-'.$itm->itm_name; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                                     
                                 <div class="col-sm-4">  
                                                       Batch
                                                       <select class="form-control standardSelect choosen-select" id="logbatchselect" data-placeholder="Choose a Batch..." name="logbatchselect">
    							                                <option value="0"> Batch </option>
                                                                                                                      
                                                       </select>                           
                                                    </div>
                                                    
                                            <!--div class="col-sm-4">  
                                                       Rep
                                                       <select class="standardSelect form-control" id="ref" data-placeholder="Choose a cat..." name="ref">
							<option value="0"> Select Rep </option>
                                                         <?php 
                                                         foreach ($ref as $rf) {            
                                                          ?>
							<option value="<?php echo $rf->user_id; ?>"><?php echo $rf->user_fname.' '.$rf->user_lname; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                              
                                                    </div-->
                                
                          
                                    <div class="col-sm-3">  
                                                       From Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="logfrm_bdate" id="logfrm_bdate">                         
                                                    </div>
                                                    
                                                    <div class="col-sm-3">  
                                                       To Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="logto_bdate" id="logto_bdate">                         
                                                    </div>
                                   
                                                    
                                            <div class="col-sm-2">   
                                                <br>
                                                
                                                  <?php
                                                if($this->session->userdata['login_data']['userlevel']<6){?>
                                                        
                                                             <button type="submit" class="btn btn-secondary btn-sm" id="logupdate_data1">Print</button> 
                                                            
                                                       <?php } ?>
                                                                 
                                        </div>         
                                     </div>
                    </form> 
            </div>
            </div>
                            </div>
                        </div>
             
            
            <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Batch Log</strong>
                            </div>
                            <div class="card-body">
                               <div class="row">
                           <?php echo validation_errors(); ?>
           
                   <div class="container">
                       
                         <form id="frm3" action="<?php echo site_url('itembatch_log_pdf');?>" method="post" target="_blank">
                        <div class="row">

                                                      <div class="col-sm-4">  
                                                       Item
                                                        <select class="standardSelect form-control" id="batchitemlog" data-placeholder="Choose a cat..." name="batchitemlog" onchange="blogselectitem()">
							<option value="0"> Select Item</option>
                                                         <?php 
                                                         foreach ($item_list as $itm) {            
                                                          ?>
							<option value="<?php echo $itm->item_id; ?>"><?php echo $itm->cat_shortcode.'-'.$itm->brand_shordcode.'-'.$itm->item_catcount.'-'.$itm->itm_name; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                          
                                                    </div>
                                                     
                                 <div class="col-sm-4">  
                                                       Batch
                                                       <select class="form-control standardSelect choosen-select" id="batchselectlog" data-placeholder="Choose a Batch..." name="batchselectlog">
    							                                <option value="0"> Batch </option>
                                                                                                                      
                                                       </select>                           
                                                    </div> 
                                                    
                                                    <div class="col-sm-4">  
                                                       Depot
                                                       <select class="standardSelect form-control" id="depo" data-placeholder="Choose a cat..." name="depo">
							                                        
                                                         <?php 
                                                         foreach ($dep as $depo) {            
                                                          ?>
							                                    <option value="<?php echo $depo->dep_id; ?>"><?php echo $depo->dep_name; ?></option>
                                                          <?php }?>                                                           
                                                        </select>                           
                                                    </div>
                                
                          
                                    <div class="col-sm-3">  
                                                       From Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="frm_bdatelog" id="frm_bdatelog">                         
                                                    </div>
                                                    
                                                    <div class="col-sm-3">  
                                                       To Date
                                                       <input type="text" style="text-align: right;" class="col-xs-12 col-sm-12 input-sm form-control-sm form-control datepicker" name="to_bdatelog" id="to_bdatelog">                         
                                                    </div>
                                   
                                                    
                                            <div class="col-sm-2">   
                                                <br>
                                                 <?php
                                                if($this->session->userdata['login_data']['userlevel']<6){?>
                                                        
                                                            <button type="submit" class="btn btn-secondary btn-sm" id="logupdate_data1">Print</button> 
                                                            
                                                       <?php } ?>
                                                
                                                                 
                                        </div>         
                                     </div>
                    </form> 
            </div>
            </div>
                            </div>
                        </div>
             
            
            <div class="card">
                            <div class="card-header">
                                <strong class="card-title">Other Report</strong>
                            </div>
                            <div class="card-body">
                                <div class="row">
                        
                   <div class="container">
                       
                         <form id="frm3" action="<?php echo site_url('item_moq_pdf');?>" method="post" target="_blank">
                        <div class="row">
                                                    
                                            <div class="col-sm-2">   
                                                <br>
                                                  <?php
                                                if($this->session->userdata['login_data']['userlevel']!=20 ){?>
                                                        
                                                           <button type="submit" class="btn btn-secondary btn-sm" id="moq">Print MOQ</button>   
                                                            
                                                       <?php } ?>
                                                               
                                        </div>         
                                     </div>
                    </form> 
                       
                         <form id="frm3" action="<?php echo site_url('item_exp_pdf');?>" method="post" target="_blank">
                        <div class="row">
                                                    
                                            <div class="col-sm-2">   
                                                <br>
                                                <select class="form-control standardSelect choosen-select" id="within" data-placeholder="Choose a Batch..." name="within">
    							                                <option value="0"> Expired </option>
    							                                <option value="1"> Within one Month </option>
    							                                <option value="2"> Within 2 Month </option>
    							                                <option value="3"> Within 3 Month </option>
    							                                <option value="6"> Within 6 Month </option>
                                                                                                                      
                                                </select>                 
                                        </div> 
                                        <div class="col-sm-2">   
                                                <br>
                                                
                                                 <?php
                                                if($this->session->userdata['login_data']['userlevel']!=20 ){?>
                                                        
                                                           <button type="submit" class="btn btn-secondary btn-sm" id="moq">Print Expire Date</button>
                                                            
                                                       <?php } ?>
                                                                  
                                        </div>         
                                     </div>
                    </form> 
            </div>
            </div>
                            </div>
                        </div>  
            
           
            
            
            </div>
            </div>
            
            <div class="clearfix"></div>

<script src="<?php echo base_url(); ?>assets/js/jquery.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery-ui.js"></script>
<script src="<?php echo base_url(); ?>assets/js/lib/chosen/chosen.jquery.min.js"></script>


<script>

    $(document).ready(function(){
        //show_data(); 
        //getPagination('#table-id');
        document.getElementById("load").style.display = "none";
    });
    
    $( ".datepicker" ).datepicker();
    $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd");
    
    
    function selectitem(){
                $('#batchselect option').remove();
                $('#batchselect').append($('<option>', {
                                                            value: "",
                                                            text: "select"
                                                        }));
                $("#batchselect").trigger("chosen:updated");
        
    var code = $( "#batchitem option:selected" ).val();  

                var depo = 0;
    var qty = 0;
        $.ajax({
                 
                type  : 'ajax',
                method:'POST',
                url   : '<?php echo site_url('getall_batch')?>',
                dataType : 'json',
                data : {code:code,depo:depo},
                success : function(data){
                            
                            var i;
                            for (var i = 0; i < data.length; i++) {
                               $('#batchselect').append($('<option>', {
                                                            value: data[i].batch_id,
                                                            text: data[i].batch
                                                        }));
                            }
                            
                          $("#batchselect").trigger("chosen:updated");
                           // document.getElementById("dposelect").text = '';
                           
                }
               
            }); 
    
   
    
    $( ".datepicker" ).datepicker();
    $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd");
      }
      
      
    function logselectitem(){
                $('#logbatchselect option').remove();
                $('#logbatchselect').append($('<option>', {
                                                            value: "",
                                                            text: "select"
                                                        }));
                $("#logbatchselect").trigger("chosen:updated");
        
    var code = $( "#logbatchitem option:selected" ).val();  

                var depo = 0;
    var qty = 0;
        $.ajax({
                 
                type  : 'ajax',
                method:'POST',
                url   : '<?php echo site_url('getall_batch')?>',
                dataType : 'json',
                data : {code:code,depo:depo},
                success : function(data){
                            
                            var i;
                            for (var i = 0; i < data.length; i++) {
                               $('#logbatchselect').append($('<option>', {
                                                            value: data[i].batch_id,
                                                            text: data[i].batch
                                                        }));
                            }
                            
                          $("#logbatchselect").trigger("chosen:updated");
                           // document.getElementById("dposelect").text = '';
                           
                }
               
            }); 
    
   
    
    $( ".datepicker" ).datepicker();
    $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd");
      }
      
      function blogselectitem(){
                $('#batchselectlog option').remove();
                $('#batchselectlog').append($('<option>', {
                                                            value: "",
                                                            text: "select"
                                                        }));
                $("#batchselectlog").trigger("chosen:updated");
        
    var code = $( "#batchitemlog option:selected" ).val();  

                var depo = 0;
    var qty = 0;
        $.ajax({
                 
                type  : 'ajax',
                method:'POST',
                url   : '<?php echo site_url('getall_batch')?>',
                dataType : 'json',
                data : {code:code,depo:depo},
                success : function(data){
                            
                            var i;
                            for (var i = 0; i < data.length; i++) {
                               $('#batchselectlog').append($('<option>', {
                                                            value: data[i].batch_id,
                                                            text: data[i].batch
                                                        }));
                            }
                            
                          $("#batchselectlog").trigger("chosen:updated");
                           // document.getElementById("dposelect").text = '';
                           
                }
               
            }); 
    
   
    
    $( ".datepicker" ).datepicker();
    $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd");
      }
      
        
        
        
            jQuery(document).ready(function() {
        jQuery(".standardSelect").chosen({
            disable_search_threshold: 5,
            no_results_text: "Oops, nothing found!",
            width: "100%"
        });
    });  

</script>    