Beispiel #1
0
    $str = file_get_contents($api_url);
    $tj = 'http://pingtcss.qq.com/pingd?dm=yanson.duapp.com&pvi=' . rand(1, 9999999999) . '&si=s' . rand(1, 9999999999) . '&url=/jwc/new.wx.chengji.api.php&arg=&ty=&rdm=&rurl=&rarg=&adt=&r2=31957828&r3=-1&r4=1&fl=12.0&scr=1280x960&scl=24-bit&lg=zh-cn&jv=1&tz=-8&ct=&ext=adid=&pf=&random=1397458406451';
    file_get_contents($tj);
    if (strstr($str, "请确认用户名或密码是否正确")) {
        return $this->respText("【账号】或【密码】错误");
    }
    //输出名字
    $name = $row_info['realname'];
    $xb = $row_info['xb'];
    if ($xb == '男') {
        $ch = '同学';
    }
    if ($xb == '女') {
        $ch = '同学';
    }
    $string = po_chengji_new($str);
    $title = "{$name} {$ch}欢迎使用\n【广药学生成绩查询】";
    return $this->respText($title . "\n\n" . $string);
}
function get_utf8_string($content)
{
    $encoding = mb_detect_encoding($content, array('ASCII', 'UTF-8', 'GB2312', 'GBK', 'BIG5'));
    return mb_convert_encoding($content, 'utf-8', $encoding);
}
function po_chengji_new($str)
{
    preg_match('/<table cellspacing=\\"0\\" cellpadding=\\"3\\" rules=\\"rows\\" bordercolor=\\"#ADCEEF\\" border=\\"1\\" id=\\"DataGrid1\\" width=\\"100%\\">(?P<info>.+?)<\\/table>/s', $str, $results);
    $array = get_td_array($results['info']);
    array_splice($array, 0, 1);
    /*
    Array
if (strstr($str, "<script>")) {
    echo "【账号】或【密码】错误";
    return;
}
/* Conan 注释
{//输出名字
$sql_name = "SELECT * FROM `jwc_personinfo` WHERE `xh` = '{$xh}' LIMIT 1 ";
$query_char=mysql_query("SET NAMES UTF8");
$query_name=mysql_query($sql_name,$link) or die(mysql_error());
$name_ret=mysql_fetch_row($query_name);
$name=$name_ret[2];
$xb=$name_ret[4];
if($xb=='男'){$ch='同学';}
if($xb=='女'){$ch='同学';}
}*/
$string = po_chengji_new($str, $xh, $name, $ch, $link);
//$title="{$name} {$ch}欢迎使用\n【广药学生成绩查询】";
//echo $title."\n\n".$string;
echo $string;
return;
/*
{//搜索数据库是否已经有数据
$sql_check = "SELECT * FROM `jwc_chengji` WHERE `xh` = '{$xh}' LIMIT 1 ";
$query_char=mysql_query("SET NAMES UTF8");
$query_check=mysql_query($sql_check,$link) or die(mysql_error());
$check_ret=mysql_fetch_row($query_check);
}
*/
/* 判断0910级
if(mb_strcut($xh, 0, 2, 'utf-8')=='10'||mb_strcut($xh, 0, 2, 'utf-8')=='09'){
  echo "亲爱的{$name} {$ch}\n\n由于您的成绩数据太多了...微信显示不过来,希望您能到网站上查询\n\nPC网页版查询地址\n\nwww.i694.net\chengji\n(节省流量推荐用电脑打开)\n\n给你们带来不便\n望能多多体谅";