本文整理汇总了PHP中remind类的典型用法代码示例。如果您正苦于以下问题:PHP remind类的具体用法?PHP remind怎么用?PHP remind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了remind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* 编辑页面分类
*/
public function edit()
{
$id = $this->input->get('id');
if (!$id) {
remind::set(Kohana::lang('o_global.bad_request'), 'site/doc_category');
}
$data = Mydoc_category::instance($id)->get();
if ($_POST) {
$category_name = $this->input->post('category_name');
$parent_id = $this->input->post('parent_id');
if (empty($category_name)) {
remind::set(Kohana::lang('o_site.doc_category_cannot_null'));
} else {
if ($parent_id == $id) {
remind::set(Kohana::lang('o_site.doc_parent_category_cannot_self'));
} else {
if (Mydoc_category::instance()->name_exist($category_name, $id)) {
remind::set(Kohana::lang('o_site.doc_category_has_exist'));
} else {
if (Mydoc_category::instance($id)->edit($_POST)) {
remind::set(Kohana::lang('o_global.update_success'), 'site/doc_category', 'success');
} else {
remind::set(Kohana::lang('o_global.update_error') . Mydoc_category::instance($id)->error());
}
}
}
}
$data = array_merge($data, $_POST);
}
$doc_categories = Mydoc_category::instance()->doc_categories(0);
$this->template->content = new View("site/doc_category_edit");
$this->template->content->data = $data;
$this->template->content->doc_categories = $doc_categories;
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:37,代码来源:doc_category.php
示例2: is_allowed
public static function is_allowed($permission = 'default', $site_id = 0, $type = NULL)
{
$verify = true;
$site_ids = role::get_site_ids($type);
//超级管理员root不需要检查权限 zhu modify
if (role::is_root()) {
$verify = true;
} else {
if ($site_id > 0 && !in_array($site_id, $site_ids)) {
$verify = false;
}
$acl = Session::instance()->get(self::$acl_tag);
if ($acl) {
$acl = unserialize($acl);
} else {
$acl = self::acl_init();
}
$manager = role::get_manager();
$verify = $acl->is_allowed($manager["username"], $permission);
}
//验证操作
if ($verify) {
return $site_ids;
} else {
if (request::is_ajax()) {
$return_struct = array('status' => 0, 'code' => 501, 'msg' => Kohana::lang('o_global.access_denied'), 'content' => array());
die(json_encode($return_struct));
} else {
$referrer = tool::referrer_url();
remind::set('权限不足', $referrer, 'error');
}
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:33,代码来源:acltool.php
示例3: index
public function index()
{
$route_data = Myroute::instance()->get();
if ($_POST) {
$site_next_flow = site::site_next_flow($this->current_flow);
$submit_target = intval($this->input->post('submit_target'));
if (Myroute::instance()->edit($_POST)) {
//判断添加成功去向
switch ($submit_target) {
case 2:
remind::set(Kohana::lang('o_global.update_success'), $site_next_flow['url'], 'success');
default:
remind::set(Kohana::lang('o_global.update_success'), 'site/route', 'success');
}
} else {
remind::set(Kohana::lang('o_global.update_error'), 'site/route');
}
}
$this->template->content = new View("site/route_edit");
$this->template->content->is_modify = 0;
if ($this->manager_is_admin == 1) {
$this->template->content->is_modify = 1;
}
$this->template->content->data = $route_data;
$this->template->content->site_id = $this->site_id;
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:26,代码来源:route.php
示例4: index
public function index()
{
$site_id = 1;
$theme_id = 2;
$server = Storage_server::instance();
$filename = $this->input->get('filename');
$theme_views = $server->get_site_themes($site_id, $theme_id, 'views');
$theme_js = $server->get_site_themes($site_id, $theme_id, 'js');
$theme_css = $server->get_site_themes($site_id, $theme_id, 'css');
if (in_array($filename, $theme_views)) {
$type = 'views';
} else {
if (in_array($filename, $theme_js)) {
$type = 'js';
} else {
if (in_array($filename, $theme_css)) {
$type = 'css';
} else {
$type = 'views';
$filename = 'index.php';
}
}
}
if ($_POST) {
$file = $_POST['file'];
$server->cache_site_theme($site_id, $theme_id, $type, $filename, $file);
remind::set('add ' . $_POST['file'], url::current(TRUE));
}
$code = $server->get_site_theme($site_id, $theme_id, $type, $filename);
$this->template->content = new View("site/theme_edit");
$this->template->content->theme_files = array_merge($theme_views, $theme_js, $theme_css);
$this->template->content->data = $code;
$this->template->content->filename = $filename;
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:34,代码来源:theme.php
示例5: index
/**
* 物流对应的地区列表
*/
function index($id)
{
if (!$id) {
remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error');
}
$deliverycn_service = DeliverycnService::get_instance();
$deliverycn_region_service = Deliverycn_regionService::get_instance();
//验证此条物流
$data = $deliverycn_service->get($id);
if (!$data['id']) {
remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
}
//初始化请求结构体
$query_struct = array('where' => array('deliverycn_id' => $id), 'like' => array(), 'orderby' => array('position' => 'ASC', 'id' => 'ASC'), 'limit' => array('per_page' => 2000, 'offset' => 0));
// 每页条目数
controller_tool::request_per_page($query_struct, $request_data);
$count = $deliverycn_region_service->query_count($query_struct);
// 模板输出 分页
$this->pagination = new Pagination(array('total_items' => $count, 'items_per_page' => $query_struct['limit']['per_page']));
$query_struct['limit']['offset'] = $this->pagination->sql_offset;
$query_struct['limit']['page'] = $this->pagination->current_page;
//调用列表
$deliverycn_regions = $deliverycn_region_service->get_delivery_regions_by_position($query_struct);
$this->template->content = new View("site/deliverycn/region");
$this->template->content->deliverycn_regions = $deliverycn_regions;
$this->template->content->data = $data;
$this->template->content->regions = $deliverycn_region_service->get_regions();
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:31,代码来源:deliverycn_region.php
示例6: do_active
/**
* 改变状态
*/
function do_active($id)
{
//权限验证
role::check('user_charge');
if (!$id) {
remind::set(Kohana::lang('o_global.bad_request'), 'user/user_charge');
}
$db = Database::instance();
$data = array_shift($db->query('SELECT * FROM user_charge_order WHERE id=' . $id)->result_array(false));
if ($data['id'] <= 0 || $data['status'] > 0) {
remind::set(Kohana::lang('o_global.bad_request'), 'user/user_charge');
}
$logodata = array();
$logodata['manager_id'] = $this->manager_id;
$logodata['ip'] = tool::get_str_ip();
$logodata['user_log_type'] = 27;
$logodata['method'] = __CLASS__ . '::' . __METHOD__ . '()';
$logodata['memo'] = "充值订单号:" . $data['order_num'] . ", 购买拍点数:" . $data['price'] . ", 充值金额:" . $data['money'];
$sql = "UPDATE user_charge_order SET status=1 WHERE id='" . $id . "' ";
if ($db->query($sql)) {
//充值用户Money
$sql_reward = "UPDATE users \r\n SET user_money = user_money+" . $data['price'] . "\r\n WHERE id='" . $data['user_id'] . "'\r\n ";
$db->query($sql_reward);
//操作log
ulog::add($logodata);
remind::set(Kohana::lang('o_global.update_success'), 'user/user_charge', 'success');
} else {
//操作log
ulog::add($logodata, 1);
remind::set(Kohana::lang('o_global.update_error'), 'user/user_charge', 'error');
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:35,代码来源:user_charge.php
示例7: add
public function add()
{
if ($_POST) {
//标签过滤
tool::filter_strip_tags($_POST, array('content'));
$site_next_flow = site::site_next_flow($this->current_flow);
$submit_target = intval($this->input->post('submit_target'));
$faq = Myfaq::instance();
if ($faq->add($_POST)) {
//判断添加成功去向
switch ($submit_target) {
case 1:
remind::set(Kohana::lang('o_global.add_success'), 'site/faq/add', 'success');
case 2:
remind::set(Kohana::lang('o_global.add_success'), $site_next_flow['url'], 'success');
default:
remind::set(Kohana::lang('o_global.add_success'), 'site/faq', 'success');
}
} else {
remind::set(Kohana::lang('o_global.add_error'), 'site/faq/add');
}
}
$this->template->content = new View("site/faq_add");
$this->template->content->title = "site faq add";
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:25,代码来源:faq.php
示例8: delete
/**
* delete mail_category
*/
public function delete($id)
{
if (Mymail_category::instance($id)->delete()) {
remind::set(Kohana::lang('o_global.delete_success'), 'manage/mail_category', 'success');
} else {
$error = Mymail_category::instance($id)->error();
remind::set(Kohana::lang('o_global.delete_error') . $error, 'manage/mail_category');
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:12,代码来源:mail_category.php
示例9: __construct
/**
* Template loading and setup routine.
*/
public function __construct()
{
parent::__construct();
// checke request is ajax
$this->ajax_request = request::is_ajax();
// Load the template
$this->template = new View($this->template);
if ($this->auto_render == TRUE) {
Event::add('system.post_controller', array($this, '_render'));
}
/**
* 判断用户登录情况
*/
if (isset($_REQUEST['session_id'])) {
$session = Session::instance($_REQUEST['session_id']);
$manager = role::get_manager($_REQUEST['session_id']);
} else {
$session = Session::instance();
$manager = role::get_manager();
}
/* 当前请求的URL */
$current_url = urlencode(url::current(TRUE));
//zhu
if (isset($manager['id'])) {
$active_time = $session->get('Opococ_manager_active_time');
//用户最后操作时间
$session->set('Opococ_manager_active_time', time());
//用户最后操作时间
$login_ip = $session->get('Opococ_manager_login_ip');
//用户登录的IP
//操作超时
if (time() - $active_time > Kohana::config('login.time_out')) {
$session->delete('Opococ_manager');
$session->delete('Opococ_manager_active_time');
$session->delete('Opococ_manager_login_ip');
remind::set(Kohana::lang('o_global.first_login'), 'login?request_url=' . $current_url);
}
//用户IP(登录状态更换IP需要重新登录)
$ip = tool::get_long_ip();
if ($ip != $login_ip) {
remind::set(Kohana::lang('o_global.login_again'), 'login?request_url=' . $current_url);
}
$this->manager = $manager;
$this->manager_id = $manager['id'];
$this->manager_name = $manager['name'];
$this->manager_is_admin = role::is_root($manager['name']) ? 1 : $manager['is_admin'];
$this->template->manager_data = $manager;
} else {
remind::set(Kohana::lang('o_global.first_login'), 'login?request_url=' . $current_url);
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:54,代码来源:template.php
示例10: delete
/**
* author zhubin
* 删除用户地址
* @param int
*/
public function delete()
{
//权限验证
role::check('user_edit');
$address_info = $this->input->get();
if (empty($address_info) || !isset($address_info['address_id']) || !isset($address_info['user_id'])) {
remind::set(Kohana::lang('o_global.bad_request'), 'user/address');
}
if (Myaddress::instance()->delete($address_info['address_id'])) {
remind::set(Kohana::lang('o_user.delete_user_address_success'), 'user/user/edit/' . $address_info['user_id'], 'success');
} else {
remind::set(Kohana::lang('o_user.delete_user_address_failed'), 'user/user/edit/' . $address_info['user_id'], 'error');
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:19,代码来源:address.php
示例11: delete
public function delete($templateId)
{
//权限检查 得到所有可管理站点ID列表
role::check('distribution_system_manage');
$templateDao = Superplaner_Realtime_contract_template::instance();
$template = $templateDao->get_by_id($templateId);
if ($template == null) {
remind::set(Kohana::lang('o_contract.contract_not_exists'), request::referrer(), 'error');
}
if (Superplaner_Realtime_contract_template::instance($templateId)->delete()) {
remind::set(Kohana::lang('o_global.delete_success'), request::referrer(), 'success');
} else {
remind::set(Kohana::lang('o_global.delete_error'), request::referrer(), 'error');
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:15,代码来源:realtime_contract_template.php
示例12: delete
public function delete($cardTypeId)
{
//权限检查 得到所有可管理站点ID列表
role::check('card_system_manage');
$cardType = $this->cardTypeDao->get_by_id($cardTypeId);
if ($cardType == null) {
remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error');
return;
}
if ($this->cardTypeDao->delete($cardTypeId)) {
remind::set(Kohana::lang('o_global.delete_success'), 'card/card_type', 'success');
return;
} else {
remind::set(Kohana::lang('o_global.delete_error'), request::referrer(), 'error');
return;
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:17,代码来源:card_type.php
示例13: add
/**
* 添加新支付类型
*/
function add()
{
//权限验证
role::check('manage_payment_type');
if ($_POST) {
//标签过滤
tool::filter_strip_tags($_POST);
$payment_type = Mypayment_type::instance();
if ($payment_type->add($_POST)) {
remind::set(Kohana::lang('o_global.add_success'), 'manage/payment_type', 'success');
} else {
$errors = $payment_type->errors();
remind::set(Kohana::lang('o_global.add_error'), 'manage/payment_type/add', 'error');
}
}
$this->template->content = new View("manage/payment_type_add");
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:20,代码来源:payment_type.php
示例14: check
/**
* 判断用户的操作权限
*
* @param <String> $model_flag
* @return <type>
*/
public static function check($model_flag = 'default')
{
//zhu modify
$verify = self::verify($model_flag);
//验证操作
if ($verify) {
return $verify;
} else {
if (request::is_ajax()) {
$return_struct = array('status' => 0, 'code' => 501, 'msg' => Kohana::lang('o_global.access_denied'), 'content' => array());
die(json_encode($return_struct));
} else {
$referrer = tool::referrer_url();
remind::set('权限不足', $referrer, 'error');
}
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:23,代码来源:role.php
示例15: queue_add
public function queue_add($site)
{
if (empty($site)) {
remind::set('域名或者IP出错,请检查下您的输入!', 'site/scan/add');
} else {
if (filter_var($site, FILTER_VALIDATE_IP)) {
$ip = $site;
} else {
if (filter_var(gethostbyname($site), FILTER_VALIDATE_IP)) {
$ip = gethostbyname($site);
} else {
remind::set('域名或者IP出错,请检查下您的输入!', 'site/scan/add');
}
}
}
$sign = $this->generate_code('queue', $ip);
return $this->client->queue_add($ip, $sign, $this->ip);
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:18,代码来源:Nessus_system.php
示例16: delete
public function delete($moneyExchangeId)
{
//权限检查 得到所有可管理站点ID列表
role::check('card_system_manage');
$moneyExchange = $this->moneyExchangeDao->get_by_id($moneyExchangeId);
if ($moneyExchange == null) {
remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error');
return;
}
if ($moneyExchange['flag'] == 2) {
remind::set("不能删除生效中的汇率方案", request::referrer(), 'error');
return;
}
if ($this->moneyExchangeDao->delete($moneyExchange)) {
remind::set(Kohana::lang('o_global.delete_success'), 'card/money_exchange', 'success');
return;
} else {
remind::set(Kohana::lang('o_global.delete_error'), request::referrer(), 'error');
return;
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:21,代码来源:money_exchange.php
示例17: function
cursor: 'wait',
left: '49%',
top: '49%'
},
overlayCSS: {
backgroundColor: '#000',
opacity: 0.1
},
message: $('<img border="0" src="' + url_base + 'images/loading.gif">')
});
},
close: function() {
$.unblockUI();
}
};
return t;
}();
</script>
</head>
<body>
<!--**error start**-->
<?php
echo remind::get();
?>
<!--**error end**-->
<?php
echo !empty($content) ? $content : '';
?>
</body>
</html>
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:30,代码来源:commonfix_html.php
示例18: del_country
function del_country()
{
$return_struct = array();
$request_data = $this->input->get();
// 修改返回状态数据
$return_struct['status'] = 1;
$return_struct['code'] = 200;
$return_struct['msg'] = 'ok';
$delivery_service = DeliveryService::get_instance();
$delivery_country_service = Delivery_countryService::get_instance();
if (empty($request_data['delivery_id']) or empty($request_data['ids'])) {
remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
}
$delivery = $delivery_service->get($request_data['delivery_id']);
if ($delivery['site_id'] != $this->site_id) {
remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
}
$query_ids = explode('-', $request_data['ids']);
foreach ($query_ids as $ids) {
$delivery_countries = $delivery_country_service->get($ids);
if ($delivery_countries['delivery_id'] != $delivery['id']) {
remind::set(Kohana::lang('o_global.access_denied'), request::referrer(), 'error');
break;
}
if (!$delivery_country_service->remove($ids)) {
$return_struct['status'] = 0;
$return_struct['code'] = 501;
break;
}
}
header('Content-Type: text/javascript; charset=UTF-8');
exit(json_encode($return_struct));
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:33,代码来源:delivery_cn.php
示例19: do_delete
public function do_delete()
{
role::check('promotion_promotion');
// 收集请求数据
$request_data = $this->input->get();
$promotion = Mypromotion::instance($request_data['id'])->get();
if (!$promotion['id']) {
remind::set(Kohana::lang('o_global.bad_request'), 'promotion/promotion_activity', 'error');
}
if (Mypromotion::instance()->delete($promotion['id'])) {
//promotion::delete_memcache($promotion['site_id']);
remind::set(Kohana::lang('o_global.delete_success'), 'promotion/promotion_activity', 'success');
}
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:14,代码来源:promotion.php
示例20: update_order_status
public function update_order_status($status)
{
$request_data = $this->input->post();
if (empty($_POST)) {
remind::set(Kohana::lang('o_global.bad_request'), '/order/order/index/' . $request_data['backurl']);
}
if (empty($request_data['order_ids'])) {
remind::set(Kohana::lang('o_global.bad_request'), 'order/order/index/' . $request_data['backurl']);
}
if (Order_basic_Model::show_status($status) == FALSE) {
remind::set(Kohana::lang('o_global.bad_request'), 'order/order/index/' . $request_data['backurl']);
}
$status_name = Order_basic_Model::show_status($status);
$order_ids = $request_data['order_ids'];
$logs_data = array();
$logs_data['manager_id'] = $this->manager_id;
$logs_data['user_log_type'] = 28;
$logs_data['ip'] = Input::instance()->ip_address();
for ($i = 0; $i < count($order_ids); $i++) {
$order_info = $this->order_basic_obj->get_order_by_id($order_ids[$i]);
if ($order_info && $order_info['status'] != $status) {
$order_id = $order_info['id'];
$u_ob_r = $this->order_basic_obj->update_status_by_order_id($order_id, $status);
if ($u_ob_r == TRUE) {
$order_details = $this->order_detail_obj->get_orders_by_orderid($order_id);
if ($order_details) {
for ($j = 0; $j < count($order_details); $j++) {
$u_od_r = $this->order_detail_obj->update_status_by_id($order_details[$j]['id'], $status);
if ($u_od_r == TRUE) {
$logs_data['memo'] = "订单操作成功!状态:" . $status_name . ",订单号:" . $order_id . '(子订单:' . $order_details[$j]['id'] . ')';
ulog::instance()->add($logs_data);
} else {
$logs_data['memo'] = "订单操作失败!状态:" . $status_name . ",订单号:" . $order_id . '(子订单:' . $order_details[$j]['id'] . ')';
ulog::instance()->add($logs_data);
}
}
} else {
$logs_data['memo'] = "子订单不存在:" . $order_id;
ulog::instance()->add($logs_data);
}
} else {
$logs_data['memo'] = "订单操作失败!状态:" . $status_name . ",订单号:" . $order_id;
ulog::instance()->add($logs_data);
}
} else {
$logs_data['memo'] = "订单ID不存在或已取消:" . $order_id;
ulog::instance()->add($logs_data);
}
}
remind::set('操作完成,详见日志', '/order/order/index/' . $request_data['backurl'], 'success');
}
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:51,代码来源:order.php
注:本文中的remind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论