當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Messages::addMessage方法代碼示例

本文整理匯總了PHP中Messages::addMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Messages::addMessage方法的具體用法?PHP Messages::addMessage怎麽用?PHP Messages::addMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Messages的用法示例。


在下文中一共展示了Messages::addMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display

 public function display()
 {
     if (Session::get('isLoggedIn')) {
         $user_name = $this->params->values('username');
         $user_password = $this->params->values('password');
         return $user_name;
         echo $user_name;
         echo json_encode($user_name);
         echo json_encode($user_pass);
         return $user_pass;
         echo $user_pass;
         //$imp = implode($user_password);
         $imp = implode($user_password);
         $encrypt = md5($imp);
         $exp = explode(" ", $encrypt);
         $usr = $this->userManager->getUserProfile($user_name, $user_password);
         //echo $user_password . " " . $user_name;
         echo json_encode($usr);
         return $this;
     } else {
         Messages::addMessage("warning", "'user_name' and/or 'password' parameters missing.");
         return null;
         return $usr;
     }
 }
開發者ID:VHughes,項目名稱:Flower2Go,代碼行數:25,代碼來源:UserProfileAction.php

示例2: login

 public function login()
 {
     if (Session::get('isLoggedIn')) {
         Messages::addMessage("info", "You are already logged in.");
         return null;
     } else {
         $user_name = $this->params->getValue('username');
         $user_password = $this->params->getValue('password');
         if ($user_name != null && $user_password != null) {
             $usr = $this->userManager->findUser($user_name, $user_password);
             //echo $usr;
             if ($usr != null) {
                 return $usr;
                 Messages::addMessage("info", "You're already logged in");
             } else {
                 Messages::addMessage("info", "Log in user and/or password incorrect.");
                 return null;
             }
         } else {
             Messages::addMessage("warning", "'user_name' and/or 'password' parameters missing.");
             return null;
             //return $usr;
         }
     }
 }
開發者ID:VHughes,項目名稱:Flower2Go,代碼行數:25,代碼來源:UserLoginAction.php

示例3: customerCheckout

 public function customerCheckout()
 {
     if (Session::get('isLoggedIn')) {
         Messages::addMessage("warning", "Not customer");
         return;
     } else {
         $response = array();
         // params have to be there
         //$user_name = $this->params->getValue('user_name');
         $custFirstName = $this->params->getValue('firstname');
         $custLastName = $this->params->getValue('lastname');
         $custPhone = $this->params->getValue('phone');
         $custEmail = $this->params->getValue('email');
         $custAddress = $this->params->getValue('address');
         $custCity = $this->params->getValue('city');
         $cartID = $_SESSION['cart_id'];
         if ($custFirstName != null && $custLastName != null && $custPhone != null && $custEmail != null && $custAddress != null && $custCity != null && $cartID != null) {
             //if($custFirstName != null) {
             $cust = $this->userManager->createCustomer($custFirstName, $custLastName, $custPhone, $custEmail, $custAddress, $custCity, $cartID);
             return $cust;
         } else {
             Messages::addMessage("warning", " parameters missing.");
             return null;
         }
     }
 }
開發者ID:osanna-hui,項目名稱:tavola_italiana,代碼行數:26,代碼來源:customerCheckoutAction.php

示例4: register

 public function register()
 {
     $response = array();
     // params have to be there
     $usr = $this->params->getValue('username');
     $pwd = $this->params->getValue('password');
     $encrypt = md5($pwd);
     $fname = $this->params->getValue('firstname');
     $lname = $this->params->getValue('lastname');
     $email = $this->params->getValue('email');
     echo $usr . " " . $pwd . " " . $fname . " " . $lname . " " . $email . " " . $encrypt;
     if ($usr != null && $pwd != null && $fname != null && $lname != null && $email != null) {
         // check if user name and password are correct
         $user = $this->userManager->addUser($fname, $lname, $usr, $encrypt, $email);
         if ($user != null) {
             // log user in
             Session::set("username", $user['username']);
             Session::set("id", $user['ID']);
             Session::set("isLoggedIn", true);
             return $user;
             return $user['ID'];
             return $encrypt;
             //return $response;
         } else {
             Messages::addMessage("warning", "'user_name' and/or 'password' parameters missing.");
             return null;
             return $usr;
         }
     }
 }
開發者ID:VHughes,項目名稱:Flower2Go,代碼行數:30,代碼來源:NewUserAction.php

示例5: login

 public function login()
 {
     if (Session::get('isLoggedIn')) {
         Messages::addMessage("info", "You are already logged in.");
         return;
     } else {
         $response = array();
         // params have to be there
         $user_name = $this->params->getValue('user_name');
         $user_password = $this->params->getValue('password');
         if ($user_name != null && $user_password != null) {
             // check if user name and password are correct
             $usr = $this->userManager->findUser($user_name, $user_password);
             if ($usr != null) {
                 // log user in
                 Session::set("user_name", $usr['user_name']);
                 Session::set("id", $usr['ID']);
                 Session::set("isLoggedIn", true);
                 return $usr;
             } else {
                 Messages::addMessage("info", "Log in user and/or password incorrect.");
                 return null;
             }
         } else {
             Messages::addMessage("warning", "'user_name' and/or 'password' parameters missing.");
             return null;
         }
     }
 }
