<?
# last update 18 july 2010
include_once('../hdr_general.php');
/* **************************************************************************************************** */
$pubmodule = $_REQUEST["module"];
$pubtask = $_REQUEST["task"];
$pubitemid = $_REQUEST["itemid"];
/* **************************************************************************************************** */
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../css/<?=$_SESSION['Xcssfile'];?>" type="text/css" media=all>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print">
<title>PMS-EVO</title>
</head>
<body leftmargin=5 topmargin=5 bgcolor="#CCCCCC">
<p style=\"color:#4D4D4D\"><u>REMARK</u><br/>
<?

 if ($_GET['y'] == "reject") {

 
$kk1 = "SELECT * FROM zikay_pmsv5.mro_details WHERE mro_pkey ='".$_GET['itemid']."'";
$kk2 = mysql_query($kk1);
$kk3 = mysql_fetch_assoc($kk2);
$mroid = $kk3['mro_id'];
$mropkey = $kk3['mro_projectpkey'];

//echo $mroid."<br />"; 
//echo $mropkey."<br />";

$ll1 = "SELECT * FROM zikay_pmsv5.mro_details WHERE mro_id ='".$mroid.".' AND mro_status = '9'";
$ll2 = mysql_query($ll1);
//echo $ll1."<br />";
$ll3 = mysql_fetch_assoc($ll2);


$mm1 = "SELECT * FROM zikay_pmsv5.mro_approvals WHERE approval_mropkey = '".$ll3['mro_pkey']."' ORDER BY approval_date DESC";
//echo $mm1."<br />";
$mm2 = mysql_query($mm1);
$mm3 = mysql_fetch_assoc($mm2);

echo $mm3['approval_remarks'];

//$ll1 = "SELECT * FROM zikay_pmsv5.mro_approvals ";

} else {
// normal
 $sql1 = "SELECT * FROM `zikay_pmsv5`.`mro_approvals` WHERE approval_mropkey = '".$_GET['itemid']."'";
 $sxx = mysql_query($sql1);
 //echo "<p style=\"color:#4D4D4D\"><u>REMARK</u>";
 while($data = mysql_fetch_assoc($sxx))
 {
 echo "<br />".$data['approval_remarks']. "";
 }
 echo  "</p>";
  }    
?>
<iframe src ="rpt_mro2.php?itemid=<?php echo $_GET['itemid'];?>&y=<?php echo $_GET['y'];?>" width="100%" height="100%" frameborder="0">

</iframe>
