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/search_parts.php

<?php
//show page head
include "page_header.inc";
$parts_code = $_REQUEST["parts_code"];

echo "<table width='100%'>";
echo "<th>Parts Details</th><th>Item Details</th><th>Category Details</th><th>Supplier Details</th></tr>";

$sql = "select * from parts_master where parts_code='$parts_code'";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$parts_id = $qd["row_id"];
$parts_code = $qd["parts_code"];
$item_code = $qd["item_code"];
$status = $qd["status"];
$remark = $qd["remark"];

echo "<tr valign='top'><td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>Parts ID</td><td>$parts_id</td></tr>";
echo "<tr><td nowrap>Parts Code</td><td>$parts_code</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "<tr><td>Remark</td><td>$remark</td></tr>";
echo "</table></td>";

$sql = "select * from item_master where row_id=$item_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$item_id = $qd["row_id"];
$description = $qd["description"];
$model_make = $qd["model_make"];
$category_code = $qd["category_code"];
$unit_price = $qd["unit_price"];
$r_date = $qd["receive_date"];
$w_date = $qd["warranty_date"];
$s_qty = $qd["stock_quantity"];
$i_qty = $qd["issued_quantity"];
$c_qty = $qd["scrap_quantity"];
$shelf_no = $qd["shelf_no"];
$supplier_code = $qd["supplier_code"];
$remark = $qd["remark"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td>Item ID</td><td>$item_id</td></tr>";
echo "<tr><td>Description</td><td>$description</td></tr>";
echo "<tr><td>Model/Make</td><td>$model_make</td></tr>";
echo "<tr><td nowrap>Unit Price</td><td>$unit_price</td></tr>";
echo "<tr><td nowrap>Receive Date</td><td nowrap>$r_date</td></tr>";
echo "<tr><td nowrap>Warranty Date</td><td nowrap>$w_date</td></tr>";
echo "<tr><td nowrap>Stock Qty.</td><td>$s_qty</td></tr>";
echo "<tr><td nowrap>Issued Qty.</td><td>$i_qty</td></tr>";
echo "<tr><td nowrap>Scrap Qty.</td><td>$c_qty</td></tr>";
echo "<tr><td nowrap>Shelf No.</td><td>$shelf_no</td></tr>";
echo "<tr><td>Remark</td><td>$remark</td></tr>";
echo "</table></td>";

$sql = "select * from category_master where row_id=$category_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$category_id = $qd["row_id"];
$category_code = $qd["category_code"];
$description = $qd["description"];
$s_qty = $qd["stock_quantity"];
$i_qty = $qd["issued_quantity"];
$c_qty = $qd["scrap_quantity"];
$t_cost = $qd["total_cost"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>Category ID</td><td>$category_id</td></tr>";
echo "<tr><td nowrap>Category Code</td><td>$category_code</td></tr>";
echo "<tr><td>Description</td><td>$description</td></tr>";
echo "<tr><td nowrap>Stock Qty.</td><td>$s_qty</td></tr>";
echo "<tr><td nowrap>Issued Qty.</td><td>$i_qty</td></tr>";
echo "<tr><td nowrap>Scrap Qty.</td><td>$c_qty</td></tr>";
echo "<tr><td nowrap>Total Cost</td><td nowrap>Rs. $t_cost</td></tr>";
echo "</table></td>";

$sql = "select * from supplier_master where row_id=$supplier_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$supplier_id = $qd["row_id"];
$supplier_code = $qd["supplier_code"];
$firm_name = $qd["firm_name"];
$phone_no = $qd["phone_no"];
$email = $qd["email"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>Supplier ID</td><td>$supplier_id</td></tr>";
echo "<tr><td nowrap>Supplier Code</td><td>$supplier_code</td></tr>";
echo "<tr><td nowrap>Firm Name</td><td>$firm_name</td></tr>";
echo "<tr><td nowrap>Phone No.</td><td>$phone_no</td></tr>";
echo "<tr><td>eMail</td><td>$email</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td></tr>";

echo "<tr><th>Used in PC</th><th>PC Details</th><th>PC Issue Details</th><th>User Details</th></tr>";

$sql = "select * from pc_configuration where parts_code=$parts_id";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$pc_code = $qd["pc_code"];
$issue_date = $qd["issue_date"];
$used_for = $qd["used_for"];

echo "<tr valign='top'><td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>PC ID</td><td>$pc_code</td></tr>";
echo "<tr><td nowrap>Issue Date</td><td nowrap>$issue_date</td></tr>";
echo "<tr><td nowrap>Used For</td><td>$used_for</td></tr>";
echo "</table></td>";

$sql = "select * from pc_master where row_id=$pc_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$pc_id = $qd["row_id"];
$pc_code = $qd["pc_code"];
$pc_series = $qd["pc_series"];
$description = $qd["description"];
$fabrication_year = $qd["fabrication_year"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>PC ID</td><td>$pc_id</td></tr>";
echo "<tr><td nowrap>PC Code</td><td nowrap>$pc_code</td></tr>";
echo "<tr><td nowrap>PC Series</td><td nowrap>$pc_series</td></tr>";
echo "<tr><td>Description</td><td>$description</td></tr>";
echo "<tr><td nowrap>Fabrication Year</td><td>$fabrication_year</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td>";

$sql = "select * from pc_issued where pc_code=$pc_id";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$user_code = $qd["user_code"];
$issue_date = $qd["issue_date"];
$due_date = $qd["due_date"];
$destination = $qd["destination"];
$issue_for = $qd["issue_for"];
$remark = $qd["remark"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td nowrap>Issue Date</td><td nowrap>$issue_date</td></tr>";
echo "<tr><td nowrap>Due Date</td><td nowrap>$due_date</td></tr>";
echo "<tr><td>Destination</td><td>$destination</td></tr>";
echo "<tr><td nowrap>Issue For</td><td>$issue_for</td></tr>";
echo "<tr><td>Remark</td><td>$remark</td></tr>";
echo "</table></td>";

$sql = "select * from user_master where row_id=$user_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$user_id = $qd["row_id"];
$user_code = $qd["user_code"];
$name = $qd["name"];
$category = $qd["category"];
$phone_no = $qd["phone_no"];
$email = $qd["email"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User ID</td><td>$user_id</td></tr>";
echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td>Name</td><td nowrap>$name</td></tr>";
echo "<tr><td>Category</td><td>$category</td></tr>";
echo "<tr><td nowrap>Phone No.</td><td>$phone_no</td></tr>";
echo "<tr><td>eMail</td><td>$email</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td></tr>";

echo "<tr><th>Issued for Project</th><th>User Deatils</th><th>Previous Users</th><th>Previosly Used in PCs</th></tr>";

$sql = "select * from parts_issued where parts_code=$parts_id";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$user_code = $qd["user_code"];
$issue_date = $qd["issue_date"];
$due_date = $qd["due_date"];
$destination = $qd["destination"];
$issue_for = $qd["issue_for"];
$remark = $qd["remark"];

echo "<tr valign='top'><td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td nowrap>Issue Date</td><td nowrap>$issue_date</td></tr>";
echo "<tr><td nowrap>Due Date</td><td nowrap>$due_date</td></tr>";
echo "<tr><td>Destination</td><td>$destination</td></tr>";
echo "<tr><td nowrap>Issue For</td><td>$issue_for</td></tr>";
echo "<tr><td>Remark</td><td>$remark</td></tr>";
echo "</table></td>";

$sql = "select * from user_master where row_id=$user_code";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$user_code = $qd["user_code"];
$name = $qd["name"];
$category = $qd["category"];
$phone_no = $qd["phone_no"];
$email = $qd["email"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td>Name</td><td nowrap>$name</td></tr>";
echo "<tr><td>Category</td><td>$category</td></tr>";
echo "<tr><td nowrap>Phone No.</td><td>$phone_no</td></tr>";
echo "<tr><td>eMail</td><td>$email</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td>";

$sql = "select * from parts_used where parts_code=$parts_id";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$user_code = $qd["user_code"];
$name = user_detail($user_code, $link_id);
$issue_date = $qd["issue_date"];
$due_date = $qd["due_date"];
$return_date = $qd["return_date"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td>Name</td><td nowrap>$name</td></tr>";
echo "<tr><td nowrap>Issue Date</td><td nowrap>$issue_date</td></tr>";
echo "<tr><td nowrap>Due Date</td><td nowrap>$due_date</td></tr>";
echo "<tr><td nowrap>Return Date</td><td nowrap>$return_date</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td>";

$sql = "select * from pc_used where pc_code=$pc_id";
$rs = mysql_query($sql, $link_id);
$qd = mysql_fetch_array($rs);

$pc_code = $qd["pc_code"];
//$name = user_detail($user_code, $link_id);
$issue_date = $qd["issue_date"];
$due_date = $qd["due_date"];
$return_date = $qd["return_date"];
$status = $qd["status"];

echo "<td><table id='orange_box' width='100%'>";
//echo "<tr><td nowrap>User Code</td><td>$user_code</td></tr>";
echo "<tr><td>PC Code</td><td nowrap>$pc_code</td></tr>";
echo "<tr><td nowrap>Issue Date</td><td nowrap>$issue_date</td></tr>";
echo "<tr><td nowrap>Due Date</td><td nowrap>$due_date</td></tr>";
echo "<tr><td nowrap>Return Date</td><td nowrap>$return_date</td></tr>";
echo "<tr><td>Status</td><td>$status</td></tr>";
echo "</table></td></tr>";

echo "</table>";
include "page_footer.inc";
?>