Add: Real server

This commit is contained in:
2018-06-22 20:58:24 +09:00
parent 225c6e944e
commit 2d4c3af9e0
13 changed files with 14 additions and 34 deletions
-2
View File
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$app_id = $_POST["AppID"];
include "./../setup/connect_db.php";
@@ -1,8 +1,6 @@
<?php
header("Content-Type: application/json");
include "./../send_error_code.php";
$maestro_id = $_POST["maestro_id"];
include "./../setup/connect_db.php";
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_id = $_POST["maestro_id"];
include "./../setup/connect_db.php";
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_id = $_POST["maestro_id"];
include "./../setup/connect_db.php";
-2
View File
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$app_id = $_POST["AppID"];
$user_id = $_POST["UserID"];
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../lib/send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$app_id = $_POST["AppID"];
$date = $_POST["Date"];
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../lib/send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$app_id = $_POST["AppID"];
$date = $_POST["Date"];
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../lib/send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$app_id = $_POST["AppID"];
$date = $_POST["Date"];
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$user_id = $_POST["UserID"];
$app_id = $_POST["AppID"];
+8 -10
View File
@@ -1,13 +1,11 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_id = $_POST["MaestroID"];
$user_id = $_POST["UserID"];
$app_id = $_POST["AppID"];
$best_record = $_POST["BestRecord"];
echo $best_record." / ";
// echo $best_record." / ";
include "./../setup/connect_db.php";
@@ -15,15 +13,15 @@ $prev_best_record_id = -1;
$prev_best_record = 0;
$prev_best_record_id = get_best_record($maestro_id, $app_id, $user_id);
// echo $prev_best_record_id." ".$prev_best_record;
// echo "id : ".$prev_best_record_id." ".$prev_best_record;
if($prev_best_record_id == "") {
echo "insert";
if($prev_best_record_id < 0) {
// echo "insert";
insert_best_record($maestro_id, $app_id, $user_id, $best_record);
} else {
echo $best_record." ".$prev_best_record;
// echo $best_record." ".$prev_best_record;
if($best_record > $prev_best_record) {
echo "update";
// echo "update";
update_best_record($prev_best_record_id, $best_record);
}
}
@@ -62,7 +60,7 @@ function insert_best_record($maestro_id, $app_id, $user_id, $best_record) {
VALUES (?, ?, ?, ?, NOW());
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('iiii', $maestro_id, $user_id, $app_id, $best_record);
$stmt->bind_param('iiid', $maestro_id, $user_id, $app_id, $best_record);
$stmt->execute();
}
@@ -75,7 +73,7 @@ function update_best_record($prev_best_record_id, $best_record) {
WHERE BestRecordID = ? AND DATE(RecordDateTime) = DATE(NOW()) AND HOUR(RecordDateTime) = HOUR(NOW())
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('ii', $best_record, $prev_best_record_id);
$stmt->bind_param('di', $best_record, $prev_best_record_id);
$stmt->execute();
}
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
$hasServiceDBSetting = file_exists("./service_db_setting.php");
$hasServiceDBSetting = file_exists("./../setup/service_db_setting.php");
if($hasServiceDBSetting == true) {
include("./service_db_setting.php");
include("./../setup/service_db_setting.php");
} else {
$db_host = "localhost";
$db_user = "afterschool";
-2
View File
@@ -1,8 +1,6 @@
<?php
header('Content-Type: application/json');
include "./../send_error_code.php";
$maestro_name = $_POST["maestro_name"];
$name = $_POST["name"];
$enterCode = $_POST["enter_code"];