[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
simpeg
/
administrator
/
[
Home
]
File: pengajuan_cuti.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='pengajuan_cuti' and c.user_id = ".$_SESSION["hrd-id"]; $rs = mysql_query($sql); $prevO = mysql_fetch_array($rs); if(!$prevO) header("location:tolak.php"); $sql = "select * from hrd_user_login a left join hrd_pgw b on a.id_pgw = b.pgw_id left join hrd_jabatan_pegawai c on b.id_jab_pgw = c.jab_pgw_id where user_id = ".$_SESSION["hrd-id"]; $rs = mysql_query($sql); $dataPgw=mysql_fetch_array($rs); //query ke tabel form $dir_img = "../img"; if($_POST["Simpan"]) { $sql = "select * from hrd_cuti where cuti_tgl = '".date_db($_POST["cuti_tgl"])."'"; $rs = mysql_query($sql); $datacuti=mysql_fetch_array($rs); if($datacuti) { echo "<script>window.alert('Anda sudah mengajukan cuti pada tanggal tersebut.');</script>"; }else{ $sql = "select max(cuti_id) as id from hrd_cuti"; $Qrs = mysql_query($sql); $id = mysql_fetch_array($Qrs); $cuti_id = $id["id"]+1; $sql = "insert into hrd_cuti (cuti_id,id_pgw,cuti_tgl,cuti_ket) values (".$cuti_id.",".$pgw_id.",'".date_db($_POST["cuti_tgl"])."','".$_POST["cuti_ket"]."')"; $rs = mysql_query($sql); $_POST["cuti_tgl"] = ""; $_POST["cuti_ket"] = ""; } } $dir_lib = "../lib"; $dir_img = "../img"; ?> <html> <head> <title><?php echo $header;?></title> </head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <!--meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"--> <link rel="stylesheet" type="text/css" href="<?php echo $dir_lib;?>/lib-style.css"> <script language="JavaScript" type="text/javascript" src="<?php echo $dir_lib;?>/ew.js"></script> <script language="JavaScript" type="text/javascript" src="<?php echo $dir_lib;?>/func_curr.js"></script> <script language="JavaScript" type="text/javascript" src="<?php echo $dir_lib;?>/elements.js"></script> <!-- calendar stylesheet --> <link rel="stylesheet" type="text/css" media="all" href="<?php echo $dir_lib;?>/jscalendar/css/calendar-system.css" title="calendar-system" /> <!-- calendar script --> <script type="text/javascript" src="<?php echo $dir_lib;?>/jscalendar/calendar.js"></script> <script type="text/javascript" src="<?php echo $dir_lib;?>/jscalendar/lang/calendar-en.js"></script> <script type="text/javascript" src="<?php echo $dir_lib;?>/jscalendar/calendar-setup.js"></script> <!-- end --> <body> <form name="frmEdit" method="POST" action="pengajuan_cuti.php"> <input type="hidden" name="act" value="<?php echo $_POST["act"];?>"> <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 > <?php echo $defFont;?> <b>Nama Karyawan</b> : <?php echo $dataPgw["pgw_nama"];?><br> <b>Jabatan</b> : <?php echo $dataPgw["jab_pgw_nama"];?><br> </font> </td> </tr> <tr bgcolor="#FFF8DC" valign="top"> <td > </td> </tr> </table> </td> </tr> <tr bgcolor="#FFF8DC"> <td colspan="2"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr valign="top"> <td width="15%"><?php echo $defFont;?>Tanggal Cuti</td> <td width="2%"><?php echo $defFont;?>:</td> <td width="83%"> <input onKeyDown="return tabOnEnter_select_with_button(this, event);" type="text" class="textField" name="cuti_tgl" id ="cuti_tgl" size="10" maxlength="10" value="<?php echo $_POST["cuti_tgl"];?>"/> <img src="../img/b_calendar.png" width="16" height="16" align="middle" id="img_cuti_tgl" style="cursor: pointer; border: 0px solid white;" title="Date selector" onMouseOver="this.style.background='red';" onMouseOut="this.style.background=''" />(tanggal-bulan-tahun) </td> </tr> <tr valign="top"> <td><?php echo $defFont;?>Keterangan</td> <td><?php echo $defFont;?>:</td> <td><textarea name="cuti_ket" cols="50" rows="3" class="textField"><?php echo nl2br($_POST["cuti_ket"]);?></textarea></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Simpan" value="Simpan" class="textField"></td> </tr> </table> </td> </tr> </table> <i><?php echo $hint;?></i> </form> <script type="text/javascript"> Calendar.setup({ inputField : "cuti_tgl", // id of the input field ifFormat : "<?=$formatCal;?>", // format of the input field showsTime : false, // will display a time selector button : "img_cuti_tgl", // trigger for the calendar (button ID) singleClick : true, // double-click mode step : 1 // show all years in drop-down boxes (instead of every other year as default) }); </script> </body> </html>