<?
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>Purchasing Online (ZIKAY)</title>
</head>
<body leftmargin=5 topmargin=5 bgcolor="#ffffff">
<table border=0 cellspacing=0 cellpadding=0 width=760>
<tr valign=top>
<td valign=top width=760px>

  <?
  include_once('../models/poModel.php');
  $mypoModel=new poModel;
  include_once('../models/mroModel.php');
  $mymroModel=new mroModel;
  include_once('../models/supplierModel.php');
  $mysupplierModel=new supplierModel;

  // get project info
  // get mro details and items

  //$project_data = $myprojectModel->getdata_project

  $myprojectid = $_SESSION['Xprojectid'];
  $myprojectname = $_SESSION['Xprojectname'];
  $po_data = $mypoModel->getdata_po($pubitemid);
  $po_items = $mypoModel->getlist_poitems($pubitemid);

  $mro_data = $mymroModel->getdata_mro($po_data['po_mropkey']);

  $supplier_data = $mysupplierModel->getdata_supplier($po_data['po_supplierpkey']);
  ?>

  <!-- //////// -->
  <form action="<?php echo $_SERVER['PHP_SELF'];?>?itemid=<?php echo $_GET['itemid'];?>&save=1" method="post">
  
  <table border=0 cellspacing=2 cellpadding=0 width=760>
  <tr valign=top>
  <td valign=top width=100>&nbsp;</td>
  <td valign=top width=560 class=rptzikayheader style="text-decoration: none; text-align: center;"><img src="../gfx/zikayheader.png" style="width: 226px; height: 82px;"><!-- 390/87 416/93 519/116 --><!--<br><span style="font-size: 14px;"><u>KEMBANG SERANTAU SDN. BHD.</u></span>--></td>
  <td valign=top width=100>
    <table border=0 cellspacing=0 cellpadding=2 width=100>
    <tr valign=top><td valign=top width=100 class=rptzikayconfidential style="font-size: 10px; text-align: right;">PU-SP-01-F4</td></tr>
    <tr valign=top><td valign=top width=100 class=rptzikayconfidential style="font-size: 10px; text-align: right; border-top: 0px;">Rev : 3</td></tr>
    </table>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=760 colspan=3 class=rptzikayheader style="text-decoration: none; text-align: center;"><span style="font-size: 14px;"><b><u>PURCHASE ORDER</u></b></span></td>
  </tr>
  </table>
  <br>

  <table border=0 cellspacing=2 cellpadding=0 width=760>
  <tr valign=top>
  <td valign=top width=100% class=cboxcontent>
    <table border=0 cellspacing=0 cellpadding=2 width=760 style="border: 0px;">
    <tr valign=top>
    <td valign=top width=400 class=listcontent style="border: 0px;">
      <table border=0 cellspacing=0 cellpadding=2 width=350>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="border-left: 1px solid black; border-top: 1px solid black;"><img src="../pixel.gif" border=0 width=1 height="1"></td>
      <td valign=top width=10 class=rptlistcontent style="border-top: 1px solid black;"><img src="../pixel.gif" border=0 width=9 height="1"></td>
      <td valign=top width=322 class=rptlistcontent>
      </td>
      <td valign=top width=10 class=rptlistcontent style="border-top: 1px solid black;"><img src="../pixel.gif" border=0 width=9 height="1"></td>
      <td valign=top width=4 class=rptlistcontent style="border-right: 1px solid black; border-top: 1px solid black;"><img src="../pixel.gif" border=0 width=1 height="1"></td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="border-left: 1px solid black; height: 9px;">
      <img src="../pixel.gif" border=0 width=1 height=9>
      </td>
      <td valign=top width=342 colspan=3 rowspan=5 class=rptlistcontent style="height: 100%;">
        <table border=0 cellspacing=0 cellpadding=2 width=350>
        <tr valign=top>
        <td valign=top width=330 class=rptlistcontent>
        <?=$supplier_data['supplier_name'];?><br><?=richtext($supplier_data['supplier_address']);?><br><?=$po_data['po_attn'];?><br>Phone: <?=$supplier_data['supplier_phone'];?><br />Fax: <?=$supplier_data['supplier_fax'];?>
		
        </td>
        </tr>
        </table>
      </td>
      <td valign=top width=4 class=rptlistcontent style="border-right: 1px solid black; height: 9px;">
      <img src="../pixel.gif" border=0 width=1 height=9>
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      <td valign=top width=4 class=rptlistcontent style="height: 100%;">&nbsp;
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="border-left: 1px solid black; height: 9px;">
      <img src="../pixel.gif" border=0 width=1 height=9>
      </td>
      <td valign=top width=4 class=rptlistcontent style="border-right: 1px solid black; height: 9px;">
      <img src="../pixel.gif" border=0 width=1 height=9>
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=4 class=rptlistcontent style="border-left: 1px solid black; border-bottom: 1px solid black;"><img src="../pixel.gif" border=0 width=1 height="1"></td>
      <td valign=top width=10 class=rptlistcontent style="border-bottom: 1px solid black;"><img src="../pixel.gif" border=0 width=9 height="1"></td>
      <td valign=top width=322 class=rptlistcontent>
      </td>
      <td valign=top width=10 class=rptlistcontent style="border-bottom: 1px solid black;"><img src="../pixel.gif" border=0 width=9 height="1"></td>
      <td valign=top width=4 class=rptlistcontent style="border-right: 1px solid black; border-bottom: 1px solid black;"><img src="../pixel.gif" border=0 width=1 height="1"></td>
      </tr>
      </table>
    </td>
    <td valign=top width=360 class=listcontent style="border: 0px; text-align: right;">
      <br>
      <table border=0 cellspacing=0 cellpadding=3 width=350 style="border: 1px solid black; border-collapse: collapse;">
      <tr valign=top>
      <td valign=top width=180 class=rptlistcontent>
      P.O. No
      </td>
      <td valign=top width=150 class=rptlistcontent>
      : <?//=poidstr($po_data['po_no'],$po_data['po_revno']);?>
	  <?=poidstr($po_data['po_no']);?>
      </td>
      <td valign=top width=120 class=rptlistcontent>
      MRO No
      </td>
      <td valign=top width=80 class=rptlistcontent>
      : <?=mroidstr($mro_data['mro_id']);?>
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=180 class=rptlistcontent>
      Credit Terms
      </td>
      <td valign=top width=120 class=rptlistcontent>
      : <?//=$po_data['po_top']." days";?>
	  <?php if (mroidstr($mro_data['mro_id']) == "MRO0465"){ // temporary hardcode 3-1-2012
	  echo "Cash";
	  }else{
	  echo $po_data['po_top']." days";
	  }
	  ?>
      </td>
	  <td valign=top width=70 class=rptlistcontent>
      RFQ No
      </td>
	  <td valign=top width=120 class=rptlistcontent>
	  <?php
	  $rfq1 = "SELECT * FROM `zikay_pmsv5`.`po_details` WHERE po_pkey ='".$_GET['itemid']."'";
	  $rfq2 = mysql_query($rfq1);
	  //echo $rfq1;
	  $rfq3 = mysql_fetch_assoc($rfq2);
	  $xx = $rfq3['po_itqpkey'];
	  
	  $rfq4 = "SELECT * FROM `zikay_pmsv5`.`itq_details` WHERE itq_pkey ='".$xx."'";
	  $rfq5 = mysql_query($rfq4);
	  $rfq6 = mysql_fetch_assoc($rfq5);
	  
	  ?>
      : <?=itqidstr($rfq6['itq_rfqno']);?>
      </td>
      <td valign=top width=140 colspan=2 class=rptlistcontent>
      &nbsp;
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=150 class=rptlistcontent>
      Date
      </td>
      <td valign=top width=120 colspan=3 class=rptlistcontent>
      : <?=unconverttounix($po_data['po_date']);?><?php //echo "<br/>".$po_data['po_date'];?>
      </td>
      <td valign=top width=140 colspan=2 class=rptlistcontent>
      &nbsp;
      </td>
      </tr>
      <tr valign=top>
      <td valign=top width=90 class=rptlistcontent>
      Project No.
      </td>
      <td valign=top width=260 colspan=3 class=rptlistcontent>
      : <?=$myprojectid;?>
      </td>
      </tr>
      </table>
    </td>
    </tr>
    </table>
    <br>

  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=100% height=490 class=cboxcontent>

    <table border=0 cellspacing=0 cellpadding=0 width=760 style="border: 1px solid black; border-collapse: collapse; height: 100%;">
    <tr valign=top>
    <td valign=top width=100 class=rptlistheader style="text-transform: none; height: 20px;">ITEM</td>
    <td valign=top width=260 class=rptlistheader style="text-transform: none;">DESCRIPTION</td>
    <td valign=top width=100 class=rptlistheader style="text-transform: none;">QTY</td>
    <td valign=top width=100 class=rptlistheader style="text-transform: none;">UNIT</td>
    <td valign=top width=100 class=rptlistheader style="text-transform: none;">UNIT PRICE</td>
    <td valign=top width=100 class=rptlistheader style="text-transform: none;">AMOUNT</td>
    </tr>
    
	
	<!-- tambahan quick edit-->
	<?php
	$a1 = "SELECT * FROM `zikay_pmsv5`.`po_details` WHERE po_pkey = '".$_GET['itemid']."'";
    $a2 = mysql_query($a1);
	$a3 = mysql_fetch_assoc($a2);
	$a4 = $a3['po_mropkey'];
	
	$dd = "SELECT item_subtradepkey FROM `zikay_pmsv5`.`mro_items` WHERE item_mropkey = '".$a4."'";
	$dd2 = mysql_query($dd);
	$dd3 = mysql_fetch_assoc($dd2);

	$ee = $dd3['item_subtradepkey'];

	$ff = "SELECT * FROM `zikay_pmsv5`.`settings_trades` WHERE tradepkey = '" .$ee. "'";
	$ff2 = mysql_query($ff);
	$ff3 = mysql_fetch_assoc($ff2);
	
	
	?>
	<tr valign=top>
      <td valign=top width=100 class=rptlistnumber style="height: 16px;">&nbsp;<br /><b><?php echo $ff3['tradecode'];?></b></td>
      <td valign=top width=260 class=rptlistcontent-left style="text-indent: 2px;">TO SUPPLY AND DELIVER :<br />
	  <b><?php echo $ff3['tradedescription']; ?>
	  
	  
	  </td>
      <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
      <td valign=top width=100 class=rptlistcontent-left style="text-align: center;">&nbsp;</td>
      <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
      <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
      </tr>
	
	<!-- -->
    <? $poitemcount=0; ?>
    <? $pototalamount=0; ?>
    <? $pototalstring=""; ?>
       <? $count1 = 1; ?>
    <? foreach($po_items as $myitem) { ?>

      <? $posubtotal = ($myitem['item_rate']*$myitem['item_quantity']); ?>

      <tr valign=top>
      <td valign=top width=100 class=rptlistnumber style="height: 16px;"><?php echo $count1; ?></td>
      <td valign=top width=260 class=rptlistcontent-left style="text-indent: 2px;"><?=unescape($myitem['item_code']);?> : 
	  <?=unescape($myitem['item_description']);?><? if ($myitem['item_remarks']!="") { echo "<br>".unescape($myitem['item_remarks']); } ?>
	  <br /><br />
	   <?php 
	  /********************** 
	     cancel remark add
	     quick edit : yusr   
         remark : function at below/end of this script.		 
	   **********************/
	 // echo po_cancel_show($po_data['po_cancel'],$_GET['itemid']);
	 
	   
	  ?>
	  
	  </td>
      <td valign=top width=100 class=rptlistcontentnumeric-left><?=number_format($myitem['item_quantity'],4);?>&nbsp;</td>
      <td valign=top width=100 class=rptlistcontent-left style="text-align: center;"><?=$myitem['item_unit'];?>&nbsp;</td>
      <td valign=top width=100 class=rptlistcontentnumeric-left><?=number_format($myitem['item_rate'],2);?>&nbsp;</td>
      <td valign=top width=100 class=rptlistcontentnumeric-left><?=number_format($posubtotal,2);?>&nbsp;</td>
      </tr>
       <?php echo po_cancel_show($po_data['po_cancel'],$_GET['itemid'],$poitemcount); ?>
      <? $poitemcount++; ?>
      <? $pototalamount += $posubtotal; ?>

    <? $count1++;} ?>
   
    <tr valign=top>
    <td valign=top width=100 class=rptlistnumber style="height: 100%;">&nbsp;</td>
    <td valign=top width=260 class=rptlistcontent-left>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-left style="text-align: center;">&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
    </tr>
    <?php
	$dd1 = "SELECT * FROM zikay_pmsv5.po_details WHERE po_pkey ='".$_GET['itemid']."'";
	$dd2 = mysql_query($dd1);
	$dd3 = mysql_fetch_assoc($dd2);
	
	?>
    <tr valign=top>
    <td valign=top width=100 class=rptlistnumber style="height: 16px;">&nbsp;</a></td>
    <td valign=top width=260 class=rptlistcontent-left>Transport :  <br /><textarea style="overflow:auto; border: 0;" name="remark_desc1"rows="15" cols="45"><?php if($dd3['remark_desc1'] == "" ) { echo "Put your remark here ..";} else {  echo $dd3['remark_desc1']; } ?></textarea><br /> <b>Note: Total Items <?=$myitem['item_no'];?> Only</b><br><br></td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-left style="text-align: center;">&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-left>
	<?php 
	// transport
	$skl = "SELECT * FROM `zikay_pmsv5`.`po_details` WHERE po_pkey = '".$_GET['itemid']."'";
	$skl2 = mysql_query($skl);
	$skl3 = mysql_fetch_assoc($skl2);
	
	$xx1 = $skl3['po_supplierpkey']; 
	$xx2 = $skl3['po_itqpkey'];
	
	$skl4 = "SELECT * FROM `zikay_pmsv5`.`itq_suppliers` WHERE itq_supplierpkey = '".$xx1."' AND itq_pkey = '".$xx2."'";
	$skl5 = mysql_query($skl4);
	$skl6 = mysql_fetch_assoc($skl5);
    
	//echo $xx1;
	//echo $skl4;
	echo number_format($skl6['itq_transportrate'],2) ."&nbsp;";
	
	?><br /> &nbsp;</td>
    </tr>

    <?
	$kirac = $pototalamount + $skl6['itq_transportrate'];
    $pototalstring=number_format($kirac,2);	// test "561,246.23/00";
    $pototalstring=str_replace(",","",$pototalstring);
    $postrings = explode(".", $pototalstring);
    $ponum = number_to_words($postrings[0])." Ringgit";
    if ($postrings[1]!="00") {
      $podec = " and ".number_to_words($postrings[1])." Cents";
    }
    ?>

    <tr valign=top>
    <td valign=top width=560 colspan=4 class=rptlistcontent style="border-top: 1px solid black; height: 16px;">Ringgit Malaysia: <u><?=$ponum.$podec." Only";?></u></td>
    <td valign=top width=100 class=rptlistcontent-left style="border-top: 1px solid black;"><b>TOTAL</b><br><br></td>
    <td valign=top width=100 class=rptlistcontentnumeric-left style="border-top: 1px solid black;"><b><?=number_format($kirac,2);?>&nbsp;</b>&nbsp;</td>
    </tr>

    </table>

  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=70% class=cboxcontent>

    <table border=0 cellspacing=0 cellpadding=4 width=760 style="border: 1px solid black; border-collapse: collapse;">
    <tr valign=top>
    <td valign=top width=380 class=rptlistcontent-leftrightbottom>

      <table border=0 cellspacing=0 cellpadding=0 width=370 style="border: 0px;">
      <tr valign=top>
      <td valign=top width=100 class=rptlistcontent>
      Project Location:
      </td>
      <td valign=top width=270 class=rptlistcontent>
      <br>
      <? if ($po_data['po_co']!="") { echo $po_data['po_co']."<br>"; } ?>
	  <?=$myprojectname;?><br>
	  <?
	  ////////////////////////////////////////////////////
	  $sql1 = "SELECT * FROM zikay_pmsv5.project_details WHERE projectname = '$myprojectname'";
	  $sql2 = mysql_query($sql1);
	  while($data = mysql_fetch_array($sql2)) {
	  //echo $data['projectdescription'];
	  
	  }
	  
	  ?>
	  <!-- <input type="text" name="xxx" id="xxx" value="" size="30"> -->
	  <textarea  style="overflow:auto; border: 0;" name="remark_pl" rows="7" cols="45"><?php if($dd3['remark_pl'] == "" ) { echo "Put your remark here ..";} else {  echo $dd3['remark_pl']; } ?></textarea>
	  <br><?=$po_data['po_contactnumber'];?><br><br><?=$po_data['po_contactperson'];?><br><br>
      </td>
      </tr>
      </table>

    </td>
    <td valign=top width=380 class=rptlistcontent-leftrightbottom>

      <table border=0 cellspacing=0 cellpadding=0 width=370 style="border: 0px;">
      <tr valign=top>
      <td valign=top width=370 class=rptlistcontent style="font-family: times new roman; font-size: 11px;">
      <u>CONDITION AND INSTRUCTION</u><br>
        <table border=0 cellspacing=0 cellpadding=0 width=370 style="border: 0px;">
        <tr valign=top>
        <td valign=top width=15 class=rptlistcontent>
        1.
        </td>
        <td valign=top width=355 class=rptlistcontent style="font-family: times new roman; font-size: 10px;">
         No goods are to be delivered without a written order signed by any Person Authorised by the company.
        </td>
        </tr>
        <tr valign=top>
        <td valign=top width=15 class=rptlistcontent>
        2.
        </td>
        <td valign=top width=355 class=rptlistcontent style="font-family: times new roman; font-size: 10px;">
         Materials must  not be in excess of quantity ordered and must be of the required quality, and must meet the specification of our order, otherwise they will be returned at supplier’s risk and expense.
		 </td>
        </tr>
        <tr valign=top>
        <td valign=top width=15 class=rptlistcontent>
        3.
        </td>
        <td valign=top width=355 class=rptlistcontent style="font-family: times new roman; font-size: 10px;">
        Delivery  time is the essence of the contract and we have option to cancel the contract, to charge late penalty charges or refuse acceptance  if not complied with.  for <b>KEMBANG SERANTAU SDN. BHD.</b> (to refer KSSB terms & condition) </td>
        </tr>
        </table>
      </td>
      </tr>
      </table>

    </td>
    </tr>

    <tr valign=top>
    <td valign=top width=380 class=rptlistcontent-left>

      <table border=0 cellspacing=0 cellpadding=0 width=370 style="border: 0px;">
      <tr valign=top>
      <td valign=top width=100 class=rptlistcontent>
      <u>Prepared By:</u>
      </td>
      <td valign=top width=270 class=rptlistcontent>
      <br><br>
      <u>&nbsp;<? echo $po_data['po_requestor'];//$pubuserfullname;?><br>
	  <? //$po_data['po_requestor'];?></u>
      </td>
      </tr>
      </table>

    </td>
    <td valign=top width=380 class=rptlistcontent-left>

      <table border=0 cellspacing=0 cellpadding=0 width=370 style="border: 0px;">
      <tr valign=top>
      <td valign=top width=130 class=rptlistcontent>
      <u>Authorised Signature:</u>
      </td>
      <td valign=top width=240 class=rptlistcontent>
      <br><br>
	  
      <u>&nbsp;
	  <?php if ($_GET['itemid'] == "7150af03f0801274e89f7c066435bd07" ){
	  echo "ABDUL RAZAK MOHD ALI";
	  }else if ($_GET['itemid'] == "b40792f60ff730f4944feb44e77c9c8f" ){
	  echo "ABDUL RAZAK MOHD ALI";
	  }
	  else
	  {
	   echo $po_data['po_approver']; 
	  
	  }?>
	  <? // echo $app_data['approval_officername'];?>&nbsp;</u>
      </td>
      </tr>
      </table>

    </td>
    </tr>

    </table>

  </td>
  </tr>
  </table>
  <br>

  <!--
  <table border=0 cellspacing=2 cellpadding=0 width=760 style="position: absolute; top: 900px;">
  <tr valign=top>
  <td valign=top width=100% class=cboxcontent>
    <table border=0 cellspacing=0 cellpadding=2 width=750>
    <tr valign=top>
    <td>
    </td>
    </tr>
    </table>
  </td>
  </tr>
  </table>
