本文整理汇总了PHP中UC函数的典型用法代码示例。如果您正苦于以下问题:PHP UC函数的具体用法?PHP UC怎么用?PHP UC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addActivityCouponAct
public function addActivityCouponAct()
{
if (IS_POST) {
$id = I('post.id');
$info = I('post.');
$info['stime'] = strtotime($info['stime']);
$info['etime'] = strtotime($info['etime']);
if ($id) {
D('activity_coupon')->where(array('id' => $id))->save($info);
$this->success("修改成功!", UC('Activity/lookupdetail?id=' . $info['activity_id']));
} else {
D('activity_coupon')->add($info);
$this->success("添加成功!", UC('Activity/lookupdetail?id=' . $info['activity_id']));
}
}
$id = I('get.id');
$activity_id = I('get.activity_id');
if ($id) {
$info = D('activity_coupon')->where(array('id' => $id))->find();
$this->assign('info', $info);
$this->assign('headline', '修改优惠券');
} else {
$this->assign('headline', '添加优惠券');
}
$this->assign('activity_id', $activity_id);
$this->display();
}
示例2: couponAddAct
public function couponAddAct()
{
$id = I('get.id');
if ($id) {
$info = D('coupon')->where(array('id' => $id))->find();
$this->assign('headline', '修改优惠券');
$this->assign('info', $info);
if (IS_POST) {
$info = I('post.');
$info['begin_time'] = strtotime($info['begin_time']);
$info['end_time'] = strtotime($info['end_time']);
D('coupon')->where(array('id' => $id))->save($info);
$this->success("修改成功!", UC('Coupon/home'));
}
} else {
$this->assign('headline', '添加优惠券');
if (IS_POST) {
$info = I('post.');
$info['ctime'] = time();
$info['begin_time'] = strtotime($info['begin_time']);
$info['end_time'] = strtotime($info['end_time']);
D('coupon')->add($info);
$this->success("修改成功!", UC('Coupon/home'));
}
}
$this->display();
}
示例3: _initialize
public function _initialize()
{
if (SERVER_ENVIRONMENT == 'LOCAL_HOST') {
session('openid', 'oZcK7wtW4NB-hr5I1_XKKfoC6zV8');
//测试openid
}
if (ACTION_NAME != 'notifyurl') {
//支付通知--过滤掉
if (!session('openid')) {
$this->_session_openid();
}
}
$weobj = wechatInstance();
$signature = $weobj->getJsSign(currentUrl(), time(), md5(rand(1, 9999)), C('WECHAT_APPID'));
$signature['jsApiList'] = ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone'];
$this->assign('signature', str_replace("\\/", "/", json_encode($signature)));
$sharetitle = getSysConfig('share-title');
$sharedesc = getSysConfig('share-desc');
$shareimgUrl = getSysConfig('share-imgUrl');
$sharelink = getSysConfig('share-link');
$this->assign('sharetitle', $sharetitle);
$this->assign('sharedesc', $sharedesc);
$this->assign('shareimgUrl', $shareimgUrl);
$this->assign('inviteurl', domainurl() . UC($sharelink, array('invate' => getOpenid())));
}
示例4: delSpaceAct
public function delSpaceAct()
{
if (IS_POST) {
$id = I('post.id');
D('SpaceArea')->where(array('id' => $id))->delete();
$this->success("删除成功!", UC('Space/index'));
}
}
示例5: __construct
/**
* @brief 构造函数
* @param $payment_id 支付方式ID
*/
public function __construct($paymentInfo)
{
//回调函数地址
$this->callbackUrl = __BASE__ . UC('Admin/SaleOthers/scanActivity', array("id" => $paymentInfo['id']));
//回调业务处理地址
$this->serverCallbackUrl = __BASE__ . UC('Admin/SaleOthers/notifyurl', array("id" => $paymentInfo['id']));
$this->configInfo = $paymentInfo;
//中断支付返回
//$this->merchantCallbackUrl = __BASE__.U($modName.'/Payment/merchant_callback',array('_id'=>$payment_id));
}
示例6: account_editAct
/**
* 编辑管理员
*/
public function account_editAct()
{
if (IS_POST) {
$id = intval(I("post.uid"));
if (empty($_POST['password'])) {
unset($_POST['password']);
}
$data = D("AdminAccount")->create();
if ($data) {
if (empty($data['password'])) {
unset($data['password']);
}
if (D("AdminAccount")->save($data) !== false) {
$this->success("修改成功!", UC('User/index'));
} else {
$this->error("修改失败!" . D("AdminAccount")->getlastsql() . print_r($data, true));
}
} else {
$this->error(D("AdminAccount")->getError());
}
} else {
$uid = intval(I("get.uid"));
if (!$uid) {
$this->error("非法操作!");
}
$role_id = D('AdminAccount')->where(array('uid' => $uid))->getField('role_id');
if ($role_id == 1) {
$this->error("超级管理员不能编辑!", UC('User/index'));
}
$data = D("AdminAccount")->field('uid, account, role_id')->where(array("uid" => $uid))->find();
if (!$data) {
$this->error("编辑项不存在!");
}
$role_list = D('Role')->simple_role_list($data['role_id']);
$this->assign("headline", "编辑管理员");
$this->assign("role_list", $role_list);
$this->assign("action_name", ACTION_NAME);
$this->assign("info", $data);
$this->display("User:account_oper");
}
}
示例7: receiveAct
public function receiveAct()
{
$activity_id = I('get.id');
$nowtime = time();
$couponlist = D('activity_coupon')->where("activity_id={$activity_id} and stime<{$nowtime} and etime>{$nowtime}")->select();
foreach ($couponlist as $coupon) {
$isexist = D('user_activitycoupon')->where(array('open_id' => getOpenid(), 'activitycoupon_id' => $coupon['id']))->find();
if ($isexist) {
continue;
}
$info['open_id'] = getOpenid();
$info['activitycoupon_id'] = $coupon['id'];
$info['ctime'] = $nowtime;
$info['status'] = 0;
D('user_activitycoupon')->add($info);
//小提示
\Wechat\Logic\CouponLogic::ticketTip(getOpenid());
}
//设置提示
\Wechat\Logic\PushLogic::pushTextMsg(getOpenid(), getSysConfig('coupon-text'));
redirect(UC('/Wechat/Coupon/index'), 0, '页面跳转中...');
}
示例8: redirectLogin
/**
* 跳转到登入页面
*
* 注:本函数会立即退出程序执行
*
* @param string $redirect 回跳链接
*/
public function redirectLogin($tips = array(), $redirect = null)
{
if (!$redirect) {
$redirect = UC(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME);
}
$path = parse_url($redirect, PHP_URL_QUERY);
$pathPattern = '@^' . preg_quote($this->_loginPath, '@') . '@gi';
if (preg_match($pathPattern, $path)) {
$redirect = __BASE__;
}
$goto = UC(MODULE_NAME . '/public/login');
if ($redirect) {
$goto = url_append_param($goto, array(C('VAR_REDIRECT') => $redirect));
}
if (is_string($tips)) {
$tips = array('msg' => $tips);
}
if ($tips) {
$goto = url_append_param($goto, $tips);
}
redirect($goto);
}
示例9: UC
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area : ['600px', '500px'],
content: "<?php
echo UC('Admin/Order/orderDetail');
?>
?id="+id
});
layer.full(index);
}
//搜索
function search(){
$('#Hpagesize').val($('#pagesize option:selected').val());//分页参数
var data = $("form").serialize();
$.post("<?php
echo UC('Order/ticketOrder');
?>
", data,
function(data){
$('#list').html(data.info);
supage('pageNav','cengp_Page','',1, data.url, pagesize);//分页参数
},'json');
}
//时间控件
$('#dateRangePicker').daterangepicker({format : 'YYYYMMDD'}).prev().on(ace.click_event, function(){
$(this).next().focus();
});
</script>
示例10: remove_option
"sPrevious": "上页"
},
"sEmptyTable": "表格是空的",
"sZeroRecords": "没有符合条件的数据",
"sInfo": "总共_TOTAL_条数据(当前为第_START_条到第_END_条)",
"sInfoEmpty": "没有符合条件的数据",
"sInfoFiltered": "(从_MAX_条数据中过滤)",
"sLengthMenu": "显示_MENU_条数据",
"sProcessing": "数据处理中……",
"sSearch": "搜索:"
}
} );
})
function remove_option(id, cfm)
{
if (confirm(cfm))
{
$.post("<?php
echo UC('Admin/Activity/delActivityCoupon');
?>
", {"id":id},
function(data){
alert(data.info);
if (data.status == 1) {
window.location.reload();
}
},'json');
}
}
</script>
示例11: UC
<div class="page-header">
<h1>
权限设置
<a href="<?php
echo UC('Rbac/index');
?>
">
<button class="btn btn-sm" style="float:right;margin-right:35px;">
返回列表
</button>
</a>
</h1>
</div>
<div class="row">
<form class="J_ajaxForm" action="<?php
echo UC('Rbac/authorize');
?>
" method="post">
<div class="table_full">
<table width="100%" cellspacing="0" id="dnd-example">
<tbody>
{$categorys}
</tbody>
</table>
</div>
<div class="btn_wrap_pd">
<div class="btn_wrap_pd">
<input type="hidden" name="roleid" value="{$roleid}" />
<button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit" style="float:left; margin-left:18px;">授权</button>
</div>
</div>
示例12: UC
if (data.status == 1) {
window.location.href = data.url;
}
},'json');
}
});
});
});
//区确认后
$('#role').change(function(){
alert($(this).val());
$.post("<?php
echo UC('Admin/Logistic/getStreet');
?>
", {"districtids":districtids},
function(data){
$('#h-street').html(data.info);
$('#HFade').hide();
$('#streetBox').hide();
},'json');
})
//全选
function allCheck(){
$('#allCheck').find('.h-operation').prop("checked","checked");
}
</script>
示例13: function
</div>
</div>
<div class="hr hr-24"></div>
</form>
</div>
</div>
<script type="text/javascript">
jQuery(function($) {
$().ready(function() {
$("form").validate({
submitHandler: function(form)
{
var data = $("form").serialize();
$.post("<?php
echo UC('Rbac/' . $action_name);
?>
", data,
function(data){
alert(data.info);
if (data.status == 1) {
window.location.href = data.url;
}
},'json');
}
});
});
});
</script>
示例14: doPay
/**
* @see paymentplugin::doPay()
*/
public function doPay($sendData)
{
if (isset($sendData['prepay_id']) && $sendData['prepay_id']) {
$return = array();
//基本参数
$return['appId'] = $sendData['appid'];
$return['timeStamp'] = time();
$return['nonceStr'] = rand(100000, 999999);
$return['package'] = "prepay_id=" . $sendData['prepay_id'];
$return['signType'] = "MD5";
//除去待签名参数数组中的空值和签名参数
$para_filter = $this->paraFilter($return);
//对待签名参数数组排序
$para_sort = $this->argSort($para_filter);
//生成签名结果
$mysign = $this->buildMysign($para_sort, $sendData['key']);
//签名结果与签名方式加入请求提交参数组中
$return['paySign'] = $mysign;
$return['successUrl'] = __BASE__ . UC('Wechat/User/orderlist');
$return['failUrl'] = __BASE__ . UC('Wechat/User/orderlist');
include dirname(__FILE__) . '/template/pay.php';
} else {
die('微信下单API接口失败');
}
}
示例15: jQuery
</div>
<div class="hr hr-24"></div>
</form>
</div>
</div>
<script type="text/javascript">
jQuery(function($) {
$('[data-rel=popover]').popover({container:'body'});
$().ready(function() {
$("form").validate({
submitHandler: function(form)
{
var data = $("form").serialize();
$.post("<?php
echo UC('Activity/addActivityCoupon');
?>
", data,
function(data){
alert(data.info);
if (data.status == 1) {
window.location.href = data.url;
}
},'json');
}
});
});
});
$('.date-picker').datepicker({autoclose:true}).on(ace.click_event, function(){
});