function getjs_action() { $lang=include ROOT.'/lang/'.config::get('lang_type').'/system.php'; $id=front::get('id'); if(preg_match('/select/i',$id)){ exit('非法参数'); } $ballot=new ballot(); $option=new option(); $where=array('id'=>$id); $arr=$ballot->getrow($where); $row=$option->getrows(array('bid'=>$id),null,'num desc'); $this->view->arr=$arr; $this->view->row=$row; $this->view->lang=$lang; /*$html='document.write(\'<form name="form1" method="post" action="'.url("ballot").'">\');'; $html .= 'document.write(\'<input type="hidden" name="bid" id="bid" value="'.$arr['id'].'" />\');'; $html .= 'document.write(\'<h5>\');'; $html .= 'document.write(\''.$arr['title']."</h5>');"; foreach ($row as $option) { if ($arr['type'] == 'radio') { $html .= 'document.write(\'<input type="radio" name="ballot" id="ballot" value="'.$option['id'].'" />\');'; } else { $html .= 'document.write(\'<input type="checkbox" name="ballot[]" id="ballot" value="'.$option['id'].'" />\');'; } $html .= 'document.write(\' '.$option['name'].' ('.$option['num'].')<br>\');'; } $html .= 'document.write(\'<input type="submit" name="submit" id="button" value=" '.$lang['vote'].'" /></form>\');'; echo $html;*/ }