[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
cilfi
/
html
/
dashboards
/
[
Home
]
File: PinjamRuang.inc.php
<?php $nmForm = "dashboard?PinjamRuang"; $nmForm2 = "dashboard?EntryPinjam"; $nmTable = "lab_page"; if(isset($_GET["delete"])) $delete = $_GET["delete"]; else $delete = ""; if(isset($_GET["edit"])) $edit = $_GET["edit"]; else $edit = ""; $page_title = ""; $active = ""; //cara untuk hapus record if($delete == "active" && isset($_GET["page_id"])) { $exe = _del($nmTable,"page_id",MyIdDecode($_GET["page_id"]),0); echo "<script>window.alert('".$deme."');</script>"; echo "<script>window.parent.document.location.href='".$nmForm."';</script>"; } //cara untuk edit record if($edit == "active" && isset($_GET["page_id"])) { $query = "select * from ".$nmTable." where page_id = ".MyIdDecode($_GET["page_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $page_id = $iData[$a]["page_id"]; $page_title = $iData[$a]["page_title"]; $active = $iData[$a]["active"]; } } if(isset($_POST["Save"]) || isset($_POST["Update"])) { if(isset($_POST["page_title"])) $page_title = $_POST["page_title"]; if(isset($_POST["active"])) $active = $_POST["active"]; $tbField[0] = "page_id"; $tbField[1] = "page_title"; $tbField[2] = "page_create_by"; $tbField[3] = "active"; if(isset($_POST["Save"])) $page_id = maxId("page_id",$nmTable); if(isset($_POST["Update"])) $page_id = $_POST["page_id"]; $tbIsi[0] = $page_id; $tbIsi[1] = "'".$page_title."'"; $tbIsi[2] = "'".$_SESSION["user-id"]."'"; $tbIsi[3] = "'".$active."'"; $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); if(isset($_POST["Save"])) { $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); $exe = _ins($nmTable,$nmField,$isiField,0); echo "<script>window.alert('".$ssm."');</script>"; } if(isset($_POST["Update"])) { $compileSet = compile_array2($tbField,$tbIsi); // echo $compileSet; $exe = _upd($nmTable,$compileSet,$tbField[0],$tbIsi[0],0); echo "<script>window.alert('".$sum."');</script>"; } $page_title = ""; $active = ""; $page_id = ""; } $query="select * from ".$nmTable." a left join (SELECT id_page,count(*) as jumlah FROM lab_pinjam_ruang group by id_page) as b on a.page_id = b.id_page order by page_index desc"; $ViewData=sAllData($query); ?> <?php if($_GET["detail"] == "active") { ?> <!-- BEGIN BASE--> <div id="base"> <!-- BEGIN OFFCANVAS LEFT --> <div class="offcanvas"> </div><!--end .offcanvas--> <!-- END OFFCANVAS LEFT --> <!-- BEGIN CONTENT--> <div id="content"> <section> <!--div class="section-body"> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body no-padding"> <div class="table-responsive no-margin"> <table class="table table-striped no-margin"> <thead> <tr> <th>#</th> <th>Nama Lab</th> <th>Tanggal Peminjaman</th> <th>Waktu Peminjaman</th> <th>Peminjaman</th> </tr> </thead> <tbody> <?php $query="SELECT * FROM lab_pinjam_ruang a left join ".$nmTable." b on a.id_page = b.page_id left join stikesbh_akad.m_siswa c on a.id_siswa = c.siswa_id where id_page = ".MyIdDecode($_GET["page_id"]); $ViewData=sAllData($query); for($a=0,$b=count($ViewData);$a<$b;$a++) { ?> <tr> <td width="1%"><?php echo ($a+1);?></td> <td width="20%"><?php echo $ViewData[$a]["page_title"];?></td> <td width="20%"><?php echo $ViewData[$a]["tgl_pinjam"];?></td> <td width="20%"><?php echo $ViewData[$a]["periode_jam"];?></td> <td width="20%"><?php echo $ViewData[$a]["siswa_nama"];?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div--> <div class="section-body"> <!-- BEGIN RESPONSIVE TABLE 2 --> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body no-padding"> <div class="table-responsive no-margin"> <table border="1"> <thead> <tr> <td align="center"><b>#</b></td> <td align="center"><b>Tanggal</b></td> <?php for($a=8,$b=16;$a<$b;$a++) { $periode = $a.":00 - ".($a+1).":00"; echo "<td align=\"center\"><b>".$periode."</b></td>"; } ?> </tr> </thead> <tbody> <?php $dt_tgl = explode("-",$skr); for($a=0,$b=31;$a<$b;$a++) { if(strlen(($a+1)) == 1) { $tgl = "0".($a+1)."-".$dt_tgl[1]."-".$dt_tgl[0]; $tglx = $dt_tgl[0]."-".$dt_tgl[1]."-0".($a+1); }else{ $tgl = ($a+1)."-".$dt_tgl[1]."-".$dt_tgl[0]; $tglx = $dt_tgl[0]."-".$dt_tgl[1]."-".($a+1); } ?> <tr> <td width="1%" align="center"><?php echo ($a+1);?></td> <td width="10%" align="center"><?php echo $tgl;?></td> <?php for($aa=8,$bb=16;$aa<$bb;$aa++) { $periode = $aa.":00 - ".($aa+1).":00"; $query="SELECT * FROM lab_pinjam_ruang a left join ".$nmTable." b on a.id_page = b.page_id left join stikesbh_akad.m_siswa c on a.id_siswa = c.siswa_id where a.tgl_pinjam = '".$tglx."' and periode_jam = '".$periode."' and id_page = ".MyIdDecode($_GET["page_id"]); //echo $query."<br>"; $ViewData=sAllData($query); ?> <td width="10%" align="center"><?php echo $ViewData[0]["siswa_nama"];?></td> <?php } ?> </tr> <?php } ?> </tbody> </table> </div><!--end .table-responsive --> </div><!--end .card-body --> </div><!--end .card --> </div><!--end .col --> </div><!--end .row --> <!-- END RESPONSIVE TABLE 1 --> </div> <!-- BEGIN SECTION ACTION --> <div class="section-action style-primary"> <div class="section-action-row"> <a class="btn ink-reaction btn-icon-toggle" href="<?php echo $nmForm;?>"><i class="fa fa-chevron-left"></i></a> </div> <div class="section-floating-action-row"> <button type="submit" onclick="location.href='<?php echo $nmForm;?>';" name="<?php if($edit == "active") echo "Update";else echo "Save";?>" class="btn ink-reaction btn-floating-action btn-lg btn-accent"><i class="md md-send"></i></button> </div> </form> </div> <!-- END SECTION ACTION --> </section> </div><!--end #content--> <!-- END CONTENT --> <?php }else{ ?> <!-- BEGIN BASE--> <div id="base"> <!-- BEGIN OFFCANVAS LEFT --> <div class="offcanvas"> </div><!--end .offcanvas--> <!-- END OFFCANVAS LEFT --> <!-- BEGIN CONTENT--> <div id="content"> <section> <div class="section-body"> <!-- BEGIN RESPONSIVE TABLE 2 --> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body no-padding"> <div class="table-responsive no-margin"> <table class="table table-striped no-margin"> <thead> <tr> <th>#</th> <th>Nama Lab</th> <th>Jumlah Order</th> <th>Detail Order</th> <th>Booking</th> </tr> </thead> <tbody> <?php for($a=0,$b=count($ViewData);$a<$b;$a++) { ?> <tr> <td width="1%"><?php echo ($a+1);?></td> <td width="70%"><?php echo $ViewData[$a]["page_title"];?></td> <td width="10%"><?php if($ViewData[$a]["jumlah"] == null) echo "0";else echo $ViewData[$a]["jumlah"];?> kali</td> <td width="10%"> <a class="btn btn-info" href="<?php echo $nmForm;?>&detail=active&page_id=<?php echo MyIdEncode($ViewData[$a]["page_id"]);?>"> <i class="md md-beenhere"></i> </a> </td> <td class="center" width="10%"> <a class="btn btn-info" href="<?php echo $nmForm2;?>&page_id=<?php echo MyIdEncode($ViewData[$a]["page_id"]);?>"> <i class="md md-mode-edit"></i> </a> <!--a class="btn btn-danger" href="<?php echo $nmForm2;?>&delete=active&page_id=<?php echo MyIdEncode($ViewData[$a]["page_id"]);?>"> <i class="md md-delete"></i> </a--> </td> </tr> <?php } ?> </tbody> </table> </div><!--end .table-responsive --> </div><!--end .card-body --> </div><!--end .card --> </div><!--end .col --> </div><!--end .row --> <!-- END RESPONSIVE TABLE 1 --> </div> </section> </div><!--end #content--> <!-- END CONTENT --> <?php } ?>