<?php include 'topmost.php';?>
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="">
<meta name="author" content="">

    <title>My Outlet</title>
    <?php  include 'toplinks.php';  ?>
</head>
<body id="page-top"><div id="wrapper"><?php  include '../inc/menus.php';  ?>

        

<?php include 'top.php';   ?>
                <!-- End of Topbar -->

                <!-- Begin Page Content -->
                <div class="container-fluid">

                    <!-- Page Heading -->
                   <?php  include 'greet.php';  ?><br>
                   
                    <!-- DataTales Example -->
                    <div class="card shadow mb-4">
                        <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between bg-dark text-white"><h6 class="m-0 font-weight-bold text-white"># WHAREHOUSE PRODUCTS </h6>

<!-- <div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink"data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i></a>=<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink"><a class="dropdown-item" href="#" data-toggle="modal" data-target="#filterProduct"><i class="fa fa-filter text-dark"> Filter</i></a><a class="dropdown-item" href="#" id="export"><i class="fa fa-file text-dark"> Export</i></a></div></div> -->

</div>
                        <div class="card-body">
                            <div class="table-responsive">
<?php  include 'process.php';  ?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
    <p class="text-center text-dark"><strong>FILTER PRODUCTS BY</strong></p>
     <div class="row" style="">

    <?php  
if(isset($_POST['sendFilter'])){ $filter = 1;
if(!empty($_POST['eqCourse'])){ $selCrs =' and loader="'.$_POST['eqCourse'].'" ';  }else{
    $selCrs ='';
}
if(!empty($_POST['date'])){ $month =' and date_="'.$_POST['date'].'"  ';  }else{
    $month ='';
}

$query = ("SELECT * FROM products where id!='' $selCrs $month  ");
    }else{ $query ="SELECT * FROM products ORDER by item_name ASC";

}
     ?>
</div>




<thead><tr><th>#</th><th>Name</th><th>Size</th><th>Color</th><th>Company</th><th>Category</th><th>Action</th></tr></thead><tbody>

<?php
$count=1;
foreach(QueryDB($query)as $reg_std){?>
<tr><td class="small text-dark"><?php echo $count++; ?></td><td class="small text-dark"><b><?php echo strtoupper($reg_std['item_name']);  ?></b></td><td class="small text-dark">
    <?php echo $sized_by[$reg_std['size']];  ?></td><td class="small text-dark">
    <?php echo $colored_by[$reg_std['color']];  ?></td><td class="small text-dark">
    <?php echo $company[$reg_std['company']];  ?></td><td class="small text-dark">
    <?php echo $brand[$reg_std['brand']];  ?></td>

<td class="small text-dark"> <a href="stocks?view_sales_history=<?php echo $reg_std['id']; ?>" class="btn btn-dark small text-dark btn-sm" style="padding:3px;"><i class="fa fa-eye text-white small"> view Sales</i></a></td></tr>

<!--Add a Registratin-->
<div class="modal fade" id="addReged<?php echo $count; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog" role="document">
<div class="modal-content"><div class="modal-header bg-secondary text-white"><h5 class="modal-title " id="exampleModalLabel">#Modify Product - <span class="text-warning"><?php echo $reg_std['item_name']; ?></span></h5><button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body">

<form action="" method="POST"><div class="row"><div class="form-group col-md-8"><input type="text" name="prodname" class="form-control" required placeholder="Product Name e.g. LK100 or 3.75KVA" value="<?php echo $reg_std['item_name'];  ?>"></div>
<div class="form-group col-md-4"><input type="text" name="cost" class="form-control" required placeholder="cost" onkeypress="return isNumberKey(event)" value="<?php echo $reg_std['item_cost'] ?>"></div>
<input type="hidden" name="where" value="<?php echo $reg_std['id']; ?>">
  <div class="form-group col-md-6"><select class="form-control" required name="company"><?php 
for($i=0;$i<count($company);$i++){?><option value="<?php  echo $i; ?>" <?php if($i==$reg_std['company']){echo 'selected';}  ?>><?php echo $company[$i]; ?></option><?php }?></select></div><div class="form-group col-md-6"><select class="form-control" required name="brand"><option value="">--Brand--</option> <?php for($i=0;$i<count($brand);$i++){?><option value="<?php  echo $i; ?>" <?php if($i==$reg_std['brand']){echo 'selected';}  ?>><?php echo $brand[$i]; ?></option><?php }?></select></div>
<div class="form-group col-md-4"><select class="form-control" required name="size"><option value="">--Sized By-</option> <?php for($i=0;$i<count($sized_by);$i++){?>
<option value="<?php  echo $i; ?>" <?php if($i==$reg_std['size']){echo 'selected';}  ?>><?php echo $sized_by[$i]; ?></option><?php }?><</select></div><div class="form-group col-md-4"><select class="form-control" required name="color"><option value="">--Colour--</option> <?php for($i=0;$i<count($colored_by);$i++){?>
<option value="<?php  echo $i; ?>" <?php if($i==$reg_std['color']){echo 'selected';}  ?>><?php echo $colored_by[$i]; ?></option><?php }?></select></div>
<div class="form-group col-md-4"><select class="form-control" required name="tm_status"><option value="1" <?php  if($reg_std['tm_status']==1){ echo 'selected';} ?>>Visible</option><option value="0" <?php  if($reg_std['tm_status']==0){ echo 'selected';} ?>>Remove</option></select></div><div class="form-group col-md-12"><input type="submit" name="EditProduct" value="Edit Product" class="form-control btn btn-secondary"></div></div></form>


  </div><div class="modal-footer"><button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button></div></div></div></div>
<?php  } ?>

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

                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->



<?php  include 'bottom_most.php'; ?>
</body>

</html>