kospay/pay/www/daili.html

405 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;}
.mytable td,.mytable th{border:1px solid #EEE;font-size:10px;word-break:keep-all;white-space:nowrap;}
}
</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>登录账号</td><td>
<input placeholder=\"登录账号,只能是数字\" type=\"tel\" name=\"zhanghao\" id=\"zhanghao\" minlength=\"6\" maxlength=\"16\" onchange=\"value=value.replace(/[^\d]/g,'')\" onKeyUp=\"value=value.replace(/[^\d]/g,'')\" autocomplete=\"off\" />
<td></tr>
<tr><td>登录密码</td><td>
<input placeholder=\"登录密码\" type=\"password\" name=\"passd\" id=\"passd\" minlength=\"6\" maxlength=\"16\" autocomplete=\"off\" />
<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=\"手机号码\" type=\"tel\" name=\"cksj\" id=\"cksj\" minlength=\"11\" maxlength=\"11\" autocomplete=\"off\" />
<td></tr>
<tr><td>费率</td><td>
<input placeholder=\"3位小数。\" type=\"number\" name=\"cksy\" id=\"cksy\" min=\"0.006\" max=\"0.2\" step=\"0.001\" onkeyup=\"clearNoNum(this)\" autocomplete=\"off\" />
<td></tr>
</table>
<button id='button1' type=\"button\" style=\"right:30px;bottom:15px;position:absolute;cursor: pointer;\" >确认开户</button>
</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>类型</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'>
var ckuser='$ckuser'
var ckfeilv=parseFloat('${sdata[3]}')
document.getElementById('daili').style.color='#b63b4d';
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][1]==\"0\"){
var xszt='<font onclick=\"dailimod(\''+rowArray[i][0]+'\',\'1\',\'zhuangtaixiugai\')\" title=\"点击禁用该用户\" style=\"cursor: pointer;\" color=\"#008000\">▶</font>'
}else{
var xszt='<font onclick=\"dailimod(\''+rowArray[i][0]+'\',\'0\',\'zhuangtaixiugai\')\" title=\"点击启用该用户\" style=\"cursor: pointer;\" color=\"#FF0000\">▣</font>'
}
// var col5='<button type=\"button\" onclick=\"zftest(\''+rowArray[i][0]+'\')\" >测试</button> <button type=\"button\" onclick=\"starxiugai(\''+rowArray[i][0]+'\',\''+rowArray[i][1]+'\',\''+rowArray[i][2]+'\',\''+rowArray[i][3]+'\',\''+rowArray[i][4]+'\',\''+rowArray[i][5]+'\',\''+rowArray[i][6]+'\')\">修改</button></td>';
//col4='<input type=\"text\" readonly style=\"width: 100%; margin: 0; padding: 0;border:none;box-shadow: 0px 0px 0px 0px;\" autocomplete=\"off\" value=\"'+rowArray[i][1]+'\">'
// var row = tabl.insertRow(tabl.FetchRowCount);
var row = tabl.insertRow('0');
// alert(ckfeilv+0.001);
var col7='<button type=\"button\" onclick=\"repassd(\''+rowArray[i][0]+'\')\" >重置密码</button>';
var ddd,qqq;
rowArray[i][5]>=0.199?ddd='<span href=\"#\" >⇨</span>':ddd='<span href=\"#\" title=\"费率增加0.001\" onclick=\"dailimod(\''+rowArray[i][0]+'\',parseFloat(('+rowArray[i][5]+'+0.001).toPrecision(12)).toFixed(3),\'feilvxiugai\')\" style=\'cursor: pointer;\' onMousemove=\'this.style.backgroundColor = \"green\";\' onmouseout=\'this.style.backgroundColor = \"\";\' ontouchstart=\'this.style.backgroundColor = \"red\";\' ontouchend=\'this.style.backgroundColor = \"\";\' onmousedown=\'this.style.backgroundColor = \"red\";\' \">⇨</span>'
rowArray[i][5]>(ckfeilv+0.001)?qqq='<span href=\"#\" title=\"费率减少0.001\" onclick=\"dailimod(\''+rowArray[i][0]+'\',parseFloat(('+rowArray[i][5]+'-0.001).toPrecision(12)).toFixed(3),\'feilvxiugai\')\" style=\'cursor: pointer;\' onMousemove=\'this.style.backgroundColor = \"green\";\' onmouseout=\'this.style.backgroundColor = \"\";\' ontouchstart=\'this.style.backgroundColor = \"red\";\' ontouchend=\'this.style.backgroundColor = \"\";\' onmousedown=\'this.style.backgroundColor = \"red\";\' \">⇦</span>':qqq='<span href=\"#\" >⇦</span>'
row.insertCell(0).innerHTML = xszt; //状态
row.insertCell(1).innerHTML = rowArray[i][2]; //姓名
row.insertCell(2).innerHTML = base64.decode(rowArray[i][3]); //账号
row.insertCell(3).innerHTML = rowArray[i][4]=='1'?'代理':'商户'; //类型
row.insertCell(4).innerHTML = qqq+rowArray[i][5]+ddd; //费率
row.insertCell(5).innerHTML = rowArray[i][6]; //开户时间
row.insertCell(6).innerHTML = rowArray[i][7]!='NULL'?new Date(parseInt(rowArray[i][7]*1000)).toLocaleString('chinese',{hour12:false}):null; //最后修改时间
row.insertCell(7).innerHTML = col7;
// row.onclick=function(){
//alert(this.innerHTML+\"tr created!\")
//};
//row.insertCell('5').setAttribute(\"onclick\",\"window.document.location='Accounts.html'\");
// row.insertCell(5).innerHTML = rowArray[i][1]; //接口密钥
//row.insertCell(6).innerHTML = col5; //操作
}
}
}else{
if (zz.readyState == 4 && zz.status != 200)
alert(\"网络错误!\"+zz.readyState+\"|\"+zz.status);
}
};
zz.open(\"GET\", 'getuserlist.xjs',true);
zz.send(null);
}
getlist();
function staradd(){
document.getElementById('h4').innerHTML='个人支付开户';
document.getElementById('button1').innerHTML='确认开户';
document.getElementById('button1').onclick=function(){confirmadd(\"zfuseradd\")};
document.getElementById('divclose').onclick=function(){endadd(\"add\")};
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function endadd(trt){
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)
{
var zhanghao=document.getElementById('zhanghao').value;
var passd=document.getElementById('passd').value;
var yuname=document.getElementById('yuname').value;
var cksj=document.getElementById('cksj').value;
var cksy=document.getElementById('cksy').value;
// var yuhosts = yuhost.toLowerCase();
if (zhanghao.length > 16 || zhanghao.length < 6){
alert('账号由6-16位纯数字组成');
return;
}
if (passd.length > 16 || passd.length < 6){
alert('密码长度6-16位字母或数字组成');
return;
}
if (yuname.replace(/[^\u4E00-\u9FA5]/g,'') != yuname||yuname==''){
alert(\"姓名必须是汉字,且不能为空!\");
return;
if (yuname.replace(/[^\u4E00-\u9FA5]/g,'').length < 2 || yuname.replace(/[^\u4E00-\u9FA5]/g,'').length > 5 ){
alert(\"姓名长度为2-5个汉字\");
return;
}
}
if (cksj.replace(/[^\d]/g, '').length != 11){
alert('手机号不正确!');
return;
}
if (ckfeilv>=cksy||cksy>=0.2||cksy==''){
alert('商户费率不能低于自身费率且不能高于0.2\\n当前费率为'+ckfeilv);
return;
}
var pdata=base64.encode(zhanghao)+' '+base64.encode(passd)+' '+yuname+' '+cksj+' '+cksy;
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\", 'daili.xjs',true);
qq.send(pdata);
}
function repassd(kkk)
{
if(!confirm('确定要把该账号密码重置为【123456】吗?'))return;
var aaq = new XMLHttpRequest();
aaq.onreadystatechange = function () {
if (aaq.readyState == 4 && aaq.status == 200) {
var rehead=aaq.responseText;
var ztm = aaq.getResponseHeader('ztm');
if (ztm == \"noes\"){
alert('登录失效,请重登录!');
window.location.href='login.xhtml';
return;
}
if (ztm == 'okay')
{
alert('密码重置成功!');
}
}else{
if (aaq.readyState == 4 && aaq.status != 200)
alert(\"网络错误!\"+aaq.readyState+\"|\"+aaq.status);
}
};
aaq.open(\"POST\", 'paswd.xjs?repasd',true);
aaq.send(kkk);
}
function dailimod(fgf,gfg,tp)
{
var aqa = new XMLHttpRequest();
aqa.onreadystatechange = function () {
if (aqa.readyState == 4 && aqa.status == 200) {
var rehead=aqa.responseText;
var ztm = aqa.getResponseHeader('ztm');
if (ztm == \"noes\"){
alert('登录失效,请重登录!');
window.location.href='login.xhtml';
return;
}
if (ztm == 'okay')
{
getlist();
}else if (ztm == 'okey')alert(rehead);
}else{
if (aqa.readyState == 4 && aqa.status != 200)
alert(\"网络错误!\"+aqa.readyState+\"|\"+aqa.status);
}
};
aqa.open(\"POST\", 'dailis.xjs?'+tp,true);
aqa.send(fgf+' '+gfg);
}
</script>
</body>
</center>
</html>
"