示例#1
0
 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
0
 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
0
 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
0
 public function delSpaceAct()
 {
     if (IS_POST) {
         $id = I('post.id');
         D('SpaceArea')->where(array('id' => $id))->delete();
         $this->success("删除成功!", UC('Space/index'));
     }
 }
 /**
  * @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));
 }
 /**
  * 编辑管理员
  */
 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");
     }
 }
 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
0
 /**
  * 跳转到登入页面
  *
  * 注:本函数会立即退出程序执行
  *
  * @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
0
            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
0
                     "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
0
<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
0
		            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
0
		            if (data.status == 1) {
		                window.location.href = data.url;
		            } 
		        },'json');   
		   } 
		});
	});
});

//区确认后
$('#role').change(function(){

	alert($(this).val());
	
	$.post("<?php 
echo UC('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>
示例#14
0
				</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>

示例#15
0
 /**
  * @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接口失败');
     }
 }
示例#16
0
                     "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/activityDisable');
?>
", {"id":id}, 
              function(data){
                alert(data.info);
                if (data.status == 1) {
                    window.location.reload();
                }
            },'json');
        }
    }
</script>
示例#17
0
            </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(){
        });
示例#18
0
", {"id":id}, 
			  function(data){
				alert(data.info);
	            if (data.status == 1) {
	            	window.location.reload();
	            } 
	        },'json');
	    }
	}

	function h_push()
	{
		if (confirm('请确认菜单是否正确添加,是否发布?'))
	    {
			$.post("<?php 
echo UC('Menu/push');
?>
", {"id":1}, 
			  function(data){
				alert(data.info);
	            if (data.status == 1) {
	            	window.location.reload();
	            } 
	        },'json');
	    }
	}

	

	
</script>
示例#19
0
 /**
  * 录入白名单原因
  */
 public function editChangeStoreWhiteListReasonAct()
 {
     $logid = I("post.id");
     $reason = I("post.reason");
     if (empty($logid)) {
         $this->error("非法操作!");
     }
     if (empty($reason)) {
         $this->error("原因不能为空!");
     }
     $data = D('ChangestoreWhitelist')->getChangeStoreWhiteListDataByID($logid);
     if (empty($data)) {
         $this->error("该记录已不存在!");
     }
     $opUid = $this->_account['uid'];
     // 操作员ID
     $opName = $this->_account['account'];
     // 操作员账号
     // 录入白名单原因
     $update_result = D("ChangestoreWhitelist")->updateReason($logid, $reason, $opName, $opUid);
     if ($update_result !== false) {
         $this->success("录入原因成功!", UC("User/changeStoreWhiteList"));
     } else {
         $this->error("录入原因失败!");
     }
 }
 public function editSortAct()
 {
     $sortid = intval(I("sortid"));
     if (IS_POST) {
         //有效时间
         if ($_POST['endday']) {
             $time = explode('-', $_POST['endday']);
             $_POST['b_time'] = strtotime($time[0] . ' 00:00:00');
             $_POST['e_time'] = strtotime($time[1] . ' 23:59:59');
         }
         $data = D("Card")->create();
         if ($data) {
             if (D("Card")->save($data) !== false) {
                 $this->success("修改成功!");
             } else {
                 $this->error("修改失败!");
             }
         } else {
             $this->error('修改失败');
         }
     } else {
         $info = D('Category')->where(array('sortid' => $sortid))->find();
         $info = string_gb2312_to_utf8($info);
         $this->assign('info', $info);
         $sortTree = D('Category')->sortTree();
         $this->assign('sortTree', $sortTree);
         $result = D("Category")->field('sortid,parentid,sortname')->order(array("sortdir" => "ASC"))->select();
         $result = string_gb2312_to_utf8($result);
         $tree = new p\Tree();
         $parentid = intval(I("get.parentid"));
         foreach ($result as $r) {
             $r['selected'] = $r['id'] == $parentid ? 'selected' : '';
             $array[] = $r;
         }
         $str = "<option value='\$sortid' \$selected>\$spacer \$sortname</option>";
         $tree->init($array);
         $select_categorys = $tree->get_tree(0, $str);
         $this->assign("select_categorys", $select_categorys);
         $this->assign('jumpurl', UC("Category/editSort"));
     }
     $this->display();
 }
