Beispiel #1
0
 // 构造搜索条件和翻页参数
 if (!empty($_POST['title'])) {
     $arrWhere[] = "user_name LIKE '%" . $_POST['title'] . "%' or real_name LIKE '%" . $_POST['title'] . "' ";
 }
 if (!empty($_POST['pass']) && ($_POST['pass'] == '1' || $_POST['pass'] == '0')) {
     $arrWhere[] = "pass='******'pass'] . "'";
 }
 $strWhere = implode(' AND ', $arrWhere);
 if (!empty($strWhere)) {
     $strWhere = ' WHERE ' . $strWhere;
 }
 if (!isset($_POST['page']) || $_POST['page'] == '') {
     $_POST['page'] = 1;
 }
 $strOrder = ' Order by user_id ';
 $arrInfoList = $objWebInit->getUserList($strWhere, $strOrder, ($_POST['page'] - 1) * $_POST['type_id'], $_POST['type_id'], false);
 unset($arrInfoList['COUNT_ROWS']);
 $arrEmail = array();
 if ($arrInfoList) {
     foreach ($arrInfoList as $v) {
         if (!empty($v['email'])) {
             $arrEmail[] = $v['email'];
         }
     }
     $arrEmail = array_unique($arrEmail);
     $strEmail = implode("\r\n", $arrEmail);
 }
 $arrMOutput["smarty_assign"]['strEmailCount'] = count($arrEmail);
 $arrMOutput["smarty_assign"]['strEmail'] = $strEmail;
 $arrMOutput["smarty_assign"]['strEmailPage'] = ++$_POST['page'];
 //	echo '<pre>';print_r($arrEmail);
Beispiel #2
0
    }
}
$strWhere = implode(' AND ', $arrWhere);
if (!empty($strWhere)) {
    $strWhere = ' WHERE ' . $strWhere;
}
if (empty($_GET['sort'])) {
    $strOrder = ' ORDER BY submit_date DESC';
} elseif ($_GET['sort'] == 1) {
    $strOrder = ' ORDER BY user_id DESC';
} elseif ($_GET['sort'] == 2) {
    $strOrder = ' ORDER BY user_id ASC';
}
$arrLink[] = 'sort=' . $_GET['sort'];
if (!isset($_GET['page']) || $_GET['page'] == '') {
    $_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getUserList($strWhere, $strOrder, ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
//翻页跳转
$strLink = '';
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['arrInfo'] = $arrData;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'index.htm';
$objWebInit->output($arrMOutput);