<?
$pars = $_GET;
$file = fopen("admin/webconfig/makehtml.txt","r");
$makehtml = fgetss($file);
fclose($file);

if ($makehtml == 1)
{
	if (file_exists(realpath("EMS_News".$pars["bid"].$pars["sid"].$pars["tid"].$pars["fid"].".html")))
	{
		header("Location:"."EMS_News".$pars["bid"].$pars["sid"].$pars["tid"].$pars["fid"].".html");
		exit();
	}

}
?>
<?php include_once "EMS_Top.php";?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td><table width="960" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="padding-top:10px; padding-bottom:10px;">
      <tr>
        <td width="20%" valign="top" style="padding-left:5px;"><?php include_once("EMS_Left.php");?></td>
        <td width="80%" valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #a1d0ec;">
          <tr>
            <td><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/appimages/news_bg.jpg">
              <tr>
                <td width="4%" height="34" style="padding-left:20px; font-size:12px; font-weight:bold; color:#43a6df"><img src="images/appimages/home.jpg" width="19" height="17" /></td>
                <td width="11%" align="left" style="padding-left:5px; font-size:12px; font-weight:bold; color:#43a6df"><?php echo Sublm($pars,0);?></td>
                <td width="85%" align="right" style=" padding-right:20px; font-size:12px;color:#43a6df">您的位置：
                  <?php Sublm($pars["bid"],1); ?>
                  <?php Sublm($pars["sid"],1); ?>
                  <?php Sublm($pars["tid"],1); ?>
                  <?php Sublm($pars["fid"],1); ?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php
			$menu_query = mysql_query("select otherpar,news_par from `web_menu` where id=".$pars["fid"]." and bid=".$pars["bid"]." and sid=".$pars["sid"]." and tid=".$pars["tid"]);
			while ($mrs = mysql_fetch_array($menu_query))
			{
				$news_config = $mrs[0];
				$newspar = $mrs[1];
			}
				mysql_free_result($menu_query);	 
			 
			
			
			
			
			
			$result = pagelists(0,$newspar,"select count(*) from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"]." order by sort desc ");
 $page =  pagelists(1,$newspar,"select count(*) from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"]." order by sort desc ");
 $totalNumber = pagelists(2,$newspar,"select count(*) from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_news` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"]." order by sort desc ");
 $totalPage=  pagelists(3,$newspar,"select count(*) from `web_news` where bid=".$pars["bid"]."  and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_news` where bid=".$pars["bid"]." and sid=".$pars["sid"]." and recyle=0 and tid=".$pars["tid"]." and fid=".$pars["fid"]." order by sort desc ");
			
			  while ($app_rs = @mysql_fetch_array($result))
	          { 
			?>
              <table width="98%" border="0" align="center" style=" font-size:12px; border-bottom:1px #CCC dashed;">
                <tr>
                  <td width="5%" align="center" height="30"><img src="images/topBar_bg.gif" /></td>
                  <td width="75%"><a href="EMS_ShowNews.php?id=<?php echo $app_rs[0];?>&amp;bid=<?php echo $pars["bid"];?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>" style="font-size:12px;color:<?php echo $app_rs["colors"];?>; text-decoration:none;" title="<?php echo $app_rs["title"]; ?>" target="<?php GetTag($app_rs["open"]);?>"><?php echo $app_rs["title"]; ?></a>
                    <?php Getcons(substr($news_config,3,1),(string)date_fromats($app_rs["addtime"]),(string)date("Y-m-d"),"<img src='images/new.gif'/>") ?>
                    <?php Getcons(substr($news_config,4,1),(string)date_fromats($app_rs["addtime"]),(string)date("Y-m-d"),"<img src='images/hot.gif'/>") ?></td>
                  <td width="20%" align="center"><?php Getcontrols(substr($news_config,5,1),"",date_fromats($app_rs["addtime"]))?></td>
                </tr>
              </table>
              <?php
			  }
			?>
              <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px;">
                <tr>
                  <td width="32%" height="40" class="STYLE4">&nbsp;&nbsp; 共有<strong><?php echo $totalNumber ;?></strong> 条记录，当前第<strong><?php echo $page ;?></strong> 页，共 <strong><?php echo $totalPage ;?></strong> 页</td>
                  <td width="53%" height="20" align="right" class="STYLE4"><a href="EMS_News.php?bid=<?php echo $pars["bid"]?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>&amp;page=1" style="color:#000;">第一页</a> &nbsp;|&nbsp; <a href="EMS_News.php?bid=<?php echo $pars["bid"]?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>&amp;page=<?php echo $page-1 ?>" style="color:#000;">上一页</a> &nbsp;|&nbsp; <a href="EMS_News.php?bid=<?php echo $pars["bid"]?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>&amp;page=<?php echo $page+1 ?>" style="color:#000;">下一页</a> &nbsp;|&nbsp; <a href="EMS_News.php?bid=<?php echo $pars["bid"]?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>&amp;page=<?php echo $totalPage ?>" style="color:#000;">最后一页</a></td>
                  <td width="15%" align="center"><span class="STYLE1">转到第 </span>
                    <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('self',this,0)" style="font-size:12px;border:#b5d6e6 solid 1px;">
                      <?php
                        for($p=1;$p<=$totalPage;$p++)
                        {
						?>
                      <option value="EMS_News.php?bid=<?php echo $pars["bid"]?>&amp;sid=<?php echo $pars["sid"];?>&amp;tid=<?php echo $pars["tid"];?>&amp;fid=<?php echo $pars["fid"];?>&amp;page=<?php echo $p;?>" 
					  <?php 
					  if ($_GET["page"] == $p) :
					  echo "selected=selected";
					  endif; ?> 
                      ><?php echo $p; ?></option>
                      <?php 
                        }
                        ?>
                    </select>
                    <span class="STYLE1"> 页 </span></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

    
    </td>
  </tr>
</table>
<?php include_once("EMS_Bottom.php");?>