示例#21
0
echo UC('Admin/Public/captcha');
?>
" onclick="freshCaptcha()" border="0" alt="点击刷新验证码" style="cursor: pointer; height: 40px; width: 225px;" align="absmiddle">
                     &nbsp;&nbsp;<a href="javascript:void freshCaptcha();">点击刷新</a>
                     <div class="space" style="margin-top:15px"></div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-block submit ajax-post" target-form="login-form">登 录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="bottom navbar-fixed-bottom text-center padding-top padding-bottom">
        <span>Copyright © 传奇互动  All rights reserved.</span>
    </div>
    <script language="JavaScript">
	function freshCaptcha(){ 
		//重载验证码
		var timenow = new Date().getTime();
		$('#captchaImg').attr('src', '<?php 
echo UC('Admin/Public/captcha');
?>
?'+timenow);
	}
	
	</script>
</body>
</html>
{__NOLAYOUT__}

示例#22
0
	                 "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('User/del_account');
?>
", {"uid":id}, 
			  function(data){
				alert(data.info);
	            if (data.status == 1) {
	            	window.location.reload();
	            } 
	        },'json');
	    }
	}
</script>
示例#23
0
            </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/activityAdd');
?>
", data, 
                      function(data){
                        alert(data.info);
                        if (data.status == 1) {
                            window.location.href = data.url;
                        } 
                    },'json');   
               } 
            });
        });
    });

</script>
示例#24
0
 public function passwordAct()
 {
     $this->_requireLogin();
     if (!IS_POST) {
         //$account = M('AdminAccount')->field('account')->find();
         //$account = $account['account'];
         //$this->assign('account',$account);
         $this->display();
     } else {
         $aClean = array();
         $aClean['oldpass'] = I('post.oldpass');
         $aClean['newpass'] = I('post.newpass');
         $aClean['retypepass'] = I('post.retypepass');
         if (!$aClean['oldpass'] || !$aClean['newpass'] || !$aClean['retypepass']) {
             $this->error(TL("操作失败:请完整输入所有必填项"), __ACTION__);
         }
         $oAccount = D('AdminAccount');
         // 验证新密码是否一致
         if (strcmp($aClean['newpass'], $aClean['retypepass'])) {
             $this->error(TL("操作失败:新密码两次输入不一致"), __ACTION__);
         }
         // 验证旧密码是否正确
         if (!$oAccount->verifyLogin($this->_account['account'], $aClean['oldpass'])) {
             $this->error(TL("操作失败:输入的旧密码不正确"), __ACTION__);
         }
         // 修改为新密码
         $oAccount->changePassword($this->_account['uid'], $aClean['newpass']);
         // 自动退出,要求重新登陆
         $this->auth->logout();
         $this->success(TL("成功修改密码!请使用新密码重新登陆。"), UC('Admin/Public/login'));
     }
 }
示例#25
0
 /**
  *  编辑菜单
  */
 public function menu_editAct()
 {
     if (IS_POST) {
         if (D("Menu")->create()) {
             if (D("Menu")->save() !== false) {
                 $this->_admin_log(I('post.id'), '编辑菜单', "成功!");
                 $this->success("更新成功!", UC("Menu/index"));
             } else {
                 $this->_admin_log(I('post.id'), '编辑菜单', "失败!");
                 $this->error("更新失败!");
             }
         } else {
             $this->_admin_log(I('post.id'), '编辑菜单', "失败!" . D("Menu")->getError());
             $this->error(D("Menu")->getError());
         }
     } else {
         $id = intval(I("get.id"));
         if (!$id) {
             $this->error('编辑项不存在!');
         }
         $rs = D("Menu")->where(array("id" => $id))->find();
         $result = D("Menu")->field('id,name,parentid')->order(array("listorder" => "ASC"))->select();
         $tree = new p\Tree();
         foreach ($result as $r) {
             $r['selected'] = $r['id'] == $rs['parentid'] ? 'selected' : '';
             $array[] = $r;
         }
         $str = "<option value='\$id' \$selected>\$spacer \$name</option>";
         $tree->init($array);
         $select_categorys = $tree->get_tree(0, $str);
         $this->assign("info", $rs);
         $this->assign("select_categorys", $select_categorys);
         $this->assign("headline", "编辑菜单");
         $this->assign("action_name", ACTION_NAME);
         $this->display("Menu:menu_oper");
     }
 }
