<?php 
include 'inc.header.php';

?>




<div class="content my-0 mt-n2 px-1">
<div class="d-flex">
<div class="align-self-center">
<h3 class="font-16 mb-2">Products</h3>
</div>



</div>
<div class="row">
<div class="form-custom form-label form-icon mt-2">

<div style="border-bottom: 1px solid #000;display:flex;">
<input type="text" class="form-control rounded-xs" id="c2" placeholder="Search Product" style="border:none; solid #000 !important;color:#222;height:40px !important; padding-left:12px !important;">
<ul id="buttonlist">
    <li><i class="fa fa-plus"></i></li>
    <li><i class="fa fa-copy"></i></li>
</ul>
</div>
</div>
</div>

<style>
    .thwrap h6{
        font-size: 13px;
        color: #949398;
    }
    ul li{
        list-style: none;
        margin-left: 10px;
    }
    input#c2::placeholder{
        font-size: 15px !important;
        color: #000;
    }
    ul{
        padding-left: 0;
        margin-bottom: 10px;
        display: flex;

    }
    ul#buttonlist li i{
        position: relative !important;
        background-color: #9773d5 !important;
        color: #fff;
        border-radius: 50%;
        height: 40px;
         width: 40px;
        line-height: 39px;
    }
    ul#buttonlist li i::before{
        background-color: #9773d5 !important;
    }
</style>
</div>

<div class="card card-style">

<div class="content">
<?php $products = mysqli_query($conn, "SELECT * FROM mobileproducts ORDER BY proname ASC"); 
if ($products->num_rows > 0) {
    while($row = $products->fetch_assoc()) {
        $prid = $row['prid'];
?>
<div class="d-flex py-1" onclick="addNewProductById(<?php echo $prid; ?>);">
<div class="align-self-center">
<span class="icon rounded-s me-2 gradient-orange shadow-bg shadow-bg-s" style="color:#fff;font-size:20px;"><?php echo substr($row['proname'], 0, 1); ?></span>
</div>
<div class="align-self-center ps-1">
<h5 style="font-size:14px;" class="pt-1 mb-n1"><?php echo $row['proname']; ?></h5>
<p class="mb-0 font-11 opacity-50"><?php echo $row['itemcode']; ?> <span class="copyright-year"></span></p>
</div>
 <div class="align-self-center ms-auto text-end">
<h4 style="font-size:16px;" class="pt-1 mb-n1 color-red-dark"><?php echo number_format((float) $row['sellprice'], 2); ?></h4>
<p class="mb-0 font-11">
    <?php 
        $stock = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM tbl_stock WHERE prid='$prid'"));
        if(empty($stock['qty'])){
            echo 0;
        }else{
    	    echo $stock['qty'];
        }
    ?>
</p>
</div>
    </div>
<div class="divider my-2 opacity-50"></div>
<?php } } ?>




</div>

</div>







<?php 
include 'inc.footer.php';

?>
