<?php include("auth.php");

require("conn.php");
$action = "Add";
$id = null;

$v_code=$_SESSION['v_code'];
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>Sales Report </title>
    <meta content="" name="description">
    <meta content="" name="keywords">
    <link href="assets/img/favicon.png" rel="icon">
    <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
    <?php include("templates/inc.php"); ?>

    <script src="scripts/ManagePin.js" type="text/javascript" language="javascript"></script>


</head>

<body>

    <!-- ======= Header ======= -->
    <?php
    include("templates/header.php");
    ?>

    <!-- End Header -->

    <!-- ======= Sidebar ======= -->
    <?php
    include("templates/sidebar.php");

    ?>
    <!-- End Sidebar-->

    <main id="main" class="main">

        <div class="pagetitle">
            <h1>Sales Report</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
                    <li class="breadcrumb-item">Sales Report</li>

                </ol>
            </nav>
            <hr>
            
        </div><!-- End Page Title -->



     <section class="section">
    <div class="row">
        <div class="col-lg-12">

            <div class="card" style="overflow:scroll;">
                <div class="card-body" id="records">
                    <h5 class="card-title">Sales Report</h5>
                    <!-- Table with stripped rows -->
                 <table id="example" class="table table-striped dt-responsive nowrap" style="width:100%">

                        <thead>
                            <tr>
                          <th>ID</th>
                          <th>COUPON NO</th>
                          <th>DID</th>
                           <th>SID</th>
                          <th>DATE</th>
                          <th>REWARD</th>

                            </tr>
                        </thead>
                        
                         <tbody>
                <?php
                require "conn.php";
                $sl = 1;
                $sql = "select * from tbl_reward where did='$did' order by id desc";
                $rs = mysqli_query($conn, $sql);
                while ($row = mysqli_fetch_assoc($rs)) {
                  echo "<tr>";
                  echo '<td>' . $sl . '</td>';

                  echo '<td>' . $row['coupon_no'] . '</td>';
                  echo '<td>' . $row['did'] . '</td>';
                  echo '<td>' . $row['sid'] . '</td>';
                  echo '<td>' . $row['date'] . '</td>';
                  echo '<td>' . $row['rwd'] . '</td>';

                  echo "</tr>";
                  $sl++;
                }
                ?>

              </tbody>
                    
                    </table>
                </div>
            </div>
        </div>
    </div>

</section>








    </main><!-- End #main -->

    <!-- ======= Footer ======= -->
    <?php
    include("templates/footer.php");
    ?>
    <!-- End Footer -->


    <?php include("templates/vendors.php"); ?>
    
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.4/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.4.1/js/dataTables.responsive.min.js" ></script>

<script>
  $(document).ready(function() {
      $('#example').DataTable();
  } );
  </script>




</body>

</html>