当前位置: 首页>>代码示例>>PHP>>正文


PHP get_activity_message函数代码示例

本文整理汇总了PHP中get_activity_message函数的典型用法代码示例。如果您正苦于以下问题:PHP get_activity_message函数的具体用法?PHP get_activity_message怎么用?PHP get_activity_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_activity_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $this->lang->load('login');
     if ($this->user->islogged()) {
         redirect('dashboard');
     }
     $this->template->setTitle($this->lang->line('text_title'));
     $data['site_name'] = $this->config->item('site_name');
     $data['reset_url'] = site_url('login/reset');
     if ($this->input->post() and $this->validateLoginForm() === TRUE) {
         if (!$this->user->login($this->input->post('user'), $this->input->post('password'))) {
             // checks if form validation routines ran successfully
             $this->alert->set('danger', $this->lang->line('alert_username_not_found'));
             redirect('login');
         } else {
             log_activity($this->user->getStaffId(), 'logged in', 'staffs', get_activity_message('activity_logged_in', array('{staff}', '{link}'), array($this->user->getStaffName(), admin_url('staffs/edit?id=' . $this->user->getStaffId()))));
             if ($previous_url = $this->session->tempdata('previous_url')) {
                 $this->session->unset_tempdata('previous_url');
                 redirect($previous_url);
             }
             redirect(referrer_url());
         }
     }
     $this->template->setPartials(array('header', 'footer'));
     $this->template->render('login', $data);
 }
开发者ID:AKCore,项目名称:TastyIgniter,代码行数:26,代码来源:Login.php

