<?php
  
  $DataTransaksi = new DataTransaksi;
?>
<link href="<?php echo $base?>plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $base?>plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
<link href="<?php echo $base?>plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/iCheck/all.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet"/>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link href="<?php echo $base?>bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/locales/bootstrap-datetimepicker.id.js" charset="UTF-8"></script>
<link href="<?php echo $base?>plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $base?>plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>

<section class="content-header">
  <h1>
    Data Kunjungan
  </h1>
  <ol class="breadcrumb">
    <li><a href="<?php echo $base?>"><i class="fa fa-dashboard"></i> Home</a></li>
    <li class="active">Data Laporan Kunjungan</li>
  </ol>
</section>
<section class="content">
  <div class="row">
    <div class="col-xs-12">
     
      <div class="box">
        <div class="box-header">
           <div class="col-sm-5" >
             <div class="form-group">
             <form action="<?php echo $base?>data-laporankunjungan"  name="cmb" method="post">
                <label class="control-label">Dari</label>
                <div class="input-group date form_date" data-date="" data-date-format="dd-mm-yyyy" data-link-field="tglspk">
                    <input required="required" class="form-control" type="text" value="" placeholder="pilih tanggal" >
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    <input type="hidden" id="tglspk" name="tgl1" value=""/>
                    <script type="text/javascript">
                        $('.form_date').datetimepicker({
                            language:  'id',
                            weekStart: 1,
                            todayBtn:  1,
                            autoclose: 1,
                            todayHighlight: 1,
                            startView: 2,
                            minView: 2,
                            forceParse: 0
                        });
                    </script>  
                </div>
              </div>
        </div>
        <label class="control-label">Sampai</label>
                <div class="input-group date form_date1" data-date="" data-date-format="dd-mm-yyyy" data-link-field="tglspk1">
                    <input required="required" class="form-control" type="text" value="" placeholder="pilih tanggal" >
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    <input type="hidden" id="tglspk1" name="tgl2" onChange="cmb.submit();" value=""/>
                    <script type="text/javascript">
                        $('.form_date1').datetimepicker({
                            language:  'id',
                            weekStart: 1,
                            todayBtn:  1,
                            autoclose: 1,
                            todayHighlight: 1,
                            startView: 2,
                            minView: 2,
                            forceParse: 0
                        });
                    </script> 
                     
                </div>
              </div>
        </div>

        </div>
        </div><!-- /.box-header -->


        <div class="box-body">
        <div class="table-responsive">
          <table id="example1" class="table table-bordered table-striped table-hover">
             <thead>
                <tr>
                    <th>No Anggota</th>
                    <th>Nama</th>
                    <th>Status</th>
                    <th>Tanggal Kunjungan</th>
                </tr>
            </thead>
            <tbody>
            <?php
        $tgl1 = $_POST['tgl1'];
        $tgl2 = $_POST['tgl2'];
        $tgl = substr($tgl, 0, 10);
              $JumlahData = $DataTransaksi->get_laporankunjungan_bytgl('',$a,'jumlah', $tgl1,$tgl2);
        if ($JumlahData<=0){
          echo "<tr class='odd gradeX'>";
          echo "<td>No Data</td>";
          echo "<td></td>";
          echo "<td></td>";
          echo "<td></td>";
          echo "</tr>"; 
        }else{
          for ($a=1;$a<=$JumlahData;$a++){
            $NoAnggota = $DataTransaksi->get_laporankunjungan_bytgl('noAnggota',$a,'', $tgl,$tgl2);
            $Nama = $DataTransaksi->get_laporankunjungan_bytgl('nama',$a,'', $tgl,$tgl2);
            $Status = $DataTransaksi->get_laporankunjungan_bytgl('Status',$a,'', $tgl,$tgl2);
            $TanggalKunjungan = $DataTransaksi->get_laporankunjungan_bytgl('Waktu',$a,'', $tgl,$tgl2);
            
            
            echo "<tr id='".$NoAnggota."' class='odd gradeX context'>";
            echo "<td>".$NoAnggota."</td>";
            echo "<td>".$Nama."</td>";
            echo "<td>".$Status."</td>";
            echo "<td>".$TanggalKunjungan."</td>";
            echo "</tr>";
          }
        }
      ?>
          </tbody>
          </table>
          </div>
          </div>

       
        
    
</section>
 
