kospay/pay/www/geren.html

453 lines
16 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
while read kos
do
[ "${#kos}" -le "1" ]&&break;
koss="$kos
$koss"
done
ck=($(echo "$koss"|awk -F'[|:]' '{IGNORECASE=1}$1=="Cookie"{print $3}'))
sqlstart="SELECT passd,grups,isok,feilv,ckuser,ckname,ckkey,tixian,shouyi FROM user WHERE userid = '${ck[2]}'"
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
sdata=($dada)
cksec=${ck[4]}
yunse=$(echo -n "$REMOTE_HOST${sdata[2]}${sdata[1]}${ck[2]}${sdata[0]}${dateddd:0:6}"|md5sum|tr -dc [0-9])
[ "$yunse" = "$cksec" ]||{
echo "HTTP/1.1 302 Moved temporarily
Connection: close
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Cache-Control: private
Server: kos-1.0
Content-Type: text/html;charset=utf-8
Location: login.xhtml
"
exit 0
}
echo "HTTP/1.1 200 ok
Connection: close
Pragma: no-cache
Cache-Control: no-cache
Cache-Control: no-store
Cache-Control: private
Server: kos-1.0
Content-Language:zh-CN,zh
Content-Type: text/html;charset=utf-8
<!DOCTYPE html>
<html>
<center>
<head>
<script type=\"text/javascript\">
var ckname='${sdata[5]}';
var tixian='${sdata[7]}';
var shouyi='${sdata[8]}';
var ifeilv='${sdata[3]}';
</script>
<title>个人号$titles</title>
$(cat $rpath/www/man 2>/dev/null)
<style>
.mytable {width:100%;border:0;text-align:center;border-collapse:collapse;border-spacing:0;}
.mytable th{background:#0090D7;font-weight:normal;line-height:30px;font-size:14px;color:#FFF;}
.mytable tr:nth-child(odd){background:#F4F4F4;}
.mytable td:nth-child(even){color:#C00;}
.mytable tr:hover{background:#73B1E0;color:#FFF;}
.mytable td,.mytable th{border:1px solid #EEE;}
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=88);
}
.white_content {
margin: auto;
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 300px;
height: 280px;
padding: 0px;
border: 1px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
.erweima_black{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1003;
-moz-opacity: 0.8;
opacity:.90;
filter: alpha(opacity=88);
}
.erweima {
margin: auto;
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 230px;
height: 250px;
padding: 0px;
border: 1px solid #0090d7;
background-color: white;
z-index:1004;
overflow: auto;
}
@media only screen and (max-width:800px) {
.mytable{width:100%;border:0;text-align:center;border-collapse:collapse;border-spacing:0;}
.mytable th{background:#0090D7;font-weight:normal;line-height:30px;font-size:14px;color:#FFF;}
.mytable tr:nth-child(odd){background:#F4F4F4;}
.mytable tr:hover{background:#73B1E0;color:#FFF;}
.mytable td:nth-child(even){color:#C00;font-size:10px;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mytable td,.mytable th{border:1px solid #EEE;font-size:10px;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
}
</style>
<body>
<button type=\"button\" style=\"float:right;\" onclick=\"staradd()\" >添加收款账户</button>
<!-- 开户窗口开始 -->
<div id=\"light\" class=\"white_content\">
<div id='divclose' style=\"right:0;top:0;position:absolute;cursor: pointer;\" >X</div>
<div id='h4'>微信H5召唤地址开户</div><hr>
<table>
<tr><td id=\"enabletd\">状态</td><td>
<select id=\"enable\">
<option value =\"1\">启用</option>
<option value =\"0\">禁用</option>
</select>
<td></tr>
<tr><td id=\"idvaltd\">收款ID</td><td>
<input placeholder=\"点击下方按钮获取收款ID\" readonly type=\"tel\" name=\"zhifubaoid\" id=\"idval\" minlength=\"16\" maxlength=\"16\" autocomplete=\"off\" />
<td></tr>
<tr><td id=\"zfbbtntd\">-</td><td>
<input type=\"button\" id=\"zfbbtn\" onclick=\"starerweima('zfb')\" value=\"扫码获取支付宝收款ID\">
<td></tr>
<tr><td>收款人姓名</td><td>
<input placeholder=\"收款人真实姓名,必填\" type=\"text\" name=\"yuname\" id=\"yuname\" minlength=\"2\" maxlength=\"5\" autocomplete=\"off\" />
<td></tr>
<tr><td>每日限额(元)</td><td>
<input placeholder=\"2位小数。\" type=\"number\" id=\"cksy\" min=\"1000\" max=\"800000\" step=\"100\" value='100000' onkeyup=\"clearNoNum(this)\" autocomplete=\"off\" />
<td></tr>
</table>
<button id='button1' type=\"button\" style=\"right:30px;bottom:15px;position:absolute;cursor: pointer;\" >确认开户</button>
<!-- 二层窗口开始 -->
<div class=\"erweima\" id=\"erweima\">
<div id='divclose' style=\"right:0;top:0;position:absolute;cursor: pointer;\" onclick =\"enderweima()\" >X</div>
<div id='h55'>支付宝扫描二维码</div><hr>
<div id=\"qrcode\">
</div>
</div>
<div id=\"erweima_black\" class=\"erweima_black\">
</div>
<!-- 二层窗口结束 -->
</div>
<div id=\"fade\" class=\"black_overlay\">
</div>
<!-- 开户窗口结束 -->
<div style=\"width: 100%; overflow-x: auto;\">
<table class=\"mytable\" width=\"100%\" border=\"1\" id=\"tablqwq\">
<thead>
<tr>
<th>状态</th>
<th>姓名</th>
<th>类型</th>
<th>唯一收款ID</th>
<th>每日限额</th>
<th>今日交易量</th>
<th>累计交易量</th>
<th>开户时间</th>
<th>最后交易时间</th>
<th>操作</th>
</tr></thead>
<tbody id=\"tabl\"></tbody>
</table>
</div>
<script type=\"text/javascript\" src=\"base64.js\"></script>
<script type=\"text/javascript\" src=\"md5.js\"></script>
<script type=\"text/javascript\" src=\"qrcode.js\"></script>
<script type = 'text/javascript'>
document.getElementById('haomachi').style.color='#b63b4d';
document.getElementById('haomachi-geren').style.color='white';
document.getElementById('haomachi-geren').style.background='#b63b4d';
var ckuser='$ckuser'
var ckfeilv=parseFloat('${sdata[3]}')
var dateddd='$dateddd'
var base64 = new Base64();
function getlist(){
var zz = new XMLHttpRequest();
zz.onreadystatechange = function () {
if (zz.readyState == 4 && zz.status == 200) {
var ztm = zz.getResponseHeader('ztm');
if (ztm === \"noes\"){
alert('登录失效,请重登录!');
window.location.href='login.xhtml';
return;
}
if (ztm === \"okay\"){
var str =zz.responseText;
var rowArray = str.split(\"\n\");
var tabl = document.getElementById(\"tabl\");
var rowNum=tabl.rows.length;
for (ii=0;ii<rowNum;ii++)
{
tabl.deleteRow(ii);
rowNum=rowNum-1;
ii=ii-1;
}
for (var i = 0; i < rowArray.length-1; i++) {
rowArray[i] = rowArray[i].split(\"\t\");
if ( rowArray[i][2]==\"1\"){
var xszt='<font color=\"#008000\">▶</font>'
}else{
var xszt='<font color=\"#FF0000\">▣</font>'
}
var col5='<button type=\"button\" onclick=\"confirmadd(\''+rowArray[i][0]+'\',\'delone\',this)\" >删除</button> <button type=\"button\" onclick=\"starxiugai(\''+rowArray[i][0]+'\',\''+rowArray[i][2]+'\',\''+rowArray[i][5]+'\',\''+rowArray[i][7]+'\')\">修改</button></td>';
// var row = tabl.insertRow(tabl.FetchRowCount);
var row = tabl.insertRow('0');
row.insertCell(0).innerHTML = xszt; //状态
row.insertCell(1).innerHTML = rowArray[i][5];
row.insertCell(2).innerHTML = rowArray[i][3]=='zfb'?'支付宝':'微信';
row.insertCell(3).innerHTML = rowArray[i][4];
row.insertCell(4).innerHTML = rowArray[i][7];
row.insertCell(5).innerHTML = rowArray[i][8];
row.insertCell(6).innerHTML = rowArray[i][9];
row.insertCell(7).innerHTML = rowArray[i][10];
row.insertCell(8).innerHTML = rowArray[i][11];
row.insertCell(9).innerHTML = col5;
}
}
}else{
if (zz.readyState == 4 && zz.status != 200)
alert(\"网络错误!\"+zz.readyState+\"|\"+zz.status);
}
};
zz.open(\"GET\", 'getgeren.xjs',true);
zz.send(null);
}
getlist();
function staradd(){
document.getElementById('enabletd').style.display='none';
document.getElementById('enable').style.display='none';
document.getElementById('idvaltd').style.display='block';
document.getElementById('idval').style.display='block';
document.getElementById('zfbbtntd').style.display='block';
document.getElementById('zfbbtn').style.display='block';
document.getElementById('h4').innerHTML='支付参数录入';
document.getElementById('button1').innerHTML='确认提交';
document.getElementById('button1').onclick=function(){confirmadd(\"0\",\"zfzhanghaoadd\")};
document.getElementById('divclose').onclick=function(){endadd(\"add\")};
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function starxiugai(ids,enables,yunamee,maxjines){
document.getElementById(\"enable\").value=enables;
document.getElementById(\"yuname\").value=yunamee;
document.getElementById(\"cksy\").value=maxjines;
document.getElementById('idvaltd').style.display='none';
document.getElementById('idval').style.display='none';
document.getElementById('zfbbtntd').style.display='none';
document.getElementById('zfbbtn').style.display='none';
document.getElementById('enabletd').style.display='block';
document.getElementById('enable').style.display='block';
document.getElementById('divclose').onclick=function(){endadd(\"xiugai\")};
document.getElementById('h4').innerHTML='支付参数修改';
document.getElementById('button1').innerHTML='确认修改';
document.getElementById('button1').onclick=function(){confirmadd(ids,\"xiugai\")};
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function endadd(trt){
if (trt == \"xiugai\"){
document.getElementById(\"enable\").value=0;
document.getElementById(\"yuname\").value='';
document.getElementById(\"cksy\").value='';
}
document.getElementById('light').style.display='none';
document.getElementById('fade').style.display='none';
}
function clearNoNum(obj) {
obj.value = obj.value.replace(/[^\\d.]/g, \"\"); //清除除了“数字”和“.”以外的字符
obj.value = obj.value.replace(/\\.{2,}/g, \".\"); //只保留第一个. 清除多余的
obj.value = obj.value.replace(\".\", \"\$#\$\").replace(/\\./g, \"\").replace(\"\$#\$\", \".\");
obj.value = obj.value.replace(/^(\\-)*(\\d+)\.(\\d\\d\\d).*$/, '\$1\$2.\$3');//只能输入3个小数
if (obj.value.indexOf(\".\") < 0 && obj.value != \"\") {
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
obj.value = parseFloat(obj.value);
}
}
function confirmadd(fgf,gfg,x)
{
//alert(fgf+'\n'+gfg);
var enables=document.getElementById(\"enable\").value;
var yuname=document.getElementById(\"yuname\").value;
var appidss=document.getElementById(\"idval\").value;
var maxjines=document.getElementById(\"cksy\").value;
if(gfg!='delone'){
if(appidss.length<16&&gfg!='xiugai'){
alert('AppId参数不对\n微信以wx开头由18位字母和数字组成。\n支付宝以2088开头由16位纯数字组成。');
return;
}
if(!yuname){
alert('姓名不能为空,必须真实姓名');
return 3;
}
if (maxjines>1000000){
alert('收款每天最大限额不要超过100万');
return;
}
}else{
var tab=document.getElementById(\"tablqwq\");
var rows=tab.rows;
// alert(rows[x.parentNode.parentNode.rowIndex].cells[2].innerHTML);
if(!confirm('确认删除【'+rows[x.parentNode.parentNode.rowIndex].cells[1].innerHTML+'】'+rows[x.parentNode.parentNode.rowIndex].cells[2].innerHTML+'通道?\n收款Id:'+rows[x.parentNode.parentNode.rowIndex].cells[3].innerHTML))return;
}
switch (gfg)
{
case 'delone':
var pdata=fgf;
break;
case 'zfzhanghaoadd':
var pdata='zfb '+appidss+' '+yuname+' '+maxjines;
break;
case 'xiugai':
var pdata=fgf+' '+enables+' '+yuname+' '+maxjines;
break;
}
var qq = new XMLHttpRequest();
qq.onreadystatechange = function () {
if (qq.readyState == 4 && qq.status == 200) {
var rehead=qq.responseText;
var ztm = qq.getResponseHeader('ztm');
if (ztm === \"noes\"){
alert('登录失效,请重登录!');
window.location.href='login.xhtml';
return;
}
if (ztm == 'okay')
{
alert(rehead);
endadd('xiugaiend');
getlist();
}else if (ztm == 'okey')alert(rehead);
}else{
if (qq.readyState == 4 && qq.status != 200)
alert(\"网络错误!\"+qq.readyState+\"|\"+qq.status);
}
};
qq.open(\"POST\", 'geren.xjs?'+gfg,true);
qq.send(pdata);
}
//二维码获取ID开始
function starerweima(aa){
//document.getElementById(\"qrcode\").innerHTML = '';
var timestamp = new Date().getTime();
var uid=md5(ckuser+timestamp);
var uidd='al'+uid;
var text = 'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=2019051765009318&scope=auth_base&redirect_uri=http://krepay.com:88/getid.xjs&state='+uidd;
var erweimatitle='请打开支付宝扫一扫'
document.getElementById('h55').innerHTML='支付宝扫描二维码';
var qrcode = new QRCode(document.getElementById(\"qrcode\"), {
width : 200,//设置宽高
height : 200
});
qrcode.makeCode(text,erweimatitle);
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var rehead=xmlhttp.responseText.substr(0,4)
switch (rehead)
{
case 'okay':
var zfid = xmlhttp.getResponseHeader('zfid');
document.getElementById('idval').value=zfid;
enderweima();
break;
case 'wait':
break;
case 'noes':
alert('登录失效,请重登录!');
window.location.href='login.xhtml';
break;
default:
alert(\"错误!\"+xmlhttp.readyState+\"|\"+xmlhttp.status+\"\n\"+xmlhttp.responseText);
}
}else{
if (xmlhttp.readyState == 4 && xmlhttp.status != 200)
alert(\"网络错误!\"+xmlhttp.readyState+\"|\"+xmlhttp.status);
}
};
function qazwsx()
{
xmlhttp.open(\"POST\", 'getid.xjs',true);
xmlhttp.send(uidd);
}
setint=window.setInterval(function(){ qazwsx() }, 3000);
document.getElementById('erweima').style.display='block';
document.getElementById('erweima_black').style.display='block';
}
//二维码获取ID结束
function enderweima(){
//关闭二维码时关闭异步循环
window.clearInterval(setint);
document.getElementById(\"qrcode\").innerHTML = '';
document.getElementById('erweima').style.display='none';
document.getElementById('erweima_black').style.display='none';
}
//关闭二维码结束
</script>
</body>
</center>
</html>
"