Exemple #1
0
 public function send(Msg $msg)
 {
     // Get template file path.
     $templatePath = SPrintF('Notifies/Jabber/%s.tpl', $msg->getTemplate());
     $smarty = JSmarty::get();
     if (!$smarty->templateExists($templatePath)) {
         throw new jException('Template file not found: ' . $templatePath);
     }
     $smarty->assign('Config', Config());
     foreach (array_keys($msg->getParams()) as $paramName) {
         $smarty->assign($paramName, $msg->getParam($paramName));
     }
     try {
         $message = $smarty->fetch($templatePath);
     } catch (Exception $e) {
         throw new jException(SPrintF("Can't fetch template: %s", $templatePath), $e->getCode(), $e);
     }
     $recipient = $msg->getParam('User');
     if (!$recipient['Params']['NotificationMethods']['Jabber']['Address']) {
         throw new jException("JabberID not found for user: "******"Couldn't add task to queue: " . $result);
         case 'exception':
             throw new jException("Couldn't add task to queue: " . $result->String);
         case 'array':
             return TRUE;
         default:
             throw new jException("Unexpected error.");
     }
 }
 function add($params)
 {
     $re = $this->db->exec("insert into `progress` set \n\t\t\t\tbusiness_id=:business_id,\n\t\t\t\tprocess_id=:process_id,\n\t\t\t\tnote=:note,\n\t\t\t\tdate_end=:date_end,\n\t\t\t\tcreate_time=now()\n\t\t\t", $params);
     if ($re == 1) {
         include 'msg.php';
         $msg = new Msg($params['business_id'], 'business');
         $msg->pushMessage('工商注册', '尊敬的客户你的工商注册进度更新了');
     }
     return $re;
 }
 public function delete($id)
 {
     try {
         $msg = new Msg($id);
         if (UserHelper::getProfileId() != $msg->getReceiver() and !UserHelper::isEditor()) {
             throw new fValidationException('not allowed');
         }
         $msg->delete();
         $this->ajaxReturn(array('result' => 'success'));
     } catch (fException $e) {
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
Exemple #4
0
 public function beforeSave()
 {
     if ($this->id && $this->id == $this->parent_id) {
         $this->parent_id = 0;
         \Msg::add('Категория не может быть сама себе родителем');
     }
 }
Exemple #5
0
 public function editorAction($module)
 {
     if (!file_exists(Module::getModulePath($module) . '/generatorHash.php')) {
         Msg::add('Этот модуль был создан без помощи генератора. Возможности его изменения ограничены и могут привести к порче модуля', 'danger');
     }
     $this->view->page(['data' => compact('module')]);
 }
Exemple #6
0
 public function actionNewmsg()
 {
     $model = new Msg();
     if (isset($_POST['Msg'])) {
         $model->uid = Yii::app()->user->id;
         $model->time = time();
         $model->state = 1;
         $model->attributes = $_POST['Msg'];
         if ($model->save()) {
             $this->redirect_message('私信发送成功!', 'success', '3', $this->createUrl('msg/inbox'));
         }
     }
     $fans = Follow::model()->findAll('touid = ' . Yii::app()->user->id);
     $data = array('model' => $model, 'fans' => $fans);
     $this->render('newmsg', $data);
 }
/**
 * loop through twitter messages, put them to database and send them to qaul app
 */
function twitter_process_messages($data, $type)
{
    foreach ($data as $item) {
        // check if message already exists
        $msg = MsgQuery::create()->filterByTwitterid($item->id_str)->findOne();
        if (!$msg) {
            // save message in data base
            $msg = new Msg();
            $msg->setType($type);
            $msg->setName($item->user->screen_name);
            $msg->setMsg($item->text);
            $msg->setIp(get_qaul_setting('ip'));
            $msg->setTime($item->created_at);
            $msg->setStatus(0);
            $msg->setTwitterid($item->id_str);
            $msg->save();
            // send message to qaul app
            twitter_send2qaul($msg);
        }
    }
}
Exemple #8
0
 public function actionDelete($id)
 {
     //$this->loadModel($id)->delete();
     $model = Msg::model()->findByPk($id);
     if ($model->delete()) {
         //添加成功时候的提示信息设置
         /**
          *setFlash getFlash hasFlash 几个方法
          */
         Yii::app()->user->setFlash('shanchu', '删除成功!');
     }
     $this->redirect('./index.php?r=backend/msg/index');
 }
Exemple #9
0
	function message($key = "message.defaultMessage", $scope = "global") {
		$retval = "";
		$sessionMsg = Session::load(MSG_SCOPE, $scope);
		if (!empty($sessionMsg)) {
			reset($sessionMsg);
			$retval .= Msg::get("message.extra.warning");
			foreach ($sessionMsg as $message) {
				$retval .= "<div>".$message["string"]."</div>\n";
			}
			
		} else {
			$retval = Msg::get("message.extra.tooltip").Msg::get($key);
		}
		return $retval;
	}
 /**
  * @descrpition 从微信服务器获取微信ACCESS_TOKEN
  * @return Ambigous|bool
  */
 private static function _getAccessToken()
 {
     $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . WECHAT_APPID . '&secret=' . WECHAT_APPSECRET;
     $accessToken = Curl::callWebServer($url, '', 'GET');
     if (!isset($accessToken['access_token'])) {
         return Msg::returnErrMsg(MsgConstant::ERROR_GET_ACCESS_TOKEN, '获取ACCESS_TOKEN失败');
     }
     $accessToken['time'] = time();
     $accessTokenJson = json_encode($accessToken);
     //存入数据库
     $db = new mysql();
     $db->connect(DBHOST, DBUSER, DBPASSWORD, DBNAME);
     $sql = "update accesstoken set access_token='" . $accessTokenJson . "' where id=1";
     $db->query($sql);
     return $accessToken;
 }
Exemple #11
0
 /**
  * @descrpition 从微信服务器获取微信ACCESS_TOKEN
  * @return Ambigous|bool
  */
 private function _getAccessToken()
 {
     $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . WECHAT_APPID . '&secret=' . WECHAT_APPSECRET;
     $accessToken = Curl::callWebServer($url, '', 'GET');
     if (!isset($accessToken['access_token'])) {
         return Msg::returnErrMsg(MsgConstant::ERROR_GET_ACCESS_TOKEN, '获取ACCESS_TOKEN失败');
     }
     $accessToken['time'] = time();
     $accessTokenJson = json_encode($accessToken);
     //存入数据库
     /**
      * 这里通常我会把access_token存起来,然后用的时候读取,判断是否过期,如果过期就重新调用此方法获取,存取操作请自行完成
      *
      * 请将变量$accessTokenJson给存起来,这个变量是一个字符串
      */
     return $accessToken;
 }
 /**
  * @descrpition 从微信服务器获取js sdk api_ticket
  * @return Ambigous|bool
  */
 private static function _getJsapiTicket()
 {
     $accessToken = AccessToken::getAccessToken();
     $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=" . $accessToken;
     $JsapiTicket = Curl::callWebServer($url, '', 'GET');
     if (!isset($JsapiTicket['ticket'])) {
         return Msg::returnErrMsg(MsgConstant::ERROR_GET_ACCESS_TOKEN, '获取js ticket失败');
     }
     $JsapiTicket['time'] = time();
     $JsapiTicketJson = json_encode($JsapiTicket);
     //存入数据库
     $db = new mysql();
     $db->connect(DBHOST, DBUSER, DBPASSWORD, DBNAME);
     $sql = "update jsapiticket set ticket='" . $JsapiTicketJson . "' where id=1";
     $db->query($sql);
     return $JsapiTicket;
 }
Exemple #13
0
 public function parseRequest($request)
 {
     if (!empty($request[$this->colName]['pass']) && !empty($request[$this->colName]['pass'])) {
         if (empty($request[$this->colName]['pass'])) {
             \Msg::add('Вы не ввели пароль в первое поле', 'danger');
             return FALSE;
         }
         if (empty($request[$this->colName]['repeat'])) {
             \Msg::add('Вы не ввели пароль во второе поле', 'danger');
             return FALSE;
         }
         if ($request[$this->colName]['pass'] != $request[$this->colName]['repeat']) {
             \Msg::add('Введенные пароли не совадают', 'danger');
             return FALSE;
         }
         $this->activeForm->model->{$this->colName} = \App::$cur->users->hashpass($request[$this->colName]['pass']);
     }
 }
Exemple #14
0
 public function init()
 {
     \App::$cur->view->customAsset('js', '/static/moduleAsset/UserForms/js/formCatcher.js');
     if (!empty($_POST['UserForms'])) {
         foreach ($_POST['UserForms'] as $form_id => $inputs) {
             $form = \UserForms\Form::get((int) $form_id);
             if (!$form) {
                 continue;
             }
             $formRecive = new \UserForms\Recive();
             $formRecive->user_id = (int) \Users\User::$cur->id;
             $formRecive->form_id = (int) $form_id;
             $data = [];
             $error = false;
             foreach ($form->inputs as $input) {
                 if (isset($inputs['input' . $input->id])) {
                     $data['input' . $input->id] = htmlspecialchars($inputs['input' . $input->id]);
                 } elseif ($input->required) {
                     $error = true;
                     Msg::add('Вы не заполнили поле: ' . $input->label);
                 } else {
                     $data['input' . $input->id] = '';
                 }
             }
             if (!$error) {
                 $formRecive->data = json_encode($data);
                 $formRecive->save();
             }
         }
         if (!$error && !empty(App::$cur->config['site']['email'])) {
             $text = '';
             foreach ($form->inputs as $input) {
                 if (isset($inputs['input' . $input->id])) {
                     $text .= "<b>{$input->label}:</b> " . htmlspecialchars($inputs['input' . $input->id]) . "<br />";
                 }
             }
             if ($text) {
                 $text = 'Дата получения по серверному времени: ' . date('Y-m-d H:i:s') . '<br />Заполненые поля:<br />' . $text;
                 Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $form->name, $text);
             }
         }
         Tools::redirect($_SERVER['REQUEST_URI'], 'Ваша форма была успешно отправлена', 'success');
     }
 }
Exemple #15
0
	function datetime($format, Date $date) {
		// TODO you can only use dd MM yy yyyy HH mm ss
		$format = Msg::get($format);
		$patterns[0] = '/dd/';
		$patterns[1] = '/MM/';
		$patterns[2] = '/yyyy/';
		$patterns[3] = '/yy/';
		$patterns[4] = '/HH/';
		$patterns[5] = '/mm/';
		$patterns[6] = '/ss/';
		$replacements[6] = sprintf("%02d", $date->date);
		$replacements[5] = sprintf("%02d", $date->month);
		$replacements[4] = sprintf("%04d", $date->year);
		$replacements[3] = sprintf("%02d", $date->year % 100);
		$replacements[2] = sprintf("%02d", $date->hour);
		$replacements[1] = sprintf("%02d", $date->minute);
		$replacements[0] = sprintf("%02d", $date->second);
		echo preg_replace($patterns, $replacements, $format);
	}
Exemple #16
0
 public function init()
 {
     $callbacksData = filter_input(INPUT_POST, 'Callbacks', FILTER_REQUIRE_ARRAY);
     if (!empty($callbacksData)) {
         $callback = new \Callbacks\Callback();
         $error = false;
         if (empty($callbacksData['text'])) {
             $error = true;
             Msg::add('Вы не написали текст отзыва');
         } else {
             $callback->text = nl2br(htmlspecialchars($callbacksData['text']));
         }
         if (empty($callbacksData['name'])) {
             $error = true;
             Msg::add('Вы не указали свое имя');
         } else {
             $callback->name = htmlspecialchars($callbacksData['name']);
         }
         if (empty($callbacksData['phone'])) {
             $error = true;
             Msg::add('Вы не указали свой номер телефона');
         } else {
             $callback->phone = htmlspecialchars($callbacksData['phone']);
         }
         $files = filter_var($_FILES['Callbacks'], FILTER_REQUIRE_ARRAY);
         if (!empty($files['tmp_name']['photo'])) {
             $callback->image_file_id = App::$cur->files->upload(['name' => $files['name']['photo'], 'tmp_name' => $files['tmp_name']['photo']]);
         }
         $callback->mail = htmlspecialchars($callbacksData['mail']);
         $callback->type_id = (int) $callbacksData['type'];
         if (!$error) {
             $callback->save();
             if (!empty(App::$cur->config['site']['email'])) {
                 $subject = 'Новый отзыв';
                 $text = 'Вы можете его посмотреть по этому адресу: <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/callbacks">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/callbacks</a>';
                 Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $subject, $text);
             }
             Tools::redirect('/', 'Ваш отзыв был получен и появится после обработки администратором', 'success');
         }
     }
 }
    /**
     * @descrpition 从微信服务器获取微信API_TICKET
     * @return Ambigous|bool
     */
    private static function _getApiTicket(){
        $accessToken = AccessToken::getAccessToken(true);
        $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=$accessToken";

        $apiTicket = Curl::callWebServer($url, '', 'GET');
        if(!isset($apiTicket['ticket'])){
            return Msg::returnErrMsg(MsgConstant::ERROR_GET_API_TICKET, '获取API_TICKET失败');
        }
        $apiTicket['time'] = time();
        $apiTicketJson = json_encode($apiTicket);
        //存入数据库
        /**
         * 这里通常我会把api_ticket存起来,然后用的时候读取,判断是否过期,如果过期就重新调用此方法获取,存取操作请自行完成
         *
         * 请将变量$apiTicketJson给存起来,这个变量是一个字符串
         */
        $f = fopen(self::_fileName2Store(), 'w+');
        fwrite($f, $apiTicketJson);
        fclose($f);
        return $apiTicket;
    }
