[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
repository-perpus
/
app
/
html
/
dashboards
/
[
Home
]
File: Manage.inc.php
<?php $nmForm = "dashboard?Manage"; $nmForm2 = "dashboard?AddUser"; $nmTable = "user_login"; if(isset($_GET["delete"])) $delete = $_GET["delete"]; else $delete = ""; if(isset($_GET["edit"])) $edit = $_GET["edit"]; else $edit = ""; $user_fullname = ""; $user_name = ""; $user_profile = ""; $user_pass = ""; //cara untuk hapus record if($delete == "active" && isset($_GET["user_id"])) { $exe = _del($nmTable,"user_id",MyIdDecode($_GET["user_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["user_id"])) { $query = "select * from ".$nmTable." where user_id = ".MyIdDecode($_GET["user_id"]); $iData=sAllData($query); for($a=0,$b=count($iData);$a<$b;$a++) { $user_id = $iData[$a]["user_id"]; $user_fullname = $iData[$a]["user_fullname"]; $user_name = $iData[$a]["user_name"]; $user_profile = $iData[$a]["user_profile"]; $user_pass = $iData[$a]["user_pass"]; } } if(isset($_POST["Save"]) || isset($_POST["Update"])) { if(isset($_POST["user_fullname"])) $user_fullname = $_POST["user_fullname"]; if(isset($_POST["user_name"])) $user_name = $_POST["user_name"]; if(isset($_POST["user_profile"])) $user_profile = $_POST["user_profile"]; if(isset($_POST["user_pass"])) $user_pass = $_POST["user_pass"]; $tbField[0] = "user_id"; $tbField[1] = "user_fullname"; $tbField[2] = "user_create_by"; $tbField[3] = "user_name"; $tbField[4] = "user_profile"; $tbField[5] = "user_pass"; if(isset($_POST["Save"])) $user_id = maxId("user_id",$nmTable); if(isset($_POST["Update"])) $user_id = $_POST["user_id"]; $tbIsi[0] = $user_id; $tbIsi[1] = "'".$user_fullname."'"; $tbIsi[2] = "'".$_SESSION["user-id"]."'"; $tbIsi[3] = "'".$user_name."'"; $tbIsi[4] = "'".$user_profile."'"; $tbIsi[5] = "'".$user_pass."'"; $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>"; } } $query="select * from ".$nmTable." order by user_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">Manage User</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>Fullname</th> <th>Username</th> <th>Profile</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="25%"><?php echo $ViewData[$a]["user_fullname"];?></td> <td width="25%"><?php echo $ViewData[$a]["user_name"];?></td> <td width="25%"><?php echo $ViewData[$a]["user_profile"];?></td> <td class="center" width="24%"> <a class="btn btn-info" href="<?php echo $nmForm2;?>&edit=active&user_id=<?php echo MyIdEncode($ViewData[$a]["user_id"]);?>"> <i class="md md-mode-edit"></i> </a> <a class="btn btn-danger" href="<?php echo $nmForm;?>&delete=active&user_id=<?php echo MyIdEncode($ViewData[$a]["user_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 -->