-->
 <center>
  <span style="font-family: times new roman; font-size: 11px;"><b>ARAS 8, BANGUNAN ZIKAY, JALAN RAJA ALANG, KAMPUNG BARU, 50300 KUALA LUMPUR.
  <br/>
  TEL: 03-26988789 &nbsp;&nbsp;&nbsp; FAX: 03-26936775</b><br/>
  THIS IS A COMPUTER GENERATED FORM AND IT DOES NOT REQUIRE ANY SIGNATUE
  </span>
  </center><span style="font-family: times new roman; font-size: 11px; float: right"><span id="clock"><script type="text/javascript" src="timer.js"></script></span></span> 
  <!--
  <table border=0 cellspacing=2 cellpadding=0 width=760 style="position: absolute; top: 40px;">
  <tr valign=top>
  <td valign=top width=100% class=cboxcontent>
    <table border=0 cellspacing=0 cellpadding=2 width=750>
    <tr valign=top>
    <td valign=top width=400 class=rptlistcontent>
    Printed By: <?=$_SESSION['Xstaffname'];?>&nbsp;&nbsp;&nbsp;&nbsp;Date: <?=unconverttounixslash(getdatestamp());?>
    </td>
    <td valign=top width=350 class=rptlistcontent style="text-align: right;">
    Page 1
    </td>
    </tr>
    </table>
  </td>
  </tr>
  </table>
  -->

