예제 #1
0
파일: getpassword.php 프로젝트: nanfs/lt
         $cnde = $code . '-' . $nber . '-' . $admin_list['admin_id'];
         /*发送短信*/
         require_once ROOTPATH . 'include/export.func.php';
         $domain = strdomain($met_weburl);
         $message = "{$lang_password9}{$code}{$lang_password10}{$nber}[{$domain}]";
         $smsok = sendsms($admin_list['admin_mobile'], $message, 5);
         if ($smsok == 'SUCCESS') {
             $mobile = substr($admin_list['admin_mobile'], 0, 3) . '****' . substr($admin_list['admin_mobile'], 7, 10);
             $description = $lang_password11 . '<br/><span class="color999">' . $lang_password12 . '</span>';
             $query = "delete from {$met_otherinfo} where lang = 'met_cnde'";
             $db->query($query);
             /*写入数据库*/
             $query = "INSERT INTO {$met_otherinfo} SET \n\t\t\t\t\t\tauthpass = '******',\n\t\t\t\t\t\tlang     = 'met_cnde'";
             $db->query($query);
         } else {
             okinfo('getpassword.php', sedsmserrtype($smsok));
         }
     } else {
         okinfo('getpassword.php', $lang_password13);
     }
 } else {
     $admin_list = $db->get_one("SELECT * FROM {$met_admin_table} WHERE admin_id='{$admin_mobile}' and usertype='3'");
     if ($admin_list && $admin_list['admin_email'] == '') {
         okinfo('../admin/getpassword.php', $lang_password14);
     }
     if (!$admin_list) {
         if (!is_email($admin_mobile)) {
             okinfo('../admin/getpassword.php', $lang_password7);
         }
         $admin_list = $db->get_one("SELECT * FROM {$met_admin_table} WHERE admin_email='{$admin_mobile}' and usertype='3'");
         if (!$admin_list) {
예제 #2
0
} else {
    $total_count = $db->counter($met_sms, "{$serch_sql}", "*");
}
require_once 'include/pager.class.php';
$page = (int) $page;
if ($page_input) {
    $page = $page_input;
}
$list_num = 20;
$rowset = new Pager($total_count, $list_num, $page);
$from_record = $rowset->_offset();
$query = "SELECT * FROM {$met_sms} {$serch_sql} order by time desc LIMIT {$from_record}, {$list_num}";
$result = $db->query($query);
while ($list = $db->fetch_array($result)) {
    $list['text'] = utf8substr($list['content'], 0, 15);
    $total_tels = explode(',', $list['tel']);
    $telsnum = count($total_tels);
    $list['telnum'] = $telsnum;
    $list['teltext'] = utf8substr($list['tel'], 0, 11);
    $list['type'] = sedsmstype($list['type']);
    $list['time'] = date('Y-m-d H:i:s', $list['time']);
    $list['remark'] = sedsmserrtype($list['remark'], 1);
    $record_list[] = $list;
}
$page_list = $rowset->link("smsnotes.php?anyid={$anyid}&lang={$lang}&notes_type={$notes_type}&page=");
$css_url = $depth . "../templates/" . $met_skin . "/css";
$img_url = $depth . "../templates/" . $met_skin . "/images";
include template('app/sms/smsnotes');
footer();
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.
예제 #3
0
function sendsms($phone, $message, $type)
{
    global $db, $met_otherinfo, $met_sms, $met_file;
    global $code, $lang_smstips66;
    /*验证商业用户*/
    $varcode = varcodeb('sms');
    $varcode = $varcode['re'] == 'SUC' ? $varcode['md5'] : '';
    /*发送短信*/
    $total_pass = $db->get_one("SELECT * FROM {$met_otherinfo} WHERE lang='met_sms'");
    if ($total_pass) {
        $met_file = '/sms/sendsms.php';
        $post = array('total_pass' => $total_pass['authpass'], 'phone' => $phone, 'message' => $message, 'type' => $type, 'varcode' => $varcode, 'code' => $code);
        $sms = curl_post($post, 30);
        $sms = trim($sms);
        $time = time();
        switch ($sms) {
            case 'SUCCESS':
                $qey = 1;
                break;
            case 'ERR_10':
                $qey = $type == 1 ? 0 : 1;
                break;
            case 'ERR_11':
                $qey = 0;
                break;
            case 'ERR_12':
                $qey = 0;
                break;
            case 'ERR_13':
                $qey = $type == 1 ? 0 : 1;
                break;
            case 'ERR_14':
                $qey = $type == 1 ? 0 : 1;
                break;
            case 'ERR_15':
                $qey = 0;
                break;
            case 'ERR_16':
                $qey = $type == 1 ? 0 : 1;
                break;
            case 'ERR_17':
                $qey = $type == 1 ? 0 : 1;
                break;
            case 'ERR_17':
                $qey = 0;
                break;
        }
        $metinfo = $type == 1 ? sedsmserrtype($sms) : $sms;
        if ($qey) {
            $query = "INSERT INTO {$met_sms} SET\n\t\t\t\ttime     ='{$time}',\n\t\t\t\ttype     ='{$type}',\n\t\t\t\tcontent  ='{$message}',\n\t\t\t\ttel      ='{$phone}',\n\t\t\t\tremark   ='{$sms}'";
            $db->query($query);
        }
    } else {
        $metinfo = $lang_smstips66;
    }
    /*删除验证文件*/
    if ($varcode != '') {
        delcodeb($varcode);
    }
    return $metinfo;
}