Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/mcell/report/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/mcell/report/stock_computer.php

<?php
//show page head
include "report_header.inc";
$tbl = "pc_master";
echo "</center><b>Products in Stock</b><br>";

$series_code = $_REQUEST['series_code'];
echo "Select PC Series <select name='series_code'>";
$rs = mysql_query("select row_id,name from product_series order by name", $con);
while ($o = mysql_fetch_object($rs)){
  $row_id = $o->row_id;
  $description = $o->name;
  echo "<option value='$row_id'";
  if ($row_id == $series_code) echo " selected";
  echo ">$description</option>";
}
?>
</select> <input type='submit' name='submit' value='LIST'>
<table width='100%' id='gray_box' border='1' cellspacing='0' cellpadding='5'>
<tr><th width='10%'>No.</th><th width='25%'>Product Code</th><th width='30%'>Description</th><th width='15%'>Cost</th><th width='10%'>Fab.Year</th><th width='10%'>Status</th></tr>
<?php
if (!$series_code) exit;
/*
$sql1 = "select pc_code,sum(unit_price) cost from product_configuration pc left join parts_master pm on pc.parts_code=pm.row_id left join parts_receipt im on pm.item_code=im.row_id group by pc_code";
$rs1 = mysql_query($sql1, $con);
while ($o = mysql_fetch_object($rs1)){
  $pc_code1 = $o->pc_code;
  $cost = $o->cost;
  mysql_query("update $tbl set cost=$cost where row_id=$pc_code1", $con);
  //echo $pc_code . '-- Rs.' . $cost . '<br>';
}
exit;
*/
$sql1 = "select row_id,series_code,pc_code,description,cost,fabrication_year,status from product_master where ";
if ($series_code) $sql1 .= "series_code=$series_code order by pc_code";
$rs1 = mysql_query($sql1, $con);
if(!$rs1) echo sql_error();
while ($o = mysql_fetch_object($rs1)){
  $i++; $j++;
  $row_id = $o->row_id;
  $pc_code = $o->pc_code;
  $description = $o->description;
  $cost = $o->cost;
  $tcost += $cost;
  $fabrication_year = $o->fabrication_year;
  $status = $o->status;
  if ($series_code != $o->series_code){
    $series_code = $o->series_code;
    $series = series($series_code,$con);
    echo "<tr><td colspan='5'><font size='+1' color='red'>$series</td></tr>";
    $i = 1;
  }
  echo "<tr id='gray_box' valign='top'><td>$i</td><td><a href='report/form_computer_issue.php?pc_code=$row_id'>$pc_code</a></td><td>$description</td><td align='right'>Rs. $cost</td><td align='center'>$fabrication_year</td><td>$status</td></tr>";
}
echo "<tr id='gray_box' valign='top'><td></td><td></td><td align='right'><b>Total&nbsp;</b></td><td align='right'><b>Rs. $tcost.00</b></td><td></td><td></td></tr>";
echo "</table>";

include "report_footer.inc";
?>