<?php
//====== 后台管理 ======
require "common.php";
$ver="0.8.0";
$m=file_get_contents("php://input");if($m=="")$m='{"act":"idx"}';$m=Dec($m,true);session_start();
if($m["act"]!="idx"&&$m["act"]!="lgn"){if(!isset($_SESSION["Jir_Admin"])&&$_SESSION["Jir_Admin"]!=$m["sid"])die('{"msg":"连接超时,请重登录!"}');}
switch($m["act"]){
case "lgn"://管理登录
if(md5($m["Ak"])==$cfg["Ak"]){
$b=Rnd();$_SESSION["Jir_Admin"]=$b;
$p=["msg"=>"ok","cfg"=>$cfg];$p["cfg"]["DB"]="";$p["cfg"]["Ak"]="";
//$p["cfg"]["Ap"]=["Fs"=>0,"Gi"=>"","Gk"=>"","Wc"=>"","Wi"=>"","Wk"=>"","Wm"=>"","Wn"=>"","Zp"=>"","Zi"=>"","Zk"=>"","Zm"=>"","Zn"=>""];
echo Enc($p);
}else echo '{"msg":"登录密码错误!"}';
break;
case "cwv"://网站保存
$cfg["An"]=$m["An"];$cfg["Aw"]=$m["Aw"];
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
echo '{"msg":"ok"}';
break;
case "cav";//修改密码
if($cfg["Ak"]==md5($m["Ak"])){
$cfg["Ak"]=md5($m["Ap"]);
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
echo '{"msg":"ok"}';
}else echo '{"msg":"原始密码错误!"}';
break;
case "cbv"://充值设置
$cfg["Ab"]=$m["Ab"];echo '{"msg":"ok"}';
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
break;
case "ccv"://优惠设置
$cfg["Ac"]=$m["Ac"];echo '{"msg":"ok"}';
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
break;
case "cgv"://接口设置
$m["Ag"]["Be"]=$cfg["Ag"]["Be"];$m["Ag"]["Bt"]=$cfg["Ag"]["Bt"];
$m["Ag"]["We"]=$cfg["Ag"]["We"];$m["Ag"]["Wt"]=$cfg["Ag"]["Wt"];
$cfg["Ag"]=$m["Ag"];echo '{"msg":"ok"}';
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
break;
case "cpv"://支付配置
//die('{"msg":"仅供演示,不可保存!"}');
$cfg["Ap"]=$m["Ap"];echo '{"msg":"ok"}';
file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
break;
case "cpu"://支付升级
if(file_exists("onepay.php"))die('{"msg":"已存在同名文件 onepay.php,请先删除或改名!"}');
$e=Dec(Cul("https://www.pays.top/app/lic.php?p=Jir&w=".$cfg["Aw"]."&v=".$m["AL"]));
if($e["msg"]=="ok"){
$cfg['AL']=$m["AL"];file_put_contents("config.php","<?php".PHP_EOL."//系统配置".PHP_EOL."\$cfg='".Enc($cfg)."';");
file_put_contents("onepay.php","<?php".PHP_EOL."//官方支付接口".PHP_EOL."require 'common.php';\$s='".$e["str"]."';\$s=openssl_decrypt(\$s,'AES-128-CBC',md5(\$cfg['AL'].\$_SERVER['HTTP_HOST']),0,substr(md5(\$_SERVER['HTTP_HOST'].\$cfg['AL']),8,16));eval(\$s);");
}
echo Enc($e);
break;
case "shl"://分店列表
$n=["msg"=>"ok","lst"=>[],"cnt"=>[],"s0"=>Qrs(Qry("Select Sum(Ps) From ".$pre."expend Where Pd<'".date("Y-m-d")."'"))*1,"s1"=>Qrs(Qry("Select Sum(Pc) From ".$pre."expend Where Pc>0 And Pd<'".date("Y-m-d")."'"))*1];
$q=Qry("Select ID,Si,Sn,Sw,Sa,Sb,Sx,Sy,Se,Sh From ".$pre."shop Where Sh<2 Order By ID Desc");
while($r=Qra($q)){
$n["lst"][]=$r;$e=[0,0,0,0,0];
$e[0]=Qrs(Qry("Select Sum(Ps) As N From ".$pre."expend Where Pd<'".date("Y-m-d")."' And Pf=0 And Yi Like '".$r["Si"]."-%'"))/100;
$e[1]=Qrs(Qry("Select Sum(Ps) As N From ".$pre."expend Where Pd<'".date("Y-m-d")."' And Pf=0 And Yi Like '".$r["Si"]."-C%'"))/100;
$e[2]=Qrs(Qry("Select Sum(Pc) As N From ".$pre."expend Where Pd<'".date("Y-m-d")."' And Pf=0 And Yi Like '".$r["Si"]."-%' And Pc>0"))/100;
$e[3]=-Qrs(Qry("Select Sum(Pc) As N From ".$pre."expend Where Pd<'".date("Y-m-d")."' And Pf=0 And Yi Like '".$r["Si"]."-%' And Pc<0"))/100;
$e[4]=-Qrs(Qry("Select Sum(Pc) As N From ".$pre."expend Where Pd<'".date("Y-m-d")."' And Yi Like '".$r["Si"]."-%' And Pc<0"))/100;
$n["cnt"][]=$e;
}
echo Enc($n);
break;
case "shv"://分店保存
if($m["ID"]*1==0){
if(Qrc(Qry("Select ID From ".$pre."shop Where Si=".$m["Si"]))>0)die('{"msg":"新增分店ID重复!"}');if($m["Sk"]=="")$m["Sk"]="123456";
Qry("Insert Into ".$pre."shop (Si,Sn,Sw,Sa,Sb,Sx,Sy,Se,Sc,Sh) Values (".$m["Si"].",'".$m["Sn"]."','".$m["Sw"]."','".$m["Sa"]."','".$m["Sb"]."','".$m["Sx"]."','".$m["Sy"]."',0,'{\"i\":[\"0\",\"0\",\"0\",\"7-21\",\"10\",\"3\",\"5\",\"1\",\"0\",\"999\",\"请{{id}}号顾客到餐厅就餐\",\"请{{id}}号顾客到前台取餐\",\"收款成功,金额:{{id}}元\",\"来新单了,{{i1}},{{i2}}份\",\"新单,送至{{i1}},{{i2}}元\",\"\",\"\"],\"c\":[[1,1,1,1,1],[[\"限时九折\",1,0.9],[\"满百减五\",100,5]]],\"p\":[\"\",\"\",\"\",\"0\",\"0\",\"58\",\"12\",\"20\",\"欢迎光临\",\"18\",\"谢谢惠顾\",\"18\",\"58\",\"12\",\"20\",\"18\",0]}',".$m["Sh"].")");
Qry("Insert Into ".$pre."admin (Si,An,Au,Ap,Aw,Am,Ar,Ad,A0,A1,Ak,Ah) Values (".$m["Si"].",'店长','admin','".md5($m["Sk"])."','','','ABCDEFS',Now(),0,0,'',0)");
if(!file_exists("images/".$m["Si"]))mkdir("images/".$m["Si"]);
file_put_contents("images/".$m["Si"]."/d.txt",'{"msg":"ok","si":0,"sj":"'.date("Y-m-d H:i:s").'","ph":[],"yd":[]}');
file_put_contents("images/".$m["Si"]."/k.txt",'{"msg":"ok","skl":{}}');
if($m["Su"]==1){
for($j=1;$j<11;$j++)Qry("Insert Into ".$pre."table (Si,Tn,Tr,Tc,Tu,Ts,Ti,Tm,Ta,Th) Values (".$m["Si"].",'".$j."号桌',".$j.",4,0,0,0,0,0,0)");
$t1=["","热卖","牛排","披萨","仔饭","意面","沙拉","鲜汤","小吃","饮料","套餐"];$t2=[0,7,7,5,5,5,5,5,7,5,3];
for($j=1;$j<11;$j++)Qry("Insert Into ".$pre."class (Si,Bn,Bp,Br,Bs,Bh) Values (".$m["Si"].",'".$t1[$j]."',0,".$j.",".$t2[$j].",0)");
$i1=Qri()-10;$i2=0;
$t=[["精选牛仔骨",",1,2,",1,1,6800,"0",''],["极佳肥牛扒",",2,",2,1,6800,"0",''],["美国黑椒牛排",",2,",3,1,4800,"0",''],["澳洲西冷牛排",",2,",4,1,4800,"0",''],["日式香煎鸡排",",2,",5,1,3800,"0",''],["法国乡村鸭扒",",2,",6,1,3800,"0",''],["田园风光披萨",",3,",7,1,4800,"0",''],["海陆至尊披萨",",1,3,",8,1,6800,"0",''],["热带雨林披萨",",3,",9,1,5800,"0",''],["缤纷水果披萨",",3,",10,1,4800,"0",''],["红烧牛肉仔饭",",4,",11,1,2800,"0",''],["香菇滑鸡仔饭",",4,",12,1,2600,"0",''],["咖喱烤肉仔饭",",1,4,",13,1,2600,"0",''],["茄汁海鲜仔饭",",4,",14,1,2800,"0",''],["车打芝士意面",",5,",15,1,2400,"0",''],["法式蘑菇鸡面",",5,",16,1,2800,"0",''],["黑椒培根意面",",5,",17,1,3200,"0",''],["拿波里鲔鱼面",",1,5,",18,1,3000,"0",''],["大虾蔬果沙拉",",6,",19,1,2200,"0",''],["海鲜水果沙拉",",6,",20,1,2200,"0",''],["美式凯撒沙拉",",6,",21,1,2600,"0",''],["炭烤鸡肉沙拉",",6,",21,1,2000,"0",''],["培根土豆浓汤",",7,",23,1,1200,"0",''],["鲜美虾芦笋汤",",7,",24,1,2400,"0",''],["火腿玉米浓汤",",7,",25,1,1600,"0",''],["香肠菠菜浓汤",",7,",26,1,1600,"0",''],["尊享大拼盘",",8,",27,1,3600,"0",''],["鲍菇串香肠",",8,",28,1,1800,"0",''],["嫩牛香酥卷",",1,8,",29,1,1600,"0",''],["泰式口口香",",8,",30,1,1200,"0",''],["新趣海鲜棒",",8,",31,1,1800,"0",''],["浓情香鸡翼",",1,8,",32,1,2400,"0",''],["摩卡咖啡",",9,",33,1,1600,"0",''],["拿铁咖啡",",9,",34,1,1600,"0",''],["菊花柚子茶",",9,",35,1,1200,"0",''],["香橙柠檬茶",",9,",36,1,1200,"0",''],["单人套餐",",10,",37,1,6800,"0,3,32,25",'美国黑椒牛排,浓情香鸡翼,火腿玉米浓汤'],["情侣套餐",",10,",38,1,14800,"0,2,9,20,26,31",'极佳肥牛扒,热带雨林披萨,新趣海鲜棒,海鲜水果沙拉'],["全家套餐",",10,",39,1,18800,"0,1,9,13,21,27,36",'精选牛仔骨,热带雨林披萨,咖喱烤肉煲仔饭,美式凯撒沙拉,尊享大拼盘,香橙柠檬茶'],["测试支付",",1,2,3,4,5,6,7,8,9,",0,1,1,"0",'']];
for($j=0;$j<40;$j++){
$h=explode(",",$t[$j][1]);for($f=1;$f<count($h)-1;$f++)$h[$f]=$h[$f]*1+$i1;$h=join(",",$h);
$g=explode(",",$t[$j][5]);for($f=1; $f<count($g); $f++)$g[$f]=$g[$f]*1+$i2;$g=join(",",$g);
Qry("
行动之上
- 粉丝: 2275
- 资源: 931
最新资源
- 毕设和企业适用springboot企业数据智能分析平台类及智能农场管理系统源码+论文+视频.zip
- 毕设和企业适用springboot企业数据智能分析平台类及智能农业解决方案源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及数字图书馆平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及网络营销平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及个性化广告平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及产品溯源系统源码+论文+视频.zip
- 毕设和企业适用springboot企业数据智能分析平台类及资源调度平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及团队协作平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及无人驾驶系统源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及业务流程自动化平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及销售管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及客户关系管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及共享经济平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及客户服务平台源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及跨平台销售系统源码+论文+视频.zip
- 毕设和企业适用springboot企业协作平台类及平台生态系统源码+论文+视频.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