⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 topic_make.php

📁 Oracle源码:Oracle 数据库管理与应用系统开发代码
💻 PHP
📖 第 1 页 / 共 2 页
字号:

						

							$flg1=0; $flg2=0; $k++;}//第四级

							$j++;}//第三级

				      ?>

                            <option value="">***************************</option>

                            <? 							

							$old=$result_array[$i][0];$i++;}//第二级

							?>

                          </select>

                        </div>

                      </td>

                    </tr>

                  </table>

				

                  <div align="right"></div>

                </td>

                <td width="7%" valign="middle" height="59"><font color="#000000"> 

                  <input type="submit" name="cmdsearc" value="搜索" >

                  </font></td>

              </tr>

           

            </table>

          </form>



        </td>

      </tr>

      <tr> </tr>

      <tr> </tr>

      <tr> </tr>

      <tr> </tr>

      <tr>

        <td width="75%" height="70" valign="top"> 



          <div align="right"> 

            <table width="84%" border="0" align="center">
              <tr> 
                <td colspan="3"> 
                  <form name="form1" method="post" action="">
                    <table width="84%" border="0" align="center">
                      <tr> 
                        <td colspan="3"> 
                          <div align="right"> </div>
                          <?
if(($cmdsearc=="搜索")or($temp==1)or($action=="del"))
{ //如果搜索
	$sercont=trim($sercont);
	$sqldo_head="select newsid,newsname,uploadertime,pub_statue,newslength,column1,uploader from news ";
	$sqldo_head_c="select count(*) from news ";
	$sqldo_cont="";
	//echo "seritem".$seritem;
	if($sercont or $sertime or $seritem){
		$sqldo_cont.="where ";
	}
	if($sercont){
		$sqldo_cont.="(instr(newsname,'$sercont')>0 )  ";
	}
	if($sercont and $sertime){
		$datetime=date("YmdHis",mktime(date(''),date(''),date(''),date("m"),date("d")-$sertime,date("Y")) );
		$sqldo_cont.="and uploadertime>'$datetime'  ";
	}elseif($sertime){
		$datetime=date("YmdHis",mktime(date(''),date(''),date(''),date("m"),date("d")-$sertime,date("Y")) );
		$sqldo_cont.=" uploadertime>'$datetime'  ";
	}
	if(($sercont or $sertime) and $seritem){
		$sqldo_cont.="and  column1='$seritem'  ";
	}elseif($seritem){
		$sqldo_cont.=" column1='$seritem'  ";
	} 
	$sqldo_cont.="  order by newsid desc ";
	$sqldo_s=$sqldo_head.$sqldo_cont;
	// echo "sqldo".$sqldo_s."end";
	$sqldo=$sqldo_s;
	 $sqldo_c=$sqldo_head_c.$sqldo_cont;
	//$res_array=$cla->db_query($sqldo_s);
 }
?>
<?

  //搜索数据库
	if($temp==1){
		$sqldo=stripslashes($sqldo);
		$sqldo_c=stripslashes($sqldo_c);
	}
	if($sqldo_c)
	{
		$result=$cla->db_query($sqldo_c);
		$num=$result[0][0]; 
	} //分页显示无匹配记
	$perpage=20;//每页显示文章数
	$pages=ceil($num/$perpage);
	$last_offset=($pages-1)*$perpage;
	if (isset($jumpto))
	{
		if ($jumpto<=$pages){
			$offset=($jumpto-1)*$perpage;
		} else{
			$offset=$last_offset;}
		}

		//判断偏移量参数是否传递给了脚本,如果没有就使用默认值0

		if (empty($offset))
		{
			$offset=0;
		}
		if($cmdsearc=="搜索"){
			$offset=0;
		}
?>
                          <table bordercolor="#ffffff" cellspacing="0" cellpadding="0" width="100%"
align= "center" border="1" bordercolorlight="#000000" class=>
                            <tr> 
                              <td width="54%" valign="middle"> 
                                <?if(isset($num)){?>
                                <a href="<?="$PHP_SELF";?>?offset=0&temp=1&num=<?="$num";?>&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">首 
                                页</a> 
                                <?}else{echo "首  页";}?>
                                <?
//如果偏移量是0,不显示前一页的链接
	if($offset)
	{
		$preoffset=$offset-$perpage;
	?>
		<a href="<? echo $PHP_SELF;?>?offset=<?echo $preoffset;?>&temp=1&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">前一页</a>&nbsp; 
	<?
	}else{
		print "前一页 ";
	}
	//计算总共需要的页数
	$nextoffset=$offset+$perpage;
	//检查是否是最后一页
	if (($pages!=0) && ($nextoffset<$num))
	{
	?>
<a href="<? echo $PHP_SELF;?>?offset=<?echo $nextoffset;?>&temp=1&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">下一页</a>&nbsp; 
 <?
//print "<a href=\"$PHP_SELF?offset=$nextoffset&temp=1&sqldo= $sqldo&sqldo_c=$sqldo_c\">下一页</a>&nbsp;";
	}else{
		print "下一页 ";
	}
	$this_page_no=ceil($offset/$perpage)+1;
