AdminController.php 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  1. <?php
  2. /**
  3. * 纵横后台
  4. * @author cp
  5. */
  6. if (! defined ( 'IN_ZHASK' )) {
  7. exit ( 'invalid request' );
  8. }
  9. class AdminController extends DooController {
  10. private $userlogic;
  11. private $asklogic;
  12. private $adminlogic;
  13. private $menu = array ('navon' => array () );
  14. private $userinfo = array ('uid' => '0' );
  15. function __construct() {
  16. //parent::__construct ();
  17. Load::controller ( "BaseController" );
  18. $base = new BaseController ();
  19. $rs = $base->admin_init ();
  20. $this->userinfo = $rs ['userinfo'];
  21. $this->menu = $rs ['menu'];
  22. Load::logic ( 'User' );
  23. Load::logic ( 'Ask' );
  24. Load::logic ( 'Admin' );
  25. $this->userlogic = new UserLogic ();
  26. $this->asklogic = new AskLogic ();
  27. $this->adminlogic = new AdminLogic ();
  28. }
  29. /**
  30. * 进入后台登录页面
  31. */
  32. function login() {
  33. $data ['user_info'] = $this->userinfo;
  34. $this->render ( '/admin/login', $data );
  35. }
  36. /**
  37. * 用户登出
  38. */
  39. function admin_user_exit() {
  40. setcookie ( "auth_main", "", time () + 3600 * 24, "/", COOKIE_WEB_SITE );
  41. $this->Messager ( "登出成功", "/" );
  42. }
  43. /**
  44. * 进入后台
  45. */
  46. function do_login() {
  47. $data ['name'] = $this->get_args ( 'name' );
  48. $data ['password'] = $this->get_args ( 'password' );
  49. $user = $this->userlogic->get_users_by_name ( $data ['name'] );
  50. require_once (SITE_PATH . '/protected/plugin/client.php');
  51. $client = new client ( ZHSSO );
  52. $is_login = $client->zhsso_member_login ( $data ['name'], $data ['password'] );
  53. $is_login = explode ( "\r", $is_login );
  54. if (is_numeric ( $is_login [0] )) {
  55. if ($is_login [0] == USERNAME_ONFINE) {
  56. $this->Messager ( "您输入的帐号或者密码有误", "/login" );
  57. //删除用户相关记录--是否有同步删除功能
  58. if ($user) {
  59. //$this->userlogic->delete_user_tem( $user['uid']);
  60. }
  61. } elseif ($is_login [0] == PASSWORD_ERROR)
  62. $this->Messager ( "您输入的帐号或者密码有误", "/login" );
  63. elseif ($is_login [0] == - 3) //USER_NOACTION
  64. $this->Messager ( "用户未激活", "http://sso.smartcost.com.cn/" );
  65. } elseif (! empty ( $is_login [0] )) {
  66. $group = $this->userlogic->get_group_by_id ( $user ['groupid'] );
  67. if ($group ['grouptype'] != 1) {
  68. setcookie ( "auth_main", "", time () + 3600 * 24, "/", COOKIE_WEB_SITE );
  69. header ( 'Content-Type:text/html;charset=utf-8' );
  70. @header ( "Location: " . WEB_SITE . "/messager?content=无权进入后台&url=/" );
  71. }
  72. $userinfo = authcode ( $user ['username'], "tr" );
  73. setcookie ( "auth_main", $userinfo, time () + 3600 * 24, "/", COOKIE_WEB_SITE );
  74. //define ( 'MEMBER_NAME', $user ['username'] );
  75. //define ( "MASTER_ID", $user ['uid'] );
  76. $data ['now'] = 'use';
  77. $data ['li'] = $this->menu ['navon'];
  78. $data ['map'] = '';
  79. header ( 'Content-Type:text/html;charset=utf-8' );
  80. @header ( "Location: " . WEB_SITE . "/index/main_navon" );
  81. }
  82. // //对登录用户认证
  83. // if (empty ( $data ['name'] ) || empty ( $data ['password'] ) || $user_info ['username'] != $data ['name'] || $user_info ['password'] != md5 ( $data ['password'] )) {
  84. //
  85. // $this->Messager ( "请输入正确的账号密码", "/index/main_admin" );
  86. // } else {
  87. // //登录成功-写入session
  88. // $data ['now'] = 'use';
  89. //
  90. // $data ['li'] = $this->menu ['navon'];
  91. //
  92. // $data ['map'] = '';
  93. //
  94. // $this->render ( '/admin/index', $data );
  95. //
  96. // }
  97. }
  98. /**
  99. * 常用操作
  100. */
  101. function navon() {
  102. $data ['now'] = 'use';
  103. $list=$this->adminlogic->get_examine_list();
  104. if(!empty($list)){
  105. $this->menu ['navon'][4]='<a href="/index/main_examine_manage" target="main">审批问题 <b style="color:#f00;">'.count($list).'</b></a>';
  106. }
  107. $data ['li'] = $this->menu ['navon'];
  108. $data ['map'] = '';
  109. $this->render ( '/admin/index', $data );
  110. }
  111. /**
  112. * 获取后台欢迎页
  113. */
  114. function welcome() {
  115. $this->render ( '/admin/welcome' );
  116. }
  117. /**
  118. * 获取用户管理
  119. */
  120. function user_manage() {
  121. $u = "";
  122. $n = "";
  123. $e = "";
  124. $i = "";
  125. $t = "";
  126. $on_page = is_numeric ( $this->params ['on_page'] ) ? $this->params ['on_page'] : 1;
  127. if ($on_page <= 0)
  128. $on_page = 1;
  129. $uid = $this->get_args ( 'uid' );
  130. $uid = is_numeric ( $uid ) ? $uid : 0;
  131. $name = $this->get_args ( 'name' );
  132. $email = $this->get_args ( 'email' );
  133. $regip = $this->get_args ( 'regip' );
  134. $srchregdatestart = $this->get_args ( 'srchregdatestart' );
  135. $srchregdateend = $this->get_args ( 'srchregdateend' );
  136. $page_size = 18;
  137. //检索条件
  138. if ($uid)
  139. $u = " and uid=" . $uid;
  140. if (! empty ( $name ))
  141. $n = " and username like '%" . $name . "%'";
  142. if (! empty ( $email ))
  143. $e = " and email like '%" . $email . "%'";
  144. if (! empty ( $regip ))
  145. $e = " and regip like '%" . $regip . "%'";
  146. if (! empty ( $srchregdatestart ) && ! empty ( $srchregdateend )) {
  147. $srchregdatestart = get_time ( $srchregdatestart );
  148. $srchregdateend = get_time ( $srchregdateend );
  149. $t = " and regtime between " . $srchregdatestart . " and " . $srchregdateend;
  150. }
  151. $condition = " and uid!= 1 " . $u . $n . $e . $i . $t;
  152. $action = "/index/main_user_manage/";
  153. //获取分页相关数据
  154. $page = $this->adminlogic->get_page ( t_user, $condition, $on_page, $page_size, $action, "", "admin" );
  155. $limit = " order by regtime desc limit " . $page ['lower'] . " , " . $page_size . " ";
  156. $page ['user_list'] = $this->userlogic->get_users_list ( array (), $condition, $limit );
  157. $data ['map'] = '用户管理';
  158. $data ['user'] = $page;
  159. $this->render ( '/admin/user_manage', $data );
  160. }
  161. /**
  162. * 添加用户-需要推送用户到通行证
  163. */
  164. function user_manage_add() {
  165. $data ['map'] = '<a href="/index/main_user_manage" target="main" >用户管理</a> » 添加用户';
  166. $this->render ( '/admin/user_manage_add', $data );
  167. }
  168. /**
  169. * 进入编辑用户基本信息
  170. */
  171. function user_manage_edit() {
  172. $uid = $this->check_params ( "uid" );
  173. if (is_numeric ( $uid )) {
  174. if ($uid == SUPER_ADMIN_UID || $uid <= 0) {
  175. echo "请输入正确请求";
  176. die ();
  177. }
  178. } else {
  179. echo "请输入正确请求";
  180. die ();
  181. }
  182. $data ['user'] = $this->userlogic->get_users_information ( $uid );
  183. $data ['group'] = $this->userlogic->get_group ();
  184. $data ['categoryinfo'] = $this->asklogic->get_category_list ();
  185. $data ['map'] = '<a href="/index/main_user_manage" target="main" >用户管理</a> » 编辑用户';
  186. $data ['success'] = "";
  187. $this->render ( '/admin/user_manage_edit', $data );
  188. }
  189. /**
  190. * 修改用户信息
  191. */
  192. function user_manage_update() {
  193. $params ['uid'] = $this->get_args ( 'uid' );
  194. $params ['password'] = $this->get_args ( 'password' );
  195. $confirmpw = $this->get_args ( 'confirmpw' );
  196. $params ['email'] = $this->get_args ( 'email' );
  197. $params ['groupid'] = $this->get_args ( 'groupid' );
  198. $params ['credits'] = $this->get_args ( 'credits' );
  199. $params ['credit1'] = $this->get_args ( 'credit1' );
  200. $params ['gender'] = $this->get_args ( 'gender' );
  201. $params ['bday'] = $this->get_args ( 'bday' );
  202. $params ['phone'] = $this->get_args ( 'phone' );
  203. $params ['qq'] = $this->get_args ( 'qq' );
  204. $params ['msn'] = $this->get_args ( 'msn' );
  205. $params ['signature'] = $this->get_args ( 'signature' );
  206. $params ['expert'] = $this->get_args ( 'expert' );
  207. $params ['cids'] = json_encode ( $_POST ['cids'] );
  208. if ($params ['password'] != $confirmpw) {
  209. echo "密码不一致";
  210. die ();
  211. }
  212. if (is_numeric ( $params ['uid'] )) {
  213. if ($params ['uid'] == SUPER_ADMIN_UID || $params ['uid'] <= 0) {
  214. echo "请输入正确请求";
  215. die ();
  216. }
  217. } else {
  218. echo "请输入正确请求";
  219. die ();
  220. }
  221. $this->userlogic->update_user ( $params );
  222. $data ['user'] = $this->userlogic->get_users_information ( $params ['uid'] );
  223. $data ['group'] = $this->userlogic->get_group ();
  224. $data ['map'] = '<a href="/index/main_user_manage" target="main" >用户管理</a> » 编辑用户';
  225. $data ['success'] = "编辑成功";
  226. header ( 'Content-Type:text/html;charset=utf-8' );
  227. @header ( "Location: /index/main_user_manage_edit/" . $params ['uid'] );
  228. }
  229. /**
  230. * 删除用户
  231. */
  232. function user_manage_delete() {
  233. $type = $this->check_params ( "type" );
  234. $uid = $this->get_args ( 'uid' );
  235. if ($type == "all") {
  236. $this->userlogic->delete_user_and_QA ( $uid );
  237. } else {
  238. $this->userlogic->delete_user ( $uid );
  239. }
  240. Header ( "Location:/index/main_user_manage" );
  241. }
  242. /**
  243. * 用户积分明细
  244. */
  245. function user_manage_credit() {
  246. $uid = $this->check_params ( "uid" );
  247. $data ['map'] = '<a href="/index/main_user_manage" target="main" >用户管理</a> » 用户积分明细';
  248. $data ['creditList'] = $this->asklogic->get_credit_details ( $uid );
  249. $this->render ( '/admin/user_manage_credits', $data );
  250. }
  251. /**
  252. * 专家用户
  253. */
  254. function user_manage_expert() {
  255. $data ['map'] = '专家管理 ';
  256. $param ['expert'] = 1;
  257. $data ['userExpert'] = $this->userlogic->get_users_list ( $param, '', "" );
  258. $this->render ( '/admin/user_manage_expert', $data );
  259. }
  260. /**
  261. * 进入用户组管理
  262. */
  263. function group_manage() {
  264. $data ['group'] = $this->userlogic->get_group ();
  265. $data ['map'] = '用户组管理 ';
  266. $data ['success'] = "";
  267. $this->render ( '/admin/group_manage', $data );
  268. }
  269. /**
  270. * 用户组管理-添加
  271. */
  272. function group_manage_add() {
  273. $params ['grouptitle'] = $this->get_args ( 'grouptitle' );
  274. if (empty ( $params ['grouptitle'] ))
  275. die ( '用户组名称为空' );
  276. $this->userlogic->add_group ( $params );
  277. $data ['group'] = $this->userlogic->get_group ();
  278. $data ['map'] = '用户组管理 ';
  279. $data ['success'] = "<span style='color:red'>添加成功</span>";
  280. $this->render ( '/admin/group_manage', $data );
  281. }
  282. /**
  283. * 用户组管理-编辑
  284. */
  285. function group_manage_edit() {
  286. $params ['groupid'] = $this->get_args ( 'groupid' );
  287. $params ['grouptitle'] = $this->get_args ( 'grouptitle' );
  288. $params ['creditslower'] = $this->get_args ( 'scorelower' );
  289. $this->userlogic->update_group_list ( $params );
  290. $data ['group'] = $this->userlogic->get_group ();
  291. $data ['map'] = '用户组管理';
  292. $data ['success'] = "<span style='color:red'>编辑成功</span> ";
  293. $this->render ( '/admin/group_manage', $data );
  294. }
  295. /**
  296. * 用户组管理-删除
  297. */
  298. function group_manage_delete() {
  299. $groupid = $this->check_params ( "groupid" );
  300. if (is_numeric ( $groupid )) {
  301. if ($groupid == SUPER_ADMIN_ID || $groupid <= 0) {
  302. echo "请输入正确请求";
  303. die ();
  304. }
  305. } else {
  306. echo "请输入正确请求";
  307. die ();
  308. }
  309. $this->userlogic->delete_group ( $groupid );
  310. $data ['group'] = $this->userlogic->get_group ();
  311. $data ['map'] = '用户组管理 ';
  312. $data ['success'] = "<span style='color:red'>删除成功</span> ";
  313. $this->render ( '/admin/group_manage', $data );
  314. }
  315. /**
  316. * 用户组管理-权限设置
  317. */
  318. function group_manage_set() {
  319. $data ['map'] = '用户组权限设置 ';
  320. $data ['success'] = "<span style='color:red'></span> ";
  321. $data ['groupid'] = $this->check_params ( 'groupid' );
  322. $data ['group'] = $this->userlogic->get_group_by_id ( $data ['groupid'] );
  323. $data ['PERMISSIONS'] = Doo::conf ()->PERMISSIONS_ACTION;
  324. include SITE_PATH . '/protected/config/permissions.conf.php';
  325. $data ['PERMISSIONS_user'] = "";
  326. if (isset ( $config ['GENERAL_USER_lv' . $data ['groupid']] ))
  327. $data ['PERMISSIONS_user'] = $config ['GENERAL_USER_lv' . $data ['groupid']];
  328. $this->render ( '/admin/group_manage_set', $data );
  329. }
  330. /**
  331. * 为用户组设置权限
  332. */
  333. function group_manage_update_set() {
  334. $permissions=$this->get_args('permissons_key');
  335. $b=array('##USER7','##/USER7');
  336. $Content="<USER7>
  337. \$config['GENERAL_USER_lv7']=array('index',
  338. 'show_ask_page',
  339. 'login',
  340. 'show_into_home',
  341. 'show_home_answer',
  342. 'show_home_question',
  343. 'do_login',
  344. 'upload_question_img',
  345. 'show_home_per_info',
  346. 'show_home_avatar',
  347. 'show_home_message',
  348. 'show_vip_ask_post',
  349. 'show_ask_post',
  350. 'show_post_enter',
  351. 'show_search',
  352. 'do_support_answer',
  353. 'do_edit_answer',
  354. 'do_edit_question',
  355. 'do_up_price',
  356. 'do_add_supply',
  357. 'upload_avatar',
  358. 'do_update_vip_question',
  359. 'do_add_vip_question',
  360. 'do_delete_answer',
  361. 'do_delete_question',
  362. 'do_question_close',
  363. 'do_update_user_info',
  364. 'do_update_avatar',
  365. 'answer_again',
  366. 'do_reply_question',
  367. 'to_ask_question',
  368. 'do_add_vip_question',
  369. 'do_add_question',
  370. 'show_advisory_page',
  371. 'user_exit',
  372. //编辑问题
  373. 'do_edit_vip_question',
  374. //设置满意
  375. 'set_vip_question_satisfy',
  376. //设置不满意
  377. 'set_vip_question_nosatisfy',
  378. //追加回答
  379. 'do_add_vip_tag',
  380. //评价回答
  381. 'do_comment_vip_answer',
  382. //添加评论
  383. 'do_add_discuss',
  384. //获取退款机会
  385. 'get_vip_refunds',
  386. //交易
  387. 'show_my_pay_oder',
  388. //充值
  389. 'show_my_recharge',
  390. //登录
  391. 'do_login_index',
  392. //充值记录
  393. 'show_recharge_oder',
  394. //编辑邮件
  395. 'do_add_email_config',
  396. 'do_best_answer',
  397. 'show_article_page',
  398. 'show_messager',
  399. 'show_tip2',
  400. 'get_search_works',
  401. );
  402. <USER7>";
  403. $Content="<USER7>fsdfsdfsdfwerewr</USER7>";
  404. preg_match("<USER7>(.*)</USER7>",$Content,$kk);
  405. //ereg_replace("PHP","",$temp)
  406. //preg_replace("^##USER7 ##USER7$", " \$config['GENERAL_USER_lv7']=array() ", $Content);
  407. echo $kk;
  408. // foreach ($permissions as $value){
  409. //
  410. // }
  411. //print_r($permissions);
  412. }
  413. /**
  414. * 进去问题管理-
  415. */
  416. function question_manage() {
  417. $u = "";
  418. $n = "";
  419. $e = "";
  420. $i = "";
  421. $t = "";
  422. $on_page = $this->check_params ( 'on_page' );
  423. $on_page = is_numeric ( $on_page ) ? $on_page : 1;
  424. $authorid = $this->get_args ( 'authorid' );
  425. $title = $this->get_args ( 'title' );
  426. $status = $this->get_args ( 'status' );
  427. $srchregdatestart = $this->get_args ( 'srchregdatestart' );
  428. $srchregdateend = $this->get_args ( 'srchregdateend' );
  429. $page_size = 18;
  430. //检索条件
  431. if ($authorid)
  432. $u = " and author like '%" . $authorid . "%'";
  433. if (! empty ( $title ))
  434. $n = " and title like '%" . $title . "%'";
  435. if ($status >= 1)
  436. $e = " and status = " . $status;
  437. if (! empty ( $srchregdatestart ) && ! empty ( $srchregdateend )) {
  438. $srchregdatestart = get_time ( $srchregdatestart );
  439. $srchregdateend = get_time ( $srchregdateend );
  440. $t = " and time between " . $srchregdatestart . " and " . $srchregdateend;
  441. }
  442. $condition = ' and 1 ' . $u . $n . $e . $i . $t;
  443. $action = "/index/main_question_manage/";
  444. $get = "?status=" . $status . "&authorid=" . $authorid . "&title=" . $title . "&srchregdatestart=" . $srchregdatestart . "&srchregdateend=" . $srchregdateend;
  445. //获取分页相关数据
  446. $page = $this->adminlogic->get_page ( t_question, $condition, $on_page, $page_size, $action, $get, "admin" );
  447. $limit = " order by time desc limit " . $page ['lower'] . " , " . $page_size . " ";
  448. $data ['category'] = $this->asklogic->get_category_list ();
  449. $page ['question_list'] = $this->asklogic->get_questions_list_tem ( array (), $condition, $limit );
  450. $data ['question'] = $page;
  451. $data ['status'] = $status;
  452. $data ['authorid'] = $authorid;
  453. $data ['title'] = $title;
  454. $data ['srchregdatestart'] = $srchregdatestart;
  455. $data ['srchregdateend'] = $srchregdateend;
  456. $data ['map'] = '问题管理 ';
  457. $data ['success'] = "<span style='color:red'></span> ";
  458. $this->render ( '/admin/question_manage', $data );
  459. }
  460. /**
  461. * 移动问题分类
  462. */
  463. function question_manage_move_category() {
  464. }
  465. /**
  466. * 批量关闭问题
  467. */
  468. function question_manage_close() {
  469. $id = $this->get_args ( 'id' );
  470. $status = array ();
  471. $params ['id'] = $id;
  472. for($i = 0; $i < count ( $id ); $i ++) {
  473. array_push ( $status, 9 );
  474. }
  475. $params ['status'] = $status;
  476. $this->userlogic->update_list ( $params, t_question, "id" );
  477. Header ( "Location:/index/main_question_manage" );
  478. }
  479. /**
  480. * 批量删除问题
  481. */
  482. function question_manage_delete() {
  483. $id = $this->get_args ( 'id' );
  484. if (empty ( $id ))
  485. return "/index/main_question_manage";
  486. //推广
  487. //;$id = implode ( ",", $id );
  488. $fundstr=file_get_contents(SITE_PATH . '/protected/config/fund.conf.php') ;
  489. if($fundstr){
  490. foreach ($id as $value){
  491. Doo::loadModel ( 'QuestionDao' );
  492. $questionDao = new QuestionDao ();
  493. $question=$questionDao->get_question_by_id($value);
  494. if($question['price']==1&&$question['status']=1){
  495. Doo::loadModel ( 'FundDao' );
  496. $funddao = new FundDao ();
  497. $fund=$funddao->get_fund_by_amount();
  498. if(!empty($fund)){
  499. $funddao->set_fund_amount_spread("+1",$fund['id']);
  500. }
  501. }
  502. }
  503. }
  504. $this->userlogic->delete_question_list ( $id );
  505. Header ( "Location:/index/main_question_manage" );
  506. }
  507. /**
  508. * 批量设置问题为待解决
  509. */
  510. function question_manage_set_status() {
  511. //只针对已关闭的问题进行操作--是否还有RMB问题
  512. $id = $this->get_args ( 'id' );
  513. $this->userlogic->update_question_list ( $id );
  514. return "/index/main_question_manage";
  515. }
  516. /**
  517. * 进去回答管理-
  518. */
  519. function answer_manage() {
  520. $u = "";
  521. $n = "";
  522. $e = "";
  523. $i = "";
  524. $t = "";
  525. $on_page = $this->check_params ( 'on_page' );
  526. $on_page = is_numeric ( $on_page ) ? $on_page : 1;
  527. $authorid = $this->get_args ( 'author' );
  528. $title = $this->get_args ( 'title' );
  529. $srchregdatestart = $this->get_args ( 'srchregdatestart' );
  530. $srchregdateend = $this->get_args ( 'srchregdateend' );
  531. $page_size = 18;
  532. //检索条件
  533. if ($authorid)
  534. $u = " and author like '%" . $authorid . "%'";
  535. if (! empty ( $title ))
  536. $n = " and title like '%" . $title . "%'";
  537. if (! empty ( $srchregdatestart ) && ! empty ( $srchregdateend )) {
  538. $srchregdatestart = get_time ( $srchregdatestart );
  539. $srchregdateend = get_time ( $srchregdateend );
  540. $t = " and time between " . $srchregdatestart . " and " . $srchregdateend;
  541. }
  542. $condition = $u . $n . $t;
  543. $action = "/index/main_answer_manage/";
  544. $get = "?author=" . $authorid . "&title=" . $title . "&srchregdatestart=" . $srchregdatestart . "&srchregdateend=" . $srchregdateend;
  545. //获取分页相关数据
  546. $page = $this->adminlogic->get_page ( t_answer, $condition, $on_page, $page_size, $action, $get, "admin" );
  547. $limit = " order by time desc limit " . $page ['lower'] . " , " . $page_size . " ";
  548. $data ['category'] = $this->asklogic->get_category_list ();
  549. $answer_list = $this->asklogic->get_answers_list_tem ( array (), $condition, $limit );
  550. foreach ( $answer_list as $key => $value ) {
  551. $answer_list [$key] ['content'] = strip_tags ( $value ['content'] );
  552. }
  553. $page ['answer_list'] = $answer_list;
  554. $data ['answer'] = $page;
  555. $data ['author'] = $authorid;
  556. $data ['title'] = $title;
  557. $data ['srchregdatestart'] = $srchregdatestart;
  558. $data ['srchregdateend'] = $srchregdateend;
  559. $data ['map'] = '回答管理 ';
  560. $data ['success'] = "<span style='color:red'></span> ";
  561. $this->render ( '/admin/answer_manage', $data );
  562. }
  563. /**
  564. * 回答管理-删除回答
  565. */
  566. function answer_manage_delete() {
  567. $data ['map'] = '回答管理 ';
  568. $data ['success'] = "<span style='color:red'></span> ";
  569. $id = $this->get_args ( 'id' );
  570. if (empty ( $id ))
  571. return "/index/main_answer_manage";
  572. $this->userlogic->delete_answer_list ( $id );
  573. return "/index/main_answer_manage";
  574. }
  575. /**
  576. * 名师答疑管理
  577. */
  578. function vip_question_manage() {
  579. $u = "";
  580. $n = "";
  581. $e = "";
  582. $i = "";
  583. $t = "";
  584. $on_page = $this->check_params ( 'on_page' );
  585. $on_page = is_numeric ( $on_page ) ? $on_page : 1;
  586. $authorid = $this->get_args ( 'authorid' );
  587. $title = $this->get_args ( 'title' );
  588. $status = $this->get_args ( 'status' );
  589. $srchregdatestart = $this->get_args ( 'srchregdatestart' );
  590. $srchregdateend = $this->get_args ( 'srchregdateend' );
  591. $page_size = 18;
  592. //检索条件
  593. if ($authorid)
  594. $u = " and author like '%" . $authorid . "%'";
  595. if (! empty ( $title ))
  596. $n = " and title like '%" . $title . "%'";
  597. if ($status >= 1)
  598. $e = " and status = " . $status;
  599. if (! empty ( $srchregdatestart ) && ! empty ( $srchregdateend )) {
  600. $srchregdatestart = get_time ( $srchregdatestart );
  601. $srchregdateend = get_time ( $srchregdateend );
  602. $t = " and time between " . $srchregdatestart . " and " . $srchregdateend;
  603. }
  604. $nowtime = get_time ();
  605. $condition = " " . $u . $n . $e . $i . $t;
  606. $action = "/index/main_vip_question_manage/";
  607. $get = "?status=" . $status . "&authorid=" . $authorid . "&title=" . $title . "&srchregdatestart=" . $srchregdatestart . "&srchregdateend=" . $srchregdateend;
  608. //获取分页相关数据
  609. $page = $this->adminlogic->get_page ( t_vipquestion, $condition, $on_page, $page_size, $action, $get, "admin" );
  610. $limit = " order by time desc limit " . $page ['lower'] . " , " . $page_size . " ";
  611. $data ['category'] = $this->asklogic->get_category_list ();
  612. $page ['question_list'] = $this->asklogic->get_vip_questions_list_admin ( array (), $condition, $limit, "vip" );
  613. $data ['question'] = $page;
  614. $data ['status'] = $status;
  615. $data ['authorid'] = $authorid;
  616. $data ['title'] = $title;
  617. $data ['srchregdatestart'] = $srchregdatestart;
  618. $data ['srchregdateend'] = $srchregdateend;
  619. $data ['map'] = '名师答疑管理 ';
  620. $data ['success'] = "<span style='color:red'></span> ";
  621. $this->render ( '/admin/vip_question_manage', $data );
  622. }
  623. /**
  624. * 编辑回答
  625. */
  626. function vip_question_edit_manage() {
  627. $id = $this->check_params ( 'id' );
  628. $id = is_numeric ( $id ) && $id > 0 ? $id : 1;
  629. $data ['vip_question'] = $this->asklogic->get_vip_questions_by_id ( $id );
  630. //获取回答
  631. $data ['vip_answer'] = $this->asklogic->get_vip_answer_by_id ( $id );
  632. $data ['map'] = '名师答疑管理 ';
  633. $this->render ( '/admin/vip_question_page_manage', $data );
  634. }
  635. /**
  636. * 回答名师答疑
  637. */
  638. function vip_question_add_answer_manage() {
  639. $id = $this->get_args ( 'qid' );
  640. $aid = $this->get_args ( 'aid' );
  641. $content = stripcslashes ( $this->get_args ( 'content_text' ) );
  642. $id = is_numeric ( $id ) && $id > 0 ? $id : 0;
  643. $data ['vip_question'] = $this->asklogic->get_vip_questions_by_id ( $id );
  644. $params ['id'] = array (0 => $aid );
  645. $params ['qid'] = array (0 => $id );
  646. $params ['content'] = array (0 => $content );
  647. $params ['title'] = array (0 => $data ['vip_question'] ['title'] );
  648. $params ['time'] = array (0 => get_date () );
  649. $params ['ip'] = array (0 => client_ip () );
  650. //加入回答
  651. $this->userlogic->update_list ( $params, t_vipanswer, "qid" );
  652. //发邮件
  653. $this->userlogic->send_email ( $data ['vip_question'] ['authorid'], "VIP_NEW_ANSWER", $id, 0 );
  654. //更新检索库
  655. $params ['vip_question'] = $data ['vip_question'];
  656. $ans ['time'] = get_date ();
  657. $ans ['content'] = $content;
  658. $answer = serialize ( array (0 => $ans ) );
  659. $params ['answer'] = $answer;
  660. $this->userlogic->update_vip_question_search ( $params );
  661. //发送系统信息
  662. $this->userlogic->update_vip_question_by_answers ( $id );
  663. $subject = "您的" . $data ['vip_question'] ['title'] . "问题有了新的回答";
  664. $content = "名师答疑-问题&nbsp;<a href=/advisory_page/" . $id . ">" . $data ['vip_question'] ['title'] . "</a>&nbsp;有了新的回答";
  665. $this->userlogic->send_sys_message ( $subject, $content, $data ['vip_question'] ['authorid'] );
  666. //获取回答
  667. $data ['vip_answer'] = $this->asklogic->get_vip_answer_by_id ( $id );
  668. $data ['map'] = '名师答疑管理 ';
  669. $this->render ( '/admin/vip_question_page_manage', $data );
  670. }
  671. /**
  672. * 回答追问--加入检索库
  673. */
  674. function vip_question_add_answeragain_manage() {
  675. $id = $this->get_args ( 'qid' );
  676. $content = stripcslashes ( $this->get_args ( 'answer_again_text' ) );
  677. $id = is_numeric ( $id ) && $id > 0 ? $id : 0;
  678. $data ['vip_question'] = $this->asklogic->get_vip_questions_by_id ( $id );
  679. //获取回答
  680. $data ['vip_answer'] = $this->asklogic->get_vip_answer_by_id ( $id );
  681. //加入追问
  682. $this->userlogic->update_vip_answer ( $content, $data ['vip_answer'] ['id'], $data ['vip_answer'] ['tag'] );
  683. //发邮件
  684. $this->userlogic->send_email ( $data ['vip_question'] ['authorid'], "VIP_FOLLOW_ANSWER", $id, 0 );
  685. //加入检索库
  686. $params ['vip_question'] = $data ['vip_question'];
  687. $answer = $data ['vip_answer'];
  688. $ans ['aid'] = $answer ['id'];
  689. $ans ['time'] = $answer ['time'];
  690. $ans ['content'] = $answer ['content'];
  691. $ans ['comment'] = $answer ['comment'];
  692. $tag_list = unserialize ( $answer ['tag'] );
  693. array_push ( $tag_list, $content );
  694. $tag = serialize ( $tag_list );
  695. $ans ['tag'] = $tag;
  696. $answer = serialize ( array (0 => $ans ) );
  697. $params ['answer'] = $answer;
  698. $this->userlogic->update_vip_question_search ( $params );
  699. //发送系统信息
  700. $this->userlogic->update_vip_question_by_answers ( $id );
  701. $subject = "您的" . $data ['vip_question'] ['title'] . "问题回答了您的追问";
  702. $content = "名师答疑-问题&nbsp;<a href=/advisory_page/" . $id . " >" . $data ['vip_question'] ['title'] . "</a>&nbsp;回答了追问";
  703. $this->userlogic->send_sys_message ( $subject, $content, $data ['vip_question'] ['authorid'] );
  704. $data ['map'] = '名师答疑管理 ';
  705. $this->render ( '/admin/vip_question_page_manage', $data );
  706. }
  707. /**
  708. * 公告管理
  709. */
  710. function article_manage() {
  711. $n = "";
  712. $t = "";
  713. $on_page = $this->check_params ( 'on_page' );
  714. $on_page = is_numeric ( $on_page ) ? $on_page : 1;
  715. $title = $this->get_args ( 'title' );
  716. $srchregdatestart = $this->get_args ( 'srchregdatestart' );
  717. $srchregdateend = $this->get_args ( 'srchregdateend' );
  718. $page_size = 18;
  719. //检索条件
  720. if (! empty ( $title ))
  721. $n = " and title like '%" . $title . "%'";
  722. if (! empty ( $srchregdatestart ) && ! empty ( $srchregdateend )) {
  723. $srchregdatestart = get_time ( $srchregdatestart );
  724. $srchregdateend = get_time ( $srchregdateend );
  725. $t = " and time between " . $srchregdatestart . " and " . $srchregdateend;
  726. }
  727. $condition = $n . $t;
  728. $action = "/index/main_article_manage/";
  729. $get = "?title=" . $title . "&srchregdatestart=" . $srchregdatestart . "&srchregdateend=" . $srchregdateend;
  730. //获取分页相关数据
  731. $page = $this->adminlogic->get_page ( t_article, $condition, $on_page, $page_size, $action, $get, "admin" );
  732. $limit = " order by time desc limit " . $page ['lower'] . " , " . $page_size . " ";
  733. $page ['question_list'] = $this->asklogic->get_article_list ( array (), $condition, $limit );
  734. $data ['question'] = $page;
  735. $data ['title'] = $title;
  736. $data ['srchregdatestart'] = $srchregdatestart;
  737. $data ['srchregdateend'] = $srchregdateend;
  738. $data ['map'] = '公告管理 ';
  739. $data ['success'] = "<span style='color:red'></span> ";
  740. $this->render ( '/admin/article_manage', $data );
  741. }
  742. /**
  743. * 文章添加
  744. */
  745. function article_manage_add() {
  746. $params ['title'] = $this->get_args ( 'title' );
  747. $params ['content'] = stripcslashes ( $this->get_args ( 'content_text' ) );
  748. $is_add = $this->get_args ( 'is_add' );
  749. if (! empty ( $is_add )) {
  750. if (empty ( $params ['title'] ))
  751. die ( '标题为空' );
  752. if (empty ( $params ['content'] ))
  753. die ( '内容为空' );
  754. $this->userlogic->add_article ( $params );
  755. echo "添加成功&nbsp;<a href=/index/main_article_manage >点击进入公告</a>";
  756. die ();
  757. }
  758. $data ['map'] = '公告管理-添加 ';
  759. $data ['success'] = "";
  760. $this->render ( '/admin/article_manage_add', $data );
  761. }
  762. /**
  763. * 编辑公告
  764. */
  765. function article_manage_edit() {
  766. $params ['id'] = $this->check_params ( 'id' );
  767. $params ['title'] = $this->get_args ( 'title' );
  768. $params ['content'] = stripcslashes ( $this->get_args ( 'content_text' ) );
  769. $is_edit = $this->get_args ( 'is_edit' );
  770. if (! empty ( $is_edit )) {
  771. if (empty ( $params ['title'] ))
  772. die ( '标题为空' );
  773. if (empty ( $params ['content'] ))
  774. die ( '内容为空' );
  775. $params ['id'] = $this->get_args ( 'id' );
  776. $this->userlogic->update_article ( $params );
  777. echo "更新成功&nbsp;<a href=/index/main_article_edit_manage/" . $params ['id'] . " >点击进入公告</a>";
  778. die ();
  779. }
  780. $data ['article'] = $this->userlogic->get_article_by_id ( $params ['id'] );
  781. $data ['map'] = '公告管理-编辑 ';
  782. $data ['success'] = "";
  783. $this->render ( '/admin/article_manage_edit', $data );
  784. }
  785. /**
  786. * 删除公告
  787. */
  788. function article_manage_delete() {
  789. $id = $this->get_args ( 'id' );
  790. $this->userlogic->delete_article ( $id );
  791. Header ( "Location:/index/main_article_manage" );
  792. }
  793. /**
  794. * 分类管理
  795. */
  796. function category_manage() {
  797. $n = "";
  798. $on_page = $this->check_params ( 'on_page' );
  799. $on_page = is_numeric ( $on_page ) ? $on_page : 1;
  800. if ($on_page <= 0)
  801. $on_page = 1;
  802. $title = $this->get_args ( 'title' );
  803. $page_size = 18;
  804. //检索条件
  805. if (! empty ( $title ))
  806. $n = " and name like '%" . $title . "%'";
  807. $condition = $n;
  808. $action = "/index/main_category_manage/";
  809. $get = "?title=" . $title;
  810. //获取分页相关数据
  811. $page = $this->adminlogic->get_page ( t_category, $condition, $on_page, $page_size, $action, $get, "admin" );
  812. $limit = " limit " . $page ['lower'] . " , " . $page_size . " ";
  813. $page ['question_list'] = $this->asklogic->get_list ( array (), $condition, $limit, t_category );
  814. $data ['question'] = $page;
  815. $data ['title'] = $title;
  816. $data ['map'] = '分类管理 ';
  817. $data ['success'] = "<span style='color:red'></span> ";
  818. $this->render ( '/admin/category_manage', $data );
  819. }
  820. /**
  821. * 进入添加分类页面
  822. */
  823. function category_manage_add() {
  824. //获取顶级分类
  825. $data ['category'] = $this->asklogic->get_category_list ();
  826. $data ['map'] = '添加分类 ';
  827. $data ['success'] = "<span style='color:red'></span> ";
  828. $this->render ( '/admin/category_manage_add', $data );
  829. }
  830. /**
  831. * 添加分类
  832. */
  833. function category_manage_doadd() {
  834. $params ['name'] = $this->get_args ( 'name' );
  835. $params ['pid'] = $this->get_args ( 'pid' );
  836. if (empty ( $params ['name'] ))
  837. die ( '填写分类名称' );
  838. $this->userlogic->add_category ( $params );
  839. Header ( "Location:/index/main_category_manage" );
  840. }
  841. /**
  842. * 分类管理-删除
  843. */
  844. function category_manage_delete() {
  845. $id = $this->get_args ( 'id' );
  846. $this->userlogic->delete_category_list ( $id );
  847. Header ( "Location:/index/main_category_manage" );
  848. }
  849. /**
  850. * 编辑分类
  851. */
  852. function category_manage_edit() {
  853. $id = $this->check_params ( 'id' );
  854. $data ['categoryinfo'] = $this->asklogic->get_category_by_id ( $id );
  855. //获取顶级分类
  856. $data ['category'] = $this->asklogic->get_category_list ();
  857. $data ['map'] = '添加分类 ';
  858. $data ['success'] = "<span style='color:red'></span> ";
  859. $this->render ( '/admin/category_manage_edit', $data );
  860. }
  861. /**
  862. * 更新分类信息
  863. */
  864. function category_manage_update() {
  865. $id = $this->get_args ( 'id' );
  866. $name = $this->get_args ( 'name' );
  867. $pid = $this->get_args ( 'pid' );
  868. if (empty ( $name ))
  869. die ( '填写分类名称' );
  870. $this->userlogic->update_category ( $id, $name, $pid );
  871. Header ( "Location:/index/main_category_manage" );
  872. }
  873. /**
  874. * 进入系统设置
  875. */
  876. function system_manage() {
  877. $data ['map'] = '系统管理 ';
  878. include SITE_PATH . '/protected/config/set_email_to_admin.conf.php';
  879. $data ['email'] = $sys ['set_email'];
  880. $fundstr=file_get_contents(SITE_PATH . '/protected/config/fund.conf.php') ;
  881. $data['fund']=$fundstr;
  882. $this->render ( '/admin/system_manage', $data );
  883. }
  884. function system_fund_do(){
  885. $string=$this->get_args('fund');
  886. file_put_contents(SITE_PATH . '/protected/config/fund.conf.php', $string);
  887. Header ( "Location:/index/main_system_manage" );
  888. }
  889. /**
  890. * 系统设置
  891. */
  892. function system_manage_do() {
  893. $email = $this->get_args ( 'set_email_to_admin' );
  894. $string="<?php ";
  895. $string.="\$sys=array('set_email'=>'".$email."'";
  896. $string.=");";
  897. file_put_contents(SITE_PATH . '/protected/config/set_email_to_admin.conf.php', $string);
  898. Header ( "Location:/index/main_system_manage" );
  899. }
  900. /**
  901. * 问题审批
  902. */
  903. function examine_manage(){
  904. $data ['examine_list'] = $this->adminlogic->get_examine_list ();
  905. $data ['map'] = '审批管理 ';
  906. $data ['success'] = "<span style='color:red'></span> ";
  907. $this->render ( '/admin/examine_manage', $data );
  908. }
  909. /**
  910. * 清空审批列表
  911. */
  912. function examine_manage_clear(){
  913. $this->adminlogic->examine_clear();
  914. $data ['examine_list']= $this->adminlogic->get_examine_list ();
  915. $data ['map'] = '审批管理 ';
  916. $data ['success'] = "<span style='color:red'></span> ";
  917. $this->render ( '/admin/examine_manage', $data );
  918. }
  919. function examine_add(){
  920. $idKey = $this->check_params ( "id" );
  921. $data=$this->adminlogic->get_examine ($idKey);
  922. if(empty($data))
  923. die('illegal request');
  924. $data ['category_id']=$data['cid'];
  925. $id = $this->userlogic->add_question ( $data );
  926. if (empty($id)){//金钱不够 发送站内通知---暂停开发站内通知
  927. //$this->send_email ( $data ['authorid'], "PAY_FORMONEY", $result, 0 );
  928. /*
  929. //发送系统信息-发送给发回答用户
  930. $subject = "回答&nbsp;<a href=/askpage/" . $rs ['qid'] . " >" . $rs ['title'] . "</a>&nbsp;追问后有新的回答";
  931. $content = "回答&nbsp;<a href=/askpage/" . $rs ['qid'] . " >" . $rs ['title'] . "</a>&nbsp;追问后有新的回答";
  932. $this->messagedao->send_message ( ADMIN_NAME, 0, $question ['authorid'], $subject, $content );
  933. */
  934. }
  935. $this->adminlogic->examine_delete ($idKey);
  936. return '/index/main_examine_manage';
  937. //$rs=$this->adminlogic->examine_add ($idKey);
  938. }
  939. /**
  940. * 获取get或者POST值
  941. * @param string $name 属性名称
  942. * @return fixed 值
  943. */
  944. function get_args($name) {
  945. if (isset ( $_GET [$name] )) {
  946. if (is_array ( $_GET [$name] ))
  947. return $_GET [$name];
  948. else
  949. return addslashes ( $_GET [$name] );
  950. } elseif (isset ( $_POST [$name] )) {
  951. if (is_array ( $_POST [$name] ))
  952. return $_POST [$name];
  953. else
  954. return addslashes ( $_POST [$name] );
  955. } else {
  956. return false;
  957. }
  958. }
  959. /**
  960. * 检测数据输入的非法字符和转义非法字符
  961. */
  962. function check_params($name = "") {
  963. if (isset ( $this->params [$name] )) {
  964. return addslashes ( $this->params [$name] );
  965. } else {
  966. return false;
  967. }
  968. }
  969. /**
  970. * 限时跳转
  971. * @param unknown_type $message
  972. * @param unknown_type $redirectto
  973. * @param unknown_type $time
  974. * @param unknown_type $return_msg
  975. * @param unknown_type $js
  976. */
  977. function Messager($message, $redirectto = '', $time = -1, $return_msg = false, $js = null) {
  978. global $rewriteHandler;
  979. $data ['redirectto'] = $redirectto;
  980. $data ['message'] = $message;
  981. if ($time === - 1) {
  982. //配置文件
  983. //$time=(is_numeric($this->Config['msg_time'])?$this->Config['msg_time']:5);
  984. $data ['time'] = 5;
  985. }
  986. $data ['to_title'] = ($data ['redirectto'] === '' or $data ['redirectto'] == - 1) ? "返回上一页" : "跳转到指定页面";
  987. if ($data ['redirectto'] === null) {
  988. $return_msg = $return_msg === false ? "&nbsp;" : $return_msg;
  989. } else {
  990. $data ['redirectto'] = ($data ['redirectto'] !== '') ? $data ['redirectto'] : ($from_referer = referer ());
  991. // if(str_exists($data['redirectto'],'mod=login','code=register','/login','/register'))
  992. // {
  993. // $referer='&referer='.urlencode('index.php?'.$_SERVER['QUERY_STRING']);
  994. // $this->CookieHandler->Setvar('referer','index.php?'.$_SERVER['QUERY_STRING']);
  995. // }
  996. if (is_numeric ( $data ['redirectto'] ) !== false and $data ['redirectto'] !== 0) {
  997. if ($data ['time'] !== null) {
  998. $data ['url_redirect'] = "<script language=\"JavaScript\" type=\"text/javascript\">\r\n";
  999. $data ['url_redirect'] .= sprintf ( "window.setTimeout(\"history.go(%s)\",%s);\r\n", $data ['redirectto'], $data ['time'] * 1000 );
  1000. $data ['url_redirect'] .= "</script>\r\n";
  1001. }
  1002. $data ['redirectto'] = "javascript:history.go({$data['redirectto']})";
  1003. } else {
  1004. if ($rewriteHandler && null !== $data ['message']) {
  1005. $data ['redirectto'] .= $referer;
  1006. if (! $from_referer && ! $referer) {
  1007. $data ['redirectto'] = $rewriteHandler->formatURL ( $data ['redirectto'], true );
  1008. }
  1009. }
  1010. if ($data ['message'] === null) {
  1011. $data ['redirectto'] = rawurldecode ( stripslashes ( ($data ['redirectto']) ) );
  1012. @header ( "Location: " . $data ['redirectto'] ); #HEADER跳转
  1013. }
  1014. if ($data ['time'] !== null) {
  1015. $data ['url_redirect'] = ($data ['redirectto'] ? '<meta http-equiv="refresh" content="' . $data ['time'] . '; URL=' . $data ['redirectto'] . '">' : null);
  1016. }
  1017. }
  1018. }
  1019. $title = "消息提示:" . (is_array ( $data ['message'] ) ? implode ( ',', $data ['message'] ) : $data ['message']);
  1020. $title = strip_tags ( $title );
  1021. if ($js != "") {
  1022. $js = "<script language=\"JavaScript\" type=\"text/javascript\">{$js}</script>";
  1023. }
  1024. $additional_str = $data ['url_redirect'] . $js;
  1025. $this->render ( 'messager', $data );
  1026. exit ();
  1027. }
  1028. }
  1029. ?>