本文整理汇总了PHP中sp_execute函数的典型用法代码示例。如果您正苦于以下问题:PHP sp_execute函数的具体用法?PHP sp_execute怎么用?PHP sp_execute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sp_execute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_response_news
function db_response_news($postObj, $newsid)
{
/*
* note:
* 1 text
* dfault and 2 :news
*
* */
$params = array(array($newsid, SQLSRV_PARAM_IN));
$sp = "{call app_get_news(?)}";
$rs = sp_execute($sp, $params);
if (count($rs) == 1) {
$msgtype = $rs[0]["kind"];
//is_numeric($rs[0]["type"])?intval($rs[0]["type"]):0;
//
if ($msgtype == 1) {
//text mode
response_text($postObj, $rs[0]["describle"]);
} else {
//2
$newsContent = array("title" => $rs[0]["title"], "description" => $rs[0]["describle"], "picUrl" => $rs[0]["picurl"], "url" => $rs[0]["url"]);
response_news($postObj, $newsContent);
}
} elseif (count($rs) > 1) {
//多行新闻的方式
$arr = array();
foreach ($rs as $row) {
$newsContent = array("title" => $row["title"], "description" => $row["describle"], "picUrl" => $row["picurl"], "url" => $row["url"]);
array_push($arr, $newsContent);
}
response_multiNews($postObj, $arr);
} else {
response_text($postObj, "未定义的newsid[{$newsid}]");
}
}
示例2: handleText
function handleText($postObj)
{
$arr = explode(" ", $postObj->Content);
//preview news 1
$action = $arr[0];
$param1 = $arr[1];
if (count($arr) > 2) {
$param2 = $arr[2];
} else {
$param2 = "";
}
//$param2 = $arr[2];
//strcasecmp忽略字符串大小写
if (strcasecmp($action, "set") == 0) {
if (strcasecmp($param1, "master") == 0) {
$ret = " ";
$params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array($ret, SQLSRV_PARAM_INOUT));
$sp = "{call app_set_master(?,?)}";
$rs = sp_execute($sp, $params);
if ($ret == "ok") {
response_text($postObj, "您已成为[" . $rs[0]["cname"] . "]微信管理员");
} else {
response_text($postObj, "操作不成功,管理位置是不是另有他人了呢?");
}
} else {
response_text($postObj, "我不明白,你想设置啥呢?");
}
} else {
if (strcasecmp($action, "preview") == 0) {
if (strcasecmp($param1, "news") == 0) {
if (is_numeric($param2)) {
db_response_news($postObj, $param2);
} else {
response_text($postObj, "您要预览的新闻编号[{$param2}]有误,请输入新闻编号");
}
} else {
if (is_numeric($param1)) {
db_response_news($postObj, $param1);
} else {
response_text($postObj, "未定义的预览类型[{$param1}]");
}
}
} else {
if (strcasecmp($action, "hqewm") == 0 || strcasecmp($action, "获取二维码") == 0 || strcasecmp($action, "dst") == 0 || strcasecmp($action, "大食堂") == 0) {
response_image($postObj, "Tz7KKK4QFPZbEIclqnbhsWYy8keSL-3McoYu9I749Vk");
} else {
if (strcasecmp($action, "help") == 0) {
response_text($postObj, '欢迎关注大食堂<br>预览新闻 发"preview 新闻编号\\r\\n获取大食堂二维码,发送"hqewm"');
} else {
response_text($postObj, "未定义action[{$action}]");
}
}
}
}
}
示例3: handleClick
/**
* @param $postObj
*/
function handleClick($postObj)
{
//处理签到
if ($postObj->EventKey == "3bd50cf09752dc08ab1d78ba0c6d4099") {
$rep = " ";
$params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array($rep, SQLSRV_PARAM_OUT));
sp_execute("{call app_weixin_checkin(?,?)}", $params);
response_text($postObj, $rep);
} else {
}
}
示例4: handleScan
function handleScan($postObj)
{
$uid = 0;
$params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array("" . $postObj->ToUserName, SQLSRV_PARAM_IN), array($uid, SQLSRV_PARAM_INOUT));
$sp = "{call app_subscrible(?,?,?)}";
sp_execute($sp, $params);
//
//用户扫描带场景值二维码
$cid = str2num(canteenid_content, $postObj->EventKey);
$sp = "{call app_user_add_canteen(?,?)}";
$params = array(array($uid, SQLSRV_PARAM_IN), array($cid, SQLSRV_PARAM_IN));
$rs = sp_execute($sp, $params);
//
response_canteen_welcome($postObj, $postObj->EventKey, $rs[0]["cname"], $rs[0]["picurl"], $rs[0]["newsid"]);
}
示例5: click_new
function click_new($postObj)
{
if ($postObj->EventKey == "c45fed65e9873ee368625b73ef7d5760") {
$sp = "{call vp_get_video_list}";
$rs = sp_execute($sp, null);
$arr = array();
foreach ($rs as $row) {
$newsContent = array("title" => $row["title"], "description" => $row["content"], "picUrl" => CFG_HTTP . "/apps/mobile/upload/2011111.jpg", "url" => CFG_HTTP . "/apps/mobile/upload/" . $row["media_id"] . ".mp4");
array_push($arr, $newsContent);
}
$resultStr = response_multiNews($postObj, $arr);
echo $resultStr;
} else {
}
}
示例6: handleImage
function handleImage($postObj)
{
//https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
$access_token = db_get_token_ticket(CFG_APPID, CFG_SECRET)["token"];
$mediaId = $postObj->MediaId;
$url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token={$access_token}&media_id={$mediaId}";
$fileinfo = downloadWeixinFile($url);
//
$uploadPath = dirname(__FILE__) . "/upload/weixin/";
$fileName = time() . ".jpg";
saveWeixinFile($uploadPath . $fileName, $fileinfo["body"]);
response_text($postObj, "图片上传完成");
//保存图片信息
$params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array("" . $fileName, SQLSRV_PARAM_IN));
sp_execute("{call app_upload_image(?,?)}", $params);
}
示例7: get_db_date
/**
* @param $d 天数,昨天-1,明天+1
* @return mixed
*/
function get_db_date($d)
{
$sql = "select convert(varchar(50),GETDATE(){$d},120) dt";
$rs = sp_execute($sql, null);
return $rs[0]["dt"];
}
示例8: set_canteen_session
/**
* 将餐厅信息设置到session中
* @param $row
*/
function set_canteen_session($row)
{
$_SESSION["cid"] = $row["cid"];
$_SESSION["cname"] = $row["cname"];
$_SESSION["verticket"] = $row["verticket"];
$_SESSION["verurl"] = $row["verurl"];
$_SESSION["allow"] = $row["allow"];
$_SESSION["cpicurl"] = $row["picurl"];
$_SESSION["ctelnum"] = $row["telnum"];
$_SESSION["roleid"] = $row["roleid"];
//判断餐厅是否有二维码,没有则创建生成二维码
if (strlen($row["verticket"]) < 1) {
/* 根据餐厅编号生成带场景二维码 */
$str = num2str(canteenid_content, $_SESSION["cid"]);
$token = db_get_token_ticket(CFG_APPID, CFG_SECRET)["token"];
$url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={$token}";
$data = '{"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_id":234, "scene_str":"' . $str . '"}}}';
$data = json_decode(get_http_result($url, $data), true);
//插入数据库,更新餐厅二维码信息
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array("" . $data["ticket"], SQLSRV_PARAM_IN), array("" . $data["url"], SQLSRV_PARAM_IN), array("", SQLSRV_PARAM_IN));
sp_execute("{call web_set_canteen_verify(?,?,?,?)}", $params);
$_SESSION["verticket"] = $data["ticket"];
}
}
示例9: array
float: right;
margin: 10px 10px 0 10px;
}
#help11{ margin:0; padding:0;}
#help11 img{width:inherit}
#help11 p{display: block; width:96%; padding-left:4%; line-height:20px;}
#help11 p .dst{color:#ff3838}
</style>
<div id="help11" style="display:none;">
<img src="<?php
echo CFG_HTTP . "images/" . CFG_APP_QRCODE;
?>
" width="100" height="100" class="left"/>
<?php
$params = array(array(intval($_SESSION["uid"]), SQLSRV_PARAM_IN));
$rs = sp_execute("{call app_user_get_can(?)}", $params);
$_SESSION["ccl"] = $rs[0]["ccl"];
?>
<p>
如果你已经看到本页面,可点击"<a href="javascript:createCanteen()" style="color:#0099CC; border-bottom:1px solid #0099CC;">创建餐厅</a>",直接创建自己的餐厅。<br>
如果想推荐身边人创建餐厅,可以通过扫描右侧的二维码关注"<?php
echo CFG_APPNAME;
?>
",即可在本页面,创建自己的餐厅。<br>
如果要推荐自己的微信好友创建餐厅,可以将右上方二维码以图片形式发送给好友,或者让好友关注并进入微信公众号"<label class="dst"><?php
echo CFG_WECHATID;
?>
</label>"后,在本页面创建好友自己的餐厅。<br>
<label style="font-style:italic;">说明:为保证餐厅质量,限制一个微信号只可以创建一个餐厅</label>。<br>
</p>
</div>
示例10: num2str
$filename = $path . $name;
//ready param
$cids = num2str(canteenid_content, $_SESSION["cid"]);
$codeText = CFG_HTTP . "mobile/sales_scan.php?cids={$cids}&winids={$winids}";
QRcode::png($codeText, $filename, L, 12, 2);
$winver = "qrcode/{$name}";
$windesc = $_POST["windesc"];
db_log("winid:{$winid}, winname:{$winname}, verurl:{$winver}, desc:{$windesc}, cid:" . $_SESSION["cid"]);
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array($winid, SQLSRV_PARAM_IN), array("" . $winname, SQLSRV_PARAM_IN), array("" . $winver, SQLSRV_PARAM_IN), array("" . $windesc, SQLSRV_PARAM_IN));
sp_execute("{call web_set_sales_win(?,?,?,?,?)}", $params);
$status = "ok";
$info = $name;
} else {
if ($action == "set_canteen_allow_order") {
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array(intval($_REQUEST["orden"]), SQLSRV_PARAM_IN));
sp_execute("{call web_set_canteen_sale_state(?,?)}", $params);
$status = "ok";
$info = "成功";
}
}
}
}
}
}
}
}
}
}
}
}
}
示例11: time
if ($_REQUEST["act_xx"] == "setcookie") {
$code = $_REQUEST["code"];
//获得的用户授权code
if ($user = get_snsapi_userinfo(CFG_APPID, CFG_SECRET, $code)) {
//正确获得用户的授权信息
$time = time() + 3600 * 24 * 7;
weixin_set_auth_cookie($user, $time);
echo '<script>location.href="http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '"</script>';
exit;
}
} else {
$redirect_uri = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "&act_xx=setcookie");
weixin_require_auth($redirect_uri);
exit;
}
}
$wid = $_COOKIE["wxp_user_openid"];
$params = array(array(0, SQLSRV_PARAM_IN), array($wid, SQLSRV_PARAM_IN));
//
$rs = sp_execute("{call app_get_userinfo(?,?)}", $params);
//set userinfo to session
if (count($rs) > 0) {
$_SESSION["uid"] = $rs[0]["uid"];
}
}
?>
示例12: db_log
$picurl = $time . $ext;
$cid = 0;
//创建餐厅,并建立绑定关系,设置成管理员
$longitude = $_REQUEST["longitude"];
$latitude = $_REQUEST["latitude"];
db_log("create canteen x:{$longitude}, y:{$latitude}, tel:{$canteenTel}");
$params = array(array(intval($_SESSION["uid"]), SQLSRV_PARAM_IN), array("" . $canteenName, SQLSRV_PARAM_IN), array("" . $canteenTel, SQLSRV_PARAM_IN), array("" . $picurl, SQLSRV_PARAM_IN), array("" . $longitude, SQLSRV_PARAM_IN), array("" . $latitude, SQLSRV_PARAM_IN), array($cid, SQLSRV_PARAM_OUT));
sp_execute("{call app_user_create_canteen(?,?,?,?,?,?,?)}", $params);
$_SESSION["cid"] = $cid;
$_SESSION["cname"] = $canteenName;
$_SESSION["shop_picurl"] = $picurl;
//根据经纬度获得餐厅地址信息
if (strlen($longitude) > 0 && strlen($latitude)) {
$addr = get_location_bdapi(CFG_BDAPI_AK, $longitude, $latitude);
$params = array(array($cid, SQLSRV_PARAM_IN), array("" . $addr, SQLSRV_PARAM_IN));
sp_execute("{call web_set_canteen_addr(?,?)}", $params);
}
$status = "ok";
} else {
$status = "error";
}
echo json_encode(array("status" => $status));
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php
echo $_REQUEST["action"] == "finish" ? $_SESSION["cname"] : "注册餐厅";
示例13: array
</header>
<div id="main-content">
<div><div class="panel">
<div class="panel-title">
<?php
echo "【" . $_SESSION["cname"] . "】";
?>
订单管理</div>
<div class="panel-body">
<div class="col-sm-8">
<form name="form1" action="order.php" method="post" class="form-inline" style="margin-bottom:14px;">
<div class="form-group" style="margin-left:20px;">
<label style="font-size: 14px; font-weight: normal;">菜单名称 </label>
<?php
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array(0, SQLSRV_PARAM_IN));
$rs = sp_execute("{call web_get_menu_list(?,?)}", $params);
?>
<select name="mid" class="form-control">
<option value="0"> 全部 </option>
<?php
foreach ($rs as $row) {
echo '<option value="' . $row["mid"] . '" ' . ($row["mid"] == $_REQUEST["mid"] ? "selected" : "") . '>' . $row["mname"] . '</option>';
}
?>
</select>
</div>
<div class="form-group" style="margin-left:20px;">
<label style="font-size: 14px; font-weight: normal;">日期 </label>
<?php
$qdt = date("Y-m-d");
if (isset($_REQUEST["qdt"])) {
示例14: getmidstr
*/
require_once "../config.php";
require_once "../conn.php";
require_once "admin_filter.php";
require_once "../include/php_funs.php";
//检查权限
if (!filter_canteenadmin()) {
exit;
}
//
require_once "../libs/PHPExcel/PHPExcel.php";
//ready data
$mode = $_REQUEST["mode"];
$mode_str = getmidstr(CFG_ORDER_MODE, intval($mode) - 1);
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array("", SQLSRV_PARAM_IN), array(intval($mode), SQLSRV_PARAM_IN));
$rs = sp_execute("{call web_get_canteen_order_list(?,?,?)}", $params);
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// Set properties
$objPHPExcel->getProperties()->setCreator("ctos")->setLastModifiedBy("ctos")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
// set width
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(10);
示例15: array
* Fun: 移动端页面管理员订单明细维护
*/
require_once "../config.php";
require_once "../conn.php";
require_once "../canteen_funs.php";
require_once "mobile_filter.php";
if (!check_is_user()) {
exit;
}
//for debug
if ($_SESSION["resubmit_oid"] == 0) {
echo "<script>location.href='user_mymenu" . $_SESSION["menumode"] . ".php'</script>";
exit;
}
$params = array(array(intval($_SESSION["uid"]), SQLSRV_PARAM_IN), array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN));
$btnArr = sp_execute("{call app_get_canteen_do(?,?)}", $params);
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once "meta.php";
?>
<!--sweet-alert plugin start-->
<link rel="stylesheet" type="text/css" href="plugins/sweetalert/sweetalert.css?v=1"/>
<script src="plugins/sweetalert/sweetalert.min.js?v=2"></script>
<!--sweet-alert plugin end-->
</head>
<body>
<div class="body1">
<!--topsearch-->