<?php session_start(); ?>
<script type="text/javascript">
function sendValue(s,a, b, c, d, e, f, g){
var selvalue = s;
var selvalue2 = a;
var selvalue3 = b;
var selvalue4 = c;
var selvalue5 = d;
var selvalue6 = e;
var selvalue7 = f;
var selvalue8 = g;
window.opener.document.form1.no_sj.value = selvalue;
window.opener.document.form1.manifest.value = selvalue2;
window.opener.document.form1.vol_coll.value = selvalue3;
window.opener.document.form1.no_pol.value = selvalue4;
window.opener.document.form1.harga.value = selvalue5;
window.opener.document.form1.tipe.value = selvalue6;
window.opener.document.form1.iso.value = selvalue7;
window.opener.document.form1.matdoc.value = selvalue8;

window.close();
}
</script>
<style type="text/css">
body,td,th {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
}
</style>

<table width="517" border="0" cellpadding="1" cellspacing="1">
  <tr>
    <th width="39" bgcolor="#CCCCCC">NO</th>
    <th width="137" bgcolor="#CCCCCC">NO. SURAT JALAN</th>
    <th width="41" bgcolor="#CCCCCC">ID</th>
    <th width="67" bgcolor="#CCCCCC">CABANG</th>
	<th width="85" bgcolor="#CCCCCC">MANIFEST</th>
    <th width="72" bgcolor="#CCCCCC">ISO TANK</th>
    <th width="54" bgcolor="#CCCCCC">Volume</th>
    <th width="54" bgcolor="#CCCCCC">MATDOC</th>
  </tr>
  <?php 
include "koneksi.php";
//include "library.php";

$sql="SELECT * FROM t_dn WHERE status = 0";
$execute = mysql_query($sql);
while($row= mysql_fetch_array($execute))

{
$no = $no +1;
if($bg==0)
{
echo"<tr style=background-color:#eeeeee;>";
$bg++;
}
else
{
echo"<tr style=background-color:#;>";
$bg--;
}
?>

        <td align="center"><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $no; ?></a></td>
        
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['dnnumb']; ?></a></td>
      
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['idcab']; ?></a></td>
      
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');">
	  <?php
	  $sql1="SELECT idcab FROM t_dn where dnnumb ='".$row['dnnumb']."'";
								$execute1 = mysql_query($sql1);
								$row_sj=mysql_fetch_array($execute1);
								
	  $sql2="SELECT cabname FROM m_cab where idcab ='".$row_sj['idcab']."'";
								$execute2 = mysql_query($sql2);
								$row_nama_cab=mysql_fetch_array($execute2);
								$pengirim = 	$row_nama_cab['cabname'];
	  echo $pengirim; 
	  ?></a></td>
      
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['mnfst']; ?></a></td>
      
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['noiso']; ?></a></td>
      
	  <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['vol']; ?></a></td>
      
      <td><a href="#" onClick="sendValue('<?=$row['dnnumb'];?>','<?=$row['mnfst'];?>','<?=$row['vol'];?>','<?=$row['vnumb'];?>','<?=$row['harga'];?>','<?=$row['type'];?>','<?=$row['noiso'];?>','<?=$row['matdoc'];?>');"><?php echo $row['matdoc']; ?></a></td>
    </tr>
  <? }?>
  </table>