本文整理汇总了PHP中cloud_prepare函数的典型用法代码示例。如果您正苦于以下问题:PHP cloud_prepare函数的具体用法?PHP cloud_prepare怎么用?PHP cloud_prepare使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cloud_prepare函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: payResult
public function payResult($params)
{
global $_GPC, $_W;
$weid = $this->_weid;
$sql = 'SELECT * FROM ' . tablename('hotel2_order') . ' WHERE `id` = :id AND `weid` = :weid';
$order = pdo_fetch($sql, array(':id' => $params['tid'], ':weid' => $weid));
pdo_update('hotel2_order', array('paystatus' => 1), array('id' => $params['tid']));
$sql = 'SELECT `email`, `mobile` FROM ' . tablename('hotel2_set') . ' WHERE `weid` = :weid';
$setInfo = pdo_fetch($sql, array(':weid' => $_W['uniacid']));
if ($setInfo['email']) {
$body = "<h3>酒店订单</h3> <br />";
$body .= '订单编号:' . $order['ordersn'] . '<br />';
$body .= '姓名:' . $order['name'] . '<br />';
$body .= '手机:' . $order['mobile'] . '<br />';
$body .= '房型:' . $order['style'] . '<br />';
$body .= '订购数量' . $order['nums'] . '<br />';
$body .= '原价:' . $order['oprice'] . '<br />';
$body .= '会员价:' . $order['mprice'] . '<br />';
$body .= '入住日期:' . date('Y-m-d', $order['btime']) . '<br />';
$body .= '退房日期:' . date('Y-m-d', $order['etime']) . '<br />';
$body .= '总价:' . $order['sum_price'];
// 发送邮件提醒
if (!empty($setInfo['email'])) {
load()->func('communication');
ihttp_email($setInfo['email'], '微酒店订单提醒', $body);
}
}
if ($setInfo['mobile']) {
// 发送短信提醒
if (!empty($setInfo['mobile'])) {
load()->model('cloud');
cloud_prepare();
$body = '用户' . $order['name'] . ',电话:' . $order['mobile'] . '于' . date('m月d日H:i') . '成功支付微酒店订单' . $order['ordersn'] . ',总金额' . $order['sum_price'] . '元' . '.' . random(3);
cloud_sms_send($setInfo['mobile'], $body);
}
}
if ($params['from'] == 'return') {
$roomid = $order['roomid'];
$room = pdo_fetch("SELECT score FROM " . tablename('hotel2_room') . " WHERE id = {$roomid} AND weid = {$weid} LIMIT 1");
$score = intval($room['score']);
if ($score) {
$from_user = $this->_from_user;
pdo_fetch("UPDATE " . tablename('hotel2_member') . " SET score = (score + " . $score . ") WHERE from_user = '" . $from_user . "' AND weid = " . $weid . "");
if ($_W['member']['uid'] > 0) {
pdo_query("UPDATE " . tablename('mc_members') . " SET credit1 = (credit1 + " . $score . ") WHERE uid = '" . $_W['member']['uid'] . "' AND uniacid = " . $_W['uniacid'] . "");
}
}
message('支付成功!', '../../app/' . $this->createMobileUrl('orderdetail', array("id" => $order['id'])), 'success');
}
}
示例2: load
stonefish_planting<?php
/**
* [WeEngine System] Copyright (c) 2014 012wz.com
* WeEngine is NOT a free software, it under the license terms, visited http://bbs.52jscn.com/ for more details.
*/
load()->func('communication');
load()->model('cloud');
$r = cloud_prepare();
if (is_error($r)) {
message($r['message'], url('cloud/profile'), 'error');
}
$step = $_GPC['step'];
$steps = array('files', 'schemas', 'scripts');
$step = in_array($step, $steps) ? $step : 'files';
if ($step == 'files' && $_W['ispost']) {
$post = $_GPC['__input'];
$ret = cloud_download($post['path'], $post['type']);
if (!is_error($ret)) {
exit('success');
}
exit;
}
if ($step == 'scripts' && $_W['ispost']) {
$post = $_GPC['__input'];
$fname = $post['fname'];
$entry = IA_ROOT . '/data/update/' . $fname;
if (is_file($entry) && preg_match('/^update\\(\\d{12}\\-\\d{12}\\)\\.php$/', $fname)) {
$evalret = (include $entry);
if (!empty($evalret)) {
cache_build_users_struct();
cache_build_setting();
示例3: doMobileResearch
//.........这里部分代码省略.........
$datas[] = $entry;
}
}
}
}
// 兼容会员居住地字段
if (!empty($_GPC['reside'])) {
if (in_array('reside', $binds)) {
$update['resideprovince'] = $_GPC['reside']['province'];
$update['residecity'] = $_GPC['reside']['city'];
$update['residedist'] = $_GPC['reside']['district'];
}
foreach ($_GPC['reside'] as $key => $value) {
$resideData = array('reid' => $reside['reid']);
$resideData['rerid'] = 0;
$resideData['refid'] = $reside['refid'];
$resideData['data'] = $value;
$datas[] = $resideData;
}
}
// 更新关联会员资料
if (!empty($update)) {
load()->model('mc');
mc_update($_W['member']['uid'], $update);
}
if (empty($datas)) {
message('非法访问.', '', 'error');
}
if (pdo_insert('research_rows', $row) != 1) {
message('保存失败.');
}
$rerid = pdo_insertid();
if (empty($rerid)) {
message('保存失败.');
}
foreach ($datas as &$r) {
$r['rerid'] = $rerid;
pdo_insert('research_data', $r);
}
if (empty($activity['starttime'])) {
$record = array();
$record['starttime'] = TIMESTAMP;
pdo_update('research', $record, array('reid' => $reid));
}
if (!empty($datas)) {
$image = $body = '';
foreach ($datas as $row) {
if (substr($row['data'], 0, 6) != 'images') {
$body .= '<h4>' . $fields[$row['refid']]['title'] . ':' . $row['data'] . '</h4>';
} else {
$image .= '<p>' . $fields[$row['refid']]['title'] . ': <img src="' . tomedia($row['data']) . '" /></p>';
}
}
// 发送邮件提醒
if (!empty($activity['noticeemail'])) {
load()->func('communication');
ihttp_email($activity['noticeemail'], $activity['title'] . '的预约提醒', $image . $body);
}
// 发送短信提醒
if (!empty($activity['mobile'])) {
load()->model('cloud');
cloud_prepare();
$body = '项目' . $activity['title'] . '于' . date('Y-m-d H:i') . '有了新的预约信息,请到后台查看具体内容.' . random(3);
cloud_sms_send($activity['mobile'], $body);
}
}
message($activity['information'], 'refresh');
}
// 兼容会员居住地字段
foreach ($binds as $key => $value) {
if ($value == 'reside') {
unset($binds[$key]);
$binds[] = 'resideprovince';
$binds[] = 'residecity';
$binds[] = 'residedist';
break;
}
}
if (!empty($_W['fans']['from_user']) && !empty($binds)) {
$profile = fans_search($_W['fans']['from_user'], $binds);
if ($profile['gender']) {
if ($profile['gender'] == '0') {
$profile['gender'] = '保密';
}
if ($profile['gender'] == '1') {
$profile['gender'] = '男';
}
if ($profile['gender'] == '2') {
$profile['gender'] = '女';
}
}
foreach ($ds as &$r) {
if ($profile[$r['bind']]) {
$r['default'] = $profile[$r['bind']];
}
}
}
load()->func('tpl');
include $this->template('submit');
}
示例4: defined
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
load()->model('cloud');
load()->func('communication');
$do = !empty($_GPC['do']) && in_array($do, array('module', 'system')) ? $_GPC['do'] : exit('Access Denied');
$result = cloud_prepare();
if (is_error($result)) {
message($result['message'], '', 'ajax');
}
if ($do == 'module') {
$info = cloud_m_info(trim($_GPC['m']));
if (is_error($info) && $info['errno'] == -10) {
message($info, '', 'ajax');
}
}
示例5: load
<?php
/**
* [Weizan System] Copyright (c) 2014 wdlcms.com
* Weizan is NOT a free software, it under the license terms, visited http://www.wdlcms.com/ for more details.
*/
load()->model('cloud');
$dos = array('auth', 'build', 'schema', 'download', 'module.query', 'module.info', 'module.build', 'theme.query', 'theme.info', 'theme.build', 'application.build');
$do = in_array($do, $dos) ? $do : '';
if (empty($do)) {
exit;
}
if ($do != 'auth') {
if (is_error(cloud_prepare())) {
exit('cloud service is unavailable.');
}
}
$post = file_get_contents('php://input');
if ($do == 'auth') {
$secret = random(32);
$auth = @json_decode(base64_decode($post), true);
if (empty($auth)) {
exit;
}
$auth['secret'] = $secret;
cache_write('cloud:auth:transfer', $auth);
exit($secret);
}
if ($do == 'build') {
$dat = __secure_decode($post);
if (!empty($dat)) {
示例6: load
load()->model('cloud');
$post = $_GPC['__input'];
$mass = pdo_get('mc_mass_record', array('uniacid' => $_W['uniacid'], 'id' => intval($post['id'])));
if (!empty($mass) && $mass['cron_id'] > 0) {
$status = cron_delete(array($mass['cron_id']));
if (is_error($status)) {
message($status, '', 'ajax');
}
}
pdo_delete('mc_mass_record', array('uniacid' => $_W['uniacid'], 'id' => intval($post['id'])));
message(error(0, ''), '', 'ajax');
}
if ($do == 'post') {
load()->func('cron');
load()->model('cloud');
$cloud = cloud_prepare();
if (is_error($cloud)) {
message($cloud, '', 'ajax');
}
set_time_limit(0);
$records = pdo_fetchall('SELECT id, cron_id FROM ' . tablename('mc_mass_record') . ' WHERE uniacid = :uniacid AND sendtime >= :time AND status = 1 ORDER BY sendtime ASC LIMIT 8', array(':uniacid' => $_W['uniacid'], ':time' => strtotime(date('Y-m-d'))), 'id');
if (!empty($records)) {
foreach ($records as $re) {
if (!$re['cron_id']) {
continue;
}
$corn_ids[] = $re['cron_id'];
}
if (!empty($corn_ids)) {
$status = cron_delete($corn_ids);
if (is_error($status)) {