<?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"> 
                 Money Cash 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"> History Money Cash 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">
                History Money Cash Kasir
              </div>
              
              <div class="card-body">
                <table  class="table table-bordered table-striped">
                  <thead>
                    <tr>
                      <th>No</th>
                      <th>Tanggal</th>
                      <th>Nama User</th>
                      <th>Kantor </th>
                      <th style="text-align: right;">Jumlah</th>
                      <th>Keterangan</th> 


                      
                    </tr>
                  </thead>
                  <tbody>
                    <?php $no = $this->uri->segment('3') + 1; foreach($data->result()  as $rows) : 

                    $id_admin= $rows->id_admin;
                    $this->db->where('id',$id_admin);
                    $query = $this->db->get('tb_admin');
                    $row = $query->row();
                    $nama_admin = $row->nama_admin;
                    $nama_barang = $row->nama_barang;

                      //rak

                    ?>  
                    <tr>
                      <td><?php echo $no; ?></td>
                      <td><?php echo  $rows->date; ?></td>
                      <td><?php echo $nama_admin; ?></td>
                      <td>
                        <?php 
                        $id_kantor = $rows->id_kantor; 
                        $sql_menu = "SELECT * FROM tb_kantor WHERE  id_kantor = '$id_kantor' ";
                        $main_menu = $this->db->query($sql_menu)->result();
                        foreach ($main_menu as $maink) {
                          echo  $maink->nama_kantor;

                        }
                        ?>
                        
                        <td style="text-align: right;">
                            <?php $cek = $rows->keterangan; 
                            if($cek =='login-kasir'){ ?>
                            <?php echo nominal($rows->nominal);  ?>
                            <?php } else{ ?>


                             
                        <p>Awal cash Money  : <?php echo nominal($rows->awal_moneycash);  ?> </p>
                          <p>Total Transaksi : <?php echo nominal($rows->total_transaksi);  ?> </p>
                        <p>Setor : <?php echo nominal($rows->nominal);  ?> </p>
                        <p>Selisih  : <?php echo nominal($rows->selisih);  ?> </p>

                          <?php } ?>
                          
                        </td>
                        <td><?php echo $rows->keterangan;  ?></td>
                            

                      </tr>
                      <?php $no++; endforeach; ?>

                    </tbody>

                  </table>
                <div class="row">
                  <div class="col">
                    <!--Tampilkan pagination-->
                    <?php echo $pagination; ?>
                  </div>
                </div>
                  
              </div>
              <!-- /.card-body -->
            </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

   