Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/pcstore/report/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/pcstore/report/form_computer_issue.php

<?php
include "report_header.inc";

$submit=$_REQUEST["submit"];
$pc_code = strtoupper($_REQUEST["pc_code"]);

/*//update unit price of computer
$sql1 = "select sum(unit_price) as tcost from parts_receipt i, parts_master s, product_configuration c where c.parts_no=s.parts_code and s.item_code=i.item_code and pc_code='$pc_code' group by pc_code";
$rs1 = mysql_query($sql1, $con);
if (!$rs1) echo sql_error();
$qd1 = mysql_fetch_array($rs1);
$total_cost = $qd1["tcost"];
if ($total_cost == "") $total_cost = 0;
*/

echo "<center><b><u><font color='red'>Product Configuration Form</font></u></b><p><br>";
echo "<table width='100%' border='1' bordercolordark='white' bordercolor='white' frame='box' cellspacing='0'>";

$sql = "select pc_code,series_code,description,fabrication_year from product_master where row_id=$pc_code";
$rs = mysql_query($sql, $con);
$qd = mysql_fetch_array($rs);
$pc_code1 = $qd["pc_code"];
$description = $qd["description"];
$series_code = $qd["series_code"];
$series = series($series_code, $con);
$fabrication_year = $qd["fabrication_year"];

$sql = "select issue_date,user_code from product_issued where pc_code=$pc_code";
$rs = mysql_query($sql, $con);
if (mysql_num_rows($rs)){
  $qd = mysql_fetch_array($rs);
  $issue_date = $qd["issue_date"];
  $user_code = $qd["user_code"];
  $customer = customer($user_code, $con);
}

echo "<tr><td width='10%' nowrap>Product Code:</td><td width='20%' nowrap>$pc_code1</td><td width='10%' nowrap>Series Name:</td><td width='20%' nowrap>$series</td><td nowrap width='10%'>Fabrication Year:</td><td nowrap width='15%'>$fabrication_year</td><tr>";
echo "<tr valign='top'><td>Description:</td><td>$description</td><td nowrap>Issued To:</td><td nowrap>$customer</td><td nowrap>Issue Date:</td><td>$issue_date</td><tr>";
echo "</table><p>";

echo "<table width='100%' border='1' cellspacing='0' cellpadding='1' bordercolordark='white' bordercolor='black' frame='box'>";
echo "<tr><th>No.</th><th nowrap>Item</th><th>Model/Make</th><th nowrap>Parts Code</th><th>Supplier</th><th nowrap>Unit Price</th><th nowrap>Receive Date</th><th nowrap>Warranty Date</th><tr>";

$sql = "select pc.*,im.category_code,im.description,im.model_make,im.supplier_code,im.unit_price,im.receive_date,im.warranty_date from product_configuration pc,parts_master pm,parts_receipt im where pc.pc_code=$pc_code and pc.parts_code=pm.row_id and pm.item_code=im.row_id order by im.category_code";
$rs = mysql_query($sql, $con);
while ($qd = mysql_fetch_array($rs)){
  $i++;
  $category_code1 = $qd["category_code"];
  $category = category($category_code1, $con);
  $parts_code1 = $qd["parts_code"];
  $parts = parts($parts_code1, $con);
  $description = $qd["description"];
  $model_make = $qd["model_make"];
  $supplier_code1 = $qd["supplier_code"];
  $supplier = supplier($supplier_code1, $con);
  $unit_price = $qd["unit_price"];
  $receive_date = $qd["receive_date"];
  $warranty_date = $qd["warranty_date"];
  if ($warranty_date == "" or $warranty_date == NULL or $warranty_date == "0000-00-00") $warranty_date = "No warranty";
  if ($warranty_date == $receive_date) $warranty_date = "Life time";

  $total_cost += $unit_price;
  echo "<tr valign='top'><td align='center'>$i</td><td>$category</td><td>$model_make</td><td nowrap>$parts</td><td>$supplier</td><td align='right' nowrap>Rs. $unit_price</td><td align='center' nowrap>$receive_date</td><td align='center' nowrap>$warranty_date</td><tr>";
}
$total_cost = number_format($total_cost, 2);
echo "<tr><th colspan='6' align='right'>Total $i Items Worth Rs. $total_cost</th><td colspan='2'>(Approx.)</td></tr></table>";

echo "<p><table width='100%'>";
echo "<tr><td><p><p>Received above items in good condition.<p></td><td align='right'><p><p>Sanctioned By<p></td></tr>";
echo "<tr><td><br><br>Received By</td><td align='right'><br><br>Issued By</td></tr>";
echo "</table><p>User is requested to report defects in any of the above items (if found) within the warranty period, so that warranty can be claimed.";

echo '<p><p><input type="button" value="PRINT" onClick="window.print()" />';
echo "</center>";

include "report_footer.inc";

?>