當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sp_execute函數代碼示例

本文整理匯總了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}]");
    }
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:35,代碼來源:db_weixin_funs.php

示例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}]");
                }
            }
        }
    }
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:55,代碼來源:handle_text.php

示例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 {
    }
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:14,代碼來源:handle_click.php

示例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"]);
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:15,代碼來源:handle_subscribe.php

示例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 {
    }
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:15,代碼來源:handle_click.php

示例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);
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:16,代碼來源:handle_image.php

示例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"];
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:10,代碼來源:conn.php

示例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"];
    }
}
開發者ID:noikiy,項目名稱:Bentley,代碼行數:28,代碼來源:mycanteen.php

示例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>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果你已經看到本頁麵,可點擊"<a href="javascript:createCanteen()" style="color:#0099CC; border-bottom:1px solid #0099CC;">創建餐廳</a>",直接創建自己的餐廳。<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果想推薦身邊人創建餐廳,可以通過掃描右側的二維碼關注"<?php 
echo CFG_APPNAME;
?>
",即可在本頁麵,創建自己的餐廳。<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果要推薦自己的微信好友創建餐廳,可以將右上方二維碼以圖片形式發送給好友,或者讓好友關注並進入微信公眾號"<label class="dst"><?php 
echo CFG_WECHATID;
?>
</label>"後,在本頁麵創建好友自己的餐廳。<br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label style="font-style:italic;">說明:為保證餐廳質量,限製一個微信號隻可以創建一個餐廳</label>。<br>
                </p>
            </div>
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:use_manual.php

示例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 = "成功";
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:ajax_response.php

示例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"];
    }
}
?>




開發者ID:noikiy,項目名稱:Bentley,代碼行數:26,代碼來源:check_cookie_with_wid.php

示例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"] : "注冊餐廳";
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:user_canteen_create.php

示例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;">菜單名稱&nbsp;&nbsp;</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;">日期&nbsp;&nbsp;</label>
                            <?php 
$qdt = date("Y-m-d");
if (isset($_REQUEST["qdt"])) {
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:order.php

示例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);
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:order_today_export.php

示例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-->
開發者ID:noikiy,項目名稱:Bentley,代碼行數:31,代碼來源:user_order_submit.php


注:本文中的sp_execute函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。