<?PHP
include("index.cma.db.php");
include("index.embed.php");
$date = date("m");
include("index.globalconfig.php");
$query = "Select * from $mytable"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){
$query = "Select * from tab_settings"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){
if ($row['s_global'] == "" && $row['s_install'] == "0"){
echo "<LINK href=\"images/index.css\" rel=\"stylesheet\" type=\"text/css\"><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"4\">
  <tr>
    <td><img src=\"install/install.jpg\" width=\"800\" height=\"378\"></td>
  </tr>
    <tr>
    <td>Terima Kasih</td>
  </tr>
   <tr>
    <td>Selamat datang di Aplikasi Camelon, Sekarang ikuti langkah yang telah kami sediakan ini hingga akhir. Sebelum memulai siapkan Daftar personil secara lengkap, Daftar Asal SPDP, Nomor SMS Center yang dipakai, jika sudah siap lakukan proses selanjutnya</td>
  </tr>
  <tr>
    <td><a href=\"install/index.php\" class=\"menu\">MULAI PROSES INSTALL </a></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>";
}

elseif ($row['s_update'] == "$date"){
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$query = "UPDATE tab_settings Set s_update = '12' where s_id = '1'";  
$result = mysql_query($query); 
echo "<LINK href=\"images/index.css\" rel=\"stylesheet\" type=\"text/css\"><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"4\">
  <tr>
    <td><img src=\"install/install.jpg\" width=\"800\" height=\"378\"></td>
  </tr>
    <tr>
    <td>Terima Kasih</td>
  </tr>
   <tr>
    <td>Saat ini telah memasuki bulan 12 (desember)Silahkan untuk mempersiapkan migrasi database anda ke tahun berikutnya. Klik mengerti apabila anda sudah membaca pesan ini. Hubungi admin untuk mendapatkan codenya.</td>
  </tr>
  <tr>
    <td><a href=\"install/install.update.php\" class=\"menu\">OK Saya Mengerti</a></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>";
} 
//elseif ($date == "12"){
//mysql_connect("$server", "$username", "$password");
//mysql_select_db("$database");
//$query = "UPDATE tab_settings Set s_update = '12' where s_id = '1'";  
//$result = mysql_query($query); 
//echo "<a href=\"index.php\" class=\"menu\">SET DATE</a>";
//}
else {
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?PHP echo $satker; ?> | <?PHP echo $alamat; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="favicon.png" rel="shortcut icon"/>
<LINK href="images/index.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--

.style1 {color: #FFFFFF}
body {
	margin-top: 0px;
	margin-bottom: 0px;
	background-color: #336600;
	background-image: url();
}
-->
</style>
<style type="text/css">
#fixmetoo { position: absolute; right: 0px; bottom: 0px; width: 100%;
}
body > div#fixmetoo { position: fixed; }
.style1 {color: #FFFFFF}
.style7 {color: #FFFFFF}
.style7 {color: #FFFFFF}
.style8 {color: #FFFFFF}
.style8 {color: #FFFFFF}
.style9 {
	color: #FFCC00;
	font-weight: bold;
}
.style10 {	font-size: xx-large;
	font-weight: bold;
	color: #006600
}
.style11 {color: #FFFFFF}
.style11 {color: #FFFFFF}
.style14 {	color: #000000;
	font-weight: bold;
}
</style>
<SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>
<script language="javascript">

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

</script>
</head>

<body>
<?PHP 
$date = date("d/m/Y");
if ($validthru == $date){
print ('<table width="1100"  border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
    <td height="500" bgcolor="#FF0000"><table width="80%"  border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td><div align="center" class="style7"><strong>MASA BERLAKU UJI COBA ANDA TELAH BERAKHIR. </strong></div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><div align="center" class="style7">JIKA ANDA MENYUKAI APLIKASI INI TUNJUKKAN DUKUNGAN ANDA DENGAN MENGGUNAKAN FULL VERSION OK</div></td>
      </tr>
    </table></td>
  </tr>
</table>
');
} else {
}
?>
<table width="1100"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="200" valign="bottom" background="themes/camelon_a.jpg">&nbsp;</td>
  </tr>
  <tr>
    <td height="25" bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="6" cellpadding="6">
      <tr>
        <td><div align="center"><?PHP echo $satker; ?> | <?PHP echo $alamat; ?></div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" bgcolor="#669900"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="50">
      <param name="movie" value="themes/top_hijau.swf">
      <param name="quality" value="high">
      <embed src="themes/top_hijau.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="50"></embed>
    </object></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="22%" valign="top" bgcolor="#353500"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td bgcolor="#669900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><form name="form1" method="post" action="index.auth.php">
                  <table width="300" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="themes/camelon_b.jpg"><table width="100%"  border="0" align="center" cellpadding="4" cellspacing="4">
                          <tr>
                            <td><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td><div align="center"><strong>NAMA PENGGUNA </strong></div></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                                <input name="n" type="text" id="n" size="15">
                            </div></td>
                          </tr>
                          <tr>
                            <td><div align="center"><strong>KATA KUNCI </strong></div></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                                <input name="p" type="password" id="p" size="15">
                            </div></td>
                          </tr>
                          <tr>
                            <td><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td><div align="center">
                                <input type="submit" name="Submit" value="LOGIN">
                            </div></td>
                          </tr>
                          <tr>
                            <td><div align="center"></div></td>
                          </tr>
                      </table>
                        </td>
                    </tr>
                  </table>
                </form></td>
              </tr>
            </table></td>
          </tr>
        </table>
          <table width="300" border="0" cellspacing="1" cellpadding="0">
            <tr>
              <td><a href="index.patrol.php" class="menu">PEMANTAUAN PAPAN KONTROL</a></td>
            </tr>
            <tr>
              <td><a href="index.mip.php" class="menu">PEMANTAUAN MEDIA INFO PUBLIK (KiosK)</a></td>
            </tr>
            <tr>
              <td><a href="tamu/index.php" class="menu">BUKU TAMU DIGITAL </a></td>
            </tr>
            <tr>
              <td><a href="login.php" class="menu">LOGIN SEDERHANA </a></td>
            </tr>
            <tr>
              <td><a href="besuk.php" class="menu">BESUK SWALAYAN </a></td>
            </tr>
            <tr>
              <td><table width="300" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><a href="http://www.jaksa.id" target="_blank"><img src="themes/jaksaid.jpg" width="300" height="80" border="0"></a></td>
                </tr>
                <tr>
                  <td><a href="index.mip.php"><img src="images/camelon_mip.jpg" width="300" height="200" border="0"></a></td>
                </tr>
                <tr>
                  <td><a href="index.mip.php" class="menuintel">PEMANTAUAN MEDIA INFO PUBLIK </a></td>
                </tr>
              </table>
                <table width="300" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="449" valign="top" background="images/camelon_library.jpg"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><form name="form2" method="post" action="perpustakaan/perpus_search.php">
                          <table width="80%" border="0" align="center" cellpadding="8" cellspacing="8">
                            <tr>
                              <td><div align="center"></div></td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td><div align="center"><span class="style1">PENCARIAN BUKU </span></div></td>
                            </tr>
                            <tr>
                              <td><div align="center">
                                  <input name="query2" type="text" id="query2">
                              </div></td>
                            </tr>
                            <tr>
                              <td><div align="center">
                                  <input type="submit" name="Submit2" value="CARI JUDUL BUKU">
                              </div></td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td><a href="perpustakaan/index.php" class="menubin">KANAL PERPUSTAKAAN</a></td>
                            </tr>
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                          </table>
                        </form></td>
                      </tr>
                    </table>                      </td>
                  </tr>
                </table>                </td>
            </tr>
          </table></td>
        <td width="78%" valign="top" bgcolor="#FFE1B7">  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#FF9900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td bgcolor="#CCCC00" class="style11"><table width="100%"  border="0" cellspacing="6" cellpadding="6">
                        <tr>
                          <td><span class="style14">KOLOM PENGUMUMAN DIKELOLA OLEH BIDANG PEMBINAAN</span></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td><table width="100%"  border="0" cellspacing="6" cellpadding="6">
                        <tr>
                          <td><?PHP
					$tahun=date("Y");
$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma", $link);
$SQL     = "SELECT * FROM pengumuman ORDER By i_id DESC LIMIT 5";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
print ('<table width="100%"  border="0" cellspacing="1" cellpadding="4">
                                <tr>
                                  <td width="10%" bgcolor="#FFCC00"><center>'.$row['i_tgl'].'</center></td>
                                  <td width="90%" bgcolor="#FFFFFF">'.$row['i_kegiatan'].'</td>
                                </tr>
                              </table>');
} 
print ('');
?>
                          </td>
                        </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table>
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td bgcolor="#FF6600"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><a href="index.pembinaan.php" class="menubin">PEMANTAUAN PEMBINAAN</a></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td bgcolor="#FFCC66"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                <tr>
                  <td width="42%" valign="top"><strong>
                    <?php

$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result1 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='1'", $link);
$num_rows = mysql_num_rows($result1);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">JAKSA</td><td width="5%">:</td>
<td width="59%">'.$num_rows.'</td></tr></table>');
$result2 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='2'", $link);
$num_rows2 = mysql_num_rows($result2);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">PEMBINAAN</td><td width="5%">:</td>
<td width="59%">'.$num_rows2.'</td></tr></table>');
$result3 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='3'", $link);
$num_rows3 = mysql_num_rows($result3);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">INTELIJEN</td><td width="5%">:</td>
<td width="59%">'.$num_rows3.'</td></tr></table>');
$result4 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='4'", $link);
$num_rows4 = mysql_num_rows($result4);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">PIDUM</td><td width="5%">:</td>
<td width="59%">'.$num_rows4.'</td></tr></table>'); 
$result5 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='5'", $link);
$num_rows5 = mysql_num_rows($result5);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">PIDSUS</td><td width="5%">:</td>
<td width="59%">'.$num_rows5.'</td></tr></table>');
$result6 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='6'", $link);
$num_rows6 = mysql_num_rows($result6);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">DATUN</td><td width="5%">:</td>
<td width="59%">'.$num_rows6.'</td></tr></table>');
//-----------
$result7 = mysql_query("SELECT * FROM tab_personil where daftar_jenis ='7'", $link);
$num_rows7 = mysql_num_rows($result7);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">RANGBUKPAS</td><td width="5%">:</td>
<td width="59%">'.$num_rows7.'</td></tr></table>');
//--------
$result8 = mysql_query("SELECT * FROM tab_personil", $link);
$num_rows8 = mysql_num_rows($result8);
print ('<table width="100%"  border="0" cellspacing="2" cellpadding="2"><tr>
<td width="36%">TOTAL</td><td width="5%">:</td>
<td width="59%">'.$num_rows8.' Pegawai</td></tr></table>');
?>
                  </strong></td>
                  <td width="58%" valign="top"><?PHP
					$tahun=date("Y");
$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma", $link);
print ('<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td bgcolor="#CC6600"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
      <tr>
<td width="100%">NAMA PEGAWAI AKAN NAIK PANGKAT REGULER</td>
      </tr>');

$SQL     = "SELECT * FROM tab_personil";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){

$teks = $row['daftar_npyad'];
//pecah string berdasarkan string ","
$pecah = explode("/", $teks);
//mencari element array 0
$hasil3 = $pecah[2];


 if ($tahun == $hasil3) {

  
  
print ('<tr bgcolor="#FFFFFF">
        <td><b>'.$row['daftar_nama'] . '</b> | ');
 if ($row['daftar_pangkat'] == "1") {echo "YUANA DHARMA";} 
  elseif ($row['daftar_pangkat'] == "2") {echo "MUDA DARMA";} 
   elseif ($row['daftar_pangkat'] == "3") {echo "MADYA DARMA";} 
    elseif ($row['daftar_pangkat'] == "4") {echo "SENA DARMA";} 
	else if ($row['daftar_pangkat'] == "5") {echo "YUANA WIRA";} 
	else if ($row['daftar_pangkat'] == "6") {echo "MUDA WIRA";} 
	else if ($row['daftar_pangkat'] == "7") {echo "MADYA WIRA";} 
	else if ($row['daftar_pangkat'] == "8") {echo "MUDA WIRA";} 
else if ($row['daftar_pangkat'] == "0") {echo "Pangkat tidak dapat ditampilan";} 
print ('| NIP:'.$row['daftar_nip'].'');
print ('</tr>');
} } 
print ('
    </table></td>
  </tr>
</table>');
?></td>
                </tr>
              </table></td>
            </tr>
            </table>  
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#FF9F9F"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td bgcolor="#006600"><a href="index.intel.php" class="menuintel">PEMANTAUAN INTELIJEN </a></td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#FF0000"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="48%"><span class="style8"><a href="index.patrol.php" class="menupidum">PEMANTAUAN PIDANA UMUM </a></span></td>
                      <td width="52%"><a href="index.tilang.php" class="menupidum">PEMANTAUAN TILANG </a></td>
                    </tr>
                    <tr>
                      <td colspan="2" bgcolor="#FF3300"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                        <tr bgcolor="#FFC1C1">
                          <td colspan="2"><strong>Rekap Perkara </strong></td>
                          <td colspan="2"><strong>TOTAL</strong></td>
                        </tr>
                        <tr>
                          <td width="4%"><div align="center">1.</div></td>
                          <td width="31%" bgcolor="#FF3333">SPDP MASUK </td>
                          <td width="12%" bgcolor="#CCCCCC"><?php
$query = "Select * from tab_dataperkara where t_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
$mytabler1 = $row['t_table'];
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result1 = mysql_query("SELECT * FROM $mytabler1", $link);
$num_rows = mysql_num_rows($result1);
$query = "UPDATE tab_perkaragrafik Set jumlah_a = '$num_rows'";  
$result = mysql_query($query); 
print (''.$num_rows.'');
}
 ?></td>
                          <td width="53%">SPDP</td>
                        </tr>
                        <tr>
                          <td width="4%"><div align="center">2.</div></td>
                          <td width="31%" bgcolor="#FF3333">SPDP  TANPA NAMA </td>
                          <td width="12%" bgcolor="#CCCCCC"><?php

$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result33 = mysql_query("SELECT * FROM $mytabler1 where spdp_namatsk ='TANPA NAMA'", $link);
$num_rows33 = mysql_num_rows($result33);
$query = "UPDATE tab_perkaragrafik Set jumlah_b = '$num_rows33'";  
$result = mysql_query($query); 
print (''.$num_rows33.'');
 ?></td>
                          <td>SPDP</td>
                        </tr>
                        <tr>
                          <td><div align="center">2.</div></td>
                          <td bgcolor="#FF3333">SUDAH P21 </td>
                          <td bgcolor="#CCCCCC"><?php

$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result2 = mysql_query("SELECT * FROM $mytabler1 where berkas_tahap1p21tgl !=''", $link);
$num_rows2 = mysql_num_rows($result2);
$query = "UPDATE tab_perkaragrafik Set jumlah_c = '$num_rows2'";  
$result = mysql_query($query); 
print (''.$num_rows2.'');
 ?>
                              <div align="right"></div></td>
                          <td>Berkas Perkara </td>
                        </tr>
                        <tr>
                          <td><div align="center">3.</div></td>
                          <td bgcolor="#FF3333">SUDAH LIMPAH </td>
                          <td bgcolor="#CCCCCC"><?php
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result3 = mysql_query("SELECT * FROM $mytabler1 where berkas_limpahp31tgl !=''", $link);
$num_rows3 = mysql_num_rows($result3);
$query = "UPDATE tab_perkaragrafik Set jumlah_d = '$num_rows3'";  
$result = mysql_query($query); 
print (''.$num_rows3.'');
 ?>
                              <div align="right"></div></td>
                          <td>Berkas Perkara </td>
                        </tr>
                        <tr>
                          <td><div align="center">4.</div></td>
                          <td bgcolor="#FF3333">SUDAH PUTUS </td>
                          <td bgcolor="#CCCCCC"><?php
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result4 = mysql_query("SELECT * FROM $mytabler1 where berkas_p48tgl !=''", $link);
$num_rows4 = mysql_num_rows($result4);
$query = "UPDATE tab_suratgrafik Set jumlah_e = '$num_rows4'";  
$result = mysql_query($query); 
print (''.$num_rows4.'');
 ?>
                              <div align="right"></div></td>
                          <td>Berkas Perkara / Berkekuatan Hukum Tetap </td>
                        </tr>
                      </table>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td bgcolor="#FFFFFF"><table width="760"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><div align='center'><?php
							  
include ("FusionCharts/FC_Colors.php");
include ("FusionCharts/FusionCharts_Gen.php");
include ("FusionCharts/FusionCharts.php");

 $strXML="<graph caption='Grafik PNBP' numberPrefix='Rp.' yAxisName='Jumlah' decimalPrecision='0' formatNumberScale='0'>";
	$kategori="<categories>";
	//Data Macam Surat
	$data = "<dataset seriesName='JAN' color='".getFCColor()."' >";
	$data1 = "<dataset seriesName='FEB' color='".getFCColor()."' >";
	$data2 = "<dataset seriesName='MAR' color='".getFCColor()."' >";
	$data3 = "<dataset seriesName='APR' color='".getFCColor()."' >";
	$data4 = "<dataset seriesName='MEI' color='".getFCColor()."' >";
	$data5 = "<dataset seriesName='JUN' color='".getFCColor()."' >";
	$data6 = "<dataset seriesName='JUL' color='".getFCColor()."' >";
	$data7 = "<dataset seriesName='AGT' color='".getFCColor()."' >";
	$data8 = "<dataset seriesName='SEP' color='".getFCColor()."' >";
	$data9 = "<dataset seriesName='OKT' color='".getFCColor()."' >";
	$data10 = "<dataset seriesName='NOP' color='".getFCColor()."' >";
	$data11 = "<dataset seriesName='DES' color='".getFCColor()."' >";
	//Load Database
	mysql_connect("localhost","root","benk")or die(mysql_error());
mysql_select_db("cma_tilang") or die(mysql_error());
	$sql="SELECT * FROM t_rekap where t_id='2018'"; $qr=mysql_query($sql); while($Data=mysql_fetch_array($qr)){
   	$arrData[0][1]="$Data[t_id]";
   	$arrData[0][2]="$Data[t_januari]";
   	$arrData[0][3]="$Data[t_pebruari]";
    $arrData[0][4]="$Data[t_maret]";
	$arrData[0][5]="$Data[t_april]";
	$arrData[0][6]="$Data[t_mei]";
	$arrData[0][7]="$Data[t_juni]";
	$arrData[0][8]="$Data[t_juli]";
	$arrData[0][9]="$Data[t_agustus]";
	$arrData[0][10]="$Data[t_september]";
	$arrData[0][11]="$Data[t_oktober]";
	$arrData[0][12]="$Data[t_nopember]";
	$arrData[0][13]="$Data[t_desember]";
   foreach ($arrData as $arSubData) {
      $kategori .= "<category name='".$arSubData[1]."' />";
      $data .= "<set value='".$arSubData[2] ."' />";
      $data1 .= "<set value='".$arSubData[3] ."' />";
	  $data2 .= "<set value='".$arSubData[4] ."' />";
	  $data3 .= "<set value='".$arSubData[5] ."' />";
	  $data4 .= "<set value='".$arSubData[6] ."' />";
	  $data5 .= "<set value='".$arSubData[7] ."' />";
	  $data6 .= "<set value='".$arSubData[8] ."' />";
	  $data7 .= "<set value='".$arSubData[9] ."' />";
	 $data8 .= "<set value='".$arSubData[10] ."' />";
	  $data9 .= "<set value='".$arSubData[11] ."' />";
	  $data10 .= "<set value='".$arSubData[12] ."' />";
	  $data11 .= "<set value='".$arSubData[13] ."' />";
	  $data12 .= "<set value='".$arSubData[14] ."' />";
   }
}
$kategori .= "</categories>";

   $data .= "</dataset>";
   $data1 .= "</dataset>";
   $data2 .= "</dataset>";
   $data3 .= "</dataset>";
   $data4 .= "</dataset>";
   $data5 .= "</dataset>";
   $data6 .= "</dataset>";
   $data7 .= "</dataset>";
   $data8 .= "</dataset>";
  $data9 .= "</dataset>";
  $data10 .= "</dataset>";
  $data11 .= "</dataset>";
 
   $strXML .= $kategori . $data . $data1 . $data2 . $data3 . $data4. $data5. $data6. $data7. $data8. $data9. $data10. $data11. $data12;
   $strXML .= "</graph>";
   echo renderChart("FusionCharts/FCF_MSColumn3D.swf", "", $strXML, "productSales", 760, 300);

?></div></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#FF3333"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><span class="style8"><a href="index.pidsus.php" class="menupidsus">PEMANTAUAN PIDANA KHUSUS </a></span></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FF99FF"><table width="100%"  border="0" cellspacing="8" cellpadding="8">
                          <tr>
                            <td width="34%">TOTAL PERKARA PENYIDIKAN </td>
                            <td width="4%">:</td>
                            <td width="62%"><b>
                              <?php

$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma_pidsus", $link);
$result = mysql_query("SELECT * FROM p_perkara where berkas_p21 !=''", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows"; ?>
                            </b></td>
                          </tr>
                          <tr>
                            <td>TOTAL PERKARA PENUNTUTAN </td>
                            <td>:</td>
                            <td><b>
                              <?php

$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma_pidsus", $link);
$result = mysql_query("SELECT * FROM p_perkara where berkas_limpahp31tgl !=''", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows"; ?>
                            </b></td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#FFCC00"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><span class="style8"><a href="datun/index.php" class="menudatun">PEMANTAUAN PERDATA DAN TATA USAHA NEGARA </a></span></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FF9900"><table width="100%" border="0" cellspacing="8" cellpadding="8">
                        <tr>
                          <td><?
include("./datun/index.db.php");
$mytable = "agenda";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 5;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "AGENDA ACARA BIDANG DATUN <strong>$xnum</strong>";

print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE i_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY d_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B0B0B0">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>TGL</strong></span></td>
<td width="85%"><span class="style1"><strong>ACARA & TEMPAT</strong></span></td>



</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['d_id'].'</center></td>');
print ('<td><center>'.$row['d_tgl'].'</center></td>');

print ('<td><b>'.$row['d_acara'].'</b><br>');

print (''.$row['d_tempat'].'</td>');
print ('</tr>');
}
print ('</tbody></table>');
}
?></td>
                        </tr>
                        <tr>
                          <td><?
include("./datun/index.db.php");
$mytable = "mou";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 5;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "MEMORY OF UNDERSTANDING <strong>$xnum</strong>";
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE i_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY d_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B0B0B0">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>TGL MOU</strong></span></td>
<td width="85%"><span class="style1"><strong>MOU DENGAN & TENTANG</strong></span></td>
</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['d_id'].'</center></td>');
print ('<td><center>'.$row['d_tgl'].'</center></td>');

print ('<td><b>'.$row['d_dengan'].'</b><br>');

print (''.$row['d_tentang'].'</td>');
print ('</tr>');
}
print ('</tbody></table>');

}
?></td>
                        </tr>
                        <tr>
                          <td><?
include("./datun/index.db.php");
$mytable = "skk";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 5;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "SURAT KUASA KHUSUS <strong>$xnum</strong>";
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE i_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY d_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B0B0B0">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>TGL SKK</strong></span></td>
<td width="60%"><span class="style1"><strong>SKK DENGAN & TENTANG</strong></span></td>
<td width="15%"><span class="style1"><strong><center>STATUS</center></strong></span></td>


</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['d_id'].'</center></td>');
print ('<td><center>'.$row['d_tgl'].'</center></td>');

print ('<td><b>'.$row['d_pemberikuasa'].'</b><br>');

print (''.$row['d_kuasatentang'].'</td>');

//Kolom status
print ('<td><center>'. $row['d_tgl'].'</center>');
$tgl1 = $row['d_tgl']; $tgl2 = date("d/m/Y"); 
$pecah1 = explode("/", $tgl1);$date1 = $pecah1[0];$month1 = $pecah1[1];$year1 = $pecah1[2];
$pecah2 = explode("/", $tgl2);$date2 = $pecah2[0];$month2 = $pecah2[1];$year2 =  $pecah2[2];
$jd1 = GregorianToJD($month1, $date1, $year1);
$jd2 = GregorianToJD($month2, $date2, $year2);
$selisih = $jd2 - $jd1;
$timelate = "365"; //BATAS TELAT
$selisih2 = $selisih - $timelate;
if ($row['d_tgl'] !== "") { //LIMITASI
if($selisih>=365) { 
$id = $row['uid'];
print ('<center><img src="images/idcred.gif" width="32" height="16">');
print ('<br>Lewat: '.$selisih2.'Hr<br><font color="red"><b>Terbitkan SKK Baru</b></font>');
//$query = "UPDATE $mytable SET late_spdp = '3' WHERE uid = '$id'";
//$result = mysql_query($query);
}
elseif($selisih<365){ 
print ('<center><img src="images/idcgreen.gif" width="32" height="16">');
print ('<br>Jalan: '.$selisih.'Hr</center>');
} 
} 
print ('</td>');


print ('</tr>');
}
print ('</tbody></table>');
}
?></td>
                        </tr>
                        <tr>
                          <td><?
include("./datun/index.db.php");
$mytable = "tergugat";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 5;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "SELAKU TERGUGAT <strong>$xnum</strong>";
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE i_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY d_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B0B0B0">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>TGL</strong></span></td>
<td width="75%"><span class="style1"><strong>TENTANG & ISI PETITUM</strong></span></td>
<td width="10%"><span class="style1"><strong>JENIS</strong></span></td>



</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['d_id'].'</center></td>');
print ('<td><center>'.$row['d_tgl'].'</center></td>');

print ('<td><b>'.$row['d_tentang'].'</b><br>');
print (''.$row['d_petitum'].'</td>');
print ('<td>');
if ($row['d_jenis'] == "1") {echo "<center><b>TUN</b></center>";} 
  elseif ($row['d_jenis'] == "2") {echo "<center><b>PERDATA</b></center>";} 
  elseif ($row['d_jenis'] == "0") {echo "<center><b>PPH</b></center>";} 
print ('</td>');

print ('</tr>');
}
print ('</tbody></table>');

}
?></td>
                        </tr>
                        <tr>
                          <td><?
include("./datun/index.db.php");
$mytable = "penggugat";
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 5;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "SELAKU PENGGUGAT <strong>$xnum</strong>";

print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "WHERE i_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY d_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B0B0B0">
        <thead><tr>
<td width="5%"><span class="style1"><strong>NO</strong></span></td>
<td width="10%"><span class="style1"><strong>TGL</strong></span></td>
<td width="75%"><span class="style1"><strong>MENGUGAT, TENTANG & ISI PETITUM</strong></span></td>
<td width="10%"><span class="style1"><strong>JENIS</strong></span></td>



</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$row['d_id'].'</center></td>');
print ('<td><center>'.$row['d_tgl'].'</center></td>');

print ('<td><b>'.$row['d_tentang'].'</b><br>');
print (''.$row['d_petitum'].'</td>');
print ('<td>');
if ($row['d_jenis'] == "1") {echo "<center><b>TUN</b></center>";} 
  elseif ($row['d_jenis'] == "2") {echo "<center><b>PERDATA</b></center>";} 
  elseif ($row['d_jenis'] == "0") {echo "<center><b>PPH</b></center>";} 
print ('</td>');

print ('</tr>');
}
print ('</tbody></table>');
}
?></td>
                        </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#669900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><span class="style8"><a href="index.barbuk.php" class="menuall">PEMANTAUAN BARANG BUKTI </a></span></td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="0" cellspacing="8" cellpadding="8">
                          <tr>
                            <td><?PHP
