$wheresql = " WHERE s_body like '%{$key}%'"; } if ($key_type === 2) { $wheresql = " WHERE s_mobile = '{$key}'"; } $oederbysql = ""; } $_GET['s_type'] != '' ? $wheresqlarr['s_type'] = intval($_GET['s_type']) : ''; if (!empty($wheresqlarr)) { $wheresql = wheresql($wheresqlarr); } $total_sql = "SELECT COUNT(*) AS num FROM " . table('smsqueue') . $wheresql; $page = new page(array('total' => $db->get_total($total_sql), 'perpage' => $perpage)); $currenpage = $page->nowindex; $offset = ($currenpage - 1) * $perpage; $list = get_smsqueue($offset, $perpage, $wheresql . $oderbysql); $smarty->assign('navlabel', "list"); $smarty->assign('list', $list); $smarty->assign('page', $page->show(3)); $smarty->display('smsqueue/admin_smsqueue_list.htm'); } elseif ($act == 'smsqueue_add') { get_token(); $label[] = array('{sitename}', '网站名称'); $label[] = array('{sitedomain}', '网站域名'); $label[] = array('{sitelogo}', '网站LOGO'); $label[] = array('{address}', '联系地址'); $label[] = array('{tel}', '联系电话'); $smarty->assign('label', $label); $smarty->assign('navlabel', 'add'); $smarty->display('smsqueue/admin_smsqueue_add.htm'); } elseif ($act == 'smsqueue_add_save') {
refresh_cache('sms_templates'); adminmsg("保存成功!", 2, $link); } elseif ($act == 'send') { get_token(); $smarty->assign('pageheader', "短信营销"); require_once dirname(__FILE__) . '/include/admin_smsqueue_fun.php'; require_once QISHI_ROOT_PATH . 'include/page.class.php'; $uid = intval($_GET['uid']); $mobile = trim($_GET['mobile']); $wheresql = ' WHERE s_uid=' . $uid . ' ORDER BY s_id DESC '; $total_sql = "SELECT COUNT(*) AS num FROM " . table('smsqueue') . $wheresql; $perpage = 10; $page = new page(array('total' => $db->get_total($total_sql), 'perpage' => $perpage)); $currenpage = $page->nowindex; $offset = ($currenpage - 1) * $perpage; $sms_log = get_smsqueue($offset, $perpage, $wheresql); $url = trim($_REQUEST['url']); if (empty($url)) { $url = "?act=send&mobile={$mobile}&uid={$uid}"; } $smarty->assign('url', $url); $smarty->assign('smslog', $sms_log); $smarty->assign('page', $page->show(3)); $smarty->display('sms/admin_sms_send.htm'); } elseif ($act == 'sms_send') { check_token(); $txt = trim($_POST['txt']); $mobile = trim($_POST['mobile']); $uid = intval($_POST['uid']); $url = trim($_REQUEST['url']); if (!$uid) {