示例#1
0
     $do->itemid = $pollid;
     $P = $do->get_one();
     $P or msg('票选不存在');
     $I = $do->item_all("pollid={$pollid}");
     $sfields = array('按条件', '会员', 'IP');
     $dfields = array('username', 'username', 'ip');
     isset($fields) && isset($dfields[$fields]) or $fields = 0;
     $fields_select = dselect($sfields, 'fields', '', $fields);
     $condition = "pollid={$pollid}";
     if ($itemid) {
         $condition .= " AND itemid={$itemid}";
     }
     if ($keyword) {
         $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
     }
     $lists = $do->get_list_record($condition);
     include tpl('poll_record', $module);
     break;
 case 'stats':
     $pollid = isset($pollid) ? intval($pollid) : 0;
     $pollid or msg();
     $menus = array(array('选项管理', '?moduleid=' . $moduleid . '&file=' . $file . '&pollid=' . $pollid . '&action=item'), array('投票记录', '?moduleid=' . $moduleid . '&file=' . $file . '&pollid=' . $pollid . '&action=record'), array('统计报表', '?moduleid=' . $moduleid . '&file=' . $file . '&pollid=' . $pollid . '&action=stats'));
     $do->itemid = $pollid;
     $P = $do->get_one();
     $P or msg('票选不存在');
     $title = $P['title'];
     $I = $do->item_all("pollid={$pollid}");
     $chart_data = '';
     foreach ($I as $k => $v) {
         if ($k) {
             $chart_data .= '\\n';