Exemple #18
0
} elseif ($year) {
    LogStats::monthly($table, $year);
} else {
    LogStats::yearly($table);
}
if ($table == 'record') {
    include_once "../model/Query/Page/Record.php";
    $logQ = new Query_Page_Record();
} else {
    include_once "../model/Query/Page/Access.php";
    $logQ = new Query_Page_Access();
    $profiles = array(OPEN_PROFILE_ADMINISTRATOR => _("Administrator"), OPEN_PROFILE_ADMINISTRATIVE => _("Administrative"), OPEN_PROFILE_DOCTOR => _("Doctor"));
}
if (!$logQ->select($year, $month, $day)) {
    $logQ->close();
    echo Msg::info(_("No logs in this date."));
    include_once "../layout/footer.php";
    exit;
}
$thead = array(_("#"), _("Access Date"), _("Login"));
if ($table == 'record') {
    $thead[] = _("Table");
    $thead[] = _("Operation");
    $thead[] = _("Data");
} else {
    $thead[] = _("Profile");
}
$options = array('align' => 'center', 0 => array('align' => 'right'));
$tbody = array();
for ($i = 1; $log = $logQ->fetch(); $i++) {
    $row = $i . '.';
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMsg0()
 {
     return $this->hasOne(Msg::className(), ['id' => 'msg']);
 }
 * Retrieving get vars
 */
$idMember = intval($_GET["id_member"]);
$surname1 = Check::safeText($_GET["surname1"]);
$surname2 = Check::safeText($_GET["surname2"]);
$firstName = Check::safeText($_GET["first_name"]);
/**
 * Show page
 */
$title = _("Delete Staff Member");
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Admin") => "../admin/index.php", _("Staff Members") => $returnLocation, $title => "");
echo HTML::breadcrumb($links, "icon icon_staff");
unset($links);
/**
 * Form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../admin/staff_del.php'));
$tbody = array();
$tbody[] = Msg::warning(sprintf(_("Are you sure you want to delete staff member, %s %s %s?"), $firstName, $surname1, $surname2));
$tbody[] = Form::hidden("id_member", $idMember);
$tfoot = array(Form::button("delete", _("Delete")) . Form::generateToken());
$options = array('class' => 'center');
echo Form::fieldset($title, $tbody, $tfoot, $options);
echo HTML::end('form');
echo Msg::hint('* ' . _("Note: The del function will delete the related user too (if exists)."));
echo HTML::para(HTML::link(_("Return"), $returnLocation));
require_once "../layout/footer.php";
 /**
  *@descrpition 从文件中获取access_token
  * @return string
  */
 private static function _getFromFile()
 {
     if (self::_existsToken()) {
         if (self::_expriseToken()) {
             //重新获取一次access_token,并且将文件删除,重新向文件里面写一次
             $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . WECHAT_APPID . '&secret=' . WECHAT_APPSECRET;
             $accessToken = Curl::callWebServer($url, '', 'GET');
             if (!isset($accessToken['access_token'])) {
                 return Msg::returnErrMsg(MsgConstant::ERROR_GET_ACCESS_TOKEN, '获取ACCESS_TOKEN失败');
             }
             unlink('token.txt');
             file_put_contents('token.txt', $accessToken['access_token']);
         } else {
             $accessToken = file_get_contents('token.txt');
         }
     } else {
         $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . WECHAT_APPID . '&secret=' . WECHAT_APPSECRET;
         $accessToken = Curl::callWebServer($url, '', 'GET');
         if (!isset($accessToken['access_token'])) {
             return Msg::returnErrMsg(MsgConstant::ERROR_GET_ACCESS_TOKEN, '获取ACCESS_TOKEN失败');
         }
         file_put_contents('token.txt', $accessToken['access_token']);
     }
     return $accessToken['access_token'];
 }
  document.forms[0].action = "../admin/theme_preview.php";
  document.forms[0].target = "secondary";
  document.forms[0].submit();
}

