<link href="_lib/search.css" rel="stylesheet" type="text/css">
<link href="_lib/gradient.css" rel="stylesheet" type="text/css">
<a class="button" onclick="window.open('data:application/msexcel,'+document.getElementById('export').outerHTML.replace(/ /g, '%20'));">Export Data ke Excel</a>&nbsp;<a class="button" onclick="window.open('data:application/msword,'+document.getElementById('export').outerHTML.replace(/ /g, '%20'));">Export Data ke Word</a>
<?php
include 'config/koneksi.php';
include '_lib/fungsi_indotgl.php';
	

//menampilkan data
$posisi  = 0;
$empty = "";
$tgl_awal = date('Y-m-d');
$tgl_akhir = date('Y-m-d');
$hasil = mysql_query("SELECT 
a.nama_gelar,
c.nomor_perkara,
SUM(CASE WHEN DATE(c.tanggal_pendaftaran) <'$tgl_awal' THEN 1 ELSE 0 END) AS masuk_lalu,
SUM(CASE WHEN DATE(d.tanggal_putusan) < '$tgl_awal' THEN 1 ELSE 0 END) AS putus_lalu,
SUM(CASE WHEN DATE(c.tanggal_pendaftaran) BETWEEN '$tgl_awal' AND '$tgl_akhir' THEN 1 ELSE 0 END) AS masuk,
SUM(CASE WHEN DATE(d.tanggal_putusan) BETWEEN '$tgl_awal' AND '$tgl_akhir' THEN 1 ELSE 0 END) AS putus
FROM hakim_pn a, perkara_hakim_pn b, perkara c
LEFT JOIN perkara_putusan d ON c.perkara_id = d.perkara_id 
WHERE b.hakim_id=a.id
AND b.perkara_id=c.perkara_id
AND a.aktif='Y'
GROUP BY a.nama_gelar");
echo "<div id='export'>";
echo "<h2></h2><br>";

	
	
$no = $posisi+1;
$totalperkara = mysql_num_rows($hasil);
echo "<p align=center><b><br><br>UNDER CONSTRUCTION <br><br> Lagi Pusing !!!!!!!!!</b> </p><br>";
while($r=mysql_fetch_array($hasil)){


  }
echo "</table><br>";
?>