本文整理汇总了PHP中messages类的典型用法代码示例。如果您正苦于以下问题:PHP messages类的具体用法?PHP messages怎么用?PHP messages使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了messages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login()
{
$msg = new messages();
$fun = new funciones();
if (!$fun->isAjax()) {
header("Location: login.php");
}
$con = new con();
$con->connect();
$response = new StdClass();
$usu = $_POST['usr'];
$pass = $_POST['psw'];
$pass = sha1(md5($pass));
/*Consulta a la Bd*/
$selectSQL = "SELECT * FROM `tbl_users` WHERE `us_usuario` = '{$usu}' AND `us_clave` = '{$pass}' AND us_estado = 1";
$row_cons = mysql_query($selectSQL);
$existe = mysql_fetch_assoc($row_cons);
/*Termina Consulta*/
/*Existe*/
//$existe = 1;
if ($existe) {
$res = true;
$mes = "panel.html";
$_SESSION["ses_id"] = $existe['us_id'];
//$menu = 1;
} else {
$res = false;
$mes = $msg->get_msg("e002");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例2: test_get_current_message
public function test_get_current_message()
{
$m = new messages();
//No message has been set
$this->assertEquals('', $m->get_current_message());
//Set a message and check if it's ok
$m->set_message('general-ok-0');
$this->assertEquals('Command OK', $m->get_current_message());
}
示例3: action_index
function action_index()
{
$data = new messages();
if (isset($_POST['send'])) {
if ($_POST["id"]) {
$data->sendMessage($_POST["id"], $_POST["message"]);
}
}
$messages = $data->getMessages();
$data = array(array($messages, 'messages'));
$this->view->generate('messages.tpl', $data);
}
示例4: add_persona
function add_persona()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$tipo = $_POST['tipo'];
$nombre = $_POST['nombre'];
$ced = $_POST['ced'];
$lic = $_POST['lic'];
$lic_v = $_POST['lic_v'];
$dir = $_POST['dir'];
$tel = $_POST['tel'];
$cel = $_POST['cel'];
$f1 = $_POST['f1'];
$f2 = $_POST['f2'];
$placa = $_POST['placa'];
if ($tipo == 1) {
$placa = "0";
}
if ($nombre == "") {
$res = false;
$mes = $msg->get_msg("e005");
} else {
$con = new con();
$con->connect();
/* verificamos que no esté registrado en la tabla de personas*/
$res_existe = $fun->existe("personas", "pe_cedula", $ced);
if (!$res_existe) {
/* ingresamos datos de la persona */
$qry = "INSERT INTO tbl_personas \n\t\t\t\t(pe_nombre, pe_tel, pe_cedula, pe_licencia, pe_licencia_vigencia, pe_dir, pe_cel, pe_tipo, pe_created, pe_estado, pe_f1, pe_f2, pe_ve_id) \n\t\t\t\tVALUES \n\t\t\t\t('" . $nombre . "', '" . $tel . "', '" . $ced . "', '" . $lic . "', '" . $lic_v . "', '" . $dir . "', '" . $cel . "', '" . $tipo . "', " . $_SESSION["ses_id"] . ", 1 , '" . $f1 . "', '" . $f2 . "', " . $placa . ");";
//echo "QUERY: ".$qry;
$resp = mysql_query($qry);
if (!$resp) {
$res = false;
$mes = $msg->get_msg("e003");
} else {
$res = true;
$mes = $msg->get_msg("e004");
}
} else {
$res = false;
$mes = $msg->get_msg("e003-1", "El usuario ya existe");
}
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例5: _contacts
/**
* Файлы переписки в ЛС доступны участникам и админу.
*
* @param type $params
* @param CFile $file
*
* @return type
*/
protected function _contacts($params, CFile $file)
{
//нет необходимости так как в общей таблице
//$tableName = $file->getTableName();
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
$allow_download = false;
$users = new users();
$from_uid = $users->GetUid($error, $params['login']);
if ($from_uid > 0) {
$msgObj = new messages();
$allow_download = $msgObj->isFileExist($from_uid, $this->uid, $file->id);
}
return $allow_download;
}
示例6: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$categoryId = $this->getRequestVar('categoryid', array(1, 4, 7));
if (is_null($categoryId)) {
$this->redirect('category/list');
}
$category = new \model\category($this->getDbconnection(), $categoryId);
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->update()) {
$this->redirect('category/list', array('categoryedited=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 1);
$view->assign('systemmode', $this->getSysconfig()->getSystemMode());
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_EDIT'));
$view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
$view->render();
}
示例7: __construct
public function __construct()
{
//SINGLETON------------------------------------
$this->msgs = messages::getInstance();
//---------------------------------------------
$this->connectDB();
}
示例8: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
if (!is_null($this->getRequestVar('affiliateDelList'))) {
$affiliateIds = $this->getRequestVar('affiliateDelList');
foreach ($affiliateIds as $affiliateId) {
$affiliate = new \model\affiliate($this->getDbconnection(), $this->filterRequest($affiliateId, array(1, 4, 7)));
$affiliate->delete();
}
$this->redirect('affiliate/list', array('affiliatedeleted=yes'));
}
$affiliateList = new \model\affiliate_list($this->getDbconnection());
$affiliateList->setGroupByCategory(true);
if (!is_null($this->getRequestVar('affiliateadded'))) {
\messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_ADDAFFILIATE'));
}
if (!is_null($this->getRequestVar('affiliateedited'))) {
\messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_EDITAFFILIATE'));
}
if (!is_null($this->getRequestVar('affiliatedeleted'))) {
\messages::registerMessage(\language::returnLanguageConstant('DELETE_SUCCESS_AFFILIATES'));
}
$view = new \model\view_acp('affiliate_list');
$view->assign('theList', $affiliateList->getAffiliates());
$view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
$view->render();
}
示例9: runUpdate
public function runUpdate($fileList = array())
{
$view = new \model\view_installer('updater');
$view->assign('version', $this->sysconfig->getSysVersion());
include \base_config::$baseDir . '/version.php';
$this->updateConfigKey('sysVersion', $afltrVersion);
if (file_exists(\base_config::$updateCache)) {
@unlink(\base_config::$updateCache);
}
$fileDeleteList = array('/inc/model/model_base.php', '/inc/model/dashcontainerbox.php', '/inc/lib/jquery/jquery-1.10.2.min.js');
foreach ($fileDeleteList as $fileDelete) {
if (file_exists(\base_config::$baseDir . $fileDelete)) {
@unlink(\base_config::$baseDir . $fileDelete);
}
}
$file = new \model\file();
if (is_dir(base_config::$baseDir . '/inc/lib/lightbox')) {
$file->deleteRecursive(base_config::$baseDir . '/inc/lib/lightbox');
}
if (is_dir(base_config::$baseDir . '/inc/lib/jquery_ui')) {
$file->deleteRecursive(base_config::$baseDir . '/inc/lib/jquery_ui');
}
if (!file_exists(base_config::$uploadDir . '/banners')) {
mkdir(base_config::$uploadDir . '/banners');
}
$this->createConfigKey('timeZone', 'Europe/Berlin');
$newVersion = $this->dbconnection->select("config", "config_value", "config_key LIKE 'sysVersion'");
\messages::registerMessage(\language::returnLanguageConstant('UPDATE_SUCCESS'), true);
$view->assign('newVersion', $newVersion[0]['config_value']);
$view->assign('fileList', $fileList);
$view->render();
}
示例10: __construct
public function __construct()
{
//SINGLETON------------------------------------
$this->msgs = messages::getInstance();
$this->db = Database::getInstance();
//---------------------------------------------
}
示例11: getInstance
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new messages();
}
return self::$instance;
}
示例12: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$category = new \model\category($this->getDbconnection());
if (!is_null($this->getRequestVar('submupload'))) {
$newFile = new \model\file();
$icon = $newFile->uploadFile();
$category->setIconPath($icon);
}
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->save()) {
$this->redirect('category/list', array('categoryadded=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
} else {
$category->setIsPrivate(0);
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 0);
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_ADD'));
$view->render();
}
示例13: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$containers = array();
$containerClassFiles = scandir(\base_config::$baseDir . '/inc/dashcontainers/');
foreach ($containerClassFiles as $containerClassFile) {
if (strpos($containerClassFile, '.php') === false) {
continue;
}
$containerClassFile = str_replace('.php', '', $containerClassFile);
$containerObject = new $containerClassFile($this);
if (is_a($containerObject, '\\interfaces\\dashcontainer')) {
$containerPosition = $containerObject->getPosition();
if (isset($containers[$containerPosition])) {
$containerPosition++;
}
$containers[$containerPosition] = new \model\dashboard_container($containerObject->getBoxName(), $containerObject->getBoxHeadline(), $containerObject->getBoxContent(), $containerObject->getSize(), $containerObject->getHeight());
} else {
$message = \language::replaceLanguageConstant(\language::returnLanguageConstant('DASH_CONTAINER_INSTANCE'), array('{{dashcontainer}}' => $containerClassFile));
\messages::registerError($message);
}
}
if (count($containers) >= 1) {
ksort($containers);
}
$view = new \model\view_acp('dashboard');
$view->assign('statsContainers', $containers);
$view->render();
}
示例14: remove_user
function remove_user()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$user = $_POST["user"];
$res = $fun->borrar("vehiculos", "ve_id", $user);
if ($res) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e022");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例15: add_content
public static function add_content($content_id, $content_name)
{
ob_start();
if (file_exists(config::get_config('tpl_config')['bloks_folder'] . '/' . $content_name . '.php')) {
require config::get_config('tpl_config')['bloks_folder'] . '/' . $content_name . '.php';
} else {
messages::set_message('20', 'alert-danger');
}
self::$content[$content_id] = ob_get_contents();
ob_end_clean();
}