Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vendetta committed May 24, 2016
1 parent 765d44f commit f12de64
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
14 changes: 9 additions & 5 deletions apps/daemon.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php
$loket = $_POST['loket'];
$db = new SQLite3('../db/antrian.db');
$results = $db->query('INSERT INTO data_antrian (counter,waktu,status) VALUES ('.$loket.',"'.date("Y-m-d H:i:s").'",0)');
$next_counter = $db->lastInsertRowID();
$data = array('next' => $next_counter);
echo json_encode($data);
if (false) {
$db = new SQLite3('../db/antrian.db');
$results = $db->query('INSERT INTO data_antrian (counter,waktu,status) VALUES ('.$loket.',"'.date("Y-m-d H:i:s").'",0)');
$next_counter = $db->lastInsertRowID();
$data = array('next' => $next_counter);
echo json_encode($data);
}else{
include "";
}
?>
2 changes: 2 additions & 0 deletions apps/mysql_close.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
mysql_close($link);
5 changes: 5 additions & 0 deletions apps/mysql_connect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
6 changes: 4 additions & 2 deletions client/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
session_start();
if (!isset($_SESSION["loket_client"])) {
if (!isset($_SESSION["loket_client"]))
{
$_SESSION["loket_client"] = 0;
}
?>
Expand Down Expand Up @@ -112,7 +113,8 @@
});

// GET NEXT COUNTER
$(".next_queue").click(function(){
$(".next_queue").click(function()
{
var loket = $(".loket").val();
var data = {"loket" : loket};
$.ajax({
Expand Down
1 change: 0 additions & 1 deletion server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<center>
<div class="blog-header">
<img src="../assert/img/logo.png" width="100px;" style="margin: 8px;">
<br/>
<marquee behavior="alternate"><h3 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;"><b>Selamat datang di Institut Teknologi Sumatera</b></h3> </marquee>
</div>
</center>
Expand Down

0 comments on commit f12de64

Please sign in to comment.