<?php if($page==""){$page=1;};
include("conn/conn.php"); 
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>RSS阅读器</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script language="javascript" type="text/javascript">
function jyjq(form){
if (form.zhuti.value == ""){
  alert("发布的主题不能为空!!");
  form.zhuti.focus();
  return (false);
}
if(form.neirong.value == ""){
alert("发布的内容不能为空!!");
form.neirong.focus();
return (false);}

				return(true);  
			}
			   </script>

<script>
function charCodeAtTest(n){
var d;
  d = n.charCodeAt(d - 1);              //获取位置 n 上字符的 Unicode 值。
  return(d);                              //返回该值。
alert(d);
}

</script>

<body onLoad="window.clipboardData.getData('Text')">
<center>
<table width="795" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#D6D6D4">
    <tr>
    <td><img src="images/RSS阅读器首页_2.jpg" width="795" height="85" border="0" usemap="#Map"></td>
  </tr>
      <?php 
  if($page){
  $page_size=5;
  $query="select count(*) as total from tb_rss_database where tb_rss_id";
  $result=mysql_query($query);
  $message_count=mysql_result($result,0,'total');
  $page_count=ceil($message_count/$page_size);
  $offset=($page-1)*$page_size;
  $query="select * from tb_rss_database where tb_rss_id order by tb_rss_id desc limit $offset,$page_size";
  $result=mysql_query($query);
  while($myrow=mysql_fetch_array($result)){
  ?>
      <tr bgcolor="#ECF6FF">
        <td height="25" align="left" bgcolor="#ECF6FF" class="STYLE12">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="look_content.php?lmbs=<?php echo $myrow[tb_rss_id];?>" target="_blank"><?php echo $myrow[tb_rss_subject];?>(<?php echo $myrow[tb_rss_author]?>)</a></td>
      </tr>
      <?php }?>
      <tr>
        <td height="25" align="left" bgcolor="#ECF6FF" class="STYLE12"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECF6FF">
            <tr>
              <td width="50%" height="23" align="center" class="STYLE12">&nbsp;&nbsp;页次：<?php echo $page;?> / <?php echo $page_count;?> 页 记录：<?php echo $message_count;?> 条&nbsp; </td>
              <td width="39%" align="center" class="STYLE12"> 分页：
                <?php
			    $lmbs=urlencode(编程技巧);
       	        $xsoudh="lmbs=$lmbs";
				$next=$ljjl*10;
				$n=$ljjl-1;
				$m=$ljjl+1;	
                $prev_page=$page-10;						
					if ($ljjl==0){
                    echo "首页";					
					}else
					{
                     echo "<a href='$PATH_INFO?vv=0&ljjl=0&page=1&$xsoudh'>首页</a>&nbsp;";
					 $ccc=$vv-10;
                     echo "<a href='$PATH_INFO?vv=$ccc&ljjl=$n&page=$prev_page&$xsoudh'>上十页</a>";
					}?>
                  <?php	
 		        for ($j=1;$j<=$page_count;$j++) {
				       $pnext=$next+$j;
				       if ($mm==10){
					       break;
					   }
						if ($mm>$page_count){
							break;
						}
						if ($page_count-$vv<10){
	  						if ($mm>=$page_count-$vv){
								break;
							}									
						}
						?>
                  <?php
                        echo "<a href='$PATH_INFO?vv=$vv&ljjl=$ljjl&page=$pnext&$xsoudh'> $pnext </a>";											
              	        $mm=$mm+1;						
	     	     }
				 ?>
              </td>
              <td width="11%" class="STYLE12"><?php
				$vv=$vv+$mm;
				       if ($page_count-$vv<=0){
	                       echo "尾页";					
					   }else{
	                       echo "<a href='$PATH_INFO?vv=$vv&ljjl=$m&page=$pnext&$xsoudh'>下十页</a>";														
					   }
                if ($message_count==0){
					     echo "没有记录!";
				}
}?>
              </td>
            </tr>
        </table></td>
      </tr>
</table>
<table width="802" border="0" cellpadding="0" cellspacing="0">
<form action="index_ok.php?url=<?php echo $url;?>" method="post" enctype="multipart/form-data" name="form1" onSubmit="javascript: return jyjq(this)">
  <tr align="center">
    <td height="25" colspan="4" background="images/bg_10-(3)_7.gif" class="STYLE12">编程技巧集合</td>
    </tr>
  <tr bgcolor="#ECF6FF">
    <td width="123" height="20" align="center" class="STYLE12">姓名:</td>
    <td width="127" bgcolor="#ECF6FF"><input name="user" type="text" id="user" size="10" maxlength="10"></td>
    <td width="145" align="right" class="STYLE12">所属部门:</td>
    <td width="270"><select name="bumen" size="1" id="bumen">
     <?php $result=mysql_query("select * from gsbm");
	  while($myrow=mysql_fetch_array($result)){
	  ?>
	  <option value="<?php echo $myrow[bumen];?>"><?php echo $myrow[bumen];?></option>
      <?php }?>
    </select></td>
  </tr>
  <tr>
    <td height="25" align="center" class="STYLE12">编程技巧主题:</td>
    <td colspan="3"><input name="zhuti" type="text" id="zhuti" size="60" maxlength="80"></td>
  </tr>
  <tr bgcolor="#ECF6FF">
    <td align="center" bgcolor="#ECF6FF" class="STYLE12">功能描述:</td>
    <td colspan="3" bgcolor="#ECF6FF"><textarea name="neirong" cols="75" rows="5" id="neirong"></textarea></td>
  </tr>
  <tr>
    <td height="25" colspan="3" align="center"><input name="submit" type="submit" id="submit" value="提交">
    &nbsp;&nbsp;
    <input name="Submit2" type="reset" value="重置"></td>
  </tr>
  </form>
</table>
</center>

<map name="Map">
<area shape="rect" coords="29,59,76,81" href="http://192.168.1.59/MR/24/01/" target="_blank" onClick="window.clipboardData.setData('Text','http://192.168.1.59/MR/sl/24/02/Rss.xml')" >
<area shape="rect" coords="79,56,104,80" href="Rss.xml">
</map></body>
</html>
