
<?php 
    session_start();
    include 'header.php'; 
?>

<div class="container">

  <div class="my-2 border-bottom">
    <h5 class="fw-semibold fs-5">Laporan Kas</h5>
  </div>
    <div class="card-header d-flex justify-content-between">
      <span class="card-title fw-semibold align-self-start mb">Silahkan pilih tanggal dari dan pilih tanggal sampai kemudian klik TAMPILKAN LAPORAN </span>
      <buton>
       <a href="index.php" class="btn btn-primary btn-sm"><i class="bi bi-reply-all"></i> &nbsp Kembali</a> 
      </buton>
    </div>
  <section class="content">
    <div class="row">
      <section class="col-lg-12">
        <div class="box box-info">
          <div class="box-header">
          <div class="box-body">
            <form method="get" action="">
              <div class="row">
                <div class="col-md-2">
                  <div class="form-group">
                    <label>Dari</label>
                    <input type="date" class="form-control" name="tanggal_d" required="required" placeholder="Tanggal dari ..">
                  </div>
                </div>

                <div class="col-md-2">
                  <div class="form-group">
                    <label>Sampai</label>
                    <input type="date" class="form-control" name="tanggal_s" required="required" placeholder="Sampai tanggal ..">
                  </div>
                </div>

                <div class="col-md-2">
                  <div class="form-group">
                    <br/>
                    <input type="submit" value="TAMPILKAN LAPORAN" class="btn btn-sm btn-primary">
                  </div>
                </div>
              </div>
            </form>
          </div>
        </div>
        
        <div class="box box-info">
          <div class="box-header">
            <h6 class="box-title"></h6>
          </div>
          <div class="box-body">
            <?php 
            if(isset($_GET['tanggal_s']) && isset($_GET['tanggal_d'])){
              $tgl_d    = $_GET['tanggal_d'];
              $tgl_s    = $_GET['tanggal_s'];
              
              $tgl_ke_1 =date('2025-01-01');        
              $tgl_p    =strtotime("$tgl_d");
              $tgl_lalu =date('Y-m-d', strtotime("-1 day", $tgl_p));
            //////////////////////////////////////////////////////////////////////////// 
            ?>

              
              <div class="row">
                <div class="col-lg-8">
                  <table class="table table-bordered">
                    <tr>
                      <th width="30%">DARI TANGGAL</th>
                      <th width="1%">:</th>
                      <td><?php echo date('d-m-Y', strtotime($tgl_d)); ?></td>
                    </tr>
                    <tr>
                      <th>SAMPAI TANGGAL</th>
                      <th>:</th>
                      <td><?php echo date('d-m-Y', strtotime($tgl_s)); ?></td>
                    </tr>
                
                  </table>
                </div>
              </div>

              <div class="table-responsive">
                <table class="table table-bordered table-striped" id="table-datatable1">
                  <thead>
          <tbody>

        </table>
              </div>

              <?php 
              
            }else{
              ?>

              <div class="alert alert-info text-center">
                Silahkan Filter Laporan Terlebih Dulu.
              </div>

              <?php
            }
            ?>

          </div>
        </div>
      </section>
    </div>
  </section>
  
<?php
// menu1.php
if (isset($_POST['submit'])) {
  // Proses data menu pertama
  echo '<button onclick="prosesMenu2()">KLIK</button>';
  echo '<script>
          function prosesMenu2() {
            window.location.href = "lap_akunt_nrc_tgl_sd_tgl_lihat.php";
          }
        </script>';
  exit;
}
?>
</div>
<?php include 'footer.php'; ?>