示例2: index

 public function index()
 {
     if ($this->customer->islogged()) {
         // checks if customer is logged in then redirect to account page.
         redirect('account/account');
     }
     $this->load->model('Pages_model');
     $this->lang->load('account/login_register');
     $this->template->setTitle($this->lang->line('text_heading'));
     $data['reset_url'] = site_url('account/reset');
     $data['register_url'] = site_url('account/register');
     if ($this->input->post()) {
         // checks if $_POST data is set
         if ($this->validateForm() === TRUE) {
             $email = $this->input->post('email');
             // retrieves email value from $_POST data if set
             $password = $this->input->post('password');
             // retrieves password value from $_POST data if set
             if ($this->customer->login($email, $password) === FALSE) {
                 // invoke login method in customer library with email and password $_POST data value then check if login was unsuccessful
                 $this->alert->set('alert', $this->lang->line('alert_invalid_login'));
                 // display error message and redirect to account login page
                 redirect(current_url());
             } else {
                 // else if login was successful redirect to account page
                 log_activity($this->customer->getId(), 'logged in', 'customers', get_activity_message('activity_logged_in', array('{customer}', '{link}'), array($this->customer->getName(), admin_url('customers/edit?id=' . $this->customer->getId()))));
                 if ($redirect_url = $this->input->get('redirect')) {
                     redirect($redirect_url);
                 }
                 redirect('account/account');
             }
         }
     }
     $this->template->render('account/login', $data);
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:35,代码来源:Login.php

示例3: _updateDetails

 private function _updateDetails()
 {
     // method to validate update details form fields
     if ($this->validateForm() === TRUE) {
         $update = array();
         // START: retrieve $_POST data if $_POST data is not same as existing customer library data
         $update['first_name'] = $this->input->post('first_name');
         $update['last_name'] = $this->input->post('last_name');
         $update['telephone'] = $this->input->post('telephone');
         $update['security_question_id'] = $this->input->post('security_question_id');
         $update['security_answer'] = $this->input->post('security_answer');
         $update['password'] = $this->input->post('new_password');
         $update['newsletter'] = $this->input->post('newsletter');
         $update['status'] = '1';
         // END: retrieve $_POST data if $_POST data is not same as existing customer library data
         if (!empty($update)) {
             // if update array is not empty then update customer details and display success message
             if ($this->Customers_model->saveCustomer($this->customer->getId(), $update)) {
                 log_activity($this->customer->getId(), 'updated', 'customers', get_activity_message('activity_updated_account', array('{customer}', '{link}'), array($this->customer->getName(), admin_url('customers/edit?id=' . $this->customer->getId()))));
                 if (!empty($update['password'])) {
                     log_activity($this->customer->getId(), 'updated', 'customers', get_activity_message('activity_changed_password', array('{customer}', '{link}'), array($this->customer->getName(), admin_url('customers/edit?id=' . $this->customer->getId()))));
                 }
                 $this->alert->set('alert', $this->lang->line('alert_updated_success'));
             }
             return TRUE;
         }
     }
 }
开发者ID:allrested,项目名称:TastyIgniter,代码行数:28,代码来源:Details.php

示例4: _addCustomer

 private function _addCustomer()
 {
     if ($this->validateForm() === TRUE) {
         $this->load->model('Customers_model');
         // load the customers model
         $this->load->model('Customer_groups_model');
         $add = array();
         // if successful CREATE an array with the following $_POST data values
         $add['first_name'] = $this->input->post('first_name');
         $add['last_name'] = $this->input->post('last_name');
         $add['email'] = $this->input->post('email');
         $add['password'] = $this->input->post('password');
         $add['telephone'] = $this->input->post('telephone');
         $add['security_question_id'] = $this->input->post('security_question');
         $add['security_answer'] = $this->input->post('security_answer');
         $add['newsletter'] = $this->input->post('newsletter');
         $add['terms_condition'] = $this->input->post('terms_condition');
         $add['customer_group_id'] = $this->config->item('customer_group_id');
         $add['date_added'] = mdate('%Y-%m-%d', time());
         $result = $this->Customer_groups_model->getCustomerGroup($this->config->item('customer_group_id'));
         if ($result['approval'] === '1') {
             $add['status'] = '0';
         } else {
             $add['status'] = '1';
         }
         if (!empty($add) and $customer_id = $this->Customers_model->saveCustomer(NULL, $add)) {
             // pass add array data to saveCustomer method in Customers model then return TRUE
             log_activity($customer_id, 'registered', 'customers', get_activity_message('activity_registered_account', array('{customer}', '{link}'), array($this->input->post('first_name') . ' ' . $this->input->post('last_name'), admin_url('customers/edit?id=' . $customer_id))));
             return TRUE;
         }
     }
 }
开发者ID:AKCore,项目名称:TastyIgniter,代码行数:32,代码来源:Register.php

示例5: index

 public function index()
 {
     $this->lang->load('login');
     log_activity($this->user->getStaffId(), 'logged out', 'staffs', get_activity_message('activity_logged_out', array('{staff}', '{link}'), array($this->user->getStaffName(), admin_url('staffs/edit?id=' . $this->user->getStaffId()))));
     $this->user->logout();
     $this->alert->set('success', $this->lang->line('alert_success_logout'));
     redirect('login');
 }
开发者ID:allrested,项目名称:TastyIgniter,代码行数:8,代码来源:Logout.php

示例6: index

 public function index()
 {
     $this->load->model('Pages_model');
     $this->lang->load('account/login_register');
     $this->template->setBreadcrumb('<i class="fa fa-home"></i>', '/');
     $this->template->setBreadcrumb($this->lang->line('text_heading'), 'account/logout');
     $this->template->setTitle($this->lang->line('text_logout_heading'));
     $this->alert->set('success', $this->lang->line('alert_logout_success'));
     log_activity($this->customer->getId(), 'logged out', 'customers', get_activity_message('activity_logged_out', array('{customer}', '{link}'), array($this->customer->getName(), admin_url('customers/edit?id=' . $this->customer->getId()))));
     $this->customer->logout();
     if ($redirect_url = $this->input->get('redirect')) {
         redirect($redirect_url);
     }
     redirect('account/login');
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:15,代码来源:Logout.php

示例7: _uploadExtension

 private function _uploadExtension()
 {
     $this->user->restrict('Admin.Modules.Add', site_url('extensions/add'));
     if (isset($_FILES['extension_zip'])) {
         if ($this->validateUpload() === TRUE) {
             if ($this->Extensions_model->upload('module', $_FILES['extension_zip'])) {
                 $extension_name = basename($_FILES['extension_zip']['name'], '.zip');
                 log_activity($this->user->getStaffId(), 'uploaded', 'extensions', get_activity_message('activity_custom_no_link', array('{staff}', '{action}', '{context}', '{item}'), array($this->user->getStaffName(), 'uploaded', 'extension', $extension_name)));
                 $alert = sprintf($this->lang->line('alert_success'), "Extension {$extension_name} uploaded ");
                 $alert .= sprintf($this->lang->line('alert_install'), site_url('extensions/install?name=') . $extension_name);
                 $this->alert->set('success', $alert);
                 return TRUE;
             }
             $this->alert->danger_now($this->lang->line('alert_error_try_again'));
         }
     }
     return FALSE;
 }
开发者ID:labeetotrent,项目名称:latthiya,代码行数:18,代码来源:Extensions.php

示例8: addReservation

 public function addReservation($add = array())
 {
     if (empty($add)) {
         return FALSE;
     }
     if (isset($add['location_id'])) {
         $this->db->set('location_id', $add['location_id']);
     }
     if (isset($add['table_id'])) {
         $this->db->set('table_id', $add['table_id']);
     }
     if (isset($add['customer_id'])) {
         $this->db->set('customer_id', $add['customer_id']);
     }
     if (isset($add['guest_num'])) {
         $this->db->set('guest_num', $add['guest_num']);
     }
     if (isset($add['reserve_date'])) {
         $this->db->set('reserve_date', mdate('%Y-%m-%d', strtotime($add['reserve_date'])));
     }
     if (isset($add['reserve_time'])) {
         $this->db->set('reserve_time', $add['reserve_time']);
         $this->db->set('date_added', mdate('%Y-%m-%d %H:%i:%s', time()));
         $this->db->set('date_modified', mdate('%Y-%m-%d', time()));
     }
     if (isset($add['occasion_id'])) {
         $this->db->set('occasion_id', $add['occasion_id']);
     }
     if (isset($add['customer_id'])) {
         $this->db->set('customer_id', $add['customer_id']);
     }
     if (isset($add['first_name'])) {
         $this->db->set('first_name', $add['first_name']);
     }
     if (isset($add['last_name'])) {
         $this->db->set('last_name', $add['last_name']);
     }
     if (isset($add['email'])) {
         $this->db->set('email', $add['email']);
     }
     if (isset($add['telephone'])) {
         $this->db->set('telephone', $add['telephone']);
     }
     if (isset($add['comment'])) {
         $this->db->set('comment', $add['comment']);
     }
     if (isset($add['user_agent'])) {
         $this->db->set('user_agent', $add['user_agent']);
     }
     if (isset($add['ip_address'])) {
         $this->db->set('ip_address', $add['ip_address']);
     }
     if (!empty($add)) {
         if ($this->db->insert('reservations')) {
             $reservation_id = $this->db->insert_id();
             if (APPDIR === MAINDIR) {
                 log_activity($add['customer_id'], 'reserved', 'reservations', get_activity_message('activity_reserved_table', array('{customer}', '{link}', '{reservation_id}'), array($add['first_name'] . ' ' . $add['last_name'], admin_url('reservations/edit?id=' . $reservation_id), $reservation_id)));
             }
             $this->load->model('Mail_templates_model');
             $mail_data = $this->getMailData($reservation_id);
             $config_reservation_email = is_array($this->config->item('reservation_email')) ? $this->config->item('reservation_email') : array();
             $notify = '0';
             if ($this->config->item('customer_reserve_email') === '1' or in_array('customer', $config_reservation_email)) {
                 $mail_template = $this->Mail_templates_model->getTemplateData($this->config->item('mail_template_id'), 'reservation');
                 $notify = $this->sendMail($mail_data['email'], $mail_template, $mail_data);
             }
             if ($this->location->getEmail() and ($this->config->item('location_reserve_email') === '1' or in_array('location', $config_reservation_email))) {
                 $mail_template = $this->Mail_templates_model->getTemplateData($this->config->item('mail_template_id'), 'reservation_alert');
                 $this->sendMail($this->location->getEmail(), $mail_template, $mail_data);
             }
             if (in_array('admin', $config_reservation_email)) {
                 $mail_template = $this->Mail_templates_model->getTemplateData($this->config->item('mail_template_id'), 'reservation_alert');
                 $this->sendMail($this->config->item('site_email'), $mail_template, $mail_data);
             }
             $this->db->set('notify', $notify);
             $this->db->set('status', $this->config->item('default_reservation_status'));
             $this->db->where('reservation_id', $reservation_id);
             if ($this->db->update('reservations')) {
                 $this->load->model('Statuses_model');
                 $status = $this->Statuses_model->getStatus($this->config->item('default_reservation_status'));
                 $reserve_history = array('object_id' => $reservation_id, 'status_id' => $status['status_id'], 'notify' => $notify, 'comment' => $status['status_comment'], 'date_added' => mdate('%Y-%m-%d %H:%i:%s', time()));
                 $this->Statuses_model->addStatusHistory('reserve', $reserve_history);
             }
             $query = $reservation_id;
         }
     }
     return $query;
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:88,代码来源:Reservations_model.php

示例9: updateExtension

 public function updateExtension($type = 'module', $name = NULL, $data = array(), $log_activity = TRUE)
 {
     if ($name === NULL) {
         return FALSE;
     }
     $name = url_title(strtolower($name), '-');
     !isset($data['data']) or $data = $data['data'];
     unset($data['save_close']);
     $query = FALSE;
     if ($this->extensionExists($name)) {
         $config = $this->extension->loadConfig($name, FALSE, TRUE);
         $meta = $this->extension->getMeta($name, $config);
         if (isset($meta['type'], $meta['title']) and $type === $meta['type']) {
             $this->db->set('data', is_array($data) ? serialize($data) : $data);
             $this->db->set('serialized', '1');
             $this->db->where('type', $meta['type']);
             $this->db->where('name', $name);
             $query = $this->db->update('extensions');
             if ($log_activity) {
                 log_activity($this->user->getStaffId(), 'updated', 'extensions', get_activity_message('activity_custom_no_link', array('{staff}', '{action}', '{context}', '{item}'), array($this->user->getStaffName(), 'updated', 'extension ' . $meta['type'], $meta['title'])));
             }
         }
     }
     return $query;
 }
开发者ID:allrested,项目名称:TastyIgniter,代码行数:25,代码来源:Extensions_model.php

示例10: _savePermission

 private function _savePermission()
 {
     if ($this->validateForm() === TRUE) {
         $save_type = !is_numeric($this->input->get('id')) ? $this->lang->line('text_added') : $this->lang->line('text_updated');
         if ($permission_id = $this->Permissions_model->savePermission($this->input->get('id'), $this->input->post())) {
             log_activity($this->user->getStaffId(), $save_type, 'permissions', get_activity_message('activity_custom_no_link', array('{staff}', '{action}', '{context}', '{item}'), array($this->user->getStaffName(), $save_type, 'permission', $this->input->post('name'))));
             $this->alert->set('success', sprintf($this->lang->line('alert_success'), 'Permission ' . $save_type));
         } else {
             $this->alert->set('warning', sprintf($this->lang->line('alert_error_nothing'), $save_type));
         }
         return $permission_id;
     }
 }
开发者ID:AKCore,项目名称:TastyIgniter,代码行数:13,代码来源:Permissions.php

示例11: completeOrder

 public function completeOrder($order_id, $order_info, $cart_contents = array())
 {
     if ($order_id and !empty($order_info)) {
         $notify = $this->sendConfirmationMail($order_id);
         $update = array('old_status_id' => '', 'order_status' => !empty($order_info['status_id']) ? (int) $order_info['status_id'] : (int) $this->config->item('default_order_status'), 'notify' => $notify);
         if ($this->updateOrder($order_id, $update)) {
             if (APPDIR === MAINDIR) {
                 log_activity($order_info['customer_id'], 'created', 'orders', get_activity_message('activity_created_order', array('{customer}', '{link}', '{order_id}'), array($order_info['first_name'] . ' ' . $order_info['last_name'], admin_url('orders/edit?id=' . $order_id), $order_id)));
             }
             Events::trigger('after_create_order', array('order_id' => $order_id));
             return TRUE;
         }
     }
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:14,代码来源:Orders_model.php

示例12: completeOrder

 public function completeOrder($order_id, $order_info, $cart_contents)
 {
     if ($order_id and !empty($order_info)) {
         $this->addOrderMenus($order_id, $cart_contents);
         $order_totals = array('cart_total' => array('title' => 'Sub Total', 'value' => isset($cart_contents['cart_total']) ? $cart_contents['cart_total'] : ''), 'order_total' => array('title' => 'Order Total', 'value' => isset($cart_contents['order_total']) ? $cart_contents['order_total'] : ''), 'delivery' => array('title' => 'Delivery', 'value' => isset($cart_contents['delivery']) ? $cart_contents['delivery'] : ''), 'coupon' => array('title' => 'Coupon (' . $cart_contents['coupon']['code'] . ') ', 'value' => $cart_contents['coupon']['discount']));
         if (!empty($cart_contents['taxes'])) {
             $order_totals['taxes'] = array('title' => $cart_contents['taxes']['title'], 'value' => $cart_contents['taxes']['amount']);
         }
         $this->addOrderTotals($order_id, $order_totals);
         if (!empty($cart_contents['coupon'])) {
             $this->addOrderCoupon($order_id, $order_info['customer_id'], $cart_contents['coupon']);
         }
         $notify = $this->sendConfirmationMail($order_id);
         $update = array('old_status_id' => '', 'order_status' => !empty($order_info['status_id']) ? (int) $order_info['status_id'] : (int) $this->config->item('default_order_status'), 'notify' => $notify);
         if ($this->updateOrder($order_id, $update)) {
             if (APPDIR === MAINDIR) {
                 log_activity($order_info['customer_id'], 'created', 'orders', get_activity_message('activity_created_order', array('{customer}', '{link}', '{order_id}'), array($order_info['first_name'] . ' ' . $order_info['last_name'], admin_url('orders/edit?id=' . $order_id), $order_id)));
             }
             return TRUE;
         }
     }
 }
开发者ID:Bepartofyou,项目名称:TastyIgniter,代码行数:22,代码来源:Orders_model.php

示例13: _saveReview

 private function _saveReview()
 {
     if ($this->validateForm() === TRUE) {
         $save_type = !is_numeric($this->input->get('id')) ? $this->lang->line('text_added') : $this->lang->line('text_updated');
         if ($review_id = $this->Reviews_model->saveReview($this->input->get('id'), $this->input->post())) {
             log_activity($this->user->getStaffId(), $save_type, 'reviews', get_activity_message('activity_custom', array('{staff}', '{action}', '{context}', '{link}', '{item}'), array($this->user->getStaffName(), $save_type, 'review', current_url(), $this->input->get('id'))));
             $this->alert->set('success', sprintf($this->lang->line('alert_success'), 'Review ' . $save_type));
         } else {
             $this->alert->set('warning', sprintf($this->lang->line('alert_error_nothing'), $save_type));
         }
         return $review_id;
     }
 }
开发者ID:ududsha,项目名称:TastyIgniter,代码行数:13,代码来源:Reviews.php

示例14: addReservation

 public function addReservation($add = array())
 {
     $query = FALSE;
     if (!empty($add['location_id'])) {
         $this->db->set('location_id', $add['location_id']);
     }
     if (!empty($add['table_id'])) {
         $this->db->set('table_id', $add['table_id']);
     }
     if (!empty($add['customer_id'])) {
         $this->db->set('customer_id', $add['customer_id']);
     }
     if (!empty($add['guest_num'])) {
         $this->db->set('guest_num', $add['guest_num']);
     }
     if (!empty($add['reserve_date'])) {
         $this->db->set('reserve_date', mdate('%Y-%m-%d', strtotime($add['reserve_date'])));
     }
     if (!empty($add['reserve_time'])) {
         $this->db->set('reserve_time', $add['reserve_time']);
         $this->db->set('date_added', mdate('%Y-%m-%d %H:%i:%s', time()));
         $this->db->set('date_modified', mdate('%Y-%m-%d', time()));
     }
     if (!empty($add['occasion_id'])) {
         $this->db->set('occasion_id', $add['occasion_id']);
     }
     if (!empty($add['customer_id'])) {
         $this->db->set('customer_id', $add['customer_id']);
     }
     if (!empty($add['first_name'])) {
         $this->db->set('first_name', $add['first_name']);
     }
     if (!empty($add['last_name'])) {
         $this->db->set('last_name', $add['last_name']);
     }
     if (!empty($add['email'])) {
         $this->db->set('email', $add['email']);
     }
     if (!empty($add['telephone'])) {
         $this->db->set('telephone', $add['telephone']);
     }
     if (!empty($add['comment'])) {
         $this->db->set('comment', $add['comment']);
     }
     if (!empty($add['user_agent'])) {
         $this->db->set('user_agent', $add['user_agent']);
     }
     if (!empty($add['ip_address'])) {
         $this->db->set('ip_address', $add['ip_address']);
     }
     if (!empty($add)) {
         if ($this->db->insert('reservations')) {
             $reservation_id = $this->db->insert_id();
             if (APPDIR === MAINDIR) {
                 log_activity($add['customer_id'], 'reserved', 'reservations', get_activity_message('activity_reserved_table', array('{customer}', '{link}', '{reservation_id}'), array($add['first_name'] . ' ' . $add['last_name'], admin_url('reservations/edit?id=' . $reservation_id), $reservation_id)));
             }
             $notify = $this->_sendMail($reservation_id);
             $this->db->set('notify', $notify);
             $this->db->set('status', $this->config->item('new_reservation_status'));
             $this->db->where('reservation_id', $reservation_id);
             if ($this->db->update('reservations')) {
                 $this->load->model('Statuses_model');
                 $status = $this->Statuses_model->getStatus($this->config->item('new_reservation_status'));
                 $reserve_history = array('object_id' => $reservation_id, 'status_id' => $status['status_id'], 'notify' => $notify, 'comment' => $status['status_comment'], 'date_added' => mdate('%Y-%m-%d %H:%i:%s', time()));
                 $this->Statuses_model->addStatusHistory('reserve', $reserve_history);
             }
             $query = $reservation_id;
         }
     }
     return $query;
 }
开发者ID:labeetotrent,项目名称:latthiya,代码行数:71,代码来源:Reservations_model.php

示例15: _addExtension

 private function _addExtension()
 {
     $this->user->restrict('Admin.Extensions.Add', site_url('extensions/add'));
     if (isset($_FILES['extension_zip'])) {
         if ($this->validateUpload() === TRUE) {
             $message = $this->Extensions_model->extractExtension($_FILES['extension_zip']);
             if ($message === TRUE) {
                 $extension_name = $_FILES['extension_zip']['name'];
                 $config = $this->extension->loadConfig($extension_name, FALSE, TRUE);
                 $extension_title = isset($config['extension_meta']['title']) ? $config['extension_meta']['title'] : '';
                 $extension_type = isset($config['extension_meta']['type']) ? $config['extension_meta']['type'] : '';
                 $alert = "Extension {$extension_title} uploaded ";
                 if ($this->Extensions_model->install($extension_type, $extension_name, $config)) {
                     log_activity($this->user->getStaffId(), 'installed', 'extensions', get_activity_message('activity_custom_no_link', array('{staff}', '{action}', '{context}', '{item}'), array($this->user->getStaffName(), 'installed', $extension_type . ' extension', $extension_title)));
                     $alert .= "and installed ";
                 }
                 $this->alert->set('success', sprintf($this->lang->line('alert_success'), $alert));
                 return TRUE;
             }
             $this->alert->danger_now(sprintf($this->lang->line('alert_error'), $message));
         }
     }
     return FALSE;
 }
开发者ID:Bepartofyou,项目名称:TastyIgniter,代码行数:24,代码来源:Extensions.php


注:本文中的get_activity_message函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。