<?php
if(!isset($mydate) ){
  $mydate=date("Y-m-d");
}
 ?>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>Attendance Report</h3>
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Multi Person List</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                 <?php if ($this->session->flashdata('msg' )): ?>
                            <div class="alert alert-danger">
                            <?php echo $this->session->flashdata('msg'); ?>  
                            </div>
                             <?php endif; ?>
                  <form class="form-horizontal form-label-left" action="<?php echo $base_url;?>Report/fetch_att_selected_datewise" method="post" enctype="multipart/form-data">
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="class">Select Start Date</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date"  class="form-control col-md-7 col-xs-12" name="sdate" required="required">
                        </div>
                       </div>
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="class">Select End Date</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date"  class="form-control col-md-7 col-xs-12" name="edate" >
                        </div>
                       </div>
                        <!-- <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="class">Start Time</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="time"  class="form-control col-md-7 col-xs-12" name="stime">
                        </div>
                       </div>
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="class">End Time</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="time"  class="form-control col-md-7 col-xs-12" name="etime">
                        </div>
                       </div>-->
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Type <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select class="form-control" id="type" name="type">Select Type
                                <option value='1'>Teacher</option>
                                <option value='2'>Staff</option>
                            </select>
                        </div>
                      </div>
                       
                       
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Department <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select class="form-control" id="department" name="department">Select Department
                          <option value='0'>Select Department</option>
                         <?php
                         $data=$this->db->where('is_delete',0)->get('department')->result_array();
                        
                         foreach($data as $val)
                         {
                         ?>
                        <option value='<?php echo $val['id']?>' data-id='<?php echo $val['id']?>'><?php echo $val['department_name']?></option>
                         <?php
                         
                         }
                         ?>
                     </select>
                        </div>
                      </div>
                      
                      <div id ="person_div"class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Select Person*
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select class="form-control col-md-7 col-xs-12" multiple="multiple"  name="person[]" id="person" required>
                            	
                          </select>
                        </div>
                      </div>
                      
                      
                        
                       <div class="item form-group" > 
                        <div class="col-md-2 col-sm-2 col-xs-12" style="margin-left:40%">
                          <input type="submit" class="form-control pull-right btn btn-success" name="Datesubmit">
                        </div>
                      </div>
                  </form>
               
                
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        
      </div>
    </div>
    
    
    <footer>
          <div >
<p style="text-align:center !important;">Prudmac</p>
          </div>
          <div class="clearfix"></div>
        </footer>
        <div id='ajaxload' style='position:fixed;top:0;left:0;bottom:0; width:100%;height:100%;z-index:1000;background:rgba(2,132,130,0.5);display:none;'>
            <i class='fa fa-spinner fa-spin fa-4x' style='position: relative;top: 50%;left: 50%;margin-top: -50px;margin-left: -50px;'></i>
        </div>
        <!-- /footer content -->
      </div>
    </div>


     <!-- CSS -->
    <link href="<?php echo base_url(); ?>assets/multi_select/jquery.multiselect.css" rel="stylesheet">
    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/multi_select/jquery.multiselect.js"></script>
    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo base_url(); ?>assets/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="<?php echo base_url(); ?>assets/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url(); ?>assets/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="<?php echo base_url(); ?>assets/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.time.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.orderBars.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/date.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.spline.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/curvedLines.js"></script>
    <!-- jVectorMap -->
    <script src="<?php echo base_url(); ?>assets/js/maps/jquery-jvectormap-2.0.3.min.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/js/moment/moment.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/datepicker/daterangepicker.js"></script>

    
    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/bootstrap-datepicker.js"></script>
    

    
    <!-- Multiselect -->
    <!--<script src="<?php echo base_url(); ?>assets/multi_select/jquery.multiselect.js"></script>-->

    <script src="https://cdn.jsdelivr.net/sweetalert2/6.4.3/sweetalert2.min.js"></script>    

  
    <script>
    // var jq = jQuery.noConflict();
     $(document).ready(function(){
            $(document).ajaxStart(function() {
                $('#ajaxload').show();
            });
            $(document).ajaxStop(function() {
                 $('#ajaxload').hide();
            });
        // $('#datatable-buttons').DataTable();
      });
      
              

    </script>

<script>
// var jq = jQuery.noConflict();
$(document).ajaxStart(function() {
         $('#ajaxload').show();
      });
      $(document).ajaxStop(function() {
           $('#ajaxload').hide();
      });
 $(function () {
    $(".date").datepicker();
    date(".now");
    $(".date").focusout(function () {
        if ($(this).val().trim() == "") {
            date(".date");
        }
    });

    function date(selector) {
        var dNow = new Date();
        var localdate = dNow.getFullYear()+'/' +(dNow.getMonth() + 1)+'/' + dNow.getDate();
       
    }

});
</script>
    <script>
    // var jq = jQuery.noConflict();
    $(".abc").on("keypress", function (event) {

            var englishAlphabetAndWhiteSpace = /[A-Za-z ]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }
            return false;
        });

         $('.abc').on("paste", function (e) {
            e.preventDefault();
        });
        $(".abc1").on("keypress", function (event) {

            var englishAlphabetAndWhiteSpace = /[A-Za-z0-9|-]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 32 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }


            return false;
        }); $('.abc1').on("paste", function (e) {
            e.preventDefault();
        });
        // $(document).bind("contextmenu", function (e) {
        //     e.preventDefault();
        // });
         //form only numbers
        $(".num").on("keypress", function (e) {
          
            var evt = (e) ? e : window.event;
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }
            return true;
        });
    </script>
    
     <script>

            
        $(document).ready(function(){
           
           $("#person_div").hide();
            });
        
            $('#department').change(function(){
                    $("#person_div").show();
                  //alert("asdf");die;
                var d= $(this).val();
                var t=$('#type').val();
              
                $.get("<?php echo base_url(); ?>load/persons/"+d+"/"+t,{},function(d){
                   //alert(d);
                   
                    $("#person").html(d);
                    $('#person').multiselect('reload');
                    
                });
            });
        //   var jq = jQuery.noConflict();
              $('#person').multiselect({
                columns: 1,
                placeholder: 'Select Person',
                allSelectedText: 'All',
                selectAll: true,
                search: true
            });
              
       
    </script>
    <script>
        window.setTimeout(function() {
        $(".alert").fadeTo(500, 0).slideUp(500, function(){
        $(this).remove(); 
        });
        }, 2000);
    </script>
    
  </body>
</html>
   
    

  


      