開發者ID:AlinaQ,項目名稱:3D_products,代碼行數:29,代碼來源:UserLoginAction.php

示例6: logout

 public function logout()
 {
     if (Session::get('isLoggedIn')) {
         Session::closeSession();
         Messages::addMessage("info", "Successfully logged out.");
         return true;
     } else {
         Messages::addMessage("warning", "'isLoggedIn' parameter not found.");
         return false;
     }
 }
開發者ID:VHughes,項目名稱:Flower2Go,代碼行數:11,代碼來源:UserLogoutAction.php

示例7: updateProducts

 public function updateProducts()
 {
     $response = array();
     $sku = $this->params->getValue('sku');
     $desc = $this->params->getValue('desc');
     $price = $this->params->getValue('price');
     $qty = $this->params->getValue('qty');
     if ($sku != null && $desc != null && $price != null && $qty != null) {
         $product = $this->ProductManager->updateProducts($sku, $desc, $price, $qty);
         return $product;
     } else {
         Messages::addMessage("warning", "parameters missing.");
         return null;
     }
 }
開發者ID:osanna-hui,項目名稱:tavola_italiana,代碼行數:15,代碼來源:updateProductsAction.php

示例8: __construct

 /**
  * @param string $host
  * @param string $username
  * @param string $password
  * @param string $db
  * @param int $port
  */
 public function __construct()
 {
     if (!isset($port)) {
         $port = ini_get('mysqli.default_port');
     }
     if (file_exists("config.php")) {
         include "config.php";
     } else {
         Messages::addMessage("Config file does not exist", Messages::ERRO);
         return;
     }
     $this->_mysqli = new mysqli($db['db_host'], $db['db_user'], $db['db_pass'], $db['db_base'], $port);
     $this->_mysqli->set_charset('utf8');
     self::$_instance = $this;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:22,代碼來源:Database.php

示例9: getProfile

 public function getProfile()
 {
     if (isset($_POST['method'])) {
         $profile = $this->userManager->getUserProfile();
         if ($profile != null) {
             return $profile;
         } else {
             Messages::addMessage("info", "No user of that name.");
             return null;
         }
     } else {
     }
     // otherwise
     return null;
 }
開發者ID:VHughes,項目名稱:Flower2Go,代碼行數:15,代碼來源:ShowUserProfileAction.php

示例10: getProfile

 public function getProfile()
 {
     if (Session::get('isLoggedIn') && Session::get('user_name')) {
         $profile = $this->userManager->getUserProfile(Session::get('user_name'));
         if ($profile != null) {
             // found a user by that name
             return $profile;
         } else {
             // this shouldn't happen since this is not a log in - this is a
             // profile request. Would be good to report this here as well
             // in a log file
             Messages::addMessage("info", "No user of that name.");
             return null;
         }
     } else {
         // most likely session timed out.
     }
     // otherwise
     return null;
 }
開發者ID:osanna-hui,項目名稱:tavola_italiana,代碼行數:20,代碼來源:ShowUserProfileAction.php

示例11: logout

 public function logout()
 {
     if (Session::get('isLoggedIn')) {
         Session::closeSession();
         Messages::addMessage("info", "Successfully logged out.");
         return true;
         /*
                     $profile = $this->userManager->getUserProfile(Session::get('user_name'));
         
                     if($profile != null) {
                         // log user out
                         Session::closeSession();
                         return true;
         
                     } else {
                         Messages::addMessage("warning", "No user of that name. Logout not performed.");
                     }
         */
     } else {
         Messages::addMessage("warning", "'isLoggedIn' parameter not found.");
         return false;
     }
 }
開發者ID:ShaeS,項目名稱:Pine-Birch,代碼行數:23,代碼來源:UserLogoutAction.php

示例12: getTransactionID

 public function getTransactionID($sql)
 {
     try {
         if ($this->conn != null) {
             $this->conn->beginTransaction();
             $this->conn->exec($sql);
             // the id of the last inserted row into a table
             $lastID = $this->conn->lastInsertId();
             $this->conn->commit();
             return $lastID;
         } else {
             // connection failed, add that to the messages
             Messages::addMessage("error", "DBConnector 'getTransactionID' failure, PDO Connection was null.");
             return -1;
         }
         return -1;
     } catch (PDOException $e) {
         $this->conn->rollBack();
         Messages::addMessage("error", "DBConnector 'getTransactionID' failure, " . $e->getMessage());
     }
 }
開發者ID:keithchen112,項目名稱:PHOTO4130,代碼行數:21,代碼來源:connection.php

示例13: processAction

 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $isp = Shineisp_Registry::get('ISP');
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index');
     }
     // Get our form and validate it
     $form = $this->getForm('/admin/orders/process');
     if (!$form->isValid($request->getPost())) {
         // Invalid entries
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Order process");
         $this->view->description = $this->translator->translate("Check the information posted and then click on the save button.");
         return $this->_helper->viewRenderer('applicantform');
         // re-render the login form
     }
     // Get the values posted
     $params = $form->getValues();
     // Get the id
     $id = $this->getRequest()->getParam('order_id');
     // Save the message note
     if (!empty($params['note'])) {
         // If the order is commentable then go on
         if (Orders::IsCommentable($id)) {
             $order = Orders::getAllInfo($id, null, true);
             $link = Fastlinks::findlinks($id, $this->customer['customer_id'], 'orders');
             if (!empty($link[0]['code'])) {
                 $code = $link[0]['code'];
             } else {
                 $code = Fastlinks::CreateFastlink('orders', 'edit', json_encode(array('id' => $id)), 'orders', $id, $this->customer['customer_id']);
             }
             // Save the message in the database
             Messages::addMessage($params['note'], $this->customer['customer_id'], null, $id);
             $in_reply_to = md5($id);
             $placeholder['messagetype'] = $this->translator->translate('Order');
             $placeholders['subject'] = sprintf("%03s", $id) . " - " . Shineisp_Commons_Utilities::formatDateOut($order[0]['order_date']);
             $placeholders['fullname'] = $this->customer['firstname'] . " " . $this->customer['lastname'];
             $placeholders['orderid'] = $placeholders['subject'];
             $placeholders['conditions'] = Settings::findbyParam('conditions');
             $placeholders['url'] = "http://" . $_SERVER['HTTP_HOST'] . "/index/link/id/" . $code;
             // Send a message to the customer
             Shineisp_Commons_Utilities::sendEmailTemplate($order[0]['Customers']['email'], 'order_message', $placeholders, $in_reply_to, null, null, $isp, $order[0]['Customers']['language_id']);
             $placeholders['url'] = "http://" . $_SERVER['HTTP_HOST'] . "/admin/login/link/id/{$code}/keypass/" . Shineisp_Commons_Hasher::hash_string($isp->email);
             $placeholders['message'] = $params['note'];
             // Send a message to the administrator
             Shineisp_Commons_Utilities::sendEmailTemplate($isp->email, 'order_message_admin', $placeholders, $in_reply_to);
         }
     }
     $this->_helper->redirector('index', 'orders', 'default', array('mex' => 'The requested task has been completed successfully', 'status' => 'success'));
 }