function editTheme()
{
  document.forms[0].action = "../admin/theme_new.php";
  document.forms[0].target = "";
  document.forms[0].submit();
}
/*]]>*///-->
</script>

<?php 
echo HTML::para(HTML::link(_("Preview Theme"), '#', null, array('onclick' => 'previewTheme(); return false;')) . ' | ' . HTML::link(_("Preload CSS file"), '../admin/theme_preload_css.php', isset($idTheme) ? array('id_theme' => $idTheme, 'copy' => 'Y') : null));
echo HTML::rule();
echo Form::errorMsg();
/**
 * New form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../admin/theme_new.php'));
require_once "../admin/theme_fields.php";
echo HTML::end('form');
echo Msg::hint('* ' . _("Note: The fields with * are required."));
echo HTML::para(HTML::link(_("Return"), $returnLocation));
/**
 * Destroy form values and errors
 */
Form::unsetSession();
require_once "../layout/footer.php";
require_once "../lib/Check.php";
/**
 * Retrieving get vars
 */
$idUser = intval($_GET["id_user"]);
$login = $_GET["login"];
/**
 * Show page
 */
$title = _("Delete User");
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Admin") => "../admin/index.php", _("Users") => $returnLocation, $title => "");
echo HTML::breadcrumb($links, "icon icon_user");
unset($links);
/**
 * Form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../admin/user_del.php'));
$tbody = array();
$tbody[] = Msg::warning(sprintf(_("Are you sure you want to delete user, %s?"), $login));
$row = Form::hidden("id_user", $idUser);
$tbody[] = $row;
$tfoot = array(Form::button("delete", _("Delete")) . Form::generateToken());
$options = array('class' => 'center');
echo Form::fieldset($title, $tbody, $tfoot, $options);
echo HTML::end('form');
echo HTML::para(HTML::link(_("Return"), $returnLocation));
require_once "../layout/footer.php";
    /**
     * @descrpition 图文 - 先调用self::newsItem()再调用本方法
     * @param $fromusername
     * @param $tousername
     * @param $item 数组,每个项由self::newsItem()返回
     * @param $funcFlag 默认为0,设为1时星标刚才收到的消息
     * @return string
     */
    public static function news($fromusername, $tousername, $item, $funcFlag = 0)
    {
        //多条图文消息信息,默认第一个item为大图,注意,如果图文数超过10,则将会无响应
        if (count($item) >= 10) {
            $request = array('fromusername' => $fromusername, 'tousername' => $tousername);
            return Msg::returnErrMsg(MsgConstant::ERROR_NEWS_ITEM_COUNT_MORE_TEN, '图文消息的项数不能超过10条', $request);
        }
        $template = <<<XML
<xml>
    <ToUserName><![CDATA[%s]]></ToUserName>
    <FromUserName><![CDATA[%s]]></FromUserName>
    <CreateTime>%s</CreateTime>
    <MsgType><![CDATA[news]]></MsgType>
    <ArticleCount>%s</ArticleCount>
    <Articles>
    %s
    </Articles>
    <FuncFlag>%s</FuncFlag>
</xml>
XML;
        return sprintf($template, $fromusername, $tousername, time(), count($item), implode($item), $funcFlag);
    }
Exemple #25
0
<?php

foreach (Msg::get() as $msg) {
    ?>
    <div class="alert alert-<?php 
    echo $msg['status'];
    ?>
 alert-dismissable">
      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
      <strong><?php 
    switch ($msg['status']) {
        case 'success':
            echo 'Успех!';
            break;
        case 'danger':
        case 'warning':
            echo 'Внимание!';
            break;
        default:
            echo 'Информация.';
    }
    ?>
</strong> <?php 
    echo $msg['text'];
    ?>
    </div>
    <?php 
}
Msg::flush();
 /**
  * @descrpition 分发请求
  * @param $request
  * @return array|string
  */
 public static function switchType(&$request)
 {
     $data = array();
     switch ($request['msgtype']) {
         //事件
         case 'event':
             $request['event'] = strtolower($request['event']);
             switch ($request['event']) {
                 //关注
                 case 'subscribe':
                     //二维码关注
                     if (isset($request['eventkey']) && isset($request['ticket'])) {
                         $data = self::eventQrsceneSubscribe($request);
                         //普通关注
                     } else {
                         $data = self::eventSubscribe($request);
                     }
                     break;
                     //扫描二维码
                 //扫描二维码
                 case 'scan':
                     $data = self::eventScan($request);
                     break;
                     //地理位置
                 //地理位置
                 case 'location':
                     $data = self::eventLocation($request);
                     break;
                     //自定义菜单 - 点击菜单拉取消息时的事件推送
                 //自定义菜单 - 点击菜单拉取消息时的事件推送
                 case 'click':
                     $data = self::eventClick($request);
                     break;
                     //自定义菜单 - 点击菜单跳转链接时的事件推送
                 //自定义菜单 - 点击菜单跳转链接时的事件推送
                 case 'view':
                     $data = self::eventView($request);
                     break;
                     //自定义菜单 - 扫码推事件的事件推送
                 //自定义菜单 - 扫码推事件的事件推送
                 case 'scancode_push':
                     $data = self::eventScancodePush($request);
                     break;
                     //自定义菜单 - 扫码推事件且弹出“消息接收中”提示框的事件推送
                 //自定义菜单 - 扫码推事件且弹出“消息接收中”提示框的事件推送
                 case 'scancode_waitmsg':
                     $data = self::eventScancodeWaitMsg($request);
                     break;
                     //自定义菜单 - 弹出系统拍照发图的事件推送
                 //自定义菜单 - 弹出系统拍照发图的事件推送
                 case 'pic_sysphoto':
                     $data = self::eventPicSysPhoto($request);
                     break;
                     //自定义菜单 - 弹出拍照或者相册发图的事件推送
                 //自定义菜单 - 弹出拍照或者相册发图的事件推送
                 case 'pic_photo_or_album':
                     $data = self::eventPicPhotoOrAlbum($request);
                     break;
                     //自定义菜单 - 弹出微信相册发图器的事件推送
                 //自定义菜单 - 弹出微信相册发图器的事件推送
                 case 'pic_weixin':
                     $data = self::eventPicWeixin($request);
                     break;
                     //自定义菜单 - 弹出地理位置选择器的事件推送
                 //自定义菜单 - 弹出地理位置选择器的事件推送
                 case 'location_select':
                     $data = self::eventLocationSelect($request);
                     break;
                     //取消关注
                 //取消关注
                 case 'unsubscribe':
                     $data = self::eventUnsubscribe($request);
                     break;
                     //群发接口完成后推送的结果
                 //群发接口完成后推送的结果
                 case 'masssendjobfinish':
                     $data = self::eventMassSendJobFinish($request);
                     break;
                     //模板消息完成后推送的结果
                 //模板消息完成后推送的结果
                 case 'templatesendjobfinish':
                     $data = self::eventTemplateSendJobFinish($request);
                     break;
                 default:
                     return Msg::returnErrMsg(MsgConstant::ERROR_UNKNOW_TYPE, '收到了未知类型的消息', $request);
                     break;
             }
             break;
             //文本
         //文本
         case 'text':
             $data = self::text($request);
             break;
             //图像
         //图像
         case 'image':
             $data = self::image($request);
             break;
             //语音
         //语音
         case 'voice':
             $data = self::voice($request);
             break;
             //视频
         //视频
         case 'video':
             $data = self::video($request);
             break;
             //小视频
         //小视频
         case 'shortvideo':
             $data = self::shortvideo($request);
             break;
             //位置
         //位置
         case 'location':
             $data = self::location($request);
             break;
             //链接
         //链接
         case 'link':
             $data = self::link($request);
             break;
         default:
             return ResponsePassive::text($request['fromusername'], $request['tousername'], '收到未知的消息,我不知道怎么处理');
             break;
     }
     return $data;
 }
if ($history->getSpouseChildsStatusHealth()) {
    echo HTML::section(3, _("Spouse and Childs Status Health"));
    echo HTML::para(nl2br($history->getSpouseChildsStatusHealth()));
}
if ($history->getFamilyIllness()) {
    echo HTML::section(3, _("Family Illness"));
    echo HTML::para(nl2br($history->getFamilyIllness()));
}
echo HTML::rule();
/**
 * Show closed medical problems
 */
echo HTML::section(2, _("Closed Medical Problems List:"));
$problemQ = new Query_Page_Problem();
if (!$problemQ->selectProblems($idPatient, true)) {
    echo Msg::info(_("No closed medical problems defined for this patient."));
    echo HTML::rule();
}
while ($problem = $problemQ->fetch()) {
    echo HTML::section(3, _("Order Number"));
    echo HTML::para($problem->getOrderNumber());
    if ($problem->getIdMember()) {
        $staffQ = new Query_Staff();
        if ($staffQ->select($problem->getIdMember())) {
            $staff = $staffQ->fetch();
            if ($staff) {
                echo HTML::section(3, _("Attending Physician"));
                echo HTML::para($staff->getSurname1() . ' ' . $staff->getSurname2() . ', ' . $staff->getFirstName());
            }
            $staffQ->freeResult();
        }
Exemple #28
0
	function post() {
		parent::post();
		Msg::remove();
		$this->serverDatas["messages"] = $this->messages;
		echo '<div id="serverDatas" style="display:none">'.JSON::encode($this->serverDatas)."</div>\n";
	}
 public function actionDoDelMsg()
 {
     $msg_id = Yii::app()->request->getQuery('msg_id');
     $model = new Msg();
     $msg = $model->loadMsg($msg_id);
     $return = $msg->delMsg();
     YiicmsHelper::goBack();
     #echo $return;
 }
Exemple #30
0
 function output($template = 'output', $backup_path = null)
 {
     if ($this->hasMethod(__FUNCTION__)) {
         return $this->override(__FUNCTION__, array($template, $backup_path));
     }
     $targetUser = $targetContent = null;
     if ($this->targetUserId) {
         $targetUser = $this->POD->getPerson(array('id' => $this->targetUserId));
     }
     if ($this->targetContentId) {
         if ($this->targetContentType == 'content') {
             $targetContent = $this->POD->getContent(array('id' => $this->targetContentId));
         } else {
             if ($this->targetContentType == 'comment') {
                 $targetContent = $this->POD->getComment(array('id' => $this->targetContentId));
             }
         }
     }
     parent::output($template, array('alert' => $this, 'targetUser' => $targetUser, 'targetContent' => $targetContent), 'alerts', $backup_path);
 }