Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad luky ramdani committed May 25, 2016
1 parent ea8eadd commit 956691a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
9 changes: 6 additions & 3 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
<link href="../assert/css/jumbotron-narrow.css" rel="stylesheet">
<script src="../assert/js/jquery.min.js"></script>
</head>

<body>
<div class="container">
<form>
<div class="jumbotron">
<h1 class="counter">
<span class="glyphicon glyphicon-user"></span>
</h1>
</div>
<label for="exampleInputEmail1">Jumlah Loket</label>
<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">&times;</span></button>
Expand Down Expand Up @@ -50,8 +54,7 @@
$.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() {
Expand Down
18 changes: 6 additions & 12 deletions client/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<link href="../assert/css/jumbotron-narrow.css" rel="stylesheet">
<script src="../assert/js/jquery.min.js"></script>
</head>

<body>
<div class="container">
<button class="btn btn-small btn-primary try_queue" type="button" style="float:right;padding:20px;">
Expand All @@ -34,8 +33,6 @@
</a>
</p>
</div>

<!-- style="width: 370px; margin-left: auto; margin-right: auto;" -->
<form>
<label for="exampleInputEmail1" style="text-align: left;"><span class="glyphicon glyphicon-credit-card">&nbsp;</span>NOMOR LOKET</label>
<select class="form-control loket" name="loket" required>
Expand All @@ -46,13 +43,11 @@
<strong>WARNING !!</strong> Masukan Nomor Loket Anda.
</div>
</form>

<footer class="footer">
<p>&copy; ITERA <?php echo date("Y");?></p>
</footer>
</div>
</body>

<script type="text/javascript">
$("document").ready(function()
{
Expand Down Expand Up @@ -133,8 +128,12 @@
}

});

var timerId=0;

// DUDU
function adudu(loket, counter){
setInterval(function() {
timerId = setInterval(function() {
$.post("../apps/daemon_try_cek.php", { loket : loket, counter : counter }, function(msg){
if(msg.huft == 2){
$(".try_queue").show();
Expand All @@ -143,27 +142,22 @@ function adudu(loket, counter){
}, 1000);
}


// TRY CALL
$(".try_queue").click(function(){

//$(this).attr("disabled", "disabled");

var loket = $(".loket").val();
if (loket==0) {
$(".peringatan").show();
}else{
var counter = $(".counter").text();
$.post("../apps/daemon_try.php", { loket : loket, counter : counter }, function(msg){
if(msg.huft == 0){
//console.log(msg.huft);
$(".try_queue").hide();
clearInterval(timerId);
adudu(loket, counter);
}
},'JSON'); //request
return false;
}

});

});
Expand Down

0 comments on commit 956691a

Please sign in to comment.