<?php include "../include/config.php"; ?>
<html>
<head>
<link rel='stylesheet' type='text/css' href="../include/css/popup_styles.css" />	
<script language='javascript'>
	function select_go(id,name){			
		eval("opener.document.form.doch_outhid").value = id;	
		window.close();
		self.close();	
	}
</script>
</head>
<body>
<div id="popup">
<form action="popup_dokumen.php" method="post" enctype="multipart/form-data">
<table width="100%">
	<tr>
		<th colspan="5">
		Nomor dokumen :<input type="text" name="cari" size="20">
		      <input type="submit" name="proses" value="CARI">
		</th>
	</tr>
	<tr>
		<th>Jenis</th>
		<th>Nomor</th>
		<th>Tanggal</th>
		<th>Penerima</th>
		<th>Action</th>
	</tr>
    <?php
	$cari  = isset($_REQUEST['cari']) ? $_REQUEST['cari'] :'';
	if (isset($_REQUEST['proses'])=="CARI"){
		$list = "WHERE cust_status<>100 AND cust_name LIKE '%$cari%'";
	}else{
		$list = "";
	}
	$query = mysql_query("SELECT * FROM outgoing WHERE outh_status<>100 AND id NOT IN(SELECT doch_outhid FROM document WHERE doch_status<>100) ORDER BY id DESC");
	while($data=mysql_fetch_object($query)){
	?>
	 <tr>
		<td align="center"><?=$data->outh_doctype;?></td>
		<td align="center"><?=$data->outh_docno;?></td>
		<td align="center"><?=$data->outh_docdate;?></td>
		<td><?=$data->nm_penerima;?></td>
		<td align="center"><a href="#" onClick="select_go('<?=$data->id;?>')">GET</a></td>		
	</tr>	
	<?php } ?>
</table>
</form>
</div>
</body>
</html>
