Example #1
0
<?php

require_once '../phpInclude/db_connection.php';
//error_reporting(E_ALL);
require_once '../classes/AllClasses.php';
$user_id = $_REQUEST['user_id'];
$user_id1 = $_REQUEST['user_id2'];
$messages = $_REQUEST['message'];
$message = new Messages();
if (!empty($user_id) && !empty($user_id1) && !empty($messages)) {
    if ($message->sendMessage($user_id1, $user_id1, $messages)) {
        $success = '1';
        $msg = 'Sent successfully';
    } else {
        $success = '0';
        $msg = 'Error!';
    }
} else {
    $success = '0';
    $msg = 'Incomplete Parameters';
}
echo json_encode(array('success' => $success, 'msg' => $msg));
Example #2
0
    require_once INCLUDE_DIR . 'class.masterData.php';
    $objMaster = new MasterData();
    $schoolId = $_SESSION['schoolId'];
    $teachers = $objMaster->getAllTeachersOfSchool($schoolId);
    if ($_POST['act'] == "reply") {
        $messageId = $_POST['messageId'];
        $message = $objMsg->messagesDetail($messageId);
        $message['message'] = strip_tags($message['message']);
    }
    $objTpl->assign('login_error', $login_error);
    $objTpl->assign('message', $message);
    $objTpl->assign('teachers', $teachers);
    $objTpl->display('messages_compose.tpl');
    exit;
}
if ($_POST['act'] == "send") {
    $toId = $_POST['toId'];
    $fromId = $_SESSION['userId'];
    $title = $_POST['title'];
    $message = $_POST['message'];
    $rs = $objMsg->sendMessage($toId, $fromId, $title, $message);
    if ($rs) {
        $login_error = "Message send successfully.";
    }
}
$messages = $objMsg->getUserMessages($user);
//$unread = $objUser->getUnreadMsgs();
$objTpl->assign('login_error', $login_error);
$objTpl->assign('unread', $unread);
$objTpl->assign('messages', $messages);
$objTpl->display('messages.tpl');
Example #3
0
 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $request = $this->getRequest();
     try {
         // Check if we have a POST request
         if (!$request->isPost()) {
             return $this->_helper->redirector('index');
         }
         // Get our form and validate it
         $form = $this->getForm('/admin/domains/process');
         if (!$form->isValid($request->getPost())) {
             // Invalid entries
             $this->view->form = $form;
             $this->view->title = $this->translator->translate("Domain Process");
             $this->view->description = $this->translator->translate("Check all the information posted before saving them.");
             return $this->_helper->viewRenderer('customform');
             // re-render the login form
         }
         // Get the values posted
         $params = $form->getValues();
         // Get the id
         $id = $params['domain_id'];
         if (!empty($params['dnsform']['target']) && !empty($params['dnsform']['zones'])) {
             Dns_Zones::addDnsZone($id, $params['dnsform']['subdomain'], $params['dnsform']['target'], $params['dnsform']['zones']);
         }
         // Save the message note
         if (!empty($params['note'])) {
             Messages::addMessage($params['note'], $this->customer['customer_id'], $id);
             $isp = Shineisp_Registry::get('ISP');
             $placeholder['fullname'] = $this->customer['firstname'] . " " . $this->customer['lastname'];
             $placeholder['domain'] = domains::getDomainName($id);
             $placeholder['message'] = $params['note'];
             $placeholder['messagetype'] = $this->translator->translate('Domain');
             Messages::sendMessage("message_new", $this->customer['email'], $placeholder);
             Messages::sendMessage("message_admin", $isp->email, $placeholder);
         }
         Domains::setAuthInfo($id, $params['authinfocode']);
         Domains::setAutorenew($id, $params['autorenew']);
         $this->_helper->redirector('edit', 'domains', 'default', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
            $content = 'Proficiat ' . $firstname;
            $content = $content . ', <br/><br/>Je hebt &eacute;&eacute;n of meerdere realisaties in DeepskyLog!<br/><br/>';
            $content = $content . 'Bekijk je realisaties op <a href="http://www.deepskylog.be/index.php?indexAction=detail_observer&user='******'">http://www.deepskylog.be/index.php?indexAction=detail_observer&user='******'</a>';
            $content = $content . '<br /><br />Het DeepskyLog team';
        } else {
            if ($get->language == "en") {
                $subject = 'You have one of more realisations in DeepskyLog!';
                $content = 'Congratulations ' . $firstname;
                $content = $content . ', <br/><br/>You have one or more realisations in DeepskyLog!<br/><br/>';
                $content = $content . 'Look at your realisation at <a href="http://www.deepskylog.org/index.php?indexAction=detail_observer&user='******'">http://www.deepskylog.org/index.php?indexAction=detail_observer&user='******'</a>';
                $content = $content . '<br /><br />The DeepskyLog team';
            } else {
                if ($get->language == "fr") {
                    $subject = 'Vous avez une ou plusieures r&eacute;alisations dans DeepskyLog!';
                    $content = 'F&eacute;licitations ' . $firstname;
                    $content = $content . ', <br/><br/>Vous avez une ou plusieures r&eacute;alisations dans DeepskyLog!<br/><br/>';
                    $content = $content . 'Regardez vos r&eacute;alisations &agrave; <a href="http://www.deepskylog.fr/index.php?indexAction=detail_observer&user='******'">http://www.deepskylog.fr/index.php?indexAction=detail_observer&user='******'</a>';
                    $content = $content . '<br /><br />Le team DeepskyLog';
                } else {
                    $subject = 'Sie haben ein oder mehrere Realisierungen in DeepskyLog!';
                    $content = 'Gratulation ' . $firstname;
                    $content = $content . ', <br/><br/>Sie haben ein oder mehrere Realisierungen in DeepskyLog!<br/><br/>';
                    $content = $content . 'Sehen Sie Ihre Erkenntnisse auf <a href="http://www.deepskylog.de/index.php?indexAction=detail_observer&user='******'">http://www.deepskylog.de/index.php?indexAction=detail_observer&user='******'</a>';
                    $content = $content . '<br /><br />Das DeepskyLog Team';
                }
            }
        }
        $objMessages->sendMessage("DeepskyLog", $value, $subject, $content);
    }
}
print "Database update successful.\n<br />";
Example #5
0
 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index');
     }
     // Get our form and validate it
     $form = $this->getForm('/admin/service/process');
     if (!$form->isValid($request->getPost())) {
         // Invalid entries
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Service");
         $this->view->description = $this->translator->translate("Check all the fields and click on the save button");
         return $this->_helper->viewRenderer('customform');
         // re-render the login form
     }
     // Get the values posted
     $params = $form->getValues();
     // Get the id
     $id = $this->getRequest()->getParam('detail_id');
     if (is_numeric($id)) {
         OrdersItems::setAutorenew($id, $params['autorenew']);
     }
     // Save the message note
     if (!empty($params['message'])) {
         Messages::addMessage($params['message'], $this->customer['customer_id'], null, null, $id);
         $isp = Shineisp_Registry::get('ISP');
         $placeholder['fullname'] = $this->customer['firstname'] . " " . $this->customer['lastname'];
         $placeholder['messagetype'] = $this->translator->translate('Order Details');
         $placeholder['message'] = $params['message'];
         Messages::sendMessage("message_new", $this->customer['email'], $placeholder);
         Messages::sendMessage("message_admin", $isp->email, $placeholder);
     }
     $this->_helper->redirector('edit', 'services', 'default', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
 }
