<?php
include 'load.php';
?>

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

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
	<meta name="description" content="POS - Eat More Resturant   | Pos & Invetory System | Dashboard">
	<meta name="keywords" content="Eat More Resturant   | Pos & Invetory System | Dashboard">
	<meta name="author" content="Eat More Resturant   | Pos & Invetory System | Dashboard">
	<meta name="robots" content="noindex, nofollow">

	<title>Stock Valivation Report | Eat More Resturant   | Pos & Invetory System | Dashboard</title>

	<?php
	require_once 'headercss.php';
	?>

</head>

<body>

	<div class="main-wrapper">
		<?php
		require_once 'header.php';
		?>

		<?php
		require_once 'navbar.php';
		?>

		<div class="page-wrapper">
			<div class="content">
				<div class="page-header">
					<div class="page-title">
						<h4>Stock Valivation Report Report</h4>
						<h6>Manage your Stock</h6>
					</div>
				</div>

				<div class="card">
					<div class="card-body">
						<div class="table-top">

						</div>

                        <div class="table-responsive">
							<table class="table" id="betable">
								<thead>
									<tr>
										<th>#ID</th>
                                        <th>Product Name</th>
										<th>Qty</th>
										<th>Price</th>
										<th>Total</th>
									</tr>
								</thead>
								<tbody>
                                   <?php 
								   
								   $count=0;
								   
                                   $tot = 0;
								   
                                        $result = mysqli_query($conn, "SELECT * FROM tbl_stock WHERE qty > '0' AND prid!='148'");		
                                        if ($result->num_rows > 0) {
                                            while($row = $result->fetch_assoc()) { 
											
											$count++;
											
                                            ?>
                                                <tr>
                                                    <?php 
                                                    $prid =  $row['prid'];
                                                    $qry = mysqli_query($conn, "SELECT * FROM mobileproducts WHERE prid='$prid'");		
		                                            $rw = mysqli_fetch_array($qry); 
                                                    $tot = $tot + ($rw['price']*$row['qty']); 
													
													
													
													?>
													<td><?php echo number_format($count,0); ?></td>
                                                    <td><?php echo $rw['proname']; ?></td>
                                                    <td><?php echo $row['qty']; ?></td>
                                                    <td><?php echo $rw['price']; ?></td>
                                                    <td><?php echo $rw['price']*$row['qty']; ?></td>
                                                </tr>
                                          <?php }
                                        }
                                   
                                   
                                   ?>
                                   
                                </tbody>
                            </table>
                            <!--<div>
                            <h4>Total Rs. <?php// echo $tot; ?></h4>
                            </div> -->
                        </div>

						</div>
					</div>
				</div>

			</div>
		</div>
	</div>

<?php require_once 'footerjs.php'; ?>

</body>
</html>