[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
siakad
/
kerjasama
/
html
/
dashboards
/
[
Home
]
File: AddNew.inc.php
<?php $nmForm = "dashboard?AddNew"; $nmForm2 = "dashboard?AllPages"; $nmTable = "web_content_page"; if(isset($_GET["delete"])) $delete = $_GET["delete"]; else $delete = ""; if(isset($_GET["edit"])) $edit = $_GET["edit"]; else $edit = ""; $page_title = ""; $page_index = ""; $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"]; $page_index = $iData[$a]["page_index"]; $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"]; if(isset($_POST["page_index"])) $page_index = $_POST["page_index"]; $tbField[0] = "page_id"; $tbField[1] = "page_title"; $tbField[2] = "page_create_by"; $tbField[3] = "active"; $tbField[4] = "page_index"; 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."'"; $tbIsi[4] = "'".$page_index."'"; $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>"; echo "<script>location.href='".$nmForm2."';</script>"; } $page_title = ""; $active = ""; $page_id = ""; } $query="select * from ".$nmTable." order by page_create 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"> <form class="form-horizontal row-fluid" method="POST" action="<?php echo $nmForm;?>" enctype="multipart/form-data"> <!-- BEGIN HORIZONTAL FORM - BASIC ELEMENTS--> <div class="card"> <div class="card-body"> <div class="form-group"> <label for="regular13" class="col-sm-2 control-label">Pages</label> <div class="col-sm-10"> <input type="hidden" name="page_id" id="page_id" value="<?php echo $page_id;?>"> <input type="text" class="form-control" id="page_title" name="page_title" value="<?php echo $page_title;?>" placeholder="" data-toggle="tooltip" data-placement="bottom" data-trigger="hover" data-original-title="Set title of content"> </div> </div> <div class="form-group"> <label for="regular13" class="col-sm-2 control-label">Index</label> <div class="col-sm-10"> <input type="text" class="form-control" id="page_index" name="page_index" value="<?php echo $page_index;?>" placeholder="" data-toggle="tooltip" data-placement="bottom" data-trigger="hover" data-original-title="Set title of content"> </div> </div> <div class="form-group"> <label for="help13" class="col-sm-2 control-label">Active</label> <div class="col-sm-10"> <label class="radio-inline radio-styled"> <input type="radio" id="active" <?php if($active == "1") echo "checked";?> name="active" value="1"><span>Active</span> </label> <label class="radio-inline radio-styled"> <input type="radio" id="active" <?php if($active == "0") echo "checked";?> name="active" value="0"><span>Deactive</span> </label> </div> </div> </div><!--end .card-body --> </div><!--end .card --> <!-- END HORIZONTAL FORM - BASIC ELEMENTS--> </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 $nmForm2;?>"><i class="fa fa-chevron-left"></i></a> </div> <div class="section-floating-action-row"> <button type="submit" 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 -->