include("barbuk/index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = "$tahun_now";
$page = $_GET["page"];
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 10;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "PANTAUAN SELURUH BARANG BUKTI | TOTAL DIKELOLA <strong>$xnum</strong> BARANG| ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "<b> HAL $i |</b> ";} 
else{echo "<a href=\"?g=rekapgudang&page=$i\"> $i |</a>";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." ";
if(!empty($squery)) { $query .= "LIKE \"%$squery%\" ";}
$query .= "ORDER BY ID DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B05800">
        <thead><tr>
		<td width="3%"><span class="style1"><strong>NO</strong></span></td>
		
<td width="15%"><span class="style1"><strong>NAMA TERDAKWA</strong></span></td>
<td width="12%"><span class="style1"><strong>NOMOR REGISTER BARANG BUKTI</strong></span></td>
<td width="10%"><span class="style1"><strong>IJIN SITA</strong></span></td>
<td width="30%"><span class="style1"><strong>DAFTAR BARANG BUKTI</strong></span></td>
<td width="15%"><span class="style1"><strong>LOKASI</strong></span></td>
<td width="15%"><span class="style1"><strong>STATUS</strong></span></td>
</tr></thead>');
$no=1; // fungsi nomor
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFB7";$x=0;} else {$barva = "FFD8B0";$x=1;}
print ('<tr bgcolor=#'.$barva.'><td><center>'.$no++.'<center></td>');
print ('<td>'.$row['TERDAKWA'] .'</td>');
print ('<td>'.$row['RB'] .'</td>');
print ('<td>'.$row['IJINSITA'] .'</td>');
print ('<td>'.$row['NAMABARANG'] .'</td>');
print ('<td>');
if ($row['LOKASI'] == "0") {
print ('<img src="barbuk/images/b_belumproses.png" width="150" height="20">');
} 
 elseif ($row['LOKASI'] == "1") {
print ('<img src="barbuk/images/b_gudang.png" width="150" height="20">');
 } 
  elseif ($row['LOKASI'] == "2") {
print ('<img src="barbuk/images/b_rubasan.png" width="150" height="20">');
 } 
  elseif ($row['LOKASI'] == "3") {
print ('<img src="barbuk/images/b_penitipan.png" width="150" height="20">');
 } 
   elseif ($row['LOKASI'] == "4") {
print ('<img src="barbuk/images/b_lainlain.png" width="150" height="20">');
 } 
    elseif ($row['LOKASI'] == "5") {
print ('<img src="barbuk/images/b_limpahpn.png" width="150" height="20">');
 } 
print ('</td>');
print ('<td>');
if ($row['STATUS'] == "0") {
print ('BLM DIEKSEKUSI');
} 
 elseif ($row['STATUS'] == "1") {
print ('KEMBALI');
 } 
  elseif ($row['STATUS'] == "2") {
print ('LELANG');
 } 
  elseif ($row['STATUS'] == "3") {
print ('MUSNAH');
 } 
   elseif ($row['STATUS'] == "4") {
print ('DIRAMPAS UNTUK NEGARA');
 } 
print ('</td>');

print ('</tr>');
}
print ('</tbody></table>');
//echo "<br><br>Ditampilkan $hits /Halaman";
}