?>
 <?
 	if(!isset($num)){
		echo "末  页";
	}else{ ?>
<a href="<?=$PHP_SELF;?>?offset=<?=$last_offset;?>&temp=1&num=<?=$num;?>&sercont=<?php echo $sercont;?>&sertime=<?php echo $sertime;?>&seritem=<?php echo $seritem;?>">末 
页</a> 
<?	}?>
	<div align="right">
 	</div></td>
	<td width="46%" valign="middle"><div align="right">页次:<font class="red"> 
<?echo $this_page_no;?> /</font> <?echo $pages;?> 
 页 共<font class="red"> 
<?if($num<>""){
		echo $num;
	}
	else{
		echo "0";
	}
?>
	</font>条记录 <?echo $perpage;?> 记录/页 
	<input name="temp" size="50"    type="hidden"  value="1">
	<input name="sqldo" size="50"    type="hidden"  value="<?php print $sqldo;?>">
	<input name="sqldo_c" size="50"    type="hidden"  value="<?php print $sqldo_c;?>">
 	<br>
  	</div>
<?
for ($i=0; $i < $pages; $i++)
{
	$newoffset=$perpage*$i;
}
?>
</td>
                            </tr>
                          </table>
                          <table border="1" cellspacing="0" cellpadding="3" align="center" width="754"bgcolor="#000060" class=border bordercolor="#111111">
                            <tr> 
                              <td height="2" width="8%"> <div align="center"> 
                                  <font color="#FFFFFF"> 
                                  <input type="checkbox" name="allbox" value="Check All" onClick="CheckAll();">
                                  </font>全部选定</div></td>
                              <td height="2" width="8%"> <div align="center">发布状态</div></td>
                              <td height="2" width="30%"> <div align="center"><font color="#000000">标题</font></div></td>
                              <td height="2" width="10%"> <div align="center"><font color="#000000">提交人</font></div></td>
                              <td height="2" width="15%"> <div align="center"><font color="#000000">已属专题</font></div></td>
                              <td height="2" width="12%"> <div align="center"><font color="#000000">提交日期</font></div></td>
                              <td width="7%"> <div align="center"><font color="#000000">字节</font></div></td>
                              <td height="2" width="7%"> <div align="center"><font color="#000000">清除</font></div></td>
                            </tr>
