<?php
require("php_con.php");
$p_qury=mysqli_query($connation,"SELECT *
FROM product_details pd LEFT JOIN catogary_list cl ON pd.product_catagory=cl.catogary_id
WHERE pd.product_catagory='$_GET[catogary_id]'
ORDER BY pd.product_name ASC");

$c_qury=mysqli_query($connation,"SELECT * FROM catogary_list WHERE catogary_id='$_GET[catogary_id]'");
$cat_resalt=mysqli_fetch_assoc($c_qury);

if(mysqli_num_rows($p_qury)>0){
?>
<div align="center" style="background-color: #CCCCCC; margin-bottom: 5px; text-transform: capitalize;"><?php echo $cat_resalt['catogary_text']; ?></div>
<?php
while($p_resalt=mysqli_fetch_assoc($p_qury)){
?>
<div class="pos_cat_btn_item" onClick="add_product_pos('<?php echo $p_resalt['product_barcode']; ?>');"><?php echo $p_resalt['product_barcode']; ?> - <?php echo $p_resalt['product_name']; ?></div>
<?php } }else{ ?>
<div align="center" style="background-color: #CCCCCC; margin-bottom: 5px; color: darkred; text-transform: capitalize;"><?php echo $cat_resalt['catogary_text']; ?> not found</div>
<?php } ?>