-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ahmad luky ramdani
committed
May 19, 2016
1 parent
beeafd8
commit fa8b2fa
Showing
22 changed files
with
186 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
session_start(); | ||
if (!isset($_SESSION["loket_client"])) { | ||
$_SESSION["loket_client"] = NULL; | ||
} | ||
?> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
<title>Admin : Queue</title> | ||
<link href="../assert/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="../assert/css/jumbotron-narrow.css" rel="stylesheet"> | ||
<script src="../assert/js/jquery.min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="header clearfix"> | ||
<nav> | ||
<ul class="nav nav-pills pull-right"> | ||
<li role="presentation"><a href="#">ABOUT</a></li> | ||
</ul> | ||
</nav> | ||
<h3 class="text-muted">Admin : Queue Apps</h3> | ||
</div> | ||
|
||
|
||
<form> | ||
<div class="alert alert-info alert-dismissible peringatan" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
<strong>Info !</strong> Jumlah loket berhasil disave | ||
</div> | ||
<label for="exampleInputEmail1">Jumlah Loket</label> | ||
<input type="text" class="form-control loket" placeholder="Jumlah Loket"> | ||
</form> | ||
|
||
<footer class="footer"> | ||
<p>© ITERA <?php echo date("Y");?></p> | ||
</footer> | ||
</div> | ||
</body> | ||
|
||
<script type="text/javascript"> | ||
$("document").ready(function() | ||
{ | ||
$('.peringatan').hide(); | ||
|
||
// GET JUMLAH LOKET | ||
$.post( "../apps/admin_server.php", function( data ) { | ||
$(".loket").val(data['jumlah_loket']); | ||
},"json"); | ||
|
||
|
||
// NUMBER LOKET | ||
$('form input').data('val', $('form input').val() ); | ||
$('form input').change(function() { | ||
//set seassion or save | ||
var data = {"jmlloket": $(".loket").val()}; | ||
$.ajax({ | ||
type: "POST", | ||
dataType: "json", | ||
url: "../apps/admin_server.php",//request | ||
data: data, | ||
success: function(data) { | ||
if (data["status"]) | ||
{ | ||
$('.peringatan').show(); | ||
} | ||
} | ||
}); | ||
}); | ||
$('form input').keyup(function() { | ||
if( $('form input').val() != $('form input').data('val') ){ | ||
$('form input').data('val', $('form input').val() ); | ||
$(this).change(); | ||
} | ||
}); | ||
|
||
|
||
// GET NEXT COUNTER | ||
// $(".next_queue").click(function(){ | ||
// var loket = $(".loket").val(); | ||
// var data = {"loket" : loket}; | ||
// $.ajax({ | ||
// type: "POST", | ||
// dataType: "json", | ||
// url: "../apps/daemon.php",//request | ||
// data: data, | ||
// success: function(data) { | ||
// $(".jumbotron h1").html(data["next"]); | ||
// } | ||
// }); | ||
// return false; | ||
// }); | ||
|
||
}); | ||
</script> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
$data = array(); | ||
$db = new SQLite3('../db/antrian.db'); | ||
|
||
if (isset($_POST) and count($_POST) > 0) | ||
{ | ||
$jmlloket = $_POST['jmlloket']; | ||
|
||
$results = $db->query('DELETE FROM client_antrian;'); | ||
|
||
for ($i=1; $i <= $jmlloket ; $i++) { | ||
|
||
$results = $db->query('INSERT INTO client_antrian (client) VALUES ('.$i.')'); | ||
|
||
} | ||
|
||
echo json_encode(array("status"=>TRUE)); | ||
|
||
} else { | ||
$results = $db->query('SELECT count(*) as jumlah_loket FROM client_antrian'); | ||
|
||
if ( $results->numColumns()) | ||
{ | ||
while ($row = $results->fetchArray()) | ||
{ | ||
$data['jumlah_loket'] = $row['jumlah_loket']; | ||
} | ||
} else { | ||
$data['jumlah_loket'] = $row['jumlah_loket']; | ||
} | ||
|
||
echo json_encode($data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters