本文整理汇总了PHP中Alert类的典型用法代码示例。如果您正苦于以下问题:PHP Alert类的具体用法?PHP Alert怎么用?PHP Alert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Alert类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: send
public static function send($id_user, $content)
{
$alert = new Alert();
$alert->id_user = (int) $id_user;
$alert->is_read = 0;
$alert->content = pSQL($content);
$alert->add_date = "";
return $alert->add();
}
开发者ID:yiuked,项目名称:tmcart,代码行数:9,代码来源:Alert.php
示例2: sendMessage
/**
* @brief Envoie un message à un membre
* @param int $idUser ID du membre qui doit recevoir le message
* @param String $msg Message à envoyer
* @return Error Retourne une information
*/
public function sendMessage($idUser, $msg)
{
$privateAlert = new Alert();
$privateAlert->setIdMember($idUser);
$privateAlert->setMessage($msg);
$privateAlert->setTitle('Message de l\'administrateur');
AlertsManager::instance()->add($privateAlert);
return new Error("Votre message a bien été envoyé");
}
开发者ID:AymericFrey,项目名称:ProjetBooking,代码行数:15,代码来源:AdminManager.class.php
示例3: addAlert
public function addAlert()
{
$input = Input::all();
$alert = new Alert();
$alert->value = $input['value'];
$alert->condition = $input['condition'];
$alert->user_id = $input['user'];
$alert->owner_user_id = $input['user'];
$alert->save();
return Redirect::to('/alerts');
}
开发者ID:crudbug,项目名称:Dashboard,代码行数:11,代码来源:AlertsController.php
示例4: index
public function index(){
$alert = DAO::getOne("Alert", "idUser = ".Auth::getUser()->getId());
if ($alert == null){
$alert = new Alert();
$alert->setUser(Auth::getUser());
}
$days = array("Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche");
$this->loadView("alert/vEdit", array('alert' => $alert, "days" => $days));
}
开发者ID:aleboisselier,项目名称:helpdesk,代码行数:11,代码来源:Alerts.php
示例5: testbean_implements
public function testbean_implements()
{
error_reporting(E_ERROR | E_PARSE);
$alert = new Alert();
$this->assertEquals(false, $alert->bean_implements(''));
//test with empty value
$this->assertEquals(false, $alert->bean_implements('test'));
//test with invalid value
$this->assertEquals(true, $alert->bean_implements('ACL'));
//test with valid value
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:11,代码来源:AlertTest.php
示例6: processAlerts
function processAlerts()
{
if (isset($_POST[POST_INTERN_PROCESS_ALERTS . "_va"])) {
$alerts = explode(POST_ACTION_VALUE_SPLITTER, slashesStrip($_POST[POST_INTERN_PROCESS_ALERTS . "_va"]));
$visitors = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_ALERTS . "_vb"]);
$browsers = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_ALERTS . "_vc"]);
foreach ($alerts as $key => $text) {
$alert = new Alert($visitors[$key], $browsers[$key], $alerts[$key]);
$alert->Save();
}
}
}
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:12,代码来源:functions.internal.process.inc.php
示例7: __construct
/**
*
* Contruct that checks you are loged in before nothing else happens!
*/
function __construct(Request $request, Response $response)
{
if (Theme::get('premium') != 1) {
Alert::set(Alert::INFO, __('Upgrade your Open Classifieds site to activate this feature.'));
}
parent::__construct($request, $response);
}
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:11,代码来源:plan.php
示例8: action_status
public function action_status()
{
$status = (bool) $this->request->param('id');
Model_Config::set_value('general', 'cron', $status);
Alert::set(Alert::SUCCESS, __('General Configuration updated'));
$this->redirect(Route::url('oc-panel', array('controller' => 'crontab')));
}
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:7,代码来源:crontab.php
示例9: action_pay
/**
* [action_form] generates the form to pay at paypal
*/
public function action_pay()
{
$this->auto_render = FALSE;
$order_id = $this->request->param('id');
$order = new Model_Order();
$order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
// case when selling advert
if ($order->id_product == Model_Order::PRODUCT_AD_SELL) {
$paypal_account = $order->ad->paypal_account();
$currency = i18n::get_intl_currency_symbol();
if (isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
$order->amount = $order->amount + $order->ad->cf_shipping;
}
} else {
$paypal_account = core::config('payment.paypal_account');
$currency = core::config('payment.paypal_currency');
}
$paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
$paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => $paypal_account, 'paypal_currency' => $currency, 'item_name' => $order->description);
$this->template = View::factory('paypal', $paypal_data);
$this->response->body($this->template->render());
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->redirect(Route::url('default'));
}
}
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:30,代码来源:paypal.php
示例10: action_update
/**
* CRUD controller: UPDATE
*/
public function action_update()
{
$id_role = $this->request->param('id');
//we do not allow modify the admin
if ($id_role == Model_Role::ROLE_ADMIN) {
Alert::set(Alert::WARNING, __('Admin Role can not be modified!'));
$this->redirect(Route::url('oc-panel', array('controller' => 'role')));
}
$this->template->title = __('Update') . ' ' . __($this->_orm_model) . ' ' . $id_role;
$role = new Model_Role($id_role);
if ($this->request->post() and $role->loaded()) {
//delete all the access
DB::delete('access')->where('id_role', '=', $role->id_role)->execute();
//set all the access where post = on
foreach ($_POST as $key => $value) {
if ($value == 'on') {
DB::insert('access', array('id_role', 'access'))->values(array($role->id_role, str_replace('|', '.', $key)))->execute();
}
}
//saving the role params
$role->name = core::post('name');
$role->description = core::post('description');
$role->save();
Alert::set(Alert::SUCCESS, __('Item updated'));
$this->redirect(Route::get($this->_route_name)->uri(array('controller' => Request::current()->controller())));
}
//getting controllers actions
$controllers = Model_Access::list_controllers();
//get all the access this user has
$query = DB::select('access')->from('access')->where('id_role', '=', $id_role)->execute();
$access_in_use = array_keys($query->as_array('access'));
// d(in_array('access_index',$access_in_use));
//d($access_in_use);
return $this->render('oc-panel/pages/role/update', array('role' => $role, 'controllers' => $controllers, 'access_in_use' => $access_in_use));
}
开发者ID:nick-catanchin-ie,项目名称:common,代码行数:38,代码来源:role.php
示例11: action_pay
/**
* [action_form] generates the form to pay at paypal
*/
public function action_pay()
{
$this->auto_render = FALSE;
//sandobx doesnt do the x_receipt_link_url redirect so in sanbbox instead we put the order id
$id_order = Core::config('payment.twocheckout_sandbox') == 1 ? Core::request('x_receipt_link_url') : $this->request->param('id');
//retrieve info for the item in DB
$order = new Model_Order();
$order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
//its a fraud...lets let him know
if ($order->is_fraud() === TRUE) {
Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
$this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'checkout', 'id' => $order->id_order)));
}
if (($order_id = twocheckout::validate_passback($order)) !== FALSE) {
//mark as paid
$order->confirm_payment('2checkout', $order_id, NULL, NULL, NULL, Twocheckout::calculate_fee($order->amount));
//redirect him to his ads
Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
$this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'goal', 'id' => $order->id_order)));
} else {
Alert::set(Alert::INFO, __('Please fill your card details.'));
$this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'checkout', 'id' => $order->id_order)));
}
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->redirect(Route::url('default'));
}
}
开发者ID:Ryanker,项目名称:open-eshop,代码行数:32,代码来源:twocheckout.php
示例12: action_form
/**
* [action_form] generates the form to pay at paypal
*/
public function action_form()
{
$this->auto_render = FALSE;
$order_id = $this->request->param('id');
$order = new Model_Order();
$order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
// dependant on product we have different names
if ($order->id_product == Paypal::to_featured) {
$item_name = __('Advertisement to featured');
} else {
if ($order->id_product == Paypal::to_top) {
$item_name = __('Advertisement to top');
} else {
$item_name = $order->description . __(' category');
}
}
$paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
$paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => core::config('payment.paypal_account'), 'paypal_currency' => core::config('payment.paypal_currency'), 'item_name' => $item_name);
$this->template = View::factory('paypal', $paypal_data);
$this->response->body($this->template->render());
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->request->redirect(Route::url('default'));
}
}
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:29,代码来源:paypal.php
示例13: send
/**
* sends an email using our configs
* @param string/array $to array(array('name'=>'chema','email'=>'chema@'),)
* @param [type] $to_name [description]
* @param [type] $subject [description]
* @param [type] $body [description]
* @param [type] $reply [description]
* @param [type] $replyName [description]
* @param [type] $file [description]
* @return boolean
*/
public static function send($to, $to_name = '', $subject, $body, $reply, $replyName, $file = NULL)
{
require_once Kohana::find_file('vendor', 'php-mailer/phpmailer', 'php');
$body = Text::bb2html($body, TRUE);
//get the template from the html email boilerplate
$body = View::factory('email', array('title' => $subject, 'content' => nl2br($body)))->render();
$mail = new PHPMailer();
$mail->CharSet = Kohana::$charset;
if (core::config('email.smtp_active') == TRUE) {
$mail->IsSMTP();
//SMTP HOST config
if (core::config('email.smtp_host') != "") {
$mail->Host = core::config('email.smtp_host');
// sets custom SMTP server
}
//SMTP PORT config
if (core::config('email.smtp_port') != "") {
$mail->Port = core::config('email.smtp_port');
// set a custom SMTP port
}
//SMTP AUTH config
if (core::config('email.smtp_auth') == TRUE) {
$mail->SMTPAuth = TRUE;
// enable SMTP authentication
$mail->Username = core::config('email.smtp_user');
// SMTP username
$mail->Password = core::config('email.smtp_pass');
// SMTP password
if (core::config('email.smtp_ssl') == TRUE) {
$mail->SMTPSecure = "ssl";
// sets the prefix to the server
}
}
}
$mail->From = core::config('email.notify_email');
$mail->FromName = "no-reply " . core::config('general.site_name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
if ($file !== NULL) {
$mail->AddAttachment($file['tmp_name'], $file['name']);
}
$mail->AddReplyTo($reply, $replyName);
//they answer here
if (is_array($to)) {
foreach ($to as $contact) {
$mail->AddBCC($contact['email'], $contact['name']);
}
} else {
$mail->AddAddress($to, $to_name);
}
$mail->IsHTML(TRUE);
// send as HTML
if (!$mail->Send()) {
//to see if we return a message or a value bolean
Alert::set(Alert::ALERT, "Mailer Error: " . $mail->ErrorInfo);
return FALSE;
} else {
return TRUE;
}
}
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:71,代码来源:email.php
示例14: addUser
function addUser($args)
{
global $dbUsers;
global $Language;
// Check if the username already exist in db.
if (Text::isEmpty($args['username'])) {
Alert::set($Language->g('username-field-is-empty'));
return false;
}
if ($dbUsers->userExists($args['username'])) {
Alert::set($Language->g('username-already-exists'));
return false;
}
// Validate password.
if ($args['password'] != $args['confirm-password'] || Text::isEmpty($args['password'])) {
Alert::set($Language->g('The password and confirmation password do not match'));
return false;
}
// Add the user.
if ($dbUsers->add($args)) {
Alert::set($Language->g('user-has-been-added-successfully'));
return true;
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the account.');
return false;
}
}
开发者ID:roberthchan,项目名称:bludit,代码行数:27,代码来源:add-user.php
示例15: action_index
public function action_index()
{
//template header
$this->template->title = __('Contact Us');
$this->template->meta_description = __('Contact') . ' ' . core::config('general.site_name');
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Contact Us')));
if ($this->request->post()) {
//captcha check
if (captcha::check('contact')) {
//check if user is loged in
if (Auth::instance()->logged_in()) {
$email_from = Auth::instance()->get_user()->email;
$name_from = Auth::instance()->get_user()->name;
} else {
$email_from = core::post('email');
$name_from = core::post('name');
}
//akismet spam filter
if (!core::akismet($name_from, $email_from, core::post('message'))) {
$replace = array('[EMAIL.BODY]' => core::post('message'), '[EMAIL.SENDER]' => $name_from, '[EMAIL.FROM]' => $email_from);
if (Email::content(core::config('email.notify_email'), core::config('general.site_name'), $email_from, $name_from, 'contact-admin', $replace)) {
Alert::set(Alert::SUCCESS, __('Your message has been sent'));
} else {
Alert::set(Alert::ERROR, __('Message not sent'));
}
} else {
Alert::set(Alert::WARNING, __('This email has been considered as spam! We are sorry but we can not send this email.'));
}
} else {
Alert::set(Alert::ERROR, __('Wrong captcha'));
}
}
$this->template->content = View::factory('pages/contact');
}
开发者ID:Ryanker,项目名称:open-eshop,代码行数:35,代码来源:contact.php
示例16: initializeAlerts
/**
* initializeAlerts - initialize alert object
*
*/
public function initializeAlerts()
{
if (isset(self::$alertDataArray)) {
unset(self::$alertDataArray);
}
self::$alertDataArray = array();
}
开发者ID:javinc,项目名称:loadavg,代码行数:11,代码来源:class.Alert.php
示例17: init
/**
* 初始化
*/
public function init()
{
parent::init();
$this->topic = new TopicModel();
$this->referer = isset($_SERVER["HTTP_REFERER"]) ? str_replace('http://' . $_SERVER['HTTP_HOST'], '', $_SERVER["HTTP_REFERER"]) : '/admin/index/index';
//设置白名单(在白名单内不需要tid,否则需要提供tid
//这样可以避免在专题相关的控制器和方法中再次判断 用户对专题权限
$url_arr = array("/admin/topic/index", "/admin/topic/index/", "/admin/topicdata/index", "/admin/topicdata/index/", "/admin/topic/add/", "/admin/topic/add", "/admin/topicdata/trashindex", "/admin/topicdata/trashindex/");
if (!in_array($_SERVER['REQUEST_URI'], $url_arr)) {
$tid = $this->getRequest()->getQuery("tid");
//如果不存在tid 非法请求
if (!$tid) {
Alert::danger("非法请求");
Yaf_Controller_Abstract::redirect("/admin/topic/index/");
exit;
}
//根据tid查询当前用户是否是管理员或者是该专题的所有者,如果不是则提示权限不足
if (!$this->checkrole($tid)) {
Alert::danger("权限不足");
Yaf_Controller_Abstract::redirect("/admin/topic/index/");
exit;
}
}
//判断是否是管理员 并赋值给模板
$this->getView()->assign("is_admin", $this->is_admin());
}
开发者ID:290329416,项目名称:guahao,代码行数:29,代码来源:Topicbase.php
示例18: action_update
/**
* Update new forum
*/
public function action_update()
{
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Edit Topic')));
$topic = new Model_Topic($this->request->param('id'));
$get_all = Model_Forum::get_all();
//get all forums to build forum parents in select
$forum_parents = array();
foreach ($get_all[0] as $parent) {
$forum_parents[$parent['id']] = $parent['name'];
}
$this->template->content = View::factory('oc-panel/pages/forum/topic', array('topic' => $topic, 'forum_parents' => $forum_parents));
if ($_POST) {
$topic->title = core::post('title');
$topic->id_forum = core::post('id_forum');
$topic->description = core::post('description');
if (core::post('seotitle') != $topic->seotitle) {
$topic->seotitle = $topic->gen_seotitle(core::post('seotitle'));
}
if (core::post('status') == 'on') {
$topic->status = 1;
} else {
$topic->status = 0;
}
try {
$topic->save();
Alert::set(Alert::SUCCESS, __('Topic is updated.'));
} catch (Exception $e) {
Alert::set(Alert::ERROR, $e->getMessage());
}
HTTP::redirect(Route::url('oc-panel', array('controller' => 'topic', 'action' => 'index')));
}
}
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:35,代码来源:topic.php
示例19: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate($id)
{
LoginForm::checkLogin();
$this->pageTitle = "Create Maternal Health Record";
if (!Patient::model()->findByPk($id)) {
Alert::alertMessage('danger', 'Patient does not exist.');
Yii::app()->getController()->redirect(array('patient/index'));
}
if (MaternalHealth::model()->findByAttributes(array('patient_id' => $id))) {
Alert::alertMessage('danger', 'Maternal Health Record for this patient already exists.');
Yii::app()->getController()->redirect(array('patient/view', 'id' => $id));
}
$model = new MaternalHealth();
$patient_model = Patient::model()->findByPk($id);
$model->patient_id = $patient_model->id;
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if (isset($_POST['MaternalHealth'])) {
$model->attributes = $_POST['MaternalHealth'];
if (isset($_POST['MaternalHealth']['checklist']) && $_POST['MaternalHealth']['checklist'] !== "") {
$model->checklist = implode(';', $_POST['MaternalHealth']['checklist']);
}
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
if (isset($model->checklist) && $model->checklist !== '') {
$model->checklist = explode(';', $model->checklist);
}
$this->render('create', array('model' => $model, 'patient_model' => $patient_model));
}
开发者ID:rlaput,项目名称:integrated-municipality-management-system,代码行数:35,代码来源:MaternalhealthController.php
示例20: action_result
public function action_result()
{
$this->auto_render = FALSE;
$id_order = Core::request('id_order');
//retrieve info for the item in DB
$order = new Model_Order();
$order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
//its a fraud...lets let him know
if ($order->is_fraud() === TRUE) {
Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
//correct payment?
if (($result = paguelofacil::check_result()) === TRUE) {
//mark as paid
$order->confirm_payment('paguelofacil', Core::request('Oper'));
//redirect him to his ads
Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
$this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
} else {
Alert::set(Alert::INFO, __('Transaction not successful!'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
}
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:29,代码来源:paguelofacil.php
注:本文中的Alert类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论