本文整理汇总了PHP中GetMessages函数的典型用法代码示例。如果您正苦于以下问题:PHP GetMessages函数的具体用法?PHP GetMessages怎么用?PHP GetMessages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMessages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRub
public function getRub($price, $ConvCurrency)
{
if ($this->_glob['_curr'][$ConvCurrency]['RATE'] > 0) {
return round($price * $this->_glob['_curr'][$ConvCurrency]['RATE'], $this->_glob['_precision']);
}
return GetMessages('ERROR_CURRENCY');
}
示例2: GetContent
function GetContent()
{
global $langmessage;
echo '<div id="gpx_content">';
echo GetMessages();
echo $this->contentBuffer;
echo '</div>';
}
示例3: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request, Absent $absentModel, Product $productModel)
{
if (!right('Alerts')) {
abort(404);
}
if (isset($_POST['save'])) {
//pr($_POST);
$currentAbsents = $absentModel->getAbsentsList();
foreach ($_POST['fields'] as $key => $element) {
//если стоит галка Выполенно
if (isset($element['done'])) {
//удаляем дату у товаров
$productModel->deleteAbsent($element['old_absent']);
//удаляем уведомление
$absentModel->deleteAbsent($element['old_absent']);
} else {
//если меняем дату уведомления
if ($element['new_absent'] != $element['old_absent']) {
//меняем дату у товаров
$productModel->changeAbsent($element['old_absent'], $element['new_absent']);
//если уведомление с такой датой уже есть
if ($currentAbsents->search($element['new_absent']) !== false) {
if (!empty($element['note'])) {
//меняем комментарий
$absentModel->updateAbsent($element['new_absent'], array('note' => $element['note']));
}
//удаляем старое уведомление
$absentModel->deleteAbsent($element['old_absent']);
} else {
//просто меняем дату и коммент
$absentModel->updateAbsent($element['old_absent'], array('absent' => $element['new_absent'], 'note' => $element['note']));
}
} else {
//если написан комментарий
if (!empty($element['note'])) {
//меняем комментарий
$absentModel->updateAbsent($element['new_absent'], array('note' => $element['note']));
}
}
}
}
$absents = $productModel->getAbsentsList();
$absentModel->addAbsentsList($absents);
Session::flash('message', GetMessages("SUCCESS_UPDATE"));
return redirect($_SERVER['HTTP_REFERER']);
}
}
示例4: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Request $request, Note $noteModel, History $historyModel)
{
if (right('AddNewPublicNote')) {
if (strlen($_POST['notification']) > 0) {
$noteModel->addNote($_POST['notification']);
$historyModel->saveHistory('create_note');
Session::flash('message', GetMessages("ADD_NEW_NOTE_MESSAGE"));
return redirect()->route('note.index');
} else {
Session::flash('message', GetMessages("EMPTY_NOTE_MESSAGE"));
return redirect()->route('note.index');
}
} else {
Session::flash('message', GetMessages("NO_RIGHTS"));
return redirect($_SERVER['HTTP_REFERER']);
}
}
示例5: Messages
/**
* Add the messages to the response
*
*/
static function Messages()
{
ob_start();
echo GetMessages(false);
$content = ob_get_clean();
if (!empty($content)) {
gpAjax::JsonDo('messages', '', $content);
}
}
示例6: GetMessageArray
function GetMessageArray($vm_folder, $vm_mailbox)
{
// Get all messages in a folder
// also convert the messages to MP3 during the loop
global $g_debug;
global $g_voicemail_context_path;
$arr = array();
// Get the paths set up
$voicemail_path = $g_voicemail_context_path . $vm_mailbox . "/" . $vm_folder . "/";
// Open the voicemail directory and look for files
if (is_dir($voicemail_path)) {
$dir = dir($voicemail_path);
// **********************************************************************
// Load the files for this directory, then sort (by Date)
// **********************************************************************
// Get an array of files and unix timestamp
$arr_vm_files = GetMessages($voicemail_path);
// Sort that array by the timestamp
SortByDate($arr_vm_files);
// Get the size of the array of files
$array_size = sizeof($arr_vm_files);
// If there are no files, show a message, otherwise show the header
if ($array_size > 0) {
// Loop through the array
for ($i = $array_size - 1; $i >= 0; $i--) {
// Get the file name
$file = $arr_vm_files[$i][0];
$loopcount = 0;
if ($file != "." && $file != "..") {
// We're looking for the txt files as the proof that there is a voicemail here.
// Then we work from there...
if (strpos($file, ".txt") != FALSE) {
// We got a .txt file (which is like our INI file)
// Read INI File
$ini_array = parse_ini_file($voicemail_path . $file, false);
// Strip extension from file name
$file_noext = substr($file, 0, strpos($file, ".txt"));
// Add .wav and .mp3 on to file name
$file_wav = $file_noext . ".wav";
$file_mp3 = $file_noext . ".mp3";
// Return a better date
$origdate = str_replace(" ", " ", $ini_array['origdate']);
list($day, $month, $date, $time, $ampm, $tz, $year) = split(' ', $origdate);
$origdate_unix = strtotime("{$month} {$date} {$year} {$time} {$ampm}");
//$datetimebetter = date("D M j Y, g:i a", $origdate_unix); Sun Feb 02 2008
$datetimebetter = date("M j Y, g:i a", $origdate_unix);
$arr[$i] = array('file' => $file_noext, 'calleridname' => CallerIdGetName($ini_array['callerid']), 'calleridnumber' => CallerIdGetNumber($ini_array['callerid']), 'datetime' => $ini_array['origdate'], 'datetimebetter' => $datetimebetter, 'duration' => $ini_array['duration']);
// **********************************************************************
// See if there is a MP3 file. If not, create one.
// **********************************************************************
if (!file_exists($voicemail_path . $file_noext . ".mp3")) {
// Create a standard wav file
//$cmd = "sox ".$voicemail_path.$file_noext.".WAV -r 8000 -c 1 -s ".$voicemail_path.$file_noext.".wav";
//echo($cmd . "<br />\n");
//exec($cmd);
// Create a mp3 file from the wav file
$cmd = "lame --resample 11.025 " . $voicemail_path . $file_noext . ".wav " . $voicemail_path . $file_noext . ".mp3";
//echo($cmd . "<br />\n");
exec($cmd);
// Delete the wav file
//$cmd = "unlink ".$voicemail_path.$file_noext.".wav";
//echo($cmd . "<br />\n");
//exec($cmd);
// Touch the mp3 file to set the timestamp to match the .wav file.
// This is so the auto cleanup script will work.
// To set the date to 7:30 am 1st October 2015
// TOUCH /t 2015 10 01 07 30 00 MyFile.txt
$origdate = $ini_array['origdate'];
// Fix a bug in the asterisk date. It puts an extra space in
$origdate = str_replace(" ", " ", $origdate);
list($day, $month, $date, $time, $ampm, $tz, $year) = split(' ', $origdate);
$monthnumber = MonthToMonthNumber($month);
if (strlen($date) == 1) {
$date = "0" . $date;
}
// Pad a 0 to the beginning of date
list($hour, $minute, $second) = split(":", $time);
if ($ampm == "PM") {
$hour = $hour + 12;
}
// Compensate for PM
$touchcmd = "touch -t " . $year . $monthnumber . $date . $hour . $minute . " " . $voicemail_path . $file_noext . ".mp3";
exec($touchcmd);
}
}
$loopcount++;
}
// end if . or ..
}
// end while
$dir->close();
}
}
return $arr;
}
示例7: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Label $labelModel, Request $request, Purchase $purchaseModel, User $userModel, Product $productModel, History $historyModel)
{
if (isset($_POST['update_template'])) {
//pr($_POST);
if (isset($_POST['col']) and !empty($_POST['col'])) {
$fields = serialize($_POST['col']);
} else {
$fields = null;
}
if (!empty($_POST['name_template'])) {
$template_name = $_POST['name_template'];
} elseif (isset($_POST['selected_name_template']) and !empty($_POST['selected_name_template'])) {
$template_name = $_POST['selected_name_template'];
} else {
$template_name = 'По умолчанию';
}
$template_id = $userModel->checkTemplates($template_name, 'products');
if ($template_id != null) {
$res = array('fields' => $fields);
$userModel->updateTemplate($res, $template_id, 'products');
} else {
//добавляем шаблон
$res = array('type' => 'products', 'user_id' => Auth::User()->id, 'template' => $template_name, 'fields' => $fields);
$userModel->addTemplates($res, 'products');
}
Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
return redirect($_SERVER['HTTP_REFERER']);
}
if (isset($_POST['delete_template'])) {
$userModel->deleteTemplate($_POST['selected_name_template'], 'products');
Session::flash('message', GetMessages("SUCCESS_TEMPLATE_DELETE"));
return redirect($_SERVER['HTTP_REFERER']);
}
if (isset($_POST['select_template'])) {
$userModel->updateUser(Auth::User()->id, array('template_prod_id' => $_POST['selected_name_template']));
Session::flash('message', GetMessages("SUCCESS_SETTINGS_SAVE"));
return redirect($_SERVER['HTTP_REFERER']);
}
if (isset($_POST['search_button'])) {
//pr($_POST);
if (strlen($_POST['search_field']) > 0) {
return redirect()->route('product.search.index', ['string' => $_POST['search_field']]);
} else {
return redirect($_SERVER['HTTP_REFERER']);
}
}
if (isset($_POST['update_products'])) {
if (!right('EditProduct')) {
abort(404);
}
unset($_POST['update_products']);
unset($_POST['_token']);
$res = array();
$reViewAbsents = false;
//pr($_POST);
foreach ($_POST as $element) {
if (array_key_exists('check', $element)) {
unset($element['check']);
$childs = false;
if (isset($element['childs'])) {
$childs = unserialize($productModel->where('id', $element['id'])->pluck('childs'));
}
//status
!isset($element['status']['new']) ? $element['status']['new'] = 0 : ($element['status']['new'] = 1);
if ($element['status']['new'] != $element['status']['old']) {
$res[$element['id']]['products.status'] = $element['status']['new'];
}
//name
if ($element['name']['new'] != $element['name']['old']) {
$res[$element['id']]['products.name'] = trim($element['name']['new']);
}
//monitoring_name
if ($element['monitoring_name']['new'] != $element['monitoring_name']['old']) {
$res[$element['id']]['products.monitoring_name'] = trim($element['monitoring_name']['new']);
}
//absent
if ($element['absent']['new'] != $element['absent']['old']) {
if (empty($element['absent']['new'])) {
$res[$element['id']]['products.absent'] = null;
} else {
$res[$element['id']]['products.absent'] = trim($element['absent']['new']);
}
$reViewAbsents = true;
}
//article
if ($element['article']['new'] != $element['article']['old']) {
$res[$element['id']]['products.article'] = trim($element['article']['new']);
}
//in_stock
!isset($element['in_stock']['new']) ? $element['in_stock']['new'] = 0 : ($element['in_stock']['new'] = 1);
if ($element['in_stock']['new'] != $element['in_stock']['old']) {
$res[$element['id']]['products.in_stock'] = $element['in_stock']['new'];
}
//flag
//.........这里部分代码省略.........
示例8: flag
public function flag($category_id, Category $categoryModel, Product $productModel)
{
$childs = $categoryModel->getChild($category_id);
$products = $productModel->getIdByCategoryId($childs);
$productModel->setFlagsByProductsId($products);
Session::flash('message', GetMessages("SUCCESS_ADD_FLAG"));
return redirect($_SERVER['HTTP_REFERER']);
}
示例9: GetAdminLink
/**
* Outputs the sitemap link, admin login/logout link, powered by link, admin html and messages
* @static
*/
static function GetAdminLink()
{
global $config, $langmessage, $page;
if (!isset($config['showsitemap']) || $config['showsitemap']) {
echo ' <span class="sitemap_link">';
echo common::Link('Special_Site_Map', $langmessage['site_map']);
echo '</span>';
}
if (!isset($config['showlogin']) || $config['showlogin']) {
echo ' <span class="login_link">';
if (common::LoggedIn()) {
echo common::Link($page->title, $langmessage['logout'], 'cmd=logout', array('data-cmd' => 'creq', 'rel' => 'nofollow'));
} else {
echo common::Link('Admin', $langmessage['login'], 'file=' . rawurlencode($page->title), ' rel="nofollow" data-cmd="login"');
}
echo '</span>';
}
if (!isset($config['showgplink']) || $config['showgplink']) {
echo ' <span id="powered_by_link">';
echo 'Powered by <a href="http://gpEasy.com" title="A Free and Easy CMS in PHP" target="_blank">gp|Easy CMS</a>';
echo '</span>';
}
gpPlugin::Action('GetAdminLink');
echo GetMessages();
//global $gpLayouts;
//echo pre($gpLayouts);
//$included = get_included_files();
//echo pre($included);
}
示例10: delete
public function delete(Purchase $purchaseModel, History $historyModel, $purchase_id, $product_id)
{
$purchaseModel->deletePurchase($purchase_id, $product_id);
$historyModel->saveHistory('del_purchase', $product_id);
Session::flash('message', GetMessages("SUCCESS_DELETE_PURCHASE"));
return redirect($_SERVER['HTTP_REFERER']);
}
示例11: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(History $historyModel, Provider $providerModel, Request $request, $id)
{
if (isset($_POST['update_provider'])) {
if (!right('EditProvider')) {
abort(404);
}
if (strlen($request->input('name')) > 0) {
$data = array('name' => $request->input('name'), 'note' => $request->input('note'), 'updated_at' => date('Y-m-d H:i:s'), 'user_id' => Auth::User()->id);
$providerModel->updateProvider($id, $data);
$historyModel->saveHistory('update_provider', $request->input('name'));
Session::flash('message', GetMessages("SUCCESS_UPDATE_PROVIDER"));
return redirect()->route('provider.index');
} else {
Session::flash('message', GetMessages("ERROR_EMPTY_NAME_PROVIDER"));
return redirect($_SERVER['HTTP_REFERER']);
}
}
if (isset($_POST['status_provider'])) {
if (!right('EditProvider')) {
abort(404);
}
$providerModel->changeStatus($id, $request->input('status'));
$historyModel->saveHistory('status_provider', $id, $request->input('status'));
Session::flash('message', GetMessages("SUCCESS_CHANGE_STATUS_PROVIDER"));
return redirect($_SERVER['HTTP_REFERER']);
}
}
示例12: GetAdminLink
/**
* Outputs the sitemap link, admin login/logout link, powered by link, admin html and messages
* @static
*/
public static function GetAdminLink()
{
global $config, $langmessage, $page;
if (!isset($config['showsitemap']) || $config['showsitemap']) {
echo ' <span class="sitemap_link">';
echo \gp\tool::Link('Special_Site_Map', $langmessage['site_map']);
echo '</span>';
}
if (!isset($config['showlogin']) || $config['showlogin']) {
echo ' <span class="login_link">';
if (\gp\tool::LoggedIn()) {
echo \gp\tool::Link($page->title, $langmessage['logout'], 'cmd=logout', array('data-cmd' => 'creq', 'rel' => 'nofollow'));
} else {
echo \gp\tool::Link('Admin', $langmessage['login'], 'file=' . rawurlencode($page->title), ' rel="nofollow" data-cmd="login"');
}
echo '</span>';
}
if (!isset($config['showgplink']) || $config['showgplink']) {
if (self::is_front_page()) {
echo ' <span id="powered_by_link">';
echo 'Powered by <a href="' . CMS_DOMAIN . '" target="_blank">' . CMS_NAME . '</a>';
echo '</span>';
}
}
\gp\tool\Plugins::Action('GetAdminLink');
echo GetMessages();
}
示例13: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(Request $request, $id, User $userModel, History $historyModel)
{
if (isset($_POST['edit_user'])) {
if (!right('EditUsers')) {
abort(404);
}
$validator = Validator::make(array('name' => $request->input('name'), 'family' => $request->input('family'), 'password' => $request->input('password')), array('name' => 'required|min:3|max:55', 'family' => 'required|min:3|max:55', 'password' => 'min:4|max:4'), array('required' => 'Поле :attribute обязательно для заполнения', 'min' => 'Поле :attribute должно быть не меньше 4 символов', 'max' => 'Поле :attribute слишком длинное'));
if ($validator->fails()) {
Session::flash('message', GetMessages("ERROR_FIELD_ADD_NEW_USER"));
return redirect()->route('user.create');
} else {
if (isset($_POST['right'])) {
$serialize_rights = serialize($_POST['right']);
} else {
$serialize_rights = null;
}
if (strlen($request->input('password')) == 4) {
$password = Hash::make($request->input('password'));
} else {
$password = $userModel->getPasswordFromUser($id);
}
$showName = $request->input('family') . ' ' . $request->input('name');
$dataUser = array('name' => $request->input('name'), 'family' => $request->input('family'), 'patronymic' => $request->input('patronymic'), 'showname' => $showName, 'position' => $request->input('position'), 'login' => $request->input('login'), 'password' => $password, 'rights' => $serialize_rights, 'updated_at' => date('Y-m-d H:i:s'), 'user_id' => Auth::User()->id);
$userModel->updateUser($id, $dataUser);
$historyModel->saveHistory('update_user', $showName);
Session::flash('message', GetMessages("SUCCESS_USER_UPDATING"));
return redirect()->route('user.edit', ['id' => $id]);
}
}
if (isset($_POST['status_user'])) {
if (!right('EditUsers')) {
abort(404);
}
$status = $request->input('status');
$userModel->updateUser($id, array('status' => $status, 'updated_at' => date('Y-m-d H:i:s'), 'user_id' => Auth::User()->id));
$historyModel->saveHistory('status_user', $id, $status);
Session::flash('message', GetMessages("SUCCESS_CHANGE_STATUS_USER"));
return redirect($_SERVER['HTTP_REFERER']);
}
}
示例14: session_start
<?php
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/data-layer/dbCommunication.php";
if (isset($_POST['update_chat'])) {
GetMessages();
}
if (isset($_POST['update_leaderboard'])) {
GetLeaderboard();
}
if (isset($_POST['get_games'])) {
GetGames();
}
if (isset($_POST['send_message'])) {
$Message = $_POST["message"];
SendMessage($Message);
}
if (isset($_POST['update_game'])) {
UpdateBoard();
}
if (isset($_POST['create_game'])) {
$GameName = $_POST["game_name"];
$Username = $_SESSION["Username"];
$output = CreateGame($GameName, $Username);
UpdateBoard();
}
if (isset($_POST['game_hit'])) {
$Username = $_SESSION["Username"];
$GameID = $_SESSION["GameID"];
if (IsUserTurn($Username, $GameID)) {
HitPlayer();
示例15: flag
public function flag($label_id, Product $productModel)
{
$products = $productModel->getIdByLabelId($label_id);
$productModel->setFlagsByProductsId($products);
Session::flash('message', GetMessages("SUCCESS_ADD_FLAG"));
return redirect($_SERVER['HTTP_REFERER']);
}