master
cn.yimian.xyz 4 years ago
parent 2c7d6bc3c4
commit bc64b12f06
  1. 30
      api/checkout.php
  2. 4
      api/confirmBalance.php
  3. 6
      api/createTable.php
  4. 28
      api/functions.php
  5. 2
      api/getData.php
  6. 11
      api/joinTable.php
  7. 4
      api/newItem.php
  8. 6
      api/updateTable.php
  9. 13
      index.html
  10. 4
      records.html
  11. 68
      setTable.html

@ -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 '<script>alert("您已退出!请根据邮件提示进行checkout!!");window.location.href="https://cp-acc.yimian.xyz/"</script>';
/* 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 '<script>alert("您已退出!请根据邮件提示进行checkout!!");window.location.href="https://cp-acc.yimian.xyz/"</script>';

@ -1,8 +1,8 @@
<?php
include './functions.php';
$first = $_REQUEST['first'];
$last = $_REQUEST['last'];
$first = $_GET['first'];
$last = $_GET['last'];

@ -3,9 +3,9 @@ include './functions.php';
header("Content-type:application/json");
$hash = $_REQUEST['hash'];
$name = $_REQUEST['name'];
$threshold = $_REQUEST['threshold'];
$hash = $_GET['hash'];
$name = $_GET['name'];
$threshold = $_GET['threshold'];
if(!isset($hash) || !isset($name) || !isset($threshold)) die();

@ -791,22 +791,22 @@ function setBalance($first, $last, $threshold, $tableId, $cnn){
sendMail($lastData['email'], "CP-ACC消息: 您将从".$firstData['nickname']."收到".$threshold."磅/元", "亲爱的".$lastData['nickname'].":
根据系统的计算,您将从".$firstData['nickname']."(".$firstData['email'].")"."收取".$threshold."磅/元,以保持大家的公共支出相对公平。请在收到对方转账后点击下方确认链接或登入<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a>进行确认。您可以通过<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a>查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
确认链接: <a href='https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."'>https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."</a>
感谢您使用本站服务,祝您生活愉悦!
呓喵酱(@iotcat)", "CP-ACC");
sendMail($lastData['email'], "CP-ACC消息: 您将从".$firstData['nickname']."收到".$threshold."磅", "亲爱的".$lastData['nickname'].":
<br/> <br/>
根据系统的计算,您将从<strong>".$firstData['nickname']."(<a href='mailto:".$firstData['email']."'>".$firstData['email']."</a>)"."</strong>收取<strong>".$threshold."</strong>,以保持大家的公共支出相对公平。请在收到对方转账后<strong>点击下方确认链接</strong><strong>登入<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a></strong>进行确认。您可以通过<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a>查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
<br/> <br/>
<strong>确认链接: <a href='https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."'>https://cp-acc.yimian.xyz/api/confirmBalance.php?first=".$itemIdFirst."&last=".$itemIdLast."</a></strong>
<br/> <br/>
感谢您使用本站服务,祝您生活愉悦!<br/>
呓喵酱(<a href='https://iotcat.me/'>@iotcat</a>)", "CP-ACC");
Sleep(10);
sendMail($firstData['email'], 'CP-ACC消息: 您需要给'.$lastData['nickname'].$threshold."磅/元", "亲爱的".$firstData['nickname'].":
根据系统的计算,您需要给".$lastData['nickname']."(".$lastData['email'].")".$threshold."磅/元,以保持大家的公共支出相对公平。请在转账后提醒对方从网站或邮件中确认您的支出。您可以通过<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a>查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
感谢您使用本站服务,祝您生活愉悦!
呓喵酱(@iotcat)", "CP-ACC");
sendMail($firstData['email'], 'CP-ACC消息: 您需要给'.$lastData['nickname'].$threshold."磅", "亲爱的".$firstData['nickname'].":
<br/> <br/>
根据系统的计算,您需要给<strong>".$lastData['nickname']."(<a href='mailto:".$lastData['email']."'>".$lastData['email']."</a>)".$threshold."磅</strong>,以保持大家的公共支出相对公平。请在转账后<strong>提醒对方</strong>从网站或邮件中确认您的支出。您可以通过<a href='https://cp-acc.yimian.xyz/'>CP-ACC网站</a>查看具体账目细节。如有任何疑问,请联系站长呓喵酱(i@iotcat.me)。
<br/> <br/>
感谢您使用本站服务,祝您生活愉悦!<br/>
呓喵酱(<a href='https://iotcat.me/'>@iotcat</a>)", "CP-ACC");
}

@ -2,7 +2,7 @@
include './functions.php';
header("Content-type:application/json");
$hash = $_REQUEST['hash'];
$hash = $_GET['hash'];
if(!isset($hash)) die();

@ -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, "/");

@ -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();

@ -1,9 +1,9 @@
<?php
include './functions.php';
$tableId = $_REQUEST['tableId'];
$name = $_REQUEST['name'];
$threshold = $_REQUEST['threshold'];
$tableId = $_GET['tableId'];
$name = $_GET['name'];
$threshold = $_GET['threshold'];
if(!isset($tableId) || !isset($name) || !isset($threshold)) die();

@ -218,8 +218,8 @@
<ul>
<li><a id="ushio-blog" href="https://www.eee.dog"><i class="fa fa-home"></i></a></li>
<li><a href="https://github.com/iotcat"><i class="fa fa-github"></i></a></li>
<li><a href="mailto:i@yimian.xyz"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://www.eee.dog/feed"><i class="fa fa-rss"></i></a></li>
<li><a href="mailto:i@iotcat.me"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://guide.yimian.xyz/"><i class="fa fa-superpowers"></i></a></li>
</ul>
<p>© 2018-<script type="text/javascript">document.write(new Date().getFullYear());</script> Made with <span class="shaky"><i style="color:red;" class="fa fa-heart"></i></span> by <a id="ushio-tome" href="https://iotcat.me">iotcat</a></p>
</div>
@ -240,7 +240,6 @@
<script type="text/javascript" src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script>
<!-- JQuery library file. requared all pages -->
<script src="https://cdn.yimian.xyz/smart-settlement/js/jquery-3.2.1.min.js"></script>
<!-- Swiper JS -->
<script src="https://cdn.yimian.xyz/smart-settlement/js/swiper.min.js"></script>
@ -268,7 +267,7 @@
<script type="text/javascript">
try{
if(cookie.get('cache')){
data = JSON.parse(atob(cookie.get('cache')));
data = JSON.parse(decodeURIComponent(escape(atob(cookie.get('cache')))));
$('#title').html(data.name);
$('#total').html(data.total);
@ -342,6 +341,7 @@ function load(){
}, true]
);
$('#switch').unbind();
$("#switch").click(function(){
tips.question({
timeout: 20000,
@ -359,6 +359,7 @@ function load(){
$('#setTable').unbind();
$('#setTable').click(function(){
window.location.href="./setTable.html?tableId="+data.id;
});
@ -404,8 +405,8 @@ function load(){
threshold: data.threshold
};
try{
cookie.set('cache', btoa(JSON.stringify(briefData)));
}catch(e){}
cookie.set('cache', btoa(unescape(encodeURIComponent(JSON.stringify(briefData)))));
}catch(e){console.log(e, briefData)}
var show = [];
for(var i = data['items'].length - 1; i > data['items'].length-10 && i >= 0; i --){
if(data['items'][i]['value'] > 0 && (data['items'][i]['type'] == 'innerF' || data['items'][i]['type'] == 'external'))

@ -106,8 +106,8 @@
<ul>
<li><a id="ushio-blog" href="https://www.eee.dog"><i class="fa fa-home"></i></a></li>
<li><a href="https://github.com/iotcat"><i class="fa fa-github"></i></a></li>
<li><a href="mailto:i@yimian.xyz"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://www.eee.dog/feed"><i class="fa fa-rss"></i></a></li>
<li><a href="mailto:i@iotcat.me"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://guide.yimian.xyz/"><i class="fa fa-superpowers"></i></a></li>
</ul>
<p>© 2018-<script type="text/javascript">document.write(new Date().getFullYear());</script> Made with <span class="shaky"><i style="color:red;" class="fa fa-heart"></i></span> by <a id="ushio-tome" href="https://iotcat.me">iotcat</a></p>
</div>

@ -62,7 +62,7 @@
<br/><br/>
<div id="qr" align="center" style="display: none;">
<p>请让成员打开链接或扫描二维码加入账户:</p>
<input width="60%" type="text" id="url">
<input width="60%" type="text" id="url"><button id="copy">copy</button>
<div id="qrcode"></div>
</div>
</div>
@ -101,11 +101,10 @@
try{
if(page.params.hasOwnProperty('tableId')){
if(cookie.get('cache')){
data = JSON.parse(atob(cookie.get('cache')));
data = JSON.parse(decodeURIComponent(escape(atob(cookie.get('cache')))));
$('#name').val(data.name);
$('#threshold').val(data.threshold);
}
}
}catch(e){}
@ -168,13 +167,74 @@ session.onload(function(){
qrcode.makeCode('https://cp-acc.yimian.xyz/?tableId='+res.tableId);
$('#url').val('https://cp-acc.yimian.xyz/?tableId='+res.tableId);
cookie.set('tableId', res.tableId);
delete window.localStorage[session.get('hash')];
});
});
}
});
window.Clipboard = (function(window, document, navigator) {
var textArea,
copy;
// 判断是不是ios端
function isOS() {
return navigator.userAgent.match(/ipad|iphone/i);
}
//创建文本元素
function createTextArea(text) {
textArea = document.createElement('textArea');
textArea.value = text;
document.body.appendChild(textArea);
}
//选择内容
function selectText() {
var range,
selection;
if (isOS()) {
range = document.createRange();
range.selectNodeContents(textArea);
selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
textArea.setSelectionRange(0, 999999);
} else {
textArea.select();
}
}
//复制到剪贴板
function copyToClipboard() {
try{
if(document.execCommand("Copy")){
alert("链接复制成功!");
}else{
alert("复制失败!请手动复制!");
}
}catch(err){
alert("复制错误!请手动复制!")
}
document.body.removeChild(textArea);
}
copy = function(text) {
createTextArea(text);
selectText();
copyToClipboard();
};
return {
copy: copy
};
})(window, document, navigator);
$('#copy').click(function(){
Clipboard.copy($('#url').val());
});
</script>
</body>

Loading…
Cancel
Save