コード例 #1
0
     $count = C::t('#wechat#mobile_wechat_masssend')->count();
     $msg = C::t('#wechat#mobile_wechat_masssend')->range($start, $ppp, 'DESC');
     $multi = multi($count, $ppp, $page, ADMINSCRIPT . '?' . PMODURL);
     showformheader('plugins&operation=config&identifier=wechat&pmod=masssend_setting&ac=send', 'enctype');
     showtableheader(lang('plugin/wechat', 'mass_list'), '');
     showsubtitle(array(lang('plugin/wechat', 'mass_text_oper'), lang('plugin/wechat', 'mass_text_send'), lang('plugin/wechat', 'mass_type'), lang('plugin/wechat', 'mass_created_at'), 'MSG_ID', lang('plugin/wechat', 'mass_finish_at'), lang('plugin/wechat', 'mass_status'), lang('plugin/wechat', 'mass_totalcount'), lang('plugin/wechat', 'mass_filtercount'), lang('plugin/wechat', 'mass_sendcount'), lang('plugin/wechat', 'mass_errorcount')));
     foreach ($msg as $m) {
         showtablerow('', array(), array('<a href="' . ADMINSCRIPT . '?' . PMODURL . 'del&id=' . $m['id'] . '">' . lang('plugin/wechat', 'mass_delete') . '</a> | <a href="' . ADMINSCRIPT . '?' . PMODURL . 'add&id=' . $m['id'] . '">' . lang('plugin/wechat', 'mass_edit') . '</a>', "<input type=\"radio\" name=\"massid\" value=\"{$m['id']}\" class=\"radio\">", $m['type'], dgmdate($m['created_at']), $m['msg_id'], $m['res_finish_at'] ? dgmdate($m['res_finish_at']) : '', $m['res_status'], $m['res_totalcount'], $m['res_filtercount'], $m['res_sentcount'], $m['res_errorcount']));
     }
     showtablefooter();
     echo '<br style="clear:both"><div class="right pg">' . $multi . '</div>';
     showsubmit('sendsubmit', lang('plugin/wechat', 'mass_send'));
     showformfooter();
 } else {
     if ($ac == 'add') {
         $groups = $wechat_client->getAllGroups();
         if (!$groups) {
             cpmsg_error('wechat:mass_get_group_failed');
         }
         if (intval($_GET['id']) > 0) {
             $mass = C::t('#wechat#mobile_wechat_masssend')->fetch(intval($_GET['id']));
         }
         $massmessage = $mass['resource_id'] ? "[resource={$mass['resource_id']}]" : $mass['text'];
         showtips(lang('plugin/wechat', 'mass_add_tips'));
         WeChatSetting::showResource();
         showformheader('plugins&operation=config&identifier=wechat&pmod=masssend_setting&ac=add', 'enctype');
         showtableheader();
         showtablerow('', '', array(lang('plugin/wechat', 'mass_type')));
         showtablerow('', array('', 'class="td23 td28"', '', 'class="td29"'), array("<textarea class=\"tarea\" name=\"massmessage\" id=\"res_subscribe\" rows=\"5\" cols=\"40\">{$massmessage}</textarea>" . "<br /><a href=\"javascript:;\" id=\"rsel\" onclick=\"showResource('res_subscribe')\">" . lang('plugin/wechat', 'mass_select_media') . "</a>"));
         $select = array('group_id', array());
         foreach ($groups as $g) {