yzms/show/qc_pay_cm.php

771 lines
27 KiB
PHP
Raw Normal View History

2024-04-01 15:54:27 +08:00
<?
require_once(dirname(__FILE__)."/common.php");
$ftid = intval($_GET['ftid']);
if(!$ftid) {
die("no ftid!");
}
$channelid = intval($_GET['channelid']);
$act = $_GET['act'];
$ftInfo = $db->get_one("select * from tb_dining_hall where id=".$ftid);
if(!$ftInfo) {
die("no ftid dining_hall!");
}
$pay_values = $ftInfo['pay_values']; //价格标签
if(!$pay_values) $pay_values = '5,10,15';
if($act == 'getToday') {
if($channelid) {
$cname = $db->get_colume("select channel_name from tb_pos_channel where dining_hall_id={$ftid} and id={$channelid}");
}
$sum = $db->get_colume("select sum(recharge_amount) from tb_recharge where type in (6,12,15) and ftid={$ftid} and channel_id={$channelid} and record_datetime like '".date("Y-m-d")."%'");
if($cname) $s .= $cname.": ";
$s .= "今日消费 ".abs(floatval($sum))." 元。";
echo json_encode(array('msg' => $s));
exit;
}
$cList = $db->get_all("select * from tb_pos_channel where dining_hall_id=".$ftid." and enabled=1 order by id");
if($channelid) {
$cInfo = $db->get_one("select * from tb_pos_channel where id=".$channelid);
}
$isvoice = ($cInfo && $cInfo['voice'] == 1);
$iscomplete = $_GET['iscomplete'];
if(!$iscomplete && !$_GET['code'] && $act == '') {
header("Location: ?".$_SERVER['QUERY_STRING']."&iscomplete=1");
exit;
}
$payfee = floatval($_GET['payfee']);
$code = trim($_GET['code']);
$type = trim($_GET['type']);
if($payfee > 0 && $code != '') { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>支付</title>
<script type="text/javascript" src="js/func.js"></script>
<script type="text/javascript">
function addOrder(code, type, ispos) {
$("div1").innerHTML = '正在支付,请稍候...';
$G.ajax("/api/user/qrpay", {'fee': '<?=$payfee?>', 'ftid': '<?=$ftid?>', 'channelid': '<?=$channelid?>', 'code': code, 'type': type, 'ispos': ispos}, function(rs) {
if(rs.status == 1) {
$("div2").innerHTML = '<img src="images/suc.png" />';
$("div1").innerHTML = (rs.data.name + ',支付成功!<br />' + (rs.data.deptname?rs.data.deptname:"") + '('+rs.data.typename+')<br />余额: '+rs.data.balance+"");
if(typeof(rs.data.print_info) != 'undefined' && typeof(androidJs) != 'undefined') {
try {
androidJs.printOrder(rs.data.print_info);
} catch (e){}
}
} else {
$("div2").innerHTML = '<img src="images/fail.png" />';
if(rs.message) {
$("div1").innerHTML = ('<span style="color:red">'+rs.message+'</span>');
}
else $("div1").innerHTML = ('<span style="color:red">系统错误,请重试!</span>');
}
}, 'json', 'POST');
}
window.onload = function() {
payfee = '<?=$payfee?>';
nowNum = '';
addOrder('<?=$code?>', '<?=$type=='ic'?"ic":"qr"?>', 1);
}
</script>
</head>
<body>
<div id="div2" style="text-align:center"></div>
<div id="div1" style="font-weight:bold;font-size:30px; margin-top:10px; color:#666666">
</div>
</body>
</html>
<?
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>支付</title>
<style type="text/css">
html, body {
border: none;
}
</style>
<script type="text/javascript" src="js/func.js"></script>
<script type="text/javascript">
var hasList = [];
var dishIdList = [];
var isshowQR = false;
var isPaying = false;
var payfee = 0;
var reshowfee = ''; //连续显示付款金额
var channelid = '<?=$channelid?>';
var maxInputTime = 10;
var kb_status = {'1':'1','2':'1'};
var kb_readStr = {'1':'','2':''};
var kb_timeOut = {'1':'','2':''};
var last1time = 0;
var nowInput = false;
var inputCode = '';
var closeTime = 0;
var closeItv;
var nowInputFrom = '1';
var nowLaseInput = 0;
var lastCloseInput = 0;
var lastInput1 = 0;
var lastSucTime = 0;
var lastErrTime = 0;
var lastddh = '';
var lastdctype = '';
var getting = false;
function setMsg() {
var html = '';
var total = 0;
for(var i = 0; i < hasList.length; i++) {
var item = hasList[i];
total += item[2]*item[3];
html += '<div style="padding:10px 5px;line-height:1.5;height:auto; border-bottom:1px solid #dddddd; font-size:16px; font-weight:bold; text-align:left; padding-left:5px; background:#fafafa">'+item[1]+'(<span style="color:blue">'+item[2]+'元</span>): <span style="color:red">'+item[3]+'</span> 份<div style="margin-top:10px"><a style="color:red;text-decoration:underline; padding-left:10px" href="javascript:;" onclick="addDish('+item[0]+', \'\', 0)"><img src="images/add.png" width="30" height="30" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color:blue;text-decoration:underline; padding-left:30px" href="javascript:;" onclick="jianDish('+item[0]+')"><img src="images/jian.png" width="30" height="30" border="0" /></a></div></div>';
}
$("hasDiv").innerHTML = html;
$("totalSpan").innerHTML = total.toFixed(2);
}
function closeQR() {
getting = false;
if(itvList['fdiv']) { try{clearInterval(itvList['fdiv']);} catch(e){} delete(itvList['fdiv']); }
isshowQR = false;
isPaying = false;
$G.hide_div("fdiv");
if(reshowfee != '') {
setInput(reshowfee);
}
}
function addOrder(code, type, ispos) {
if(getting || !isPaying) return ;
if(!ispos) ispos = 0;
var tname = '扫描二维码';
if(type && type == 'ic') {
tname = '读取IC卡';
}
setMsg2('<span style="color:blue">已'+tname+',请稍候...</span>');
getting = true;
$G.ajax("/api/user/qrpay", {'fee': payfee, 'ftid': '<?=$ftid?>', 'channelid': channelid, 'code': code, 'type': type, 'ispos': ispos}, function(rs) {
getting = false;
if(rs.status == 1) {
isPaying = false;
lastddh = code;
djsNow['fdiv'] = <?=$isvoice?3:6?>;
setTimeout('$("djs_div").style.display = "";', 1200);
//setMsg2('<div style="color:#009900; font-size:30px"><img src="images/payok.png" style="vertical-align:middle" width="100" height="100" /> ' + rs.data.name + ',支付成功!</div>');
setMsg2('<div><table border="0"><tr><td><img src="images/payok.png" style="vertical-align:middle;margin-right:5px" width="100" height="100" /></td><td><div style="color:#009900; font-size:30px">' + rs.data.name + ',支付成功!</div><div style="margin-top:5px; color:#666666">' + rs.data.deptname + '('+rs.data.typename+')' + '</div><div style="margin-top:5px; color:#666666">余额: '+rs.data.balance+' 元</div></td></tr></table></div>' + get_face_img(rs.data.user_id));
voice(rs.data.name + "消费"+payfee+"");
var name = rs.data.name;
if(name.length == 2) {
name = "*" + name.substr(1);
} else if(name.length > 2) {
name = name.substr(0, 1)+"*" + name.substr(2);
}
addRecord(name+' '+rs.data.cellphone+'<br />'+rs.data.paytype+'消费 '+payfee+'元<br />'+rs.data.paytime);
if(typeof(rs.data.print_info) != 'undefined' && typeof(androidJs) != 'undefined') {
try {
androidJs.printOrder(rs.data.print_info);
} catch (e){}
}
} else {
if(rs.message) {
djsNow['fdiv'] += 5;
voice(rs.message);
setMsg2(rs.message);
}
else setMsg2("系统错误,请重试!");
}
}, 'json', 'POST');
}
function closeAlert() {
if(itvList['fdiv_alert']) { try{clearInterval(itvList['fdiv_alert']);} catch(e){} delete(itvList['fdiv_alert']); }
$G.hide_div("fdiv_alert");
}
function myalert(str, time) {
if(!time) time = 10;
$("alert_msg").innerHTML = str;
$G.show_div("fdiv_alert", 600, 250);
showDjs('fdiv_alert', 'alert_close_time', time, closeAlert);
}
function showQR() {
if(isshowQR) return ;
if(payfee == 0) {
myalert("请输入金额!");
return ;
}
var html = payfee + "";
setMsg2("请刷付款二维码");
$("dishListTd").innerHTML = html;
$G.show_div("fdiv", 760, 450);
isshowQR = true;
isPaying = true;
if(reshowfee == '') {
$("djs_div").style.display = '';
showDjs('fdiv', 'qr_close_time', 30, closeQR);
} else {
$("djs_div").style.display = 'none';
showDjs('fdiv', 'qr_close_time', 99999, closeQR);
}
}
var itvList = {};
var djsNow = {};
function showDjs(id, tid, time, func) {
djsNow[id] = time;
if(itvList[id]) return ;
$(tid).innerHTML = djsNow[id];
itvList[id] = setInterval(function() {
if(getting) return ;
djsNow[id]--;
if(djsNow[id] <= 0) {
try{clearInterval(itvList[id]);} catch(e){}
delete(itvList[id]);
func();
return ;
}
$(tid).innerHTML = djsNow[id];
}, 1000);
}
//读取二维码
var isGetting = false;
function test(code) {
if(code.toLowerCase().indexOf("shift") != -1) return ;
//code = code.replace("Num ", "").replace("num ", "");
if(code.toLowerCase() == 'backspace') code = '[back]';
if(code.toLowerCase() == 'enter') code = '[enter]';
//dealKey('2', code);//document.getElementById("div1").innerHTML = code;
//tt += code+"";
}
function fromKeyCode(code) {
if((code >= 48 && code <= 57) || (code >= 65 && code <= 90)) return String.fromCharCode(code);
var keys = {186: ';', 188: ',', 189: '-', 190: '.', 191: '/', 222: "'", 219: '[', 221: ']', 187: '=',
96:'Num 0', 97:'Num 1', 98:'Num 2', 99:'Num 3', 100:'Num 4', 101:'Num 5', 102:'Num 6', 103:'Num 7', 104:'Num 8', 105:'Num 9',
111:'Num /', 106:'Num *', 109:'Num -', 111:'Num /', 107:'Num +',13:'[enter]',8:'[back]',110:'Num .'
//,45:'0', 35:'1', 40:'2', 34:'3', 37:'4', 12:'5', 39:'6', 36:'7', 38:'8', 33:'9'
};
if(keys[code]) return keys[code];
return '*err*';
}
function hashCode(strKey)
{
var hash = 0;
if(strKey != null && strKey != "")
{
for (var i = 0; i < strKey.length; i++)
{
hash = hash * 31 + strKey.charCodeAt(i);
hash = intValue(hash);
}
}
return hash;
}
function intValue(num)
{
var MAX_VALUE = 0x7fffffff;
var MIN_VALUE = -0x80000000;
if(num > MAX_VALUE || num < MIN_VALUE)
{
return num &= 0xFFFFFFFF;
}
return num;
}
document.onkeydown = function() {
var code = event.keyCode; //alert(code+","+fromKeyCode(code));return;
//[st]sduf87fjsdfysd78,526976123;
if(code == 16) return ;
//$("testdiv").innerHTML += code + " ";
dealKey('1', fromKeyCode(code));//document.getElementById("div1").innerHTML += fromKeyCode(code);
return false;
//document.getElementById("div1").innerHTML += fromKeyCode(code)+"|";
}
//[st]a7nd823sd,-235435454;
function dealKey(from, c) {
if(!isshowQR) {
kb_status[from] = '1';
if($("fdiv_alert").style.display != 'none') {
if(c == '[enter]') {
closeAlert();
}
} else {
if(c.substr(0, 4) == 'Num ') {
c = c.substr(4);
}
if(c >= '0' && c <= '9') {
doInput(c)
} else if(c == '[enter]') {
doInput('S');
} else if(c == '[back]') {
doInput('B');
} else if(c == '.') {
doInput('.');
} else if(c == '+') {
doInput('+');
}
}
return ;
}
if(isGetting) {
kb_status[from] = '1';
readErr(from, 9);
return ;
}
if(from == '1') last1time = new Date().getTime();//alert(from);
if(kb_status[from] == '1') { //开始
if(c == '[') {
kb_timeOut[from] = setTimeout("readErr('"+from+"', 1);", 2000);
kb_status[from] = '2';
} else if(c == ';') { //IC卡
kb_timeOut[from] = setTimeout("readErr('"+from+"', 1);", 2000);
kb_status[from] = '6';
}
else readErr(from, 2);
} else if(kb_status[from] == '2') { //读取s
if(c == 'S') kb_status[from] = '3';
else {
kb_status[from] = '1';
readErr(from, 3);
}
} else if(kb_status[from] == '3') { //读取t
if(c == 'T') kb_status[from] = '4';
else {
kb_status[from] = '1';
readErr(from, 4);
}
} else if(kb_status[from] == '4') { //读取]
if(c == ']') {
kb_status[from] = '5';
kb_readStr[from] = '';
} else {
kb_status[from] = '1';
readErr(from, 5);
}
} else if(kb_status[from] == '5') { //读取内容
if(c == ';') {
try{clearTimeout(kb_timeOut[from]);} catch(e){}
kb_status[from] = '1';
var a = kb_readStr[from].split(",");
if(a.length == 2) {
var s1 = a[0].toLowerCase();
var hcode = a[1];
if(hashCode(s1) == hcode) {
if(from == '1') {
readContent(from, s1, 'qr');
} else {
setTimeout(function() {
if(new Date().getTime() - last1time > 1000) {
readContent(from, s1, 'qr');
}
}, 300);
}
} else {
//alert(s1+","+hcode+","+hashCode(s1));
readErr(from, 6);
}
} else {
readErr(from, 7);
}
kb_readStr[from] = '';
} else {
if(c == '*err*') {
kb_status[from] = '1';
readErr(from, 8);
} else {
kb_readStr[from] += c;
}
}
} else if(kb_status[from] == '6') { //IC卡读取内容
if(c == '/' || c == '[enter]') {
try{clearTimeout(kb_timeOut[from]);} catch(e){}
kb_status[from] = '1';
var s1 = kb_readStr[from].toLowerCase();
if(from == '1') {
readContent(from, s1, 'ic');
} else {
setTimeout(function() {
if(new Date().getTime() - last1time > 1000) {
readContent(from, s1, 'ic');
}
}, 300);
}
kb_readStr[from] = '';
} else {
if(c >= '0' && c <= '9') {
kb_readStr[from] += c;
} else {
kb_status[from] = '1';
readErr(from, 8, 'ic');
}
}
}
//document.getElementById("div1").innerHTML += c+"|"+kb_status[from]+"$";
}
function readErr(from, rs, type) {
kb_status[from] = '1';
kb_readStr[from] = '';
try{clearTimeout(kb_timeOut[from]);} catch(e){}
//alert(from+":读取错误!"+rs);
var tname = '二维码';
if(type && type == 'ic') {
tname = 'IC卡';
}
if(rs != 9 && new Date().getTime() - lastErrTime > 1000 && new Date().getTime() - lastSucTime > 1000) {
//lastErrTime = new Date().getTime();
//lastddh = '';
//lastdctype = '';
//setMsg2('<div style="text-align:center;font-size:50px;color:red">无效'+tname+'</div>');
}
}
function setMsg2(str) {
//$("testdiv").innerHTML += str+"<br />";
$("qrmsgdiv").innerHTML = str;
}
function readContent(from, str, type, ispos) {
//document.getElementById("div1").innerHTML += from+": "+str + '<br />';
//if(lastddh == str && new Date().getTime() - lastSucTime < 60000) return ;
lastSucTime = new Date().getTime();
//$("testdiv").innerHTML += str+"<br />";
addOrder(str, type, ispos)
//alert(str);
//document.getElementById("div1").innerHTML += str;
}
var nowNum = '';
function doInput(c) {
var checkNum = nowNum;
if(checkNum.indexOf("+") != -1) {
var a = checkNum.split("+");
checkNum = a[a.length - 1];
}
if(c == '0') {
if(checkNum.substr(0, 1) == '0' && checkNum.substr(1, 1) != '.') {
} else {
if(checkNum.indexOf(".") != -1) {
var a = checkNum.split(".");
if(a[1].length < 2)
nowNum += c;
} else nowNum += c;
}
} else if(c >= '1' && c <= '9') {
if(checkNum.indexOf(".") != -1) {
var a = checkNum.split(".");
if(a[1].length < 2)
nowNum += c;
} else nowNum += c;
} else if(c == '.') {
if(checkNum != '' && checkNum.indexOf(".") == -1) nowNum += c;
} else if(c == '+') {
if(nowNum != '') {
var last = nowNum.substr(nowNum.length - 1);
if(last != '+') {
if(last == '.') {
nowNum = nowNum.substr(0, nowNum.length - 1);
}
nowNum += c;
}
}
} else if(c == 'C') {
nowNum = '';
} else if(c == 'S') {
if(nowNum == '') {
myalert("请输入金额!");
} else {
if(nowNum.substr(nowNum.length-1) == '.') nowNum = nowNum.substr(0, nowNum.length-1);
if(nowNum.indexOf("+") != -1) {
var a = nowNum.split("+");
var total = 0;
for(var i = 0; i < a.length; i++) {
var t = Number(a[i]);
if(isNaN(t)) t = 0;
total += t;
}
nowNum = total.toFixed(2);
}
if(nowNum > 1000) {
myalert("金额不能大于1000");
} else {
payfee = nowNum;
nowNum = '';
showQR();
}
}
} else if(c == 'B') {
if(nowNum != '') nowNum = nowNum.substr(0, nowNum.length-1);
}
if(nowNum == '') {
$("feeDiv").style.color = 'blue';
$("feeDiv").innerHTML = "请输入要支付的金额";
} else {
$("feeDiv").style.color = 'red';
$("feeDiv").innerHTML = nowNum;
}
}
function setInput(y) {
nowNum = y;
reshowfee = y;
doInput('S');
}
function setChannelId(cid, cname) {
channelid = cid;
$("now_channel_id").innerHTML = decodeURIComponent(cname);
$G.hide_div("fdiv_channel");
}
function showChannels() {
<? if(!$cList) { ?>
myalert("该饭堂未配置消费机!");
<? } else { ?>
$G.show_div("fdiv_channel", 700, 350);
<? } ?>
}
window.onload = function() {
<?
$payfee = floatval($_GET['payfee']);
$code = trim($_GET['code']);
$type = trim($_GET['type']);
if($payfee > 0 && $code != '') {
?>
payfee = '<?=$payfee?>';
nowNum = '';
showQR();
readContent('1', '<?=$code?>', '<?=$type=='ic'?"ic":"qr"?>', 1);
<?
}
?>
setBtPos();
//setTimeout("addOrder('1234','')",10000);
//voice("人脸信息未注册");
}
window.onresize = function() {
setBtPos();
}
function setBtPos() {
var width = document.documentElement.clientWidth;
var height = document.documentElement.clientHeight;
var owidth = $("qiehuan").offsetWidth;
var oheight = $("qiehuan").offsetHeight;
$("qiehuan").style.top = (height - oheight - 10) + 'px';
$("qiehuan").style.left = (width - owidth - 10) + 'px';
$("todayincome").style.top = (height - oheight - 10 - oheight - 10) + 'px';
$("todayincome").style.left = (width - owidth - 10) + 'px';
}
function getToday() {
myalert("正在查询..")
$G.ajax("?act=getToday&ftid=<?=$ftid?>&channelid="+channelid, {}, function(rs) {
if(rs.msg) $("alert_msg").innerHTML = rs.msg;
else $("alert_msg").innerHTML = "查询失败!";
}, 'json', '');
}
function get_face_img(uid, noadd) {
if(!uid) return '';
var html = '';
if(!noadd) html += '<br />';
html += '<img src="get.php?act=hkface_get_face_data&uid='+uid+'&raw=1" height="130" />';
return html;
}
function readFace(card) {
readContent('1', card, 'face', 0);
}
function readFaceFail(card) {
if(!isshowQR) return ;
setMsg2("人脸信息未注册!");
voice("人脸信息未注册");
}
function voice(str) {
<?
if($isvoice) {
?>
location.href = "yzms://voice@@"+encodeURIComponent(str);
<? } ?>
}
var firstRecordDiv = null;
function addRecord(str) {
var div = document.createElement("div");
div.innerHTML = '<div style="color:red; padding:5px; font-size:13px; border-bottom:1px solid #dddddd">'+str+'</div>';
if(firstRecordDiv == null) {
$("recordDiv").appendChild(div);
} else {
$("recordDiv").insertBefore(div, firstRecordDiv);
}
firstRecordDiv = div;
}
</script>
<style type="text/css">
.numDiv {
position:absolute; width:100px; height:90px; border:1px solid #dddddd; background:#f9f9f9;
}
.textDiv {
text-align:center; font-size:60px; font-weight:bold; color:#666666; margin-top:10px;
}
</style>
</head>
<body style="margin:0px;">
<div style="width:550px; height:520px; border:1px solid #dddddd; margin:10px; position:relative;">
<div style="position:absolute; width:100%; height:60px; top:0px; left:0px; background:#f9f9f9; border-bottom:1px solid #dddddd;"><div id="feeDiv" style="font-size:35px; margin-left:10px; margin-top:12px; color:blue; font-weight:bold">请输入要支付的金额</div></div>
<div class="numDiv" style="left:15px; top:80px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('1')"><div class="textDiv">1</div></div>
<div class="numDiv" style="left:145px; top:80px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('2')"><div class="textDiv">2</div></div>
<div class="numDiv" style="left:275px; top:80px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('3')"><div class="textDiv">3</div></div>
<div class="numDiv" style="left:15px; top:190px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('4')"><div class="textDiv">4</div></div>
<div class="numDiv" style="left:145px; top:190px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('5')"><div class="textDiv">5</div></div>
<div class="numDiv" style="left:275px; top:190px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('6')"><div class="textDiv">6</div></div>
<div class="numDiv" style="left:15px; top:300px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('7')"><div class="textDiv">7</div></div>
<div class="numDiv" style="left:145px; top:300px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('8')"><div class="textDiv">8</div></div>
<div class="numDiv" style="left:275px; top:300px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('9')"><div class="textDiv">9</div></div>
<div class="numDiv" style="left:15px; top:410px; width:232px" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('0')"><div class="textDiv">0</div></div>
<div class="numDiv" style="left:275px; top:410px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('.')"><div class="textDiv">.</div></div>
<div class="numDiv" style="left:405px; top:300px; width:120px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('C')"><div class="textDiv" style="font-size:50px; margin-top:15px">归零</div></div>
<div class="numDiv" style="left:405px; top:410px; width:120px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('S')"><div class="textDiv" style="font-size:50px; margin-top:15px">确定</div></div>
<div class="numDiv" style="left:405px; top:190px; width:120px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('+')"><div class="textDiv" style="font-size:50px; margin-top:15px">+</div></div>
<div class="numDiv" style="left:405px; top:80px; width:120px;" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="doInput('B')"><div class="textDiv" style="font-size:50px; margin-top:15px;"></div></div>
</div>
<!-- 刘伟添加价格标签 -->
<div style="position: absolute;width: 200px;height: 520px;border:1px solid #dddddd;left: 575px;top: 10px;">
<div style="position:absolute; width:100%; height:60px; top:0px; left:0px; background:#f9f9f9; border-bottom:1px solid #dddddd;"><div id="feeDiv" style="font-size:35px; margin-left:10px; margin-top:12px; color:blue; font-weight:bold">标签</div></div>
<? $a = explode(",", $pay_values);
$top = 80;
foreach($a as $value) {
?>
<div class="numDiv" style="left:20px; top:<?=$top?>px; width:160px" onmousedown="this.style.backgroundColor='#eeeeee';" onmouseup="this.style.backgroundColor='#f9f9f9';" onclick="setInput('<?=$value?>')"><div class="textDiv"><?=$value?>元</div></div>
<? $top+=110;} ?>
</div>
<!-- 消费日志 -->
<div style="position: absolute;width: 200px;height: 520px;border:1px solid #dddddd;left: 790px;top: 10px;">
<div style="position:absolute; width:100%; height:60px; top:0px; left:0px; background:#f9f9f9; border-bottom:1px solid #dddddd;"><div id="feeDiv" style="font-size:35px; margin-left:10px; margin-top:12px; color:blue; font-weight:bold">消费记录</div></div>
<div id="recordDiv" style="position:absolute; width:100%; height:459px; top:61px; left:0px; overflow:hidden;">
</div>
</div>
<div style="margin-left:10px;font-weight:bold">当前饭堂: <span style="color:red;"><?=$ftInfo['name']?></span> 消费机: <span id="now_channel_id" style="color:red;"><?=$cInfo?$cInfo['channel_name']:"未选择"?></span> <input type="button" style="width:140px; height:50px;font-size:22px;font-weight:bold;color:blue" value="切换消费机" onclick="showChannels()" /></div>
<div id="fdiv" style="position:absolute; z-index:15; width:760px; height:450px; display:none; background:#FFFFFF; border:1px solid #dddddd;">
<div style="border-bottom:1px solid #dddddd; height:28px; background:#f5f5f5">
<div style="float:left; padding:5px 5px"><span style="color:#666666">请刷二维码</span></div>
<div id="djs_div" style="float:right; padding:5px 5px; font-size:13px; color:#666666"><span id="qr_close_time" style="color:#666666"></span>&nbsp;秒后关闭</div>
</div>
<div style="height:410px; overflow:hidden;text-align:center;width:758px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="450" style="padding:10px; text-align:left" valign="top" align="left">
<div id="dishListTd" style="color:red; font-size:80px; font-weight:bold"></div>
<div style="color:red;font-size:25px;font-weight:bold; margin-top:50px" id="qrmsgdiv"></div>
</td>
<td width="308" style="padding:10px" valign="top">
<div><img src="images/showqr.jpg" width="280" /></div>
<div><input type="button" style="width:140px; height:50px; font-size:30px;margin-top:30px" value="关闭" onclick="reshowfee='';closeQR()" /></div>
</td>
</tr>
</table>
</div>
</div>
<div id="fdiv_alert" style="position:absolute; z-index:15; width:600px; height:250px; display:none; background:#FFFFFF; border:1px solid #dddddd;">
<div style="border-bottom:1px solid #dddddd; height:28px; background:#f5f5f5">
<div style="float:left; padding:5px 5px"><span style="color:#666666">提示</span></div>
<div style="float:right; padding:5px 5px; font-size:13px; color:#666666"><span id="alert_close_time" style="color:#666666"></span>&nbsp;秒后关闭</div>
</div>
<div style="height:410px; overflow:hidden;text-align:center">
<div id="alert_msg" style="font-size:50px; color:red;font-weight:bold; text-align:center;height:115px;padding-top:30px"></div>
<div style="text-align:center;margin-top:5px"><input type="button" style="width:140px; height:50px; font-size:30px;" value="关闭" onclick="closeAlert()" /></div>
</div>
</div>
<div id="fdiv_channel" style="position:absolute; z-index:15; width:700px; height:350px; display:none; background:#FFFFFF; border:1px solid #dddddd;">
<div style="border-bottom:1px solid #dddddd; height:28px; background:#f5f5f5">
<div style="float:left; padding:5px 5px"><span style="color:#666666">请选择消费机</span></div>
</div>
<div style="height:310px; overflow:hidden;text-align:center;width:698px;padding:10px 10px 0px 10px">
<? foreach($cList as $item) { ?>
<a style="display:block; height:30px; float:left; border: 1px solid #DDDDDD; background-color:#F5F5F5; color:#666666; margin:5px; height:30px; padding:10px 5px 0px 5px;cursor:pointer" onclick="setChannelId(<?=$item['id']?>, '<?=rawurlencode($item['channel_name'])?>')"><nobr><?=$item['channel_name']?></nobr></a>
<? } ?>
</div>
</div>
<div id="todayincome" style="position:absolute; z-index:4;width:150px; height:60px; top:500px; left:700px"><input type="button" style="width:150px; height:60px;font-size:25px;font-weight:bold;color:blue" value="今日收入" onclick="getToday()" /></div>
<div id="qiehuan" style="position:absolute; z-index:4;width:150px; height:60px; top:500px; left:700px"><input type="button" style="width:150px; height:60px;font-size:25px;font-weight:bold;color:blue" value="取餐码支付" onclick="location.href = 'qc_cm.php?<?=$_SERVER['QUERY_STRING']?>';" /></div>
</body>
</html>