<?php foreach($kontak as $kontak) :   endforeach; ?>
<?php foreach($admin_login as $user) :   endforeach; ?> 
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"> 
            		 Modal Awal Start Kasir
            </h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active">Modal Awal Start Kasir</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
	    
          
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
      	  <div class="card">
              <div class="card-header">
                Login to Kasir 

                       <?php

              $username = $this->session->userdata("username");  
              $this->db->where('username',$username);
              $query = $this->db->get('tb_admin');
              $row = $query->row();
             
              $id_admin = $row->id;
              date_default_timezone_set('Asia/Jakarta');
              // echo 'Indonesian Timezone: ' . date('d-m-Y H:i:s');
             echo $tanggalwaktu_sekarang = date('d-m-Y H:i:s');
                    $tanggal_sekarang = date('Ymd');
                 $sql_menuxx= "SELECT keterangan FROM tb_kasir WHERE  id_admin = '$id_admin' and date(date)=' $tanggal_sekarang' and keterangan ='logout-kasir'  ";
                        $main_menuxx = $this->db->query($sql_menuxx)->result();
                        foreach ($main_menuxx as $rows) {
                          
                       
                          $cek=   $rows->keterangan; 
                       
                        }  
                  

                  if($cek == 'logout-kasir'){
                    ?>
                   ( anda sudah Setor Hari ini)
                    <?php 
                  }else{
                 ?>
                <a href="<?php echo base_url('kasir/log_in'); ?>"> <button class="btn btn-primary" >Klik Jika sudah mengisi sebelumnya </button> </a>
                <a href="<?php echo base_url('kasir/log_in_baru'); ?>"> <button class="btn btn-success" >Mode Kasir Baru </button> </a>
                <?php } ?>
              </div>
              
              <div class="card-body">


                 <?php

              $username = $this->session->userdata("username");  
              $this->db->where('username',$username);
              $query = $this->db->get('tb_admin');
              $row = $query->row();
             
              $id_admin = $row->id;
              date_default_timezone_set('Asia/Jakarta');  
              $tanggal_sekarang = date('Ymd');

                 $sql_menuxx= "SELECT keterangan FROM tb_kasir WHERE  id_admin = '$id_admin' and date(date)=' $tanggal_sekarang' and keterangan ='login-kasir'  ";
                        $main_menuxx = $this->db->query($sql_menuxx)->result();
                        foreach ($main_menuxx as $rows) {
                          
                       
                          $cek=   $rows->keterangan; 
                       
                        }  
                  

                  if($cek == 'login-kasir'){
                    ?>
                    Anda Sudah Menginput Data 
                    <?php 
                  }else{
                 ?>


              	<form class="form-horizontal" action="<?php echo base_url('kasir/code_start'); ?>" method="POST" enctype="multipart/form-data" /> 
              	<div class="col-sm-4"><!-- /.card-header -->
	              	<div class="form-group">
	              		<label for="exampleInputEmail1">Uang Tunai</label>
	              		<input type="text" class="form-control" id="exampleInputEmail1" name="uang_tunai" placeholder="Masukkan Nominal Modal di Laci" required="">
	              		<input type="hidden" name="id_admin" value="<?php  echo $id_admin; ?>">
	              		<input type="hidden" name="id_kantor" value="<?php  echo $id_kantor; ?>">
	              	</div>
	              	<button type="submit" class="btn btn-primary">Mulai </button>
              	</div>
               	</form>
 									<?php } ?>




              </div>
              <!-- /.card-body -->
            </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

   