[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
simpeg
/
administrator
/
[
Home
]
File: libur_v.php
<?php require_once("../lib/konek.php"); require_once("../lib/konfigurasi_semua.php"); require_once("../lib/cur.php"); require_once("../lib/function_tanggal.php"); $sql = "select akses_id from hrd_hak_akses a left join hrd_form b on a.id_form=b.form_id left join hrd_user_login c on a.id_lj = c.id_lj where b.form_nama='hari_libur' and c.user_id = ".$_SESSION["hrd-id"]; $rs = mysql_query($sql); $prevO = mysql_fetch_array($rs); // if(!$prevO) header("location:../tolak.php"); //konfigurasi nama file $thisForm = "libur_v.php"; $actionForm = "libur_e.php"; //konfigurasi tabel utama $tbHeader[0] = "Pilih"; $tbHeaderWidth[0] = "5%"; $tbContent[0] = "libur_id"; $tbContentAlign[0] = "center"; $tbHeader[1] = "Tanggal"; $tbHeaderWidth[1] = "15%"; $tbContent[1] = "libur_tgl"; $tbContentAlign[1] = "center"; $tbHeader[2] = "Keterangan"; $tbHeaderWidth[2] = "45%"; $tbContent[2] = "libur_ket"; $tbContentAlign[2] = "left"; //hapus if($_POST["btnHapus"]) { $liburId = & $_POST["cbDelete"]; if(count($liburId)==0) { $hint = "Silahkan pilih salah satu item"; } for($i=0,$n=count($liburId);$i<$n;$i++){ $sql = "select libur_tgl,libur_ket from hrd_hari_libur where libur_id =".$liburId[$i]; $rs = mysql_query($sql); while($dataAbs=mysql_fetch_array($rs)) { $sqlDel2 = "delete from hrd_absen where absen_tgl = '".$dataAbs["libur_tgl"]."' and absen_ket = '".$dataAbs["libur_ket"]."'"; $qDel2 = mysql_query($sqlDel2); } $sqlDel = "delete from hrd_hari_libur where libur_id =".$liburId[$i]; $qDel = mysql_query($sqlDel); } } //edit if($_POST["btnEdit"]) { $liburId = & $_POST["cbDelete"]; if(count($liburId)>1 || count($liburId)==0) { $hint = "Silahkan pilih salah satu item"; }else{ header("location:libur_e.php?mode=edit&id=".$liburId[0]); } } //query ke tabel form $sql = "select * from hrd_hari_libur"; if($_POST["order_by"]) { $sql .= " order by ".$_POST["order_by"]." ".$_POST["sort"]; }else{ $sql .= " order by libur_id"; } $QdataForm = mysql_query($sql); //echo $sql; ?> <html> <head> <title><?php echo $header;?></title> </head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="../lib/lib-style.css"> <script language="JavaScript" type="text/javascript" src="../lib/ew.js"></script> <body> <form name="frmEdit" method="POST" action="<?php $thisForm;?>"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td colspan="2" align="left" valign="middle" bgcolor="#000000" height="28"> <font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="white"> <?php echo $header;?></font> </td> </tr> <tr> <td colspan="2" align="left" bgcolor="#DEDBE7" height="20"> <?php include("menu_atas.php"); ?> </td> </tr> <tr> <td colspan="2"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr background="<?php echo $dir_img;?>/background.jpg" valign="middle" height="50"> <td height="50" width="10"> </td> <td height="50" width="200"> </td> <td height="50" width="52"> </td> <td> </td> <td height="50" width="48" align="center"> </td> <td height="50" width="5"> </td> <td height="50" width="48" align="center"> <button type="submit" name="btnHapus" value="btnHapus"> <img src="<?php echo $dir_img;?>/del23.png" height="32" width="32"> </button> </td> <td height="50" width="5"> </td> <td height="50" width="48" align="center"> <button type="submit" name="btnEdit" value="btnEdit"> <img src="<?php echo $dir_img;?>/edit23.png" height="32" width="32"> </button> </td> <td height="50" width="5"> </td> <td height="50" width="50" align="center"> <button type="button" name="btnProses" value="btnProses"> <a href="<?php echo $actionForm;?>"><img src="<?php echo $dir_img;?>/add23.png" border="0" height="32" width="32"></a> </button> </td> </tr> <tr bgcolor="#FFF8DC" valign="middle"> <td width="10"> </td> <td width="200"> </td> <td width="52"> </td> <td> </td> <td width="48" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> </td> <td width="5"> </td> <td width="48" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> <?php echo $defFont;?>Hapus</font> </td> <td width="5"> </td> <td width="48" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> <?php echo $defFont;?>Edit</font> </td> <td width="5"> </td> <td width="50" align="center" onmouseover="this.style.backgroundColor='#FF6666'" onmouseout="this.style.backgroundColor='#FFF8DC'"> <?php echo $defFont;?>Tambah</font> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <table border="0" cellspacing="1" cellpadding="1" width="100%"> <tr background="<?php echo $dir_img;?>/bg_tr.png"> <td width="<?php echo $tbHeaderWidth[0];?>" align="center"> <input type="checkbox" onClick="EW_selectKey(this,'cbDelete[]');"> </td> <?php for($start=1, $end=count($tbHeader); $start<$end; $start++) {?> <td width="<?php echo $tbHeaderWidth[$start];?>" align="center"> <?php echo $defFont;?><b><?php echo $tbHeader[$start];?></b><?php echo $tFont;?> </td> <?php } ?> </tr> <?php while($dataForm=mysql_fetch_array($QdataForm)) {?> <tr bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#00FFFF'" onmouseout="this.style.backgroundColor='#FFFFFF'"> <td align="<?php echo $tbContentAlign[0];?>"> <div><input type="checkbox" name="cbDelete[]" value="<?php echo $dataForm[$tbContent[0]];?>"></div> </td> <?php for($start=1, $end=count($tbHeader); $start<$end; $start++) {?> <td valign="top" align="<?php echo $tbContentAlign[$start];?>"> <?php echo $defFont;?><?php echo $dataForm[$tbContent[$start]];?> <?php echo $tFont;?> </td> <?php } ?> </tr> <?php } ?> </table> </td> </tr> </table> <i><?php echo $hint;?></i> </form> </body> </html>