?>
</td>
                          </tr>
                          <tr>
                            <td><?php
							 mysql_connect("localhost","root","benk");
mysql_select_db("ebarbuk");
		  echo"<div align='center'><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
	
	 $FC = new FusionCharts("Column3D","760","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 $strParam="caption=GRAFIK PENYELESAIAN BARANG BUKTI ; subcaption=Dalam Tahun Berjalan; xAxisName=JUMLAH PENYELESAIAN ; yAxisName=Jumlah; numberPrefix=; decimalPrecision=0";
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from barbuk_grafik2"); 
	 while($data=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$data[jumlah_a]","name=Belum Di Eksekusi");
	 $FC->addChartData("$data[jumlah_b]","name=Kembali");
	 $FC->addChartData("$data[jumlah_c]","name=Lelang");
	 $FC->addChartData("$data[jumlah_d]","name=Untuk Dimusnahkan");
	 $FC->addChartData("$data[jumlah_e]","name=Untuk Negara");
}	 	 

	$FC->renderChart();
echo"</div>";

?></td>
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
            </table>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="87%"><a href="tilang/index_respon.php" class="menudatun" onclick="NewWindow(this.href,'name','400','400','yes');return false">OPEN WINDOWS OTOMATION SMS GATEWAY (JANGAN TUTUP JENDELA YANG MUNCUL) </a></td>
                <td width="13%"><a href="index.readme.php" class="menuall" onclick="NewWindow(this.href,'name','800','600','yes');return false">README</a></td>
              </tr>
          </table>          
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#CC9900"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                  <tr>
                    <td><strong>PERPUSTAKAAN</strong></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td bgcolor="#CCCC00"><table width="100%"  border="0" cellspacing="6" cellpadding="6">
                  <tr>
                    <td><table width="100%"  border="0" align="center" cellpadding="5" cellspacing="5">
                      <tr>
                        <td width="60%">Total Judul Buku <b> </b><b> </b></td>
                        <td width="3%">:</td>
                        <td width="37%"><b>
                          <?php

$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma", $link);
$result = mysql_query("SELECT * FROM perpustakaan", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows"; ?>
                        </b></td>
                      </tr>
                      <tr>
                        <td>Total Jumlah Buku dalam Perpustakaan</td>
                        <td width="3%">:</td>
                        <td width="37%"><b>
                          <?php

include("./perpustakaan/perpus_postdb.php");

$sql = "SELECT SUM(p_jmlh) AS total_sumbangan FROM perpustakaan ";
    $result = mysql_query($sql) or die (mysql_error());
    $t = mysql_fetch_array($result);
echo "<b>Total Jumlah buku " . number_format($t['total_sumbangan']) . " </b>";
?>
                        </b></td>
                      </tr>
                    </table></td>
                  </tr>
                </table>
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td bgcolor="#999966"><table width="100%"  border="0" cellspacing="6" cellpadding="6">
                        <tr>
                          <td><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                            <tr>
                              <td><?

print ('<b>10 Judul Buku Terbaru </b><br><br><table width="100%"  border="0" cellspacing="2" cellpadding="2">
<tr bgcolor="#996600">
<td width="50%"><span class="style1"><strong>Judul Buku</strong></span></td>
<td width="30%"><span class="style1"><strong>Pengarang</strong></span></td>
<td width="10%"><span class="style1"><strong>Jml Buku</strong></span></td>
<td width="10%"><span class="style1"><strong>Rak</strong></span></td>
</tr>');
include("./perpustakaan/perpus_postdb.php");
$SQL = "SELECT * FROM $mytable ORDER BY uid DESC LIMIT 10";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
print ('<tr>');
print ('<td>'.$row['p_judul'] .'</td>');
print ('<td>'.$row['p_pengarang'].'</td>');
print ('<td>'.$row['p_jmlh'].'</td>');
print ('<td>'.$row['p_kat'].'</td>');
print ('</tr>');
}
print ('</table>');
?></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table></td>
                    </tr>
                  </table></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="1100" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#353500"><table width="699"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><center>
                  <?PHP
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma_tilang");
$query = "Select * from tilang_set"; 
$result = mysql_query($query); 
if($row2 = mysql_fetch_array($result)){ 
if($row2['s_status'] == '0'){ 
print ('<img src="tilang/off.jpg" width="200" height="20">');

}
elseif($row2['s_status'] == '1'){ 
print ('<img src="tilang/on.jpg" width="200" height="20">');
print ('<iframe src="tilang/index_respon.php" height="0" width="0" frameborder="0" scrolling="no"></iframe></center>');
}
}
?>
              </center></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><div align="center" class="style8">Camelon Magnifincent 2019 </div></td>
      </tr>
      <tr>
        <td><div align="center" class="style8">(c) Since 2013  Created By <a href="http://chendia.ihkeren.com" class="style9">Chendia Studio</a></div></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><div align="center"></div></td>
      </tr>
      <tr>
        <td></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<div align="center" class="style2" id="fixmetoo"> 
  <table width="100%"  border="0" cellspacing="4" cellpadding="4">
    <tr>
      <td width="11%"><a href="tamu/index.php"><img src="tamu/images/tamu_cek.png" width="150" height="150" border="0"></a></td>
      <td width="89%" valign="bottom">&nbsp;</td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
              <tr>
                <td><strong>
                  <marquee>
            Yang Akan Berulang Tahun Pada Bulan Ini :
            <?
$koneksi=mysql_connect("localhost","root","benk");
mysql_select_db("cma",$koneksi);
	$bacadata=mysql_query("SELECT * FROM tab_personil");
	while($cetakdata=mysql_fetch_array($bacadata)){
	$pecahdata=explode("/",$cetakdata['daftar_ultah']);
	$tglskrng=date("d");
	$blnskrng=date("m");
	$pecah1=$pecahdata[0];
	$pecah2=$pecahdata[1];
	//if($tglskrng==$pecah1&&$blnskrng==$pecah2){
	if($blnskrng==$pecah2){
	//echo "<p><strong>UCAPAN SELAMAT</strong></p><img src='HappyBday.gif'><p>Selamat Ulang Tahun <b>$cetakdata[nama]</b><br>Tanggal Lahir : <b>$cetakdata[tgllahir]</b><br><b>Ucapan Buat Kamu :</b> $cetakdata[ucapan]</p>";
		echo "<b>$cetakdata[daftar_nama]</b> Tanggal Lahir : <b> $cetakdata[daftar_ultah]</b> | ";

	} if ($tglskrng==$pecah1 && $blnskrng==$pecah2){
	echo "<span class=\"style6\">YANG BERULANG TAHUN HARI INI : <b>$cetakdata[daftar_nama]</b> Tanggal Lahir : <b> $cetakdata[daftar_ultah]</b></span> ";
	$id1 = $cetakdata['daftar_pegid'];
	$ultah = $cetakdata['ntfy_ultah'];
	if ($ultah=='0'){
	$query = "UPDATE tab_personil Set ntfy_ultah = '1' where daftar_pegid = '$id1'";  
$result = mysql_query($query);
} 
if ($ultah=='1'){

$SQL     = "SELECT * FROM tab_personil where ntfy_ultah = '1'";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
	$nama1 = $row['daftar_nama'];
	$notujuan = $row['daftar_nohp'];
$isipesan = "Selamat Ulang Tahun $nama1 Semoga Sehat Selalu, banyak rejeki dari Keluarga Besar Kejari";
$DestinationNumber=addslashes(strip_tags($notujuan));	
$TextDecoded=addslashes(strip_tags($isipesan)); 
$sql="INSERT INTO outbox (`UpdatedInDB` ,`InsertIntoDB` ,`SendingDateTime` ,`Text` ,`DestinationNumber` ,`Coding` ,`UDH` ,`Class` ,`TextDecoded` ,`ID` ,`MultiPart` ,`RelativeValidity` ,`SenderID` ,`SendingTimeOut` ,`DeliveryReport` ,`CreatorID`)
VALUES (NOW() , NOW(), '0000-00-00 00:00:00', NULL , '$DestinationNumber', 'Default_No_Compression', NULL , '-1', '$TextDecoded', NULL , 'false', '-1', NULL , '0000-00-00 00:00:00', 'default', '')";
mysql_query($sql); 
$query = "UPDATE tab_personil Set ntfy_ultah = '2' where daftar_pegid = '$id1'";  
$result = mysql_query($query); 

}}

	}
	}
	
	?>
                  </marquee>
                </strong></td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="21%" bgcolor="#669900"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                    <div align="center" class="style7"><strong><?PHP echo $kota; ?> <? echo date('d/m/Y'); ?></strong></div></td>
                </tr>
            </table></td>
            <td width="79%" bgcolor="#66CC00"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td height="30"><marquee>
                                <?PHP
					$tahun=date("Y");
$link = mysql_connect("localhost", "root", "benk"); mysql_select_db("cma", $link);
$SQL     = "SELECT * FROM pengumuman ORDER By i_id DESC LIMIT 5";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
print ('<b>PENGUMUMAN</b> DIKIRIM TANGGAL '.$row['i_tgl'].' [ '.$row['i_kegiatan'].' ] --- ');
} 
print (' -E-N-D- ');
?>
                </marquee></td>
              </tr>
            </table></td>
          </tr>
      </table></td>
    </tr>
  </table>
</div>
</body>
</html>

<? } if ($row[s_global] !== ""){ 
}
}
} 
?>
