Your IP : 216.73.216.40


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

<?php
include "../page_header.inc";
$tbl = "parts_issued";
echo "<b>User Dues</b><p>";

$submit = $_REQUEST["submit"];
$row_id = $_REQUEST["row_id"];
$group_code = $_REQUEST["group_code"];
$user_code = $_REQUEST["user_code"];

$category_code = $_REQUEST["category_code"];
$parts_code = $_REQUEST["parts_code"];

$issue_date = $_REQUEST["issue_date"];
if ($issue_date == "") $issue_date = date("Y-m-d");
$issue_for = $_REQUEST["issue_for"];
$destination = $_REQUEST["destination"];
if ($destination == "") $destination="lab";
$due_date = $_REQUEST["due_date"];
if ($due_date == "") $due_date = date("Y-m-d");
$return_date = date("Y-m-d");
$status = $_REQUEST["status"];
$flag = "FALSE";

if ($submit == "MAIL"){
  echo mail($user_code, $con);
}

$sql = "select row_id,name,strength from group_master where status='online' order by name";
$rs = mysql_query($sql, $con);
echo "Select <select name='group_code' onchange=\"javascript:document.location.href='" . $_SERVER["SCRIPT_NAME"] . "?group_code=' + this.value\"><option value=''>User Group</option>";
while ($qd = mysql_fetch_array($rs)){
  $row_id = $qd["row_id"];
  $name = $qd["name"];
  echo "<option value='$row_id'";
  if ($row_id == $group_code) echo " selected";
  echo ">$name</option>";
}
echo "</select> ";
//if (!$group_code) exit;

$sql = "select row_id,name from user_master where group_code=$group_code and status='online' order by name";
$rs = mysql_query($sql, $con);
echo " Select User <select name='user_code'>";
while ($qd = mysql_fetch_array($rs)){
  $row_id1 = $qd["row_id"];
  $name = $qd["name"];
  echo "<option value='$row_id1'";
  if ($row_id1 == $user_code) echo " selected";
  echo ">$name</option>";
}
echo "</select> <input type='submit' name='submit' value='FIND'> ";

if (!$user_code) exit;
echo "<input type='submit' name='submit' value='MAIL'><p>";

$i = 0; $flag = "FALSE";
echo "<p><b>PC Dues</b><br>";
$sql = "select pm.series_code,pm.pc_code,pi.issue_date,pi.due_date,pi.issue_for,pi.destination,pi.remark from pc_issued pi, pc_master pm where pi.pc_code=pm.row_id and pi.user_code=$user_code";
$rs = mysql_query($sql, $con);
if(!$rs) echo sql_error();
if (mysql_num_rows($rs)){
  echo "<table width='100%'><tr><th nowrap>PC Series</th><th nowrap>Description</th><th nowrap>Issue Date</th><th nowrap>Due Date</th><th>Issue For</th><th>Remark</th></tr>";
  while($qd = mysql_fetch_array($rs)){
    $i++;
    $row_id1 = $qd["row_id"];
    $series_code = $qd["series_code"];
    $series = series($series_code, $con);
    $pc_code = $qd["pc_code"];
    $issue_date = $qd["issue_date"];
    $issue_for = $qd["issue_for"];
    $destination = $qd["destination"];
    $due_date = $qd["due_date"];
    if ($due_date > date("Y-m-d")) $overdue = "TRUE";
    $remark = $qd["remark"];
    if ($i % 2) echo "<tr id='row1'>"; else echo "<tr id='row2'>";
    echo "<td>$series</td>";
    echo "<td>$pc_code</td><td align='center'>$issue_date</td><td align='center'>$due_date</td><td>$issue_for ($destination)</td><td>$remark</td></tr>";
  }
  echo "</table>";
}
//show user account
echo "<p><b>Parts Dues</b> ";
$sql = "select i.*,m.item_code from parts_issued i, parts_master m where i.parts_code=m.row_id and i.user_code=$user_code order by i.issue_date";
$rs = mysql_query($sql, $con);
if(!$rs) echo sql_error();
if (mysql_num_rows($rs)){
  echo "<a href='issue_form.php?user_code=$user_code'>Print Report on Issued Items</a><br>";
  echo "<table width='100%'><tr><th nowrap>Parts Code</th><th nowrap>Item Detail</th><th nowrap>Issue Date</th><th nowrap>Due Date</th><th>Issue For</th><th>Remark</th></tr>";
  while($qd = mysql_fetch_array($rs)){
    $i++;
    $row_id1 = $qd["row_id"];
    $parts_code1 = $qd["parts_code"];
    $parts = parts($parts_code1, $con);
    $item_code1 = $qd["item_code"];
    $item = item($item_code1, $con);
    $issue_date = $qd["issue_date"];
    $issue_for = $qd["issue_for"];
    $destination = $qd["destination"];
    $due_date = $qd["due_date"];
    if ($due_date > date("Y-m-d")) $overdue = "TRUE";
    $remark = $qd["remark"];
    if ($i % 2) echo "<tr id='row1'>"; else echo "<tr id='row2'>";
    echo "<td>$parts</td>";
    echo "<td>$item</td><td align='center'>$issue_date</td><td align='center'>$due_date</td><td>$issue_for ($destination)</td><td>$remark</td></tr>";
  }
  echo "</table>";
}
//show user history
echo "<p><b>Returned by User</b>";
$sql = "select u.*,m.item_code from parts_used u left join parts_master m on u.parts_code=m.row_id where u.user_code=$user_code";
$rs = mysql_query($sql, $con);
if (!$rs) echo mysql_error();
if (mysql_num_rows($rs)){
  echo "<table width='98%'><tr><th nowrap>Parts Code</th><th nowrap>Item Details</th><th nowrap>Issue Date</th><th nowrap>Return Date</th><th>Remark</th></tr>";
  while ($qd = mysql_fetch_array($rs)){
    $parts_code1 = $qd["parts_code"];
    $parts = parts($parts_code1, $con);
    $item_code1 = $qd["item_code"];
    $item = item($item_code1, $con);
    $issue_date = $qd["issue_date"];
    $return_date = $qd["return_date"];
    $remark = $qd["remark"];
    echo "<tr><td>$parts</td><td>$item</td><td align='center'>$issue_date</td><td align='center'>$return_date</td><td>$remark</td></tr>";
  }
  echo "</table>";
}
include "../page_footer.inc";
?>