示例#1
0
 $class = new patient();
 $info = $class->getInfo((int) $_POST["id"]);
 $baseinfo = array();
 $status = explode(",", $info['qa_status']);
 for ($i = 0; $i < $actionkey; $i++) {
     if (empty($status[$i])) {
         $status[$i] = 0;
     }
 }
 $status[$actionkey] = 1;
 $baseinfo['qa_status'] = join(",", $status);
 $class->edit($baseinfo, $_POST["id"]);
 // echo $baseinfo['qa_status'];
 // mail通知
 $cusClass = new registration();
 $customerInfo = $cusClass->getCustomer($_SESSION['customer_id']);
 if ($customerInfo['group_id'] >= 2) {
     //提問
     $createInfo = $cusClass->getCustomer($info['create_userid']);
     $mail_to = $createInfo["email"];
     $mail_name = $createInfo["name"];
     $msg = "有人對 Patient No. " . $_POST['id'] . " 提出疑問<p>" . $_POST["content"];
 } else {
     //回覆
     $sql = "select q.user_id from _web_question q left join _web_registration_group rg on (q.user_id=rg.id) where rg.group_id>=2 and q.id!=" . $qid . " and q.user_id!=" . $_SESSION['customer_id'] . " and q.actionkey='" . (int) $actionkey . "' order by q.add_time desc limit 1";
     $lastInfo = $webdb->getValue($sql);
     // $sql="select r.email,r.name from _web_registration r left join _web_registration_group rg on (r.group_id=rg.id) where r.id='".(int)$customer_id."' order by add_time desc";
     // $replyInfo=$webdb->getValue($sql);
     $replyInfo = $cusClass->getCustomer($lastInfo['user_id']);
     $mail_to = $replyInfo["email"];
     $mail_name = $replyInfo["name"];
示例#2
0
if ($_GET["action"]) {
    $_GET["action"] = addslashes(strip_tags(trim($_GET["action"])));
    $subPage = $_GET["action"] . ".html";
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if ($action == '') {
    $action = 'index';
}
if ($action != "index") {
    if (!isset($_SESSION['customer_id'])) {
        redirect("index.php");
    } else {
        $_SESSION['customer_id'] = (int) $_SESSION['customer_id'];
        if ($_SESSION['customer_id']) {
            $cusClass = new registration();
            $customerInfo = $cusClass->getCustomer($_SESSION['customer_id']);
        } else {
            $customerInfo = array();
        }
    }
    if (isset($_GET['patient_id'])) {
        $_SESSION['patient_id'] = (int) $_GET['patient_id'];
    } else {
        if (!in_array($_GET["action"], $action_pages)) {
            // unset($_SESSION['patient_id']);
        }
    }
    if ($_SESSION['patient_id']) {
        $patientClass = new patient();
        $patientInfo = $patientClass->getInfo((int) $_SESSION['patient_id']);
        if ($patientInfo['birthday'] == '0000-00-00') {