Example #6
0
     $emisor = PATIENT;
     $patient = $_SESSION['user']['id'];
     /*$admin = $data['mensaje']['to'];*/
     $admin = 1;
     $idioma = es;
 } else {
     $emisor = ADMIN;
     /*$admin = $_SESSION['user']['id'];*/
     $admin = 1;
     $patient = $data['mensaje']['to'];
     $pct = new Patient($db);
     $info_paciente = $pct->getPatient('info', $patient);
     $idioma = $info_paciente->datos[0]['idioma'];
 }
 $msg = new Messages($db);
 $result = $msg->sendMessage($emisor, $patient, $admin, $data['mensaje']['mensaje'], $data['mensaje']['asunto']);
 if ($result->resultado && isset($info_paciente)) {
     if ($_SESSION['user']['type'] != PATIENT) {
         switch ($idioma) {
             case "en":
                 $cuerpo = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/mails/message_en.html");
                 $asunto = 'You have received a message in your EMIO account';
                 break;
             case "de":
                 $cuerpo = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/mails/message_en.html");
                 $asunto = 'You have received a message in your EMIO account';
                 break;
             default:
                 $cuerpo = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/mails/message.html");
                 $asunto = 'Tiene un mensaje en EMIO';
         }
Example #7
0
<?php

include_once "../includes/webservice.inc.php";
$webService = new Webservices_Writer();
$webService->init();
$data = isset($_POST['data']) ? $_POST['data'] : '';
$messagesObj = new Messages();
$msgsent = $messagesObj->sendMessage($data);
if ($msgsent) {
    $webService->createXMLInstance();
    $webService->appendArrayToRootNode('', $msgsent);
    $webService->displayXML();
} else {
    $xmls = $webService->errorXML(join(",", $messagesObj->errorMessages));
    $webService->outputXML($xmls);
}