Ejemplo n.º 1
5
 /**
  * Triggered when a client sends data through the socket
  * @param  \Ratchet\ConnectionInterface $from The socket/connection that sent the message to your application
  * @param  string $msg The message received
  * @throws \Exception
  */
 function onMessage(ConnectionInterface $from, $msg)
 {
     echo $_SESSION["city"];
     if ($msg == "update") {
         $from->send(updateMessage());
     } else {
         parse_request($msg);
     }
 }
Ejemplo n.º 2
0
<?php

/**
 * This will show a specific message.
 */
include_once '../includes/message.functions.php';
include_once '../templates/header.php';
include_once '../templates/navbarMessages.php';
if (@$_POST['action'] == "Opslaan") {
    updateMessage();
} else {
    editMessage();
}
include_once '../templates/footer.php';
Ejemplo n.º 3
0
<?php

if (!$user or !privileges($mysql_link, $user['role_id'], array('ADD_MESS'))) {
    $_SESSION['msg']['message'] = setMessage('Ошибка доступа, у вас нет прав для посещения данный страницы. Пожалуйста, <a href="/?action=login">войдите под своей учётной записью</a> или <a href="/?action=registration">загеристрируйтесь</a>', 'error');
    $content = '';
} else {
    if ($_SERVER['REQUEST_METHOD'] == 'GET' and isset($_GET['id'])) {
        $message_id = clearData($mysql_link, $_GET['id']);
        $message = editMessage($mysql_link, $message_id);
        $additional_images = explode('|', $message['additional_images']);
        if ($user['user_id'] != $message['user_id'] and $message['published'] == 0) {
            $_SESSION['msg']['message'] = setMessage('Данное объявление не существует', 'error');
            $content = template('view_message.tpl.php');
        } else {
            $content = template('edit_message.tpl.php', array('message' => $message, 'additional_images' => $additional_images, 'categories' => $categories, 'types' => $types));
        }
    } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $update = updateMessage($mysql_link, $_POST);
        if ($update === TRUE) {
            $_SESSION['msg']['message'] = setMessage('Ваше объявление успешно обновлено, оно появится после модерации', 'success');
            header('Location: ' . $_SERVER['PHP_SELF']);
            exit;
        } else {
            $_SESSION['msg']['message'] = $update;
            header('Location: ' . $_SERVER['REQUEST_URI']);
            exit;
        }
    }
}
Ejemplo n.º 4
0
}
if ($_GET['action'] == "add_default_data" || $_GET['action'] == "edit_default_data") {
    $id = $_POST['id'];
    if ($id == '') {
        $id = $_GET['id'];
    }
    if ($_GET['action'] == "edit_default_data") {
        deleteMessage("日程提醒", $_GET['id']);
    }
    //弹出消息
    newMessage($_SESSION['LOGIN_USER_ID'], cutStr($_POST['CONTENT'], 12), '日程提醒', '../CRM/calendar_newai.php?' . base64_encode('action=view_default&id=' . $id), $id, $_POST['tixingtime']);
    //短信通知
    if ($_POST['ifsms'] == '1') {
        $mobiles = returntablefield("user", "user_id", $_SESSION['LOGIN_USER_ID'], "MOBIL_NO");
        print "\n<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.js\"></script>\n";
        print "<script type=\"text/javascript\" language=\"javascript\">\n\t\t\t\$.post('../Framework/sms_getContents.php?action=send', {\n\t\t\t    mobiles:'" . $mobiles . "',\n\t\t\t    msg:'" . cutStr("【日程提醒】" . $_POST['CONTENT'], 70) . "',\n\t\t\t    attime:'" . $_POST['tixingtime'] . "'\n\t\t\t}, function(data) {\t\n\t\t\t});\n\t\t</script>";
    }
}
if ($_GET['action'] == "delete_array") {
    deleteMessage("日程提醒", $_GET['selectid']);
}
if ($_GET['action'] == "finish") {
    $sql = "update calendar set over_status='" . $_GET['OVER_STATUS'] . "' where id=" . $_GET['id'];
    $db->Execute($sql);
    updateMessage("日程提醒", $_GET['id'], $_GET['OVER_STATUS']);
    header("location:calendar_newai.php");
    exit;
}
$filetablename = 'calendar';
$parse_filename = 'calendar';
require_once 'include.inc.php';