<?php
/*
* All copyright reserved (c) 2004-2010 by Gohappy
* Designer:Gohappy
*/
$root_path='.';
include_once($root_path.'/php/connect_sub.php');
include_once($root_path.'/php/sub.php');
include_once($root_path.'/php/page_sub_new.php');
include_once($root_path.'/php/top_bottom.php');

	
$result	=	mysql_db_query("$datamybase","SELECT * from {$db_sux}papers where qid  $data_sql ORDER BY addtime DESC ");
if(mysql_num_rows($result)>0)
{
					$xi=1;
					$fgfg	.=	'<table width="690" border="0" cellspacing="0" cellpadding="0">'; 
					while ($gb = mysql_fetch_array($result))
					{			
						$temp_href='info.php?inid='.$gb[qid];
				$ban_num=$db->num_rows($db->query("SELECT * from {$db_sux}papers_ban where qid='$gb[qid]'"));
				$news_num=$db->num_rows($db->query("SELECT * from {$db_sux}papers_news where qid='$gb[qid]'"));
				if($gb[ban_pdf]!=''){$pdf_ico='<a href="'.$root_path.'/upload/paper_file/'.$gb[ban_pdf].'" title="查看pdf文件" target="_blank"><img src="'.$root_path.'/images/ico_pdf.gif" border="0"></a>';}else{$pdf_ico='';}
				//图片
				$gb_ban = $db->fetch_array($db->query("SELECT * from {$db_sux}papers_ban where qid='$gb[qid]' ORDER BY bnum limit 0,1 "));
				if($gb_ban[ban_pic]!=''){$ban_pic=''.$root_path.'/upload/paper_file/s'.$gb_ban[ban_pic];}else{$ban_pic=$root_path.'/images/no_papers.jpg';}
						
						$temp_html='<table width="330" border="0" cellspacing="1" cellpadding="8" bgcolor="#bdbdbd" >
      <tr>
        <td bgcolor="#fafafa">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="50%" rowspan="8" align="left"><a href="'.$temp_href.'" target="_blank"><img class="img05" src="'.$ban_pic.'" width="150" height="225" border="1"></a></td>
            <td width="50%" height="40" align="left" ><span class="s02 fbold f14">第'.$gb[n_qi].'期 总第'.$gb[z_qi].'期</span></td>
          </tr>
          <tr>
            <td height="22" align="left">共'.$ban_num.'版 '.$news_num.'条新闻</td>
          </tr>
          <tr>
            <td height="22" align="left">阅读数：'.$gb[click_num].'&nbsp;&nbsp;下载数：'.$gb[down_num].'</td>
          </tr>
          <tr>
            <td height="22" align="left">时间：'.substrgb_old($gb[addtime],0,10).'</td>
          </tr>          
          <tr>
            <td height="22" align="left"></td>
          </tr>
          <tr>
            <td height="22" align="left">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="17%">&nbsp;</td>
                <td width="83%"> </td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="35" align="right"><a href="'.$temp_href.'" target="_blank"><img  src="'.$root_path.'/images/btn_online.gif" width="97" height="22" border="0"></a></td>
          </tr>
          
        </table>
        </td>
      </tr>
    </table>';
   // <tr>
    //        <td height="35" align="right"><a href="Newspaper_down.php?inid='.$gb[qid].'" target="_blank"><img  src="'.$root_path.'/images/btn_down.gif" width="97" height="22" border="0"></a></td>
      //    </tr>
						if($xi==1)
						{
							$fgfg.='<tr><td width="50%" align="left">'.$temp_html.'</td>';
							$xi++;
						}
						else
						{
							$fgfg.='<td width="50%" align="right">'.$temp_html.'</td></tr> <tr><td></td><td>&nbsp;</td></tr>';
							$xi=1;
						}
												
  				}
  				//补空
  				if($xi!=1)
					{
					  	$fgfg.='<td width="50%" align="right">&nbsp;</td></tr>';
							$xi=1;
					}
					$fgfg	.=	'</table><br>';
			}
	



	
$list_html=$fgfg;

include(parse_template('index'.'_g',$root_path.'/tpl/bao/',$root_path.'/'));
?>