diff --git a/api/checkout.php b/api/checkout.php
index b413c14..7d5ebaf 100644
--- a/api/checkout.php
+++ b/api/checkout.php
@@ -2,16 +2,41 @@
include './functions.php';
-$hash = $_REQUEST['hash'];
-$tableId = $_REQUEST['tableId'];
+$hash = $_GET['hash'];
+$tableId = $_GET['tableId'];
if(!isset($hash) || !isset($tableId)) die();
+
+/* special php program */
+set_time_limit(0);
+ob_end_clean();
+header("Connection: close");
+ob_start();
+
+
$cnn = db__connect();
$data = getFinalData($cnn, $tableId);
+echo '';
+
+
+
+/* close connection */
+ob_end_flush();
+flush();
+if (function_exists("fastcgi_finish_request")) {
+ fastcgi_finish_request();
+}
+sleep(2);
+ignore_user_abort(true);
+set_time_limit(0);
+
+
+
+
if($data['average'] > $data['virtualTotals'][$hash]){
foreach($data['users'] as $user){
$to = $user;
@@ -37,4 +62,3 @@ db__pushData($cnn, "user", array(
"table" => $tableId
));
-echo '';
diff --git a/api/confirmBalance.php b/api/confirmBalance.php
index ad22f0c..e7ba81f 100644
--- a/api/confirmBalance.php
+++ b/api/confirmBalance.php
@@ -1,8 +1,8 @@
CP-ACC网站进行确认。您可以通过CP-ACC网站查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
-
-确认链接: https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."
-
-感谢您使用本站服务,祝您生活愉悦!
-呓喵酱(@iotcat)", "CP-ACC");
+ sendMail($lastData['email'], "CP-ACC消息: 您将从".$firstData['nickname']."收到".$threshold."磅", "亲爱的".$lastData['nickname'].":
+
+根据系统的计算,您将从".$firstData['nickname']."(".$firstData['email'].")"."收取".$threshold."磅,以保持大家的公共支出相对公平。请在收到对方转账后点击下方确认链接或登入CP-ACC网站进行确认。您可以通过CP-ACC网站查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
+
+确认链接: https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."
+
+感谢您使用本站服务,祝您生活愉悦!
+呓喵酱(@iotcat)", "CP-ACC");
Sleep(10);
-sendMail($firstData['email'], 'CP-ACC消息: 您需要给'.$lastData['nickname'].$threshold."磅/元", "亲爱的".$firstData['nickname'].":
-
-根据系统的计算,您需要给".$lastData['nickname']."(".$lastData['email'].")".$threshold."磅/元,以保持大家的公共支出相对公平。请在转账后提醒对方从网站或邮件中确认您的支出。您可以通过CP-ACC网站查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
-
-感谢您使用本站服务,祝您生活愉悦!
-呓喵酱(@iotcat)", "CP-ACC");
+sendMail($firstData['email'], 'CP-ACC消息: 您需要给'.$lastData['nickname'].$threshold."磅", "亲爱的".$firstData['nickname'].":
+
+根据系统的计算,您需要给".$lastData['nickname']."(".$lastData['email'].")".$threshold."磅,以保持大家的公共支出相对公平。请在转账后提醒对方从网站或邮件中确认您的支出。您可以通过CP-ACC网站查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
+
+感谢您使用本站服务,祝您生活愉悦!
+呓喵酱(@iotcat)", "CP-ACC");
}
diff --git a/api/getData.php b/api/getData.php
index 5c74b82..fd8fb19 100644
--- a/api/getData.php
+++ b/api/getData.php
@@ -2,7 +2,7 @@
include './functions.php';
header("Content-type:application/json");
-$hash = $_REQUEST['hash'];
+$hash = $_GET['hash'];
if(!isset($hash)) die();
diff --git a/api/joinTable.php b/api/joinTable.php
index 0676a3e..44ff00e 100644
--- a/api/joinTable.php
+++ b/api/joinTable.php
@@ -12,7 +12,7 @@ if(!isset($hash) || !isset($tableId) || strlen($hash)<60 || strlen($tableId)<60)
$cnn = db__connect();
$data = getFinalData($cnn, $tableId);
-if(!db__rowNum($cnn, "user", "user", $hash, "table", $tableId)){
+if(!db__rowNum($cnn, "user", "user", $hash, "table", $tableId, "state", "1")){
$itemId = hash('sha256', time().$hash.$tableId.rand(222,999));
db__pushData($cnn, "account", array(
@@ -24,13 +24,7 @@ if(!db__rowNum($cnn, "user", "user", $hash, "table", $tableId)){
"value" => $data['average'],
"created_at" => date("Y-m-d H:i:s", time())
));
- db__pushData($cnn, "user", array(
- "user" => $hash,
- "table" => $tableId,
- "state" => '1',
- "created_at" => date("Y-m-d H:i:s", time())
- ));
-}else{
+}
db__pushData($cnn, "user", array(
"user" => $hash,
"table" => $tableId,
@@ -41,7 +35,6 @@ if(!db__rowNum($cnn, "user", "user", $hash, "table", $tableId)){
"table" => $tableId
));
-}
setcookie("tableId", $tableId, time()+3600*12*60*365, "/");
diff --git a/api/newItem.php b/api/newItem.php
index 1c65fd1..736fa09 100644
--- a/api/newItem.php
+++ b/api/newItem.php
@@ -3,8 +3,8 @@
include './functions.php';
-$url = $_REQUEST['url'];
-$passby = $_REQUEST['passby'];
+$url = $_GET['url'];
+$passby = $_GET['passby'];
if(!isset($url) || !isset($passby)) die();
diff --git a/api/updateTable.php b/api/updateTable.php
index 96f9fe4..debe6a0 100644
--- a/api/updateTable.php
+++ b/api/updateTable.php
@@ -1,9 +1,9 @@
© 2018- Made with by iotcat
@@ -240,7 +240,6 @@ - @@ -268,7 +267,7 @@ Made with by iotcat diff --git a/setTable.html b/setTable.html index 22373e9..0cc949a 100644 --- a/setTable.html +++ b/setTable.html @@ -62,7 +62,7 @@