<?
$A_define=array( "newsid","newsname","uploadertime","pub_statue","newslength","column1" ,"uploader"); 	
//$offset=2;
//$perpage=5;	
if($sqldo){	
	$res_array=$cla->db_query($sqldo,$A_define,$offset,$offset+$perpage);
}
$i=0;
while($res_array[$i][0]){
?>
	<tr bgcolor="#f7f7f7"> 
	<td align="center" width="8%"> <div align="center"> 
	 <font color="#FFFFFF"> 
		<input type="checkbox" name=chk<? echo $res_array[$i][0];?> value=<? echo $res_array[$i][0];?>>
	 </font></div></td>
	 <td align="center" width="8%"> <div align="center"> 
	 <font color="#FFFFFF"> 
 	 <input type="checkbox" name="check<? echo $i;?>" value= "" <?if($res_array[$i]["PUB_STATUS"]==1){echo " checked";}?>  disabled>
 	</font></div></td>
	 <td align="center" width="30%"> <font color="#000000"> 
<? if($res_array[$i][1]<>""){$temp=$res_array[$i][0];?>
 <a href="../publish/publish_news_preview.php?newid=<? echo $temp;?>" target=_blank><? echo substr($res_array[$i][1],9,200);?></a> 
 <? }else{echo "&nbsp;";}?>
</font></td>
<td align="center" width="10%"> <div align="center"> 
 <font color="#000000"> 
 <? if($res_array[$i]["UPLOADER"]<>""){echo $res_array[$i]["UPLOADER"]; }
	else{
		echo "&nbsp;";
	}
?>
  </font></div></td>
<td align="center" width="15%"> <div align="center"> 
 <font color="#000000"> 
<? 
$temp=$res_array[$i]["NEWSID"];
$sqldoin="select spec_id from topic where newsid='$temp'";
//echo $sqldoin;
$res_arrayin=$cla->db_query($sqldoin);		  
$n=0;
//echo "ay:".$res_arrayin[0]["SPEC_ID"];
//echo "ay:".$res_arrayin[1]["SPEC_ID"];
if($res_arrayin[$n][0]){
	while($res_arrayin[$n][0]){
		$temp1=$res_arrayin[$n][0];
		 //echo "id".$temp1;
		$sqldo2="select spec_name from basespec where spec_id= '$temp1'";
		$res_array2=$cla->db_query($sqldo2);
		echo $res_array2[0][0]."<br>";
		echo "\n"."<br>";
		$n++;
	 }
 }
else{
	echo "&nbsp;";
}
?>
 </font></div></td>
 <td align="center" width="12%"> <div align="center"> 
 <font color="#000000"> 
<? 
	$tstr=$res_array[$i]["UPLOADERTIME"];
	if($tstr<>""){
		echo $tstr[0].$tstr[1].$tstr[2].$tstr[3]."/".$tstr[4].$tstr[5]."/".$tstr[6].$tstr[7]."<br>".$tstr[8].$tstr[9].":".$tstr[10].$tstr[11].":".$tstr[10].$tstr[11]; }
	else{
		echo "&nbsp;";
	}
?>
 </font></div></td>
 <td width="7%" align="center"> <div align="center"> 
 <font color="#000000"> 
 <? 
	if($res_array[$i]["NEWSLENGTH"]<>""){
		echo $res_array[$i]["NEWSLENGTH"]; }
	else{
		echo "&nbsp;";
	}
?>
                                 </font></div></td>
                              <td align="center" width="7%"> <div align="center"> 
                                  <font color="#FF0000"><a href="?action=del&newsid=<? echo $res_array[$i][0];?>&dirname=<? echo $topicsel;?>&sercont<? echo $sercont;?>&sertime<? echo $sertime;?>&seritem=<? echo $seritem;?>">清除</a> 
                                </font></div></td>
                            </tr>
                            <? $i++; }?>
                            <? //}?>
                          </table>
                          <br>
                          <div align="right"> </div>
                        </td>
                      </tr>
                    </table>
                    <p align="center">选择专题: 
                      <select name="topicsel">
                        <?
				$sqldo="select spec_id,spec_name from basespec where spec_layer=2";
				$result_array=$cla->db_query($sqldo);
				$i=0;
				$old=$result_array[$i][0];
				while($result_array[$i][0]){
					$temp1=$result_array[$i][0];
					$temp1_name=strip_tags($result_array[$i]["SPEC_NAME"]);
					$sqldo_in="select spec_id,spec_name from basespec where spec_father='$temp1'";
					$result_array_in=$cla->db_query($sqldo_in);
					$j=0;
					$flg1=0;
					if($result_array_in[$j][0]==""){//如果是空,也显示一次,即将第二级专题显示出来
						$flg1=1;
					}				
				while($result_array_in[$j][0] or $flg1){	
					$temp2=$result_array_in[$j][0];
					$temp2_name=strip_tags($result_array_in[$j]["SPEC_NAME"]);	
					$sqldo_in_in="select spec_id,spec_name from basespec where spec_father='$temp2'";
					$result_array_in_in=$cla->db_query($sqldo_in_in);
					$k=0;
					$flg2=0;
					if($result_array_in_in[$k][0]==""){//如果是空,也显示一次,即将第三级专题显示出来
						$flg2=1;
					}				
				while(($result_array_in_in[$k][0]<>"") or ($flg2<>0) or ($flg1<>0)){	
					$temp3=$result_array_in_in[$k]['SPEC_ID'];
					$temp3_name=strip_tags($result_array_in_in[$k]['SPEC_NAME']);				
                ?>
                        <option value=<? if($temp3){echo $temp3;}elseif($temp2){echo $temp2;}elseif($temp1){echo $temp1;}?>> 
                        <? echo "$temp1_name";if($temp2_name){ echo ".$temp2_name";if($temp3_name) echo".$temp3_name";}?>
						 </option>
                        <?
							$flg1=0; $flg2=0; $k++;}//第四级
							$j++;}//第三级
				      ?>
                        <option value="">*************************************************************</option>
                        <? $old=$result_array[$i][0];$i++;}//第二级?>
                      </select>
                      选择摸板 
                      <select name="seltemp">
                        <option value="">默认摸板</option>
                        <?
	   $url=file("../list.txt");
       $total=count($url);
       for($i=0;$i<$total;$i++)
          {?>
                        <option value=<?echo "$url[$i]" ;?>><?echo $url[$i] ;?></option>
                        <? } ?>
                      </select>
                      <br>
                    </p>
                    <p align="center"> 
                      <input type="hidden" name="dirname" value=<? echo $topicsel;?>>
                      <input type="hidden" name="sercont" value=<? echo $sercont;?>>
                      <input type="hidden" name="sertime" value=<? echo $sertime;?>>
                      <input type="hidden" name="seritem" value=<? echo $seritem;?>>
                      <input type="submit" name="cmdadd" value="加入">
                      <input type="reset" name="cmdreset22" value="重置">
                    </p>
                  </form>
                  <div align="center"> </div>
                </td>
              </tr>
            </table>
          </div>
          <div align="right"></div>
        </td>
      </tr>
    </table>
  </div>
</center>

<p>&nbsp;</p>

<hr size="1" noshade width="90%">

<div align="center">

  &copy;Copyright All reserved 2001-2002<br>

  <p>&nbsp;</p>

</div>



<script language="JavaScript">



<!--



function CheckAll()

  {

    for (var i=0;i<document.form1.elements.length;i++)

    {

      var e = document.form1.elements[i];

      if (e.name != 'allbox')

        e.checked = document.form1.allbox.checked;

    }

  }

//-->



</script>

<?$cla->db_logoff();?>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -