Ejemplo n.º 1
0
 function createMeeting($doctor_name, $starttime, $endtime)
 {
     $site = $this->site;
     $loginName = $this->loginName;
     $password = $this->password;
     $organizerPwd = $this->organizerPwd;
     $subject = "【视频会诊】" . $doctor_name . $starttime;
     $startTime = date("Y-m-d h:i:s", strtotime($starttime) - 60 * 15);
     $endTime = date("Y-m-d h:i:s", strtotime($endtime) + 60 * 15);
     $url = "http://{$site}/integration/site/webcast/created?loginName={$loginName}&password={$password}&organizerPwd={$organizerPwd}";
     $url .= "&subject={$subject}&startTime={$startTime}&endTime={$endTime}";
     $url .= "&opened=true&switchClient=true";
     $url .= "&realtime=true&organizerToken=333333&panelistToken=888888&attendeeToken=666666";
     //$url.="&subject=$subject&startTime=$startTime&endTime=$endTime";
     //$url.="&subject=$subject&startTime=$startTime&endTime=$endTime";
     //$url.="&subject=$subject&startTime=$startTime&endTime=$endTime";
     $url = str_replace(" ", "%20", $url);
     $str = file_get_contents("{$url}");
     $ret = json_decode($str, true);
     if ($ret["code"] != "0") {
         logger_mgr::logError("GENSEE create meeting,url:{$url} :{$str}");
     } else {
         logger_mgr::logDebug("GENSEE create meeting,url:{$url} :{$str}");
     }
     return $ret;
 }
Ejemplo n.º 2
0
 public function Upload($file, $path, $name)
 {
     if ($file["error"] > 0) {
         logger_mgr::logError("Return Code: " . $file["error"]);
         return "error";
     } else {
         logger_mgr::logDebug("Upload: " . $file["name"]);
         logger_mgr::logDebug("Type: " . $file["type"]);
         logger_mgr::logDebug("Size: " . $file["size"]);
         logger_mgr::logDebug("Temp file: " . $file["tmp_name"]);
         if (file_exists($path . $name)) {
             logger_mgr::logError($path . $name . " already exists. ");
             return "exists";
         } else {
             move_uploaded_file($file["tmp_name"], $path . $name);
             logger_mgr::logDebug("Stored in: " . $path . $name);
             return "success";
         }
     }
 }
Ejemplo n.º 3
0
 public function send($to, $subject, $body)
 {
     $sitename = $this->sitename;
     $from = $this->from;
     $this->mail->setFrom($from, $sitename);
     // 设置发件人地址和名称
     $this->mail->AddReplyTo($from, $sitename);
     $this->mail->Subject = "=?utf-8?B?" . base64_encode($subject) . "?=";
     // 设置邮件标题
     $this->mail->AltBody = "为了查看该邮件,请切换到支持 HTML 的邮件客户端";
     // 可选项,向下兼容考虑
     $this->mail->MsgHTML($body);
     // 设置邮件内容
     $this->mail->AddAddress($to, $sitename);
     //$mail->AddAttachment("images/phpmailer.gif"); // 附件
     if (!$this->mail->Send()) {
         logger_mgr::logError("MAIL :sent {$to} fail, " . $this->mail->ErrorInfo);
     } else {
         logger_mgr::logDebug("MAIL :sent {$to}");
     }
 }
Ejemplo n.º 4
0
 public function submit($info)
 {
     global $CONFIG;
     $sdk = new SDK(OpenSdkConfig::APPID, OpenSdkConfig::KEYSECRET, OpenSdkConfig::SOURCENO);
     $mainParams = array('timestamp' => time() * 1000, 'channel' => 'PC', 'ipAddress' => '', 'sessionId' => '', 'deviceFinger' => '', 'deviceToken' => '', 'longitude' => '', 'latitude' => '');
     $arr = array();
     $arr["urlKey"] = "cash_desk";
     $arr["loginName"] = $info["mobile"];
     $arr["mobile"] = $info["mobile"];
     $arr["outCustomerId"] = $info["mobile"];
     $arr["outTradeNo"] = $info["order_no"];
     $arr["merchantNo"] = OpenSdkConfig::SOURCENO;
     $arr["childMerchantNo"] = OpenSdkConfig::SOURCENO;
     $arr["amount"] = 1;
     //$info["price"];
     $arr["currency"] = "CNY";
     $arr["orderBeginTime"] = date('Y-m-d H:i:s');
     $arr["orderExpireTime"] = date('Y-m-d H:i:s', time() + 3600);
     $arr["orderName"] = $info["order_no"];
     $arr["orderNotifyUrl"] = $CONFIG["xbt"]["notify"];
     $arr["orderFrontNotifyUrl"] = $CONFIG["xbt"]["return"];
     $arr["productNo"] = "DOCREMOTE";
     $arr["productName"] = "远程医疗服务";
     $arr["paySource"] = "ANDROID";
     $call = $sdk->cashDesk($mainParams, $arr);
     //echo $call;
     $json = json_decode($call, true);
     //print_r($json);
     if ($json["code"] == "1") {
         logger_mgr::logInfo("xbt:return={$call}");
         return $json["data"]["resultInfo"]["widgetPageUrl"];
     } else {
         logger_mgr::logError("xbt:return={$call}");
         return "ERROR";
     }
 }
Ejemplo n.º 5
0
 /**
  * execute sql statement
  * @param string $sql: sql statement
  * @param string $type: default '', option: CACHE | UNBUFFERED
  * @param int $expires: Cache lifetime, second for unit
  * @param string $dbname: db name
  * @return resource
  */
 function query($sql)
 {
     global $CONFIG;
     if (!($query = @sqlsrv_query($this->conn, $sql))) {
         logger_mgr::logError("sql error :{$sql}");
         if ($this->in_trans) {
             $this->rollback_trans();
         }
         if ($CONFIG['solution_configuration'] == "debug") {
             print_r(sqlsrv_errors());
             echo "<br /> " . $sql;
         } else {
             $msg = 'Sqlsrv Query Error';
         }
         $this->halt($msg, $sql);
     }
     logger_mgr::logDebug("sql :{$sql}");
     $this->querynum++;
     return $query;
 }
Ejemplo n.º 6
0
 /**
  * execute sql statement
  * @param string $sql: sql statement
  * @param string $type: default '', option: CACHE | UNBUFFERED
  * @param int $expires: Cache lifetime, second for unit
  * @param string $dbname: db name
  * @return resource
  */
 function query($sql)
 {
     if (!($query = @mysql_query($sql))) {
         logger_mgr::logError("sql error :{$sql}");
         if ($this->in_trans) {
             $this->rollback_trans();
         }
         $this->halt($sql . 'Sqlsrv Query Error', $sql);
     }
     logger_mgr::logDebug("sql :{$sql}");
     $this->querynum++;
     return $query;
 }
Ejemplo n.º 7
0
 public function SendTest($to)
 {
     $this->resetSDK();
     $arr = array('3', '10');
     $result = $this->rest->sendTemplateSMS($to, $arr, "1");
     if ($result->statusCode != 0) {
         $str = "error code :" . $result->statusCode . " ";
         $str .= "error msg :" . $result->statusMsg . " ";
         logger_mgr::logError("sms :{$str}");
         //TODO 添加错误处理逻辑
     } else {
         $str = "Sendind TemplateSMS success! ";
         // 获取返回信息
         $smsmessage = $result->TemplateSMS;
         $str .= "dateCreated:" . $smsmessage->dateCreated . " ";
         $str .= "smsMessageSid:" . $smsmessage->smsMessageSid . "";
         //TODO 添加成功处理逻辑
         logger_mgr::logDebug("sms :{$str}");
     }
 }
Ejemplo n.º 8
0
 /**
  * execute sql statement
  * @param string $sql: sql statement
  * @param string $type: default '', option: CACHE | UNBUFFERED
  * @param int $expires: Cache lifetime, second for unit
  * @param string $dbname: db name
  * @return resource
  */
 function query($sql)
 {
     if (!($query = @sqlsrv_query($this->conn, $sql))) {
         logger_mgr::logError("sql error :{$sql}");
         if ($this->in_trans) {
             $this->rollback_trans();
         }
         echo "aa";
         print_r(sqlsrv_errors());
         $this->halt($sql . sqlsrv_errors(), $sql);
     }
     logger_mgr::logDebug("sql :{$sql}");
     $this->querynum++;
     return $query;
 }
Ejemplo n.º 9
0
 function logDebug($info)
 {
     if (LOGGER_IS_DEBUG) {
         $l = logger_mgr::get_debug_logger();
         $l->debug($info);
     }
 }
Ejemplo n.º 10
0
 /**
  * execute sql statement
  * @param string $sql: sql statement
  * @param string $type: default '', option: CACHE | UNBUFFERED
  * @param int $expires: Cache lifetime, second for unit
  * @param string $dbname: db name
  * @return resource
  */
 function query($sql)
 {
     global $CONFIG;
     if (!($query = @sqlsrv_query($this->conn, $sql))) {
         logger_mgr::logError("sql error :{$sql}");
         if ($this->in_trans) {
             $this->rollback_trans();
         }
         if ($CONFIG['solution_configuration'] == "debug") {
             $res = outResult(-1435, "Sql Error:" . $sql);
             outputXml($res);
         } else {
             $res = outResult(-1435, "Sql Error");
             outputXml($res);
         }
         $this->halt($msg, $sql);
     }
     logger_mgr::logDebug("sql :{$sql}");
     $this->querynum++;
     return $query;
 }
Ejemplo n.º 11
0
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require '../include/common.inc.php';
include ROOT . '/include/init.inc.php';
require ROOT . '/classes/datamgr/order.cls.php';
require ROOT . '/classes/mgr/gensee.cls.php';
require ROOT . '/classes/mgr/sms.cls.php';
require ROOT . '/classes/paymentmgr/payment.interface.php';
require ROOT . '/classes/paymentmgr/alipay.cls.php';
logger_mgr::logInfo("notify alipay start :" . $_SERVER["REQUEST_URI"]);
logger_mgr::logInfo("notify alipay parameter" . ArrayToString($_REQUEST));
$alipay = new AlipayMgr();
$ret = $alipay->callback();
logger_mgr::logInfo("notify alipay verify return " . ArrayToString($ret));
$order_no = $ret["out_trade_no"];
$trade_no = $ret["trade_no"];
$info = $orderMgr->getOrderByNo($order_no);
$id = $info["id"];
$meeting_time = explode("-", $info["meeting_time"]);
$smarty->assign("info", $info);
if ($ret["result"] != "SUCCESS") {
    $smarty->assign("reason", "付款失败");
    $smarty->assign("reason_message", "请返回支付宝重新付款,谢谢你的支持。");
    $smarty->display(ROOT . '/templates/Order/fail.html');
    exit;
}
if ($info["meeting_id"] == "") {
    $meetingret = $genseeMgr->createMeeting($info["doctor_name"], $info["meeting_date"] . " " . $meeting_time[0], $info["meeting_date"] . " " . $meeting_time[1]);
    $orderMgr->updateMeetingInfo($id, $meetingret);
Ejemplo n.º 12
0
<?php

require '../include/common.inc.php';
require ROOT . '/classes/datamgr/order.cls.php';
require ROOT . '/classes/paymentmgr/xbt.cls.php';
require ROOT . '/classes/datamgr/sms.cls.php';
logger_mgr::logInfo("notify XBT parameter" . ArrayToString($_REQUEST));
if ($_REQUEST["tradeStatus"] == "SUCCESS") {
    $info = $orderMgr->getOrderByOrderNo($_REQUEST["outTradeNo"]);
    $orderMgr->updateOrderPayment($info["id"], "XBT", $_REQUEST["trade_no"]);
    $smsMgr->SendQueryConfirm($info["mobile"], $info["tag_name"], $info["order_date"] . " " . $info["order_time"]);
}