[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
sarpras
/
html
/
dashboards
/
[
Home
]
File: AllPages.inc.php
<?php $nmForm = "index.php?AllPages"; $nmForm2 = "index.php?AddNew"; $nmTable = "web_content_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." order by page_index desc"; $ViewData=sAllData($query); ?> <!-- 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-header"> <ol class="breadcrumb"> <li class="active">All Pages</li> </ol> </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 class="table table-striped no-margin"> <thead> <tr> <th>#</th> <th>Title</th> <th>Index</th> <th>Active</th> <th>Actions</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 echo $ViewData[$a]["page_index"];?></td> <td class="center" width="10%"> <?php if($ViewData[$a]["active"] == "1") { ?> <a class="btn btn-info" href="#"> <i class="md md-beenhere"></i> </a> <?php }else{ ?> <a class="btn btn-info" href="#"> <i class="md md-close"></i> </a> <?php } ?> </td> <td class="center" width="10%"> <a class="btn btn-info" href="<?php echo $nmForm2;?>&edit=active&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> <!-- BEGIN SECTION ACTION --> <div class="section-action style-primary"> <div class="section-floating-action-row"> <a class="btn ink-reaction btn-floating-action btn-lg btn-accent" href="<?php echo $nmForm2;?>" data-toggle="tooltip" data-placement="top" data-original-title="Compose"> <i class="md md-add"></i> </a> </div> </div><!--end .section-action --> <!-- END SECTION ACTION --> </section> </div><!--end #content--> <!-- END CONTENT -->