admin_sms.inc.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  3. exit('Access Denied');
  4. }
  5. include DISCUZ_ROOT . './source/plugin/xj_event/include/sms_func.php';
  6. if($_GET['act']=='save'){
  7. $sendcontent = $_GET['sendcontent'];
  8. //$message = sendsms_vcode($_GET['receivenumber'],lang('plugin/xj_event', 'zhesytcsdx'),1,random(8,1));
  9. $message = sendsms_success($_GET['receivenumber'],lang('plugin/xj_event', 'zhesytcsdx'),dgmdate(time()));
  10. //$message = sendsms_notice_hnmm($_GET['receivenumber'],lang('plugin/xj_event', 'zhesytcsdx'),dgmdate(time()),'人民路24号','n小白n','13088887777');
  11. //$message = sendsms_notice_yhd($_GET['receivenumber'],lang('plugin/xj_event', 'zhesytcsdx'),dgmdate(time()),'人民路24号','13088887777');
  12. //$message = sendsms_notice($_GET['receivenumber'],lang('plugin/xj_event', 'zhesytcsdx'),dgmdate(time()));
  13. //$message = xjsendsms($receivenumber,$sendcontent,lang('plugin/xj_event', 'test'));
  14. if($message == 'ok'){
  15. $message = lang('plugin/xj_event', 'fascg');
  16. }
  17. cpmsg($message,'action=plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms','succeed');
  18. }
  19. if($_GET['act'] == 'regsave'){
  20. $username = addslashes($_POST['username']);
  21. $password = addslashes($_POST['password']);
  22. $realname = addslashes($_POST['realname']);
  23. $mobile = addslashes($_POST['mobile']);
  24. $email = addslashes($_POST['email']);
  25. $message = regsms();
  26. if($message == 'ok'){
  27. $message = lang('plugin/xj_event', 'zccgqzcjszl');
  28. }elseif($message == 'repeat'){
  29. $message = lang('plugin/xj_event', 'qinwcfzc');
  30. }else{
  31. $message = lang('plugin/xj_event', 'zcsbqjcxxsftx');
  32. }
  33. cpmsg($message,'action=plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=reg','succeed');
  34. }
  35. if($_GET['act'] == 'setsave'){
  36. if($_GET['formhash'] != $_G['formhash']) {
  37. cpmsg('parameters_error','action=plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms','succeed');
  38. }
  39. $username = addslashes($_POST['username']);
  40. $password = addslashes($_POST['password']);
  41. $signature = addslashes($_POST['signature']);
  42. writetocache('xjsms',getcachevars(array('xjsms'=>array('username'=>$username,'password'=>$password,'signature'=>$signature))));
  43. $message = lang('plugin/xj_event', 'bccg');
  44. cpmsg($message,'action=plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=set','succeed');
  45. }
  46. shownav('plugin', lang('plugin/xj_event', 'chaojhd'), lang('plugin/xj_event', 'duanxsz'));
  47. showsubmenu(lang('plugin/xj_event', 'duanxsz'), array(
  48. array(lang('plugin/xj_event', 'fasongceshi'), 'plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms', empty($_GET['menu'])?1:0),
  49. array(lang('plugin/xj_event', 'fasongjilu'), 'plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=log', $_GET['menu']=='log'?1:0),
  50. array(lang('plugin/xj_event', 'duanxinyue'), 'plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=overage', $_GET['menu']=='overage'?1:0),
  51. array(lang('plugin/xj_event', 'zhanghaoshezhi'), 'plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=set', $_GET['menu']=='set'?1:0),
  52. array(lang('plugin/xj_event', 'pintaizhuce'), 'plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&menu=reg', $_GET['menu']=='reg'?1:0),
  53. ));
  54. if($_GET['menu'] == 'test' || empty($_GET['menu'])){
  55. showformheader('plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&act=save');
  56. showtableheader(lang('plugin/xj_event', 'qzcjszlszhdxpt'));
  57. showsetting(lang('plugin/xj_event', 'jieshouhaoma'), 'receivenumber', lang('plugin/xj_event', 'sursjh'), 'text');
  58. showsubmit('submit',lang('plugin/xj_event', 'ceshifasong'));
  59. showtablefooter();
  60. showformfooter();
  61. }elseif($_GET['menu'] == 'log'){
  62. showtableheader(lang('plugin/xj_event', 'fasongjilu'));
  63. showtablerow('', array('class="td25"', 'class="td28"'), array(lang('plugin/xj_event', 'select'),lang('plugin/xj_event', 'leixin'),lang('plugin/xj_event', 'haomashu'),lang('plugin/xj_event', 'fasongshijian'),lang('plugin/xj_event', 'fasongleirong'),lang('plugin/xj_event', 'state'),lang('plugin/xj_event', 'action')));
  64. $ppp = 15; //每天数量
  65. $page = $_GET['page']?intval($_GET['page']):1;
  66. $count = DB::result_first("SELECT COUNT(*) FROM ".DB::table('xj_event_sms_log'));
  67. $query = DB::query("SELECT * FROM ".DB::table('xj_event_sms_log')." ORDER BY sendtime DESC LIMIT ".(($page - 1) * $ppp).",$ppp");
  68. while($value = DB::fetch($query)) {
  69. $value['sendtime'] = dgmdate($value['sendtime']);
  70. showtablerow('', array('class="td25"', 'class="td28"'), array('<input type="checkbox" class="checkbox" name="delete[]" value="'.$value['id'].'" />',
  71. $value['sendtype'],$value['sendcount'],$value['sendtime'],$value['sendcontent'],$value['sendstate'],""));
  72. }
  73. showtablefooter();
  74. echo multi($count, $ppp, $page, ADMINSCRIPT."?action=plugins&operation=config&do=$pluginid&identifier=xj_event&pmod=admin_sms&menu=log$extra");
  75. }elseif($_GET['menu'] == 'overage'){
  76. $overage = getsmsoverage();
  77. echo lang('plugin/xj_event', 'ningddxye')." <span style='color:#f00;'>$overage</span> ".lang('plugin/xj_event', 'tiao')." [<a href='http://www.xiaoyaoapp.cn/plugin.php?id=xj_sms:recharge' target='_blank'>".lang('plugin/xj_event', 'lijichongzhi')."</a>] ".lang('plugin/xj_event','qzfsxzzfbjsdz');
  78. }elseif($_GET['menu'] == 'reg'){
  79. showtableheader(lang('plugin/xj_event', 'duanxptzc'));
  80. showformheader('plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&act=regsave');
  81. showsetting(lang('plugin/xj_event', 'yonghuming'), 'username', '', 'text','','',lang('plugin/xj_event', 'dxptzcyhmqyyw'));
  82. showsetting(lang('plugin/xj_event', 'password'), 'password', '', 'password','','',lang('plugin/xj_event', 'duanxptmm'));
  83. showsetting(lang('plugin/xj_event', 'zhengshixinmin'), 'realname', '', 'text','','',lang('plugin/xj_event', 'srndzsxmfbhnlx'));
  84. showsetting(lang('plugin/xj_event', 'shoujihaoma'), 'mobile', '', 'text','','',lang('plugin/xj_event', 'lianxysjhm'));
  85. showsetting(lang('plugin/xj_event', 'email'), 'email', '', 'text','','',lang('plugin/xj_event', 'lianxyyx'));
  86. showsubmit('submit',lang('plugin/xj_event', 'reg'));
  87. showtablefooter();
  88. showformfooter();
  89. }elseif($_GET['menu'] == 'set'){
  90. showtableheader(lang('plugin/xj_event', 'duanxptsz'));
  91. showformheader('plugins&operation=config&do='.$pluginid.'&identifier=xj_event&pmod=admin_sms&act=setsave');
  92. showsetting(lang('plugin/xj_event', 'yonghuming'), 'username', $xjsms['username'], 'text','','',lang('plugin/xj_event', 'duanxptyhm'));
  93. showsetting(lang('plugin/xj_event', 'password'), 'password', $xjsms['password'], 'password','','',lang('plugin/xj_event', 'duanxptmm'));
  94. showsetting(lang('plugin/xj_event', 'duanxqm'), 'signature', $xjsms['signature'], 'text','','',lang('plugin/xj_event', 'rtbwqmbahfs'));
  95. showsubmit('submit',lang('plugin/xj_event', 'save'));
  96. showtablefooter();
  97. showformfooter();
  98. }
  99. ?>