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

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

}
?>
<?php include_once "EMS_Top.php";?>
<script language="javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<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
             $result = pagelists(0,12,"select count(*) from `web_picture` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_picture` 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,12,"select count(*) from `web_picture` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_picture` 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,12,"select count(*) from `web_picture` where bid=".$pars["bid"]." and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_picture` 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,12,"select count(*) from `web_picture` where bid=".$pars["bid"]."  and recyle=0 and sid=".$pars["sid"]." and tid=".$pars["tid"]." and fid=".$pars["fid"],"select * from `web_picture` where bid=".$pars["bid"]." and sid=".$pars["sid"]." and recyle=0 and tid=".$pars["tid"]." and fid=".$pars["fid"]." order by sort desc ");
 
			   ?>
               <table  border="0" align="center" cellpadding="5" cellspacing="0" style=" "  >
                <tr>
                <?php 
                $num=mysql_num_rows($result);
                if ($num>0){
                 $l=0;
                while ($rs=mysql_fetch_array($result))
                {
                ?>
                  <td>
                   <table width="100%" border="0">
                   <tr>
                    <td><a href="EMS_ShowPicture.php?id=<?php echo $rs["id"];?>&bid=<?php echo $pars["bid"];?>&sid=<?php echo $pars["sid"];?>&tid=<?php echo $pars["tid"];?>&fid=<?php echo $pars["fid"];?>"><?php IsExistDataPic($rs["pic"],120,100);?></a></td>
                   </tr>
                   <tr>
                    <td align="center"><a href="EMS_ShowPicture.php?id=<?php echo $rs["id"];?>&bid=<?php echo $pars["bid"];?>&sid=<?php echo $pars["sid"];?>&tid=<?php echo $pars["tid"];?>&fid=<?php echo $pars["fid"];?>" style="font-size:12px; color:<?php echo $rs["colors"];?>; text-decoration:none;"><?php echo cut_str($rs["title"],8);?></a></td>
                   </tr>
                   </table>
                  </td>
                  <?php
                  $l++;
                  if (($l%4)==0){
                  echo "</tr>";
                  }
                  if ($l>=$num) break;
                  }
                  }else{
                    echo "";
                  }
                  ?>
              </table>
           
      <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_Picture.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_Picture.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_Picture.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_Picture.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_Picture.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>
    </td>
  </tr>
</table>




<?php include_once "EMS_Bottom.php";?>