<span class="noprint">
<br>
<button name="printreport" id="printreport" onClick="javascript:print_report();">&nbsp;Print&nbsp;</button>
<!--
<button name="printreport" id="printreport" onClick="location.href='rpt_po_sv.php?itemid=<?php echo $_GET['itemid'];?>'">&nbsp;Save Remark&nbsp;</button>
-->
<input type="submit" value="SaveRemark">
</span>

<!-- /////////////// -->
</form>
</td>
</tr>
</table>
</body>
</html>

<!-- MeadCo ScriptX -->
<!-- For IE 7 only (not using MeadCo's scale-to-fit)
<object id="factory" viewastext style="display:none"
   classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
   codebase="http://[your_path]/smsx.cab#Version=6,4,438,06">
</object>
-->

<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
   classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
   codebase="../lib/smsx.cab#Version=6,4,438,06">
   <param name="template" value="MeadCo://IE7" />
</object>

<script type="text/javascript">
function print_report() {
  //window.print();
  // save before meadco
  var h=factory.printing.header;
  var f=factory.printing.footer;
  var o=factory.printing.portrait;
  var lm=factory.printing.leftMargin;
  var tm=factory.printing.topMargin;
  var rm=factory.printing.rightMargin;
  var bm=factory.printing.bottomMargin;
  // set and print (&b for tab)
  factory.printing.header = "";
  factory.printing.footer = "";
  factory.printing.portrait = true;
  factory.printing.leftMargin = 0.75;
  factory.printing.topMargin = 0.55;
  factory.printing.rightMargin = 0.75;
  factory.printing.bottomMargin = 0.55;
  factory.printing.Print(true);
  // restore..
  factory.printing.header=h;
  factory.printing.footer=f;
  factory.printing.portrait=o;
  factory.printing.leftMargin=lm;
  factory.printing.topMargin=tm;
  factory.printing.rightMargin=rm;
  factory.printing.bottomMargin=bm;
  
}
</script>
<?php
if ($_GET['save'] == 1)
 {

	$gg1 = "UPDATE zikay_pmsv5.po_details SET remark_desc1 = '".$_POST['remark_desc1']."', remark_pl ='".$_POST['remark_pl']."' WHERE po_pkey = '".$_GET['itemid']."'";
	mysql_query($gg1);
	//echo $gg1;
	
	
	echo "<script type=\"text/javascript\">window.location = \"http://www.zikaysystem.com/sispms/views/rpt_po.php?itemid=".$_GET['itemid']."\"</script>";
	
 }
 
?>

<?php
// quick function yusr.
function po_cancel_show($po_data_cancel, $itemid, $kaunt)
	{
	
	 if($po_data_cancel == 1) // if po's = 1 (cancel)
	  {
	  
	  $sqlx1 = mysql_query("select * from zikay_pmsv5.po_approvals where approval_popkey ='".$_GET['itemid']."'");
	  $datax1 = mysql_fetch_assoc($sqlx1);
		if($kaunt == 0){
		return  "
		<tr valign=top><td></td><td colspan=\"4\" style='color:red; font-weight:bold; text-align:center; padding:10px 10px 10px 10px;'>
		". $datax1['approval_remarks']."<br />
		@ ".unconverttounixslash($datax1['approval_date']).
		"</td><td></td><td></td></tr>";
		}else{
		return "";
		}
	  }
	}
?>