case "tpdc": //结果显示
$sql="SELECT * FROM $polltable where active='1' ORDER BY id";
$result=mysql_query($sql);
$reccount=mysql_num_rows($result);
$sql.=" limit $offset,1";
$result=mysql_query($sql);
$rows=mysql_fetch_object($result);
$question=$rows->question;
$options=$rows->options;
$votes=$rows->votes;
$joindate=$rows->joindate;
$others=$rows->others;
$retu=ShowPages($reccount,$offset,1,"op=tpdc",$maxpages=10);
$tpl->assign(retu,$retu);
$tpl->assign(question_list,"<font color=#993333> No".($offset+1)."</font> ".$question);
$tpl->assign(joindate_list,$joindate);
$options=explode("|||",$options);
$votes=explode("|||",$votes);
$others=explode("|||",$others);
for ($i=0;$i<count($votes);$i++){
$poll_totals+=$votes[$i];
}
($poll_totals==0)?($poll_totals=1):($poll_totals=$poll_totals);
for ($i=0;$i<count($options);$i++){
$tpl->assign(option,$options[$i]);
$tpl->assign(width,"<img src=images/show.gif height=10 width=".($votes[$i]/$poll_totals*100)."%> ".number_format($votes[$i]/$poll_totals*100)."%");
$tpl->assign(per,$votes[$i]."人");
$tpl->parse(options_list,".option");
}
for ($i=0;$i<count($others);$i++){
$other_tr.='<tr><td colspan="3" height="18"> '.($i+1).'. '.$others[$i].'</td></tr><tr><td colspan="3" height="1" bgcolor=#008ACC ></td></tr>';
}
$tpl->assign(others,$other_tr);
$outstr=$outstr."</table><br><center><a href=javascript:window.close()>关闭窗口</a>";
$tpl->assign(poll_list,$outstr);
$tpl->parse(OUTPUT,voteshow);
$tpl->FastPrint(OUTPUT);
exit;
break;
//-------------------------------------------------信息发布------------------------------------------------
case "xwgk":
$sql="select display,id from $kind_table where cid='$cid'";
$query=mysql_query($sql);
while($rows=mysql_fetch_object($query)){
//$secitem.=" <a href=\"./?op=xwgk&id=".$rows->id."&cid=".$cid."\">".$rows->display."</a> ";
if (empty($id)) $id=$rows->id;
$secitem.="<input type=button value=".$rows->display." onclick='javascript:location=\"./?op=xwgk&id=".$rows->id."&cid=".$cid."\"' class=button1>";
}
$tpl->assign(sec_item,$secitem); $sql="select id,title,about,model from $news_table where cid='$id' && active='1' order by id";
$query=mysql_query($sql);
$reccount=mysql_num_rows($query);
if (empty($reccount)) $reccount=1;
$sql.=" limit $offset,1";
$query=mysql_query($sql);
$row=mysql_fetch_object($query); $show_about="<TABLE cellSpacing=5 cellPadding=5 border=0 width=80%><tr><td>";
if ($offset<>"0") $show_about.="<a href=./?op=xwgk&id=".$id."&cid=".$cid."&offset=".($offset-1).">上一页</a>";
if ($offset<>$reccount-1) $show_about.="<a href=./?op=xwgk&id=".$id."&cid=".$cid."&offset=".($offset+1).">下一页</a>"; $show_about.="</td></tr></table>"; if ($row->model=="model_1"){
$show_about.="<TABLE cellSpacing=5 cellPadding=5 border=0 width=80%><TBODY>";
$show_about.="<tr><td bgcolor=#F3F5FA>".$row->title."</td></tr>";
$show_about.="<tr><td bgcolor=#F7F7F7 height=450 valign=top align=left>".ereg_replace(" "," ",nl2br($row->about))."</td></tr>";
$show_about.="</tbody></table>";
}elseif($row->model=="model_2"){ //=======>网页形式<========//
$filename="../webfiles/word_web/".$row->id."/index.html";
$fd = fopen($filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
$show_about.=eregi_replace('index.files/','../webfiles/word_web/'.$row->id.'/index.files/',$contents);
$show_about=eregi_replace('a:visited','a1:visited',$show_about);
}
$tpl->assign(outstr,$show_about);
break; }$tpl->assign(retu,$retu);
$tpl->parse(OUT,"main");
$tpl->FastPrint(OUT);
?>
$sql="SELECT * FROM $polltable where active='1' ORDER BY id";
$result=mysql_query($sql);
$reccount=mysql_num_rows($result);
$sql.=" limit $offset,1";
$result=mysql_query($sql);
$rows=mysql_fetch_object($result);
$question=$rows->question;
$options=$rows->options;
$votes=$rows->votes;
$joindate=$rows->joindate;
$others=$rows->others;
$retu=ShowPages($reccount,$offset,1,"op=tpdc",$maxpages=10);
$tpl->assign(retu,$retu);
$tpl->assign(question_list,"<font color=#993333> No".($offset+1)."</font> ".$question);
$tpl->assign(joindate_list,$joindate);
$options=explode("|||",$options);
$votes=explode("|||",$votes);
$others=explode("|||",$others);
for ($i=0;$i<count($votes);$i++){
$poll_totals+=$votes[$i];
}
($poll_totals==0)?($poll_totals=1):($poll_totals=$poll_totals);
for ($i=0;$i<count($options);$i++){
$tpl->assign(option,$options[$i]);
$tpl->assign(width,"<img src=images/show.gif height=10 width=".($votes[$i]/$poll_totals*100)."%> ".number_format($votes[$i]/$poll_totals*100)."%");
$tpl->assign(per,$votes[$i]."人");
$tpl->parse(options_list,".option");
}
for ($i=0;$i<count($others);$i++){
$other_tr.='<tr><td colspan="3" height="18"> '.($i+1).'. '.$others[$i].'</td></tr><tr><td colspan="3" height="1" bgcolor=#008ACC ></td></tr>';
}
$tpl->assign(others,$other_tr);
$outstr=$outstr."</table><br><center><a href=javascript:window.close()>关闭窗口</a>";
$tpl->assign(poll_list,$outstr);
$tpl->parse(OUTPUT,voteshow);
$tpl->FastPrint(OUTPUT);
exit;
break;
//-------------------------------------------------信息发布------------------------------------------------
case "xwgk":
$sql="select display,id from $kind_table where cid='$cid'";
$query=mysql_query($sql);
while($rows=mysql_fetch_object($query)){
//$secitem.=" <a href=\"./?op=xwgk&id=".$rows->id."&cid=".$cid."\">".$rows->display."</a> ";
if (empty($id)) $id=$rows->id;
$secitem.="<input type=button value=".$rows->display." onclick='javascript:location=\"./?op=xwgk&id=".$rows->id."&cid=".$cid."\"' class=button1>";
}
$tpl->assign(sec_item,$secitem); $sql="select id,title,about,model from $news_table where cid='$id' && active='1' order by id";
$query=mysql_query($sql);
$reccount=mysql_num_rows($query);
if (empty($reccount)) $reccount=1;
$sql.=" limit $offset,1";
$query=mysql_query($sql);
$row=mysql_fetch_object($query); $show_about="<TABLE cellSpacing=5 cellPadding=5 border=0 width=80%><tr><td>";
if ($offset<>"0") $show_about.="<a href=./?op=xwgk&id=".$id."&cid=".$cid."&offset=".($offset-1).">上一页</a>";
if ($offset<>$reccount-1) $show_about.="<a href=./?op=xwgk&id=".$id."&cid=".$cid."&offset=".($offset+1).">下一页</a>"; $show_about.="</td></tr></table>"; if ($row->model=="model_1"){
$show_about.="<TABLE cellSpacing=5 cellPadding=5 border=0 width=80%><TBODY>";
$show_about.="<tr><td bgcolor=#F3F5FA>".$row->title."</td></tr>";
$show_about.="<tr><td bgcolor=#F7F7F7 height=450 valign=top align=left>".ereg_replace(" "," ",nl2br($row->about))."</td></tr>";
$show_about.="</tbody></table>";
}elseif($row->model=="model_2"){ //=======>网页形式<========//
$filename="../webfiles/word_web/".$row->id."/index.html";
$fd = fopen($filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
$show_about.=eregi_replace('index.files/','../webfiles/word_web/'.$row->id.'/index.files/',$contents);
$show_about=eregi_replace('a:visited','a1:visited',$show_about);
}
$tpl->assign(outstr,$show_about);
break; }$tpl->assign(retu,$retu);
$tpl->parse(OUT,"main");
$tpl->FastPrint(OUT);
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货