開發者ID:kokkez,項目名稱:shineisp,代碼行數:57,代碼來源:OrdersController.php

示例14: processAction

 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index');
     }
     // Get our form and validate it
     $form = $this->getForm('/admin/service/process');
     if (!$form->isValid($request->getPost())) {
         // Invalid entries
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Service");
         $this->view->description = $this->translator->translate("Check all the fields and click on the save button");
         return $this->_helper->viewRenderer('customform');
         // re-render the login form
     }
     // Get the values posted
     $params = $form->getValues();
     // Get the id
     $id = $this->getRequest()->getParam('detail_id');
     if (is_numeric($id)) {
         OrdersItems::setAutorenew($id, $params['autorenew']);
     }
     // Save the message note
     if (!empty($params['message'])) {
         Messages::addMessage($params['message'], $this->customer['customer_id'], null, null, $id);
         $isp = Shineisp_Registry::get('ISP');
         $placeholder['fullname'] = $this->customer['firstname'] . " " . $this->customer['lastname'];
         $placeholder['messagetype'] = $this->translator->translate('Order Details');
         $placeholder['message'] = $params['message'];
         Messages::sendMessage("message_new", $this->customer['email'], $placeholder);
         Messages::sendMessage("message_admin", $isp->email, $placeholder);
     }
     $this->_helper->redirector('edit', 'services', 'default', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
 }
開發者ID:kokkez,項目名稱:shineisp,代碼行數:41,代碼來源:ServicesController.php

示例15: query

 public function query($sql, $params = array())
 {
     try {
         if ($this->conn != null) {
             $statement = $this->conn->prepare($sql);
             $statement->execute($params);
             $rows = $statement->fetchAll(PDO::FETCH_ASSOC);
             return $rows;
         } else {
             // connection failed, add that to the messages
             Messages::addMessage("error", "DBConnector 'query' failure, PDO Connection was null.");
         }
         return array();
     } catch (PDOException $e) {
         Messages::addMessage("error", "DBConnector 'query' failure, " . $e->getMessage());
     }
 }
開發者ID:trinity546,項目名稱:ant_website,代碼行數:17,代碼來源:DBConnector.php


注:本文中的Messages::addMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。