
<?php
include('../includes/sidebar.php');
include('../includes/header.php');
?>
  <!-- [ Main Content ] start -->
  <div class="pc-container">
    <div class="pc-content">
      <!-- [ breadcrumb ] start -->
      <div class="page-header">
        <div class="page-block">
          <div class="page-header-title">
            <h5 class="mb-0 font-medium">Sample Page</h5>
          </div>
          <ul class="breadcrumb">
            <li class="breadcrumb-item"><a href="../dashboard/index.html">Home</a></li>
            <li class="breadcrumb-item"><a href="javascript: void(0)">Other</a></li>
            <li class="breadcrumb-item" aria-current="page">Sample Page</li>
          </ul>
        </div>
      </div>
      <!-- [ breadcrumb ] end -->


      <!-- [ Main Content ] start -->

      <div class="grid grid-cols-12 gap-x-6">
        <!-- [ sample-page ] start -->
        <div class="col-span-12">
          <div class="card">
          
            <div class="card-body">
              <div class="card table-bordered" >
              <div class="card-header"  style="display:flex;justify-content:space-between;">
                <div><h5>Recent Users</h5></div>
                <div>
                <!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
<i class="fa-solid fa-plus"></i>  Add
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h1 class="modal-title fs-5" id="exampleModalLabel">Modal title</h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
       <form action="product_add.php" method="post" enctype="multipart/form-data">
        <div class="mb-3">
    <label class="form-label">Image</label>
    <input type="file" class="form-control" name="image">
  </div>
          <div class="mb-3">
    <label class="form-label">Name</label>
    <input type="text" class="form-control"  placeholder="Enter product name" name="name">
  </div>
  <div class="mb-3">
    <label class="form-label">Price 1</label>
    <input type="text" class="form-control"  placeholder="Enter price 1" name="price1">
  </div>
   <div class="mb-3">
    <label  class="form-label">Price 2</label>
    <input type="text" class="form-control"  placeholder="Enter price 2"name="price2">
  </div>
  <div class="mb-3">
    <label  class="form-label">Quantity</label>
    <input type="text" class="form-control"  placeholder="Enter quantity"name="quantity">
  </div>

    <div class="mb-3">
    <label  class="form-label">Description</label>
   <textarea id=""class="form-control" name="description"></textarea>
  </div>
  <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Save changes</button>
      </div>
</form>
      </div>
      
    </div>
  </div>
</div>
              
              </div>
              </div>
              <div class="card-body">
                <div class="table-responsive">
                  <table class="table table-hover">
                   <thead>
                    <tr>
                       <th>Image</th>
                      <th>Name</th>
                     
                      <th>Price1</th>
                      <th>Price2</th>
                      <th>Quantity</th>
                      <th>Description</th>
                      <th>Action</th>
                    </tr>
                   
                   </thead>
                   <?php
                    include('../includes/connection.php');
                    $sql="select * from product_add";
                    $result=mysqli_query($con,$sql);
                    while($data=mysqli_fetch_assoc($result))
                    {
                   ?>
                 
                    <tr>
                      
                       <td> <img src="<?php echo $data['image'] ?>" alt="" style="height:100px;width:100px;"> </td>
                      <td><?php echo $data['name'] ?></td>
                      <td><?php echo $data['price_1'] ?></td>
                      <td><?php echo $data['price_2'] ?></td>
                      <td><?php echo $data['quantity'] ?></td>
                      <td><?php echo $data['description'] ?></td>
                      <td>
                      <a href='update_product.php?<?php echo"id=$data[id]"?>' class="btn btn-success"><i class="fa-solid fa-pen-to-square"></i></a>
                        <a href='product_delete.php?<?php echo"id=$data[id]" ?>'class="btn btn-danger" ><i class="fa-solid fa-trash"></i></a>
                        <!-- <a href="" class="btn btn-secondary"><i class="fa-solid fa-eye"></i></a> -->
                      </td>
                    </tr>
                   
                   <?php
                    }
                   ?>
                  </table>
                </div>
              </div>
            </div>
         
            </div>
          </div>

        </div>
        <!-- [ sample-page ] end -->
      </div>
      <!-- [ Main Content ] end -->
    </div>
  </div>
  <!-- [ Main Content ] end -->
         
            
        
        <!-- [ Main Content ] end -->
     
     <?php

include('../includes/footer.php');
?>
     
   