Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/irp/irp/pcstore/
Upload File :
Current File : /var/www/html/mmishra/irp/irp/pcstore/stock_inhand.php

<?php
//show page head
include "page_header.inc";

echo "<b>Stock in-Hand</b>";

echo "<table width='100%'>";
echo "<tr><th width='10%'>Item</th><th width='20%'>Supplier</th><th width='20%'>Description</th><th>Model/Make</th><th width='10%'>Stock Quantity</th><th width='10%'>Unit Price</th><th width='10%'>Receive Date</th><th width='10%'>Warranty Date</th></tr>";

$sql1 = "select row_id, category_code, description, consumable, stock_quantity from category_master where stock_quantity > 0 order by category_code";
$rs1 = mysql_query($sql1, $link_id);
if(!$rs1) echo sql_error();
while ($qd1 = mysql_fetch_array($rs1)){
  $i++;
  $category_code = $qd1["row_id"];
  $description = $qd1["category_code"] ;//. " (" . $qd1["description"] . ")<br>";
  $consumable = $qd1["consumable"];
  if ($consumable == 'Y') $description .= "Consumable";
  $qty = $qd1["stock_quantity"];
  $tqty += $qty;
  $sql2 = "select description, model_make, supplier_code, receive_date, unit_price, stock_quantity, warranty_date from item_master where stock_quantity > 0 and category_code=$category_code order by supplier_code, receive_date";
  $rs2 = mysql_query($sql2, $link_id);
  if(!$rs2) echo sql_error();
  $no = mysql_num_rows($rs2);
  if ($no) echo "<tr valign='top' id='row2'><th rowspan='$no' align='left'>$description ($qty)</th>";
  while ($qd2 = mysql_fetch_array($rs2)){
    $description = $qd2["description"];
    $model_make = $qd2["model_make"];
    $unit_price = $qd2["unit_price"];
    $receive_date = $qd2["receive_date"];
    $warranty_date = $qd2["warranty_date"];
    $stock_quantity = $qd2["stock_quantity"];
    $supplier_code = $qd2["supplier_code"];

    $supplier_detail = supplier_detail($supplier_code, $link_id);
    echo "<td>$supplier_detail</td><td>$description</td><td>$model_make</td><td align='center'>$stock_quantity</td><td align='right' nowrap>Rs. $unit_price</td><td align='center' nowrap>$receive_date</td><td align='center' nowrap>$warranty_date</td></tr>";
  }
}
echo "<tr><td colspan='4' align='right'>Total</td><td align='center'>$tqty</td></tr>";
echo "</table>";

include "page_footer.inc";
?>