Пример #1
0
                $c_token = fread($fp, 1000);
                fclose($fp);
                if (strlen($c_token) != 128) {
                    echo $c_token . "<br>";
                    echo "与BT服务器通信出错" . "<br>";
                    exit;
                }
                $token = M_decode($c_token, aeskeyB);
                $g_url = "http://" . BTURL . "buaasso.aspx?m=create&token=" . $token;
                header("Location: " . $g_url, false);
            }
        }
    }
} else {
    if ($m == 'createok') {
        $c_key = $_GET['key'];
        $token1 = $_GET['token'];
        $ssoname = M_decode($c_key, aeskeyA);
        $name = substr($ssoname, 2, 20);
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('bind') . " WHERE token1='{$token1}'");
        if (!($value = $_SGLOBAL['db']->fetch_array($query))) {
            echo "FAILURE:Token error!";
            exit;
        } else {
            $setarr2 = array('sso_name' => $name, 'sso_status' => 1);
            updatetable('bind', $setarr2, array('token1' => $token1));
            echo "OK";
            exit;
        }
    }
}
Пример #2
0
function sendMobileMsg()
{
    global $needSend;
    $aeskeyMobile = getAESKey('Mobile');
    //给领导集中发送短信通知
    foreach ($needSend as $uid => $allmsg) {
        $mergedContent = '【温馨提示】领导您好,';
        $mergedMobile = '';
        foreach ($allmsg as $atuid => $info) {
            $present = '';
            $next = '';
            switch ($info['level']) {
                case 1:
                    $header = '【温馨提示】领导您好,' . $info['name'];
                    $present = '部处';
                    $next = '单位负责人';
                    break;
                case 3:
                    $header = '【温馨提示】领导您好,' . $info['name'];
                    $present = '单位负责人';
                    $next = '主管副校长';
                    break;
                case 7:
                    $header = '【温馨提示】领导您好,' . $info['name'];
                    $present = '主管副校长';
                    $next = '校长';
                    break;
                case 10:
                    if ($mergedMobile) {
                        $mergedContent .= '、' . $info['name'] . '有' . $info['count'] . '条';
                    } else {
                        $mergedMobile = $info['mobile'];
                        $mergedContent = '【温馨提示】领导您好,' . $info['name'] . '有' . $info['count'] . '条';
                    }
                    $present = '校长';
                    $next = '校长';
                    break;
                default:
                    $header = '【温馨提示】领导您好,' . $info['name'];
                    break;
            }
            if ($info['level'] != 10) {
                $content = $header . '有' . $info['count'] . $info['msg'];
                $mobile = M_decode($info['mobile'], $aeskeyMobile);
                $sendtime = '';
                insertMsg($mobile, $uid, $info['mobile'], $content, $sendtime);
            }
            foreach ($info['cc'] as $ccuid => $ccmix) {
                list($ccmobile, $cclevel) = explode(',', $ccmix);
                // switch ($cclevel) {
                //     case 1:
                //         $header = '【温馨提示】领导您好,您';
                //         break;
                //     default:
                //         $header = '【温馨提示】领导您好,'.$info['name'];
                //         break;
                // }
                // if ($info['level'] != 10) {
                //     $content = $header.'有'.$info['count'].'条诉求在规定的时间内未处理,已上报给'.$present.'处,若不处理,将于'.fancyDate($info['dateline']).'上报给'.$next.'.';
                // } else {
                //     $content = $header.'有'.$info['count'].'条诉求在规定的时间内未处理,已上报给'.$present.'处.';
                // }
                $header = '【温馨提示】领导您好,' . $info['name'];
                $content = $header . '有' . $info['count'] . '条诉求在规定的时间内未处理,已上报给' . $present . '处.';
                $mobile = M_decode($ccmobile, $aeskeyMobile);
                $sendtime = '';
                insertMsg($mobile, $ccuid, $ccmobile, $content, $sendtime);
            }
        }
        if ($mergedMobile) {
            $content = $mergedContent . '诉求未处理,请您安排处理.';
            $mobile = M_decode($mergedMobile, $aeskeyMobile);
            $sendtime = '';
            insertMsg($mobile, $uid, $mergedMobile, $content, $sendtime);
        }
    }
}
Пример #3
0
    $Powerlevel = array();
    //存放powerlevel记录
    $mpurl = "admincp.php?dept_uid={$dept_uid}&department={$department}&up_uid={$up_uid}&official={$official}&isdept={$isdept}&mobile={$mobile}&ac=complain&type=setting";
    $perpage = 30;
    $page = empty($_GET['page']) ? 1 : intval($_GET['page']);
    if ($page < 1) {
        $page = 1;
    }
    $start = ($page - 1) * $perpage;
    //检查开始数
    ckstart($start, $perpage);
    $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('powerlevel') . " where {$where}"), 0);
    if ($count) {
        $PowerlevelQuery = $_SGLOBAL['db']->query("SELECT * FROM " . tname('powerlevel') . " where {$where} LIMIT {$start},{$perpage}");
        while ($value = $_SGLOBAL['db']->fetch_array($PowerlevelQuery)) {
            $value['mobile'] = M_decode($value['mobile'], $aeskeyMobile);
            $Powerlevel[] = $value;
        }
        $multi = multi($count, $perpage, $page, $mpurl);
    }
} elseif ($type == 'cloud') {
    $tab = 5;
    $firstday = date("Ym01", time());
    $nowday = date("Ymd");
    $startDay = $_GET['starttime'] ? trim($_GET['starttime']) : $firstday;
    $endDay = $_GET['endtime'] ? trim($_GET['endtime']) : $nowday;
    $query = $_SGLOBAL['db']->query("select tag_word as text, sum(tag_count) as weight from " . tname("complain_tagcloud") . "  where datatime >= '{$startDay}' and datatime < '{$endDay}' group by tag_word");
    $tags = array();
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $tags[] = $value;
    }