} } $status = "ok"; $info = "成功"; } catch (Exception $e) { $status = "error"; $info = $e->getMessage(); } } else { if ($action == "sale_all_orders") { try { $params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array("", SQLSRV_PARAM_IN)); $rs = sp_execute("{call web_canteen_sale_all_orders(?,?)}", $params); if (count($rs) > 0) { foreach ($rs as $row) { altermsg_for_accept($row["oid"]); } } $status = "ok"; $info = "成功"; } catch (Exception $e) { $status = "error"; $info = $e->getMessage(); } } else { if ($action == "user_upload_qrcode") { //上传图片路径 $imgpath = $_REQUEST["imgpath"]; $uploadPath = dirname(__FILE__) . "/upload/" . $imgpath . "/"; if ($_FILES["file"]["error"] <= 0) { if (file_exists($uploadPath . $_FILES["file"]["name"])) {
$status = "ok"; $info = "成功"; } else { $status = "error"; $info = "没有权限"; } } else { if ($action == "admin_order_process") { if ($_SESSION["roleid"] == 10) { $oid = str2num_x(orderid_content_x, $_REQUEST["oids"]); $state = $_REQUEST["state"]; $params = array(array($oid, SQLSRV_PARAM_IN), array(intval($state), SQLSRV_PARAM_IN)); sp_execute("{call app_set_ord_state(?,?)}", $params); if ($state == 11) { //受理发送消息 altermsg_for_accept($oid); } $status = "ok"; $info = "成功"; } else { $status = "error"; $info = "没有权限"; } } else { if ($action == "user_canteen_delete") { $cid = str2num(canteenid_content, $_REQUEST["cids"]); try { $params = array(array("" . $_COOKIE["wxp_user_openid"], SQLSRV_PARAM_IN), array($cid, SQLSRV_PARAM_IN)); sp_execute("{call app_user_del_canteen(?,?)}", $params); $status = "ok"; $info = "成功";