本文整理汇总了PHP中createMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP createMessage函数的具体用法?PHP createMessage怎么用?PHP createMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
$data = array();
if (!empty($_GET['dest'])) {
$redirect = base64_decode($_GET['dest']);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (!isset($_GET['dest'])) {
$redirect = $this->createUrl('index/index');
}
$email = formPostParams('email', VARIABLE_STRING);
$password = formPostParams('password', VARIABLE_STRING);
$condition = array(':email' => $email, ':password' => md5($password));
$query = "SELECT * FROM {{" . $this->_table . "}} WHERE email = :email AND password = :password";
$user = $this->db->createCommand($query)->bindValues($condition)->queryRow();
if (!empty($user)) {
Yii::app()->session['user'] = $user;
$this->redirect($redirect);
} else {
createMessage('Email hoặc mật khẩu không đúng', 'danger');
}
} else {
$user = Yii::app()->session['user'];
if (!empty($user)) {
$this->redirect($redirect);
}
}
$this->renderPartial('index', array('data' => $data));
}
示例2: actionPassword
public function actionPassword()
{
$data = array();
$form = new ChangePasswordForm();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$form->attributes = $_POST['ChangePasswordForm'];
if ($form->validate()) {
$uid = Yii::app()->session['user']['id'];
$query = "UPDATE {{users}} SET password = :password WHERE id = " . $uid;
$this->db->createCommand($query)->bindValues(array(':password' => md5($form->password)))->execute();
Yii::app()->session['user']['password'] = md5($form->password);
createMessage('Thay đổi mật khẩu thành công');
$this->redirect($this->createUrl('password'));
}
}
$data['form'] = $form;
$this->render('password', array('data' => $data));
}
示例3: start
function start()
{
if (!empty($_POST)) {
if (isset($_POST['_method']) && $_POST['_method'] === 'delete') {
removeUser($_POST['id']);
$flashMessage = flash('L\'utilisateur a bien été supprimé');
} elseif (isset($_POST['content'])) {
createMessage($_POST);
$flashMessage = flash('Le message a bien été ajouté !');
return go2page('user', $_POST['user_id']);
} elseif (!isset($_POST['id'])) {
createUser($_POST);
$flashMessage = flash('L\'utilisateur a été créé avec succès');
} else {
editUser($_POST);
$flashMessage = flash('L\'utilisateur a bien été modifié !');
}
return go2page('list');
}
if (!isset($_GET['id']) && !isset($_GET['page'])) {
return go2page('list');
}
if (isset($_GET['page']) && $_GET['page'] === 'add') {
require '../views/add.php';
return;
}
if (isset($_GET['page']) && $_GET['page'] === 'edit') {
if (!isset($_GET['id'])) {
die('veuillez spécifier un id d\'utilisateur');
}
$id = $_GET['id'];
$editable = ORM::for_table('users')->find_one($id);
require '../views/edit.php';
return;
}
$id = $_GET['id'];
return go2page('user', $id);
}
示例4: actionAdd
public function actionAdd()
{
$data = array();
$form = new AddAdsForm();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$form->setAttributes($_POST['AddAdsForm']);
if ($form->validate()) {
$start_time = 0;
$end_time = 0;
if ($form->campaign_type == 1) {
$start_time = $form->start_time;
$arr = explode('/', $start_time);
$arr = array_reverse($arr);
$date = implode('/', $arr) . ' 00:00:00';
$start_time = strtotime($date);
} else {
$arrDate = explode(' - ', $form->range_time);
$start_time = $arrDate[0];
$arr = explode('/', $start_time);
$arr = array_reverse($arr);
$date = implode('/', $arr) . ' 00:00:00';
$start_time = strtotime($date);
$start_time2 = $arrDate[1];
$arr = explode('/', $start_time2);
$arr = array_reverse($arr);
$date = implode('/', $arr) . ' 00:00:00';
$end_time = strtotime($date);
}
$image = $this->saveAppIcon($form->image);
$values = array('uid' => $this->user['id'], 'bundle_id' => trim($form->bundle_id), 'apple_id' => trim($form->apple_id), 'app_name' => trim($form->app_name), 'image' => $image, 'os' => intval($form->os), 'install_number' => intval($form->install_number), 'url_post_back' => trim($form->url_post_back), 'campaign_type' => intval($form->campaign_type), 'start_time' => $start_time, 'end_time' => $end_time);
yii_insert_row($this->_table, $values);
createMessage('Tạo quảng cáo thành công, quảng cáo của bạn sẽ được Admin duyệt trong vòng 24h');
$this->redirect($this->createUrl('index'));
}
}
$data['form'] = $form;
$this->render('add', array('data' => $data));
}
示例5: actionEdit
public function actionEdit()
{
$data = array();
$id = urlGETParams('id', VARIABLE_NUMBER);
$query = "SELECT * FROM tbl_category WHERE id = " . $id;
$row = $this->db->createCommand($query)->queryRow();
if (empty($row)) {
$this->redirect($this->createUrl('index'));
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
//`parent_id`, `name`, `alias`, `meta_keywords`, `meta_description`, `meta_title`, `status`
$params = array('parent_id' => formPostParams('parent_id', VARIABLE_NUMBER), 'name' => formPostParams('name'), 'alias' => change_url_seo(formPostParams('name')), 'meta_keywords' => formPostParams('meta_keywords'), 'meta_description' => formPostParams('meta_description'), 'meta_title' => formPostParams('meta_title'), 'status' => formPostParams('status', VARIABLE_NUMBER), 'is_feature' => formPostParams('is_feature', VARIABLE_NUMBER), 'weight' => formPostParams('weight', VARIABLE_NUMBER), 'cnet_url' => formPostParams('cnet_url'), 'techcrunch_url' => formPostParams('techcrunch_url'), 'wpcentral_url' => formPostParams('wpcentral_url'), 'android_center_url' => formPostParams('android_center_url'));
yii_update_row($this->_table, $params, 'id = ' . $id);
createMessage('Sửa danh mục thành công');
$this->redirect($this->createUrl('index'));
}
$query = "SELECT id, name FROM tbl_category WHERE parent_id = 0";
$result = $this->db->createCommand($query)->queryAll();
foreach ($result as $item) {
$data['category'][$item['id']] = $item['name'];
}
$data['row'] = $row;
$this->render('add', array('data' => $data));
}
示例6: mysql_fetch_assoc
$errors[] = 'Please provide the <i>' . $field['name'] . '</i>.';
}
}
if (count($errors) == 0) {
$user = mysql_fetch_assoc($db->query("select * from users where email = '" . mysql_real_escape_string($_POST['email']) . "'"));
if ($user['id'] == '') {
$errors[] = 'No user having this email address could be found.';
}
}
if (count($errors) == 0) {
$password = substr(md5(microtime()), 0, 10);
$db->query("update users set password = '" . mysql_real_escape_string(crypt($password)) . "' where id = '" . $user['id'] . "'");
@mail($user['email'], $config['projectName'] . ': Your new password', "Hi,\n\na new password has been requested for your account on " . $config['projectName'] . ". Please use the following credentials to log in (the password can be changed in your profile settings).\n" . $config['projectURL'] . "\\users\\login.html\nE-Mail: " . $user['email'] . "\nPassword: " . $password, 'Content-Type: text/plain\\n');
$message = createMessage('Your new password has been successfully sent via email.', 'confirm');
} else {
$message = createMessage(implode('<br />', $errors));
}
}
?>
<h2>Recover Password</h2>
<?php
echo $message;
?>
<form action="" method="post">
<?php
foreach ($fields as $key => $field) {
?>
<div class="row">
<label for="setting_<?php
echo $key;
?>
示例7: simpleReceiveEnvelopeAndGiveReceipt
function simpleReceiveEnvelopeAndGiveReceipt($envelope, $password)
{
$message = getMessageFromEnvelope($envelope);
$messageName = getMessageNameFromMessage($message);
$authorName = getAuthorNameFromMessage($message);
$messageHeader = array();
$messageHeader['messageName'] = $messageName;
$messageHeader['authorName'] = $authorName;
$messageBody = getMessageBodyFromMessage($message);
$signature = getSignatureFromMessage($message);
$signatureCheckStatus = checkMessageSignature($password, $messageBody['body'], $signature);
if (!$signatureCheckStatus) {
$exchangeStatus = 'EXCHANGE_FAILED';
$exchangeReceipt = createExchangeReceipt($signatureCheckStatus, $exchangeStatus, null, null);
$messageBody['body'] = writeExchangeReceipt($exchangeReceipt);
$message = createMessage($messageHeader, $messageBody);
return putMessageIntoEnvelope($message, $messageHeader);
}
$exchangeReceipt = receiveMessageAndGiveReceipt($messageHeader, $messageBody);
$messageBody['body'] = writeExchangeReceipt($exchangeReceipt);
$message = createMessage($messageHeader, $messageBody);
return putMessageIntoEnvelope($message, $messageHeader);
}
示例8: createMessage
<?php
/**
* This file wil create a new message.
*/
include_once '../templates/header.php';
include_once '../templates/navbarMessages.php';
include_once '../includes/message.functions.php';
if (@$_GET['action'] == "Opslaan") {
createMessage();
} else {
?>
<div id="container" class="container">
<div class="col-md-8 col-md-offset-2">
<form name="add" action="<?php
echo $_SERVER['PHP_SELF'];
?>
" action="save" method="GET">
<div class="form-group">
<label for="title">Title</label>
<input name="title"type="text" class="form-control" id="title" placeholder="title" required="required">
</div>
<div class="form-group">
<label for="content">Content</label>
<textarea name="content" rows="12" id="content" class="form-control" placeholder="content..." required="required"></textarea>
</div>
<button type="submit" name="action" value="Opslaan" class="btn btn-primary pull-right">SAVE</button>
</form>
</div>
</div>
<?php
示例9: headerAndSearchCode
echo $message;
}
}
?>
<!DOCTYPE html>
<html lang = "en">
<head>
<title>Prompt</title>
<link rel = "stylesheet" href = "css/main.css">
<link rel = "stylesheet" href = "css/prompt.css">
</head>
<body>
<div id = "wrapper">
<?php
headerAndSearchCode();
?>
<div id = "outer">
<div id = "inner">
<?php
createMessage($x);
?>
</div>
</div>
<?php
footerCode();
?>
</div>
</body>
</html>
示例10: createMessage
<a id="image_<?php
echo $row['id'];
?>
" href="photoView.html?id=<?php
echo $row['id'];
?>
" data-id="<?php
echo $row['id'];
?>
" class="draggablePhoto ui-draggable ui-draggable-handle" style="position: relative;"><div title="<?php
echo $row['filename'];
?>
.<?php
echo $row['extension'];
?>
" class="thumbnail"><span class="center_img"></span><img src="image.html?id=<?php
echo $row['id'];
?>
&max_size=100"></div></a>
<?php
$i++;
}
if ($i == 0) {
echo '<br /><br />' . createMessage('No images could be found matching your request.');
}
}
}
}
if (!$phpunit['isTest']) {
die;
}
示例11: addAlert
addAlert("danger", lang("ACCESS_DENIED"));
if (isset($_POST['ajaxMode']) and $_POST['ajaxMode'] == "true") {
echo json_encode(array("errors" => 1, "successes" => 0));
} else {
header('Location: ../pm.php');
}
exit;
}
if (isset($msg_id) && $msg_id >= 1) {
$parent_id = $msg_id;
} else {
$parent_id = NULL;
}
// Call the function to create a message with the required data
if ($isreply = '0' or '1') {
if (!createMessage($sender_id, $receiver_id, $title, $message, $parent_id)) {
echo json_encode(array("errors" => 1, "successes" => 0));
exit;
}
} else {
addAlert("danger", "some bad data here");
echo json_encode(array("errors" => 1, "successes" => 0));
exit;
}
restore_error_handler();
if (isset($_POST['ajaxMode']) and $_POST['ajaxMode'] == "true") {
echo json_encode(array("errors" => 0, "successes" => 1));
} else {
header('Location: ' . getReferralPage());
exit;
}
示例12: dirname
if ($currentUser['id'] == '') {
$_POST['redirect'] = $_SERVER['REQUEST_URI'];
include dirname(__FILE__) . '/../users/login.php';
} else {
include_once dirname(__FILE__) . '/albumFunctions.php';
$site['title'] = 'Delete photo';
$imageId = $_GET['id'];
$accessDenied = false;
$select_sql_string = 'SELECT * FROM images WHERE id=' . $imageId;
$result = $db->query($select_sql_string);
$row = mysql_fetch_array($result);
$error = false;
if (!empty($row)) {
if ($row['ownerId'] != $currentUser['id']) {
$message = createMessage("Access denied");
$error = true;
http_response_code(401);
$accessDenied = true;
} else {
$select_sql_string = 'SELECT albums.id, albums.name FROM imagesToAlbums, albums WHERE imagesToAlbums.imageId=' . mysql_real_escape_string($imageId) . ' AND imagesToAlbums.albumId=albums.id';
$result = $db->query($select_sql_string);
if (isset($_POST["Delete"])) {
$albums = $_POST['album'];
if (!empty($albums)) {
foreach ($albums as $albumId) {
$query_for_album = "SELECT parentAlbumId, id, ownerId, name FROM albums WHERE id='" . mysql_real_escape_string($albumId) . "'";
$album_data = mysql_fetch_array($db->query($query_for_album));
if (!empty($album_data)) {
if ($album_data['ownerId'] == $currentUser['id']) {
$delete_sql_string = 'DELETE FROM imagesToAlbums WHERE albumId="' . mysql_real_escape_string($albumId) . '" AND imageId ="' . $imageId . '"';
示例13: actionEdit
public function actionEdit()
{
$data = array();
$id = urlGETParams('id', VARIABLE_NUMBER);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$remove_gallery = intval($_POST['remove_gallery']);
$params = $_POST;
unset($params['remove_gallery']);
if ($remove_gallery == 1) {
$params['gallery'] = '';
}
if (!empty($params['tags'])) {
$tags = explode(', ', $params['tags']);
trim_array($tags);
$params['tags'] = json_encode($tags);
}
$params['have_video'] = intval($_POST['have_video']);
yii_update_row('archive', $params, 'id = ' . $id);
createMessage('Cập nhật thành công');
$this->redirect($this->createUrl('index'));
}
$data['category'] = $this->getCategory(true);
$query = "SELECT * FROM tbl_archive WHERE id = " . $id;
$data['row'] = $this->db->createCommand($query)->queryRow();
$this->render('edit', array('data' => $data));
}
示例14: array
include_once 'inc/class.simple_mail.php';
include_once 'inc/gump.class.php';
require_once 'inc/MCAPI.class.php';
include_once 'mail-config.php';
// Check Data
$isValid = GUMP::is_valid($_POST, array('newsletter-email' => 'required|valid_email'));
if ($mailchimpSupport === true) {
$mailchimpResult = sendMailchimp($_POST);
} else {
$mailchimpResult = true;
}
if ($isValid === true && $mailchimpResult === true) {
// Submit Mail
$mail = new SimpleMail();
$mail->setTo(YOUR_EMAIL_ADDRESS, YOUR_COMPANY_NAME)->setSubject('New newsletter subscription')->setFrom(htmlspecialchars($_POST['newsletter-email']), htmlspecialchars($_POST['newsletter-email']))->addGenericHeader('X-Mailer', 'PHP/' . phpversion())->addGenericHeader('Content-Type', 'text/html; charset="utf-8"')->setMessage(createMessage($_POST))->setWrap(100);
$mail->send();
$result = array('result' => 'success', 'msg' => array('Success! Thank you for signing up to our newsletter.'));
echo json_encode($result);
} else {
if ($isValid === true) {
$error = array($mailchimpResult);
} else {
$error = $isValid;
}
$result = array('result' => 'error', 'msg' => $error);
echo json_encode($result);
}
function createMessage($formData)
{
$body = "You have got new subscribe request from your website : <br><br>";
示例15: createMessage
$db->query($insert_sql_string);
@mail($user['email'], $config['projectName'] . ': Your account has been activated', "Hi,\n\nyour account on " . $config['projectName'] . " has been activated some seconds ago. You can now log in and use the service:\n" . $config['projectURL'] . "\\users\\login.html", 'Content-Type: text/plain\\n');
echo createMessage('The user was successfully enabled.', 'confirm');
} else {
echo createMessage('An error occurred.');
}
} else {
if ($_GET['action'] == 'login') {
$user = mysql_fetch_assoc($db->query("select * from users where id = '" . mysql_real_escape_string($_GET['id']) . "'"));
if ($user['id'] != '' and $user['enabled'] == '1') {
$_SESSION['id'] = $user['id'];
if (!$phpunit['isTest']) {
header('Location: ' . $config['projectURL'] . 'users/profile.html');
}
} else {
echo createMessage('An error occurred.');
}
}
}
}
?>
<p>
<a href="<?php
echo $config['projectURL'];
?>
administration/createUser.html">Create new user</a>
</p>
<?php
if ($_GET['id'] != '') {
?>
<p>