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;*/ }
function ballot($id) { $blot = new ballot(); $row = $blot->getrow($id); if($row){ $html='<script type="text/javascript" src="'.url('ballot/getjs/id/'.$id).'"></script>'; return $html; } }
function mail_action() { chkpw('seo_mail_usersend'); $where=null; $ordre='1 desc'; if ($this->table == 'archive') { $ordre="`order`,1 DESC"; $where=$this->_table->get_where('manage'); if (!front::post('_typeid')) session::del('_typeid'); if (get('_typeid')) { $typeid=get('_typeid'); session::set('_typeid',$typeid); $this->type=type::getInstance(); $types=$this->type->sons($typeid); $types[]=$typeid; $where .=' and typeid in('.trim(implode(',',$types),',').')'; } if (get('typeid')) { $typeid=get('typeid'); $where .=' and typeid='.$typeid; } if (!front::post('_title')) session::del('_title'); if (get('_title')) { $title=get('_title'); session::set('_title',$title); $where .=" and title like '%$title%' "; } } if ($this->table == 'templatetag') { if (front::get('tagfrom')) { $where="tagfrom='".front::get('tagfrom')."'"; } else $where="tagfrom='define'"; $where .=" and (`tagvar` IS NULL OR `tagvar` = '') "; } if ($this->table == 'option') { $ballot=new ballot(); $where=array('bid'=>front::$get['bid']); session::set('bid',front::$get['bid']); $row=$ballot->getrow(array('id'=>front::$get['bid'])); $this->view->ballot=$row; } $limit=((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize; $this->_view_table=$this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage')); $this->view->record_count=$this->_table->record_count; }
function url($id) { return ballot::url($id); }