Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/pcstore/backupxxxxxxx/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/pcstore/backupxxxxxxx/query_group_dues.php

<?php

$tbl = $parts_issued;
echo "<b>Group 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 sent as<br><pre id='orange_box'>" . send_mail($user_code) . "</pre><p>";;
}

$sql = "select row_id,name,strength from $customer_group where status='online' order by name";
$rs = mysql_query($sql);
echo "Select <select name='group_code' onchange=\"javascript:document.location.href='inner.php?conf=$conf&group_code=' + this.value\"><option value=''>Customer 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> Select group to list dues status of all customers (sorted on name)<p>";
if (!$group_code) exit;
//echo "<input type='submit' name='submit' value='MAIL'><p>";

$sql = "select * from $customer_master where group_code=$group_code order by name";
$rs = mysql_query($sql);
while ($o = mysql_fetch_object($rs)){
  $i = 0; $flag = "FALSE";
  $user_code = $o->row_id;
  $name = $o->name;
  $status = $o->status;
  $j++;
  echo "$j. <font color='green' size='+1'>$name</font> ($status) ";
  $sql = "select pm.series_code,pm.pc_code,pi.pc_code as p_code,pi.issue_date,pi.due_date,pi.issue_for,pi.destination,pi.remark from $product_issued pi, $product_master pm where pi.pc_code=pm.row_id and pi.user_code=$user_code";
  $rs1 = mysql_query($sql);
  if(!$rs1) echo sql_error();
  if (mysql_num_rows($rs1)){
    $flag = "TRUE";
    echo "<dir><b>Product Dues</b><br>";
    echo "<table width='100%' id='orange_box'><tr><th width='10%' nowrap>Product Series</th>
    <th width='30%' nowrap>Description</th><th width='10%' nowrap>Issue Date</th>
    <th width='10%' nowrap>Due Date</th><th width='10%' >Issue For</th><th width='30%'>Remark</th></tr>";
    while($qd = mysql_fetch_array($rs1)){
      $i++;
      $row_id1 = $qd["row_id"];
      $series_code = $qd["series_code"];
      $series = series($series_code);
      $pc_code = $qd["pc_code"];
      $p_code = $qd["p_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><td><a href='inner.php?conf=report_form_product_issue&pc_code=$p_code'>$pc_code</td>";
      echo "<td align='center'>$issue_date</td><td align='center'>$due_date</td><td>$issue_for ($destination)</td><td>$remark</td></tr>";
    }
    echo "</table></dir>";
  }else{
    $flag = "FALSE";
  }
  //show user account
  $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";
  $rs1 = mysql_query($sql);
  if(!$rs1) echo sql_error();
  if (mysql_num_rows($rs1)){
    $flag = "TRUE";
    echo "<dir><b>Parts Dues</b><br>";
    //echo "<a href='inner.php?conf=report_form_parts_issue&user_code=$user_code'>Print Report on Issued Items</a><br>";
    echo "<table width='100%' id='orange_box'><tr><th width='10%' nowrap>Parts Code</th>
    <th width='30%' nowrap>Description</th><th width='10%' nowrap>Issue Date</th>
    <th width='10%' nowrap>Due Date</th><th width='10%' nowrap>Issue For</th><th width='30%'>Remark</th></tr>";
    while($qd = mysql_fetch_array($rs1)){
      $i++;
      $row_id1 = $qd["row_id"];
      $parts_code1 = $qd["parts_code"];
      $parts = parts($parts_code1);
      $item_code1 = $qd["item_code"];
      $item = item($item_code1);
      $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><a href='inner.php?conf=query_search_parts&parts_code=$parts'>$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></dir>";
  }else{
    if ($flag == "FALSE") echo " ... Nothing due<br>";
  }
  echo "</dir>";
}
/*
//show user history
echo "<p><b>Returned by Customer</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);
if (!$rs) echo mysql_error();
if (mysql_num_rows($rs)){
  echo "<table width='98%'><tr><th nowrap>Parts Code</th><th nowrap>Description</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);
    $item_code1 = $qd["item_code"];
    $item = item($item_code1);
    $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>";
}
*/

?>