示例#26
0
echo UC(MODULE_NAME . '/Public/captcha');
?>
" onclick="freshCaptcha()" border="0" alt="点击刷新验证码" style="cursor: pointer; height: 40px; width: 225px;" align="absmiddle">
                     &nbsp;&nbsp;<a href="javascript:void freshCaptcha();">点击刷新</a>
                     <div class="space" style="margin-top:15px"></div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-block submit ajax-post" target-form="login-form">登 录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="bottom navbar-fixed-bottom text-center padding-top padding-bottom">
        <span>Copyright © {:C('SITE_TITLE')}   All rights reserved.</span>
    </div>
    <script language="JavaScript">
	function freshCaptcha(){ 
		//重载验证码
		var timenow = new Date().getTime();
		$('#captchaImg').attr('src', '<?php 
echo UC(MODULE_NAME . '/Public/captcha');
?>
?'+timenow);
	}
	
	</script>
</body>
</html>
{__NOLAYOUT__}

示例#27
0
									<a href="#">
										<i class="icon-cog"></i>
										个人设定
									</a>
								</li>

								<li>
									<a href="javascript:openapp('<?php 
echo UC('Admin/Public/password');
?>
','254Admin','修改密码'); ">
										<i class="icon-user"></i>
										修改密码
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="<?php 
echo UC('Admin/Public/logout');
?>
">
										<i class="icon-off"></i>
										退出
									</a>
								</li>
							</ul>
						</li>
					</ul><!-- /.ace-nav -->
				</div>
示例#28
0
	             },
	             "sEmptyTable": "表格是空的",
	             "sZeroRecords": "没有符合条件的数据",
	             "sInfo": "总共_TOTAL_条数据(当前为第_START_条到第_END_条)",
	             "sInfoEmpty": "没有符合条件的数据",
	             "sInfoFiltered": "(从_MAX_条数据中过滤)",
	             "sLengthMenu": "显示_MENU_条数据",
	             "sProcessing": "数据处理中……",
	             "sSearch": "搜索:"
	         }
      	} );
		
	})
	
	function remove_vote(id)
	{
		if (confirm('您确认要删除这条数据吗?'))
	    {
			$.post("<?php 
echo UC('Menu/del_menu');
?>
", {"id":id}, 
			  function(data){
				alert(data.info);
	            if (data.status == 1) {
	            	window.location.reload();
	            } 
	        },'json');
	    }
	}
</script>
示例#29
0
 /**
  * 供应商菜单角色授权
  */
 public function provider_authorizeAct()
 {
     //角色ID
     if (IS_POST) {
         $roleid = intval(I("post.roleid"));
         if (!$roleid) {
             $this->error("需要授权的角色不存在!");
         }
         if (is_array($_POST['menuid']) && count($_POST['menuid']) > 0) {
             C('TOKEN_ON', false);
             $addauthorize = array();
             //检测数据合法性
             foreach ($_POST['menuid'] as $menuid) {
                 $info = array();
                 $info['role_id'] = $roleid;
                 $info['sys_menu_id'] = $menuid;
                 $info['ctime'] = time();
                 $info['mtime'] = time();
                 $data = D('SysRoleMenu')->create($info);
                 if (!$data) {
                     $this->error(D('SysRoleMenu')->getError());
                 } else {
                     $addauthorize[] = $data;
                 }
             }
             C('TOKEN_ON', true);
             if (!$roleid || !$addauthorize || !is_array($addauthorize)) {
                 $this->error("授权失败!");
             }
             //删除旧的权限
             D('SysRoleMenu')->where(array("role_id" => $roleid))->delete();
             $res = D('SysRoleMenu')->addAll($addauthorize);
             if ($res) {
                 $this->success("授权成功!", UC("Rbac/index"));
             } else {
                 $this->error("授权失败!");
             }
         } else {
             //当没有数据时,清除当前角色授权
             D('SysRoleMenu')->where(array("role_id" => $roleid))->delete();
             $this->error("没有接收到数据,执行清除授权成功!");
         }
     } else {
         $roleid = intval(I("get.id"));
         if (!$roleid) {
             $this->error("参数错误!");
         }
         $menu = new p\Tree();
         $menu->icon = array('│ ', '├─ ', '└─ ');
         $menu->nbsp = '&nbsp;&nbsp;&nbsp;';
         $result = D('SysMenu')->order(array("listorder" => "ASC"))->select();
         $newmenus = array();
         $priv_data = D('SysRoleMenu')->where(array("role_id" => $roleid))->getField('sys_menu_id', true);
         //获取权限表数据
         foreach ($result as $m) {
             $newmenus[$m['id']] = $m;
         }
         foreach ($result as $n => $t) {
             $result[$n]['checked'] = in_array($t['id'], $priv_data) ? ' checked' : '';
             $result[$n]['level'] = $this->_get_level($t['id'], $newmenus);
             $result[$n]['parentid_node'] = $t['parentid'] ? ' class="child-of-node-' . $t['parentid'] . '"' : '';
         }
         $str = "<tr id='node-\$id' \$parentid_node>\r\n                       <td style='padding-left:30px;'>\$spacer<input type='checkbox' name='menuid[]' value='\$id' level='\$level' \$checked onclick='javascript:checknode(this);'> \$name</td>\r\n\t    \t\t\t</tr>";
         $menu->init($result);
         $categorys = $menu->get_tree(0, $str);
         $this->assign('base', __BASE__);
         $this->assign("categorys", $categorys);
         $this->assign("roleid", $roleid);
         $this->display();
     }
 }
示例#30
0
            </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('Space/addSpace');
?>
", data, 
                      function(data){
                        alert(data.info);
                        if (data.status == 1) {
                            window.location.href = data.url;
                        } 
                    },'json');   
               } 
            });
        });
    });

</script>