[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
simpegx
/
dashboard
/
application
/
pegawai
/
[
Home
]
File: PengajuanCuti.inc.php
<?php if(isset($_GET["deleteID"])) { $sql = "delete from hrd_cuti where cuti_id = ".$_GET["deleteID"]; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Data Sudah Terhapus');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } $wdth = "col-xs-12"; $sender_receiver_id = 0; if(isset($_POST["Tambah"])) { $sql = "insert into hrd_cuti (cuti_ket,cuti_tgl,id_pgw) values ('".$_POST["cuti_ket"]."','".$_POST["cuti_tgl"]."','".$pgw_id."')"; $exec = mysqli_query($conn, $sql); } if(isset($_GET["PengajuanCuti"])) { if(isset($_GET["Entry"])) $Entry = $_GET["Entry"]; else $Entry = 0; if($Entry == 1) $wdth = "col-xs-6"; else $wdth = "col-xs-12"; }else $Entry = 0; ?> <div id="wrapper"> <div class="main-content"> <div class="row small-spacing"> <?php if($Entry == 1) { ?> <form action="dashboard.php?PengajuanCuti" method="POST"> <div class="col-xs-6"> <div class="box-content"> <h4 class="box-title">Tulis Pengajuan Cuti</h4> <div class="form-group has-success"> <label for="input-states-1">Keterangan</label> <div class="form-with-icon"> <textarea id="cuti_ket" class="form-control" name="cuti_ket" maxlength="225" rows="2" placeholder="This textarea has a limit of 225 chars."></textarea> <i class="fa fa-pencil item-icon item-icon-right"></i> </div> </div> <div class="form-group has-success"> <label for="input-states-1">Tanggal Cuti</label> <div class="form-with-icon"> <input type="date" class="form-control" id="cuti_tgl" name="cuti_tgl" placeholder="Enter..."> <i class="fa fa-pencil item-icon item-icon-right"></i> </div> </div> <button type="cancel" name="cancel" class="btn btn-primary btn-sm waves-effect waves-light">Cancel</button> <button type="submit" name="Tambah" class="btn btn-primary btn-sm waves-effect waves-light">Ajukan</button> </div> </div> </form> <?php } ?> <div class="<?=$wdth;?>"> <div class="box-content"> <h4 class="box-title">Pengajuan Cuti</h4> <!-- /.box-title --> <table id="example" class="table table-striped table-bordered display" style="width:100%"> <thead> <tr> <th>No</th> <th>Keterangan</th> <th>Waktu</th> <th>Hapus</th> </tr> </thead> <tfoot> <tr> <th>No</th> <th>Keterangan</th> <th>Waktu</th> <th>Hapus</th> </tr> </tfoot> <tbody> <?php $no = 0; $sql = "SELECT * from hrd_cuti WHERE id_pgw = ".$pgw_id." order by cuti_tgl desc"; //echo $sql; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $no = ($no+1); ?> <tr> <td width="5%"><?=$no;?></td> <td width="20%"><?=$row["cuti_ket"];?></td> <td width="10%"><?=substr($row["cuti_tgl"],0,10);?></td> <td align="center" width="5%"> <a href="#" onclick="hapus(<?=$row["cuti_id"];?>);"><i class='fa fa-trash'></i></a> </td> </tr> <?php } } ?> </tbody> </table> <hr> <div align="center"> <button type="button" onclick="location.href='dashboard.php?PengajuanCuti&Entry=1';" class="btn btn-primary btn-sm waves-effect waves-light"> Entry Pengajuan Cuti</button> </div> </div> <!-- /.box-content --> </div> <script> function hapus(id) { let text = "Anda Yakin Akan Menghapus Data Ini?"; if (confirm(text) == true) { location.href='dashboard.php?PengajuanCuti&deleteID='+id; } else { } } </script>