<script type="text/javascript"> 

function PRINT(){ 

win=window.open('barang/barang_print.php','win','width=1000, height=400, menubar=0, scrollbars=1, resizable=0, location=0, toolbar=0, status=0'); } 

</script>


<style type="text/css">body {width: 100%;} </style> 

<body OnLoad="window.print()" OnFocus="window.close()"> 

<?php

include "../konmysqli.php";

echo"<link href='../ypathcss/$css' rel='stylesheet' type='text/css' />";

$YPATH="../ypathfile/";

$pk="";

$field="status";

$TB=$tbcustomer;

$item="Customer";


$sql="select * from `$TB` order by `$field` asc";

  if(isset($_GET["pk"])){

$pk=$_GET["pk"];

$sql="select * from `$TB` where `$field`='$pk' order by `$field` asc";

  }


  echo "<h3><center>Laporan Data $item $pk</h3>";

  ?>


<table width="98%" border="0">

  <tr>

    <th width="3%">No</td>

<th width="25%">Nama Customer</td>

<th width="10%">Telepon</td>

<th width="40%">Alamat</td>

<th width="5%">Status</td>

  </tr>

<?php  

  $jum=getJumM($conn,$sql);

  $no=0;

if($jum > 0){

$arr=getDataM($conn,$sql);

foreach($arr as $d) {

$no++;

$id_customer=$d["id_customer"];

$nama_customer=$d["nama_customer"];

$alamat=$d["alamat"];

$username=$d["username"];

$password=$d["password"];

$email=$d["email"];

$telepon=$d["telepon"];

$status=$d["status"];

$keterangan=$d["keterangan"];

$color="#dddddd";

if($no %2==0){$color="#eeeeee";}

echo"<tr bgcolor='$color'>

<td>$no</td>

<td><a href='mailto:$email'>$nama_customer</a> ($id_customer)<br>

                <td>$telepon</td>    

<td>$alamat</td>

<td>$status</td>>

</tr>";

}

}//if

else{echo"<tr><td colspan='7'><blink>Maaf, Data $item belum tersedia...</blink></td></tr>";}

echo"</table>";

?>