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

📄 delete_news_done1.php

📁 采用PHP+oracle;功能设计:用户管理、栏目管理、新闻管理、专题管理、日志管理
💻 PHP
字号:
<? include("../inc/check.php");

   include('../inc/func.php');

   $deletetime=date('YmdHis');

   $uploader=$ses_loginname;//操作者

   $group_name=$ses_groupid;

   for($i=0;$i<$total;$i++){

   $ch_="ch".$i;

   $ch=$$ch_;

   if($ch<>''){

   $newid=$ch;

      $sql="select pic1,pic2,pic3,pic4,pic5,pub_statue,clas_statue from news where newsid=$newid";

      echo $sql;

      $array=$cla->db_query($sql);

      $array[pic1]=$array[0][PIC1];

      $array[pic2]=$array[0][PIC2];

      $array[pic3]=$array[0][PIC3];

      $array[pic4]=$array[0][PIC4];

      $array[pic5]=$array[0][PIC5];

      $array[pub_statue]=$array[0][PUB_STATUE];

      //echo $array[pub_statue];

     

      if($array[pub_statue]==1){

           $sql="update news set del_statue=1 where newsid=$newid";

		   //echo $sql;

      }else{

          $sql="delete from news where newsid=$newid";

		   if($array[0][CLAS_STATUE]!=1){

		       if ($array[pic1]!='0'){

		            $clas=substr($array[pic1],0,1);

				    $clas=(($clas=='j')?"jpg":"gif");

				    unlink("../image_news/".$newid."/1.".$clas);

				 }

			   if ($array[pic2]!='0'){

			        $clas=substr($array[pic2],0,1);

				    $clas=(($clas=='j')?"jpg":"gif");

				    unlink("../image_news/".$newid."/2.".$clas); }

		       if ($array[pic3]!='0'){

		             $clas=substr($array[pic3],0,1);

				     $clas=(($clas=='j')?"jpg":"gif");

				     unlink("../image_news/".$newid."/3.".$clas); }

		       if ($array[pic4]!='0'){

		             $clas=substr($array[pic4],0,1);

				     $clas=(($clas=='j')?"jpg":"gif");

				     unlink("../image_news/".$newid."/4.".$clas);

			     }

			    if ($array[pic5]!='0'){

		             $clas=substr($array[pic5],0,1);

				     $clas=(($clas=='j')?"jpg":"gif");

				     unlink("../image_news/".$newid."/5.".$clas);

				 }

	 	        rmdir('../image_news/'.$newid);

		      }	

         }

   $cla->db_change($sql);

   $sql="insert into operatelog (log_id,user_name,group_name,news_id,news_title,act_type,act_time)values(operateloglog_id.nextval,'$uploader','$group_name',$newid,'$newname','删除新闻','$uploadertime')";

   $cla->db_change($sql);

   }

   }//for

   $cla->db_commit();



  //*******************************************************************************************

 

   include("news_func.php");

   $newname=trim($newname);

   $newdate=trim($newdate);

   $uploader="yjx";

   $sql="select newsid,newsname,uploadertime from news where del_statue!=1 and uploader='yjx'";

   if ($newname!=''){

     $sql.=" and newsname like '%".$newname."%'";

	 }

   if ($newdate!=''){

      $sql.=" and newsdate like '%".$newdate."%'";

    }else{

	  if($days!=0){

	    $date=date("Ymd",mktime(0,0,0,date("m"),date("d")-$days,  date("Y")) );

	    $sql.=" and  newsdate>'$date'";

		}else{

		$date=date("Ymd",mktime(0,0,0,date("m"),date("d")-3,  date("Y")) );

	    $sql.=" and  newsdate>'$date'";

		}

	}

	if ($column1!=''){

	    $sql.=" and column1=$column1"; 

		} 

		$sql.="order by -newsid ";

    // echo $sql;

	$array=$cla->db_query($sql);

	

?><html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link href="water.css" rel="stylesheet" type="text/css">

</head>



<body bgcolor="#FFFFFF" text="#000000">

<form name="form2" method="post" action="modify_news_result.php">

  <table width="772" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#111111" class=border>

    <tr align="center"> 

      <td height="28" colspan="4"> 请选择要修改的新闻</td>

    </tr>

    <tr> 

      <td width="47" align="right">标题:</td>

      <td width="310"> <input name="newname" type="text" class="input1" size="50"> </td>

      <td width="268">栏目: 

        <select name="column1">

          <option value=''>全选</option>

          <?  

				$sqldo="select class_id,class_name from baseclass where class_layer=1";

				$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]["CLASS_NAME"]);

				

				$sqldo_in="select class_id,class_name from baseclass where class_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]["CLASS_NAME"]);	

					

				$sqldo_in_in="select class_id,class_name from baseclass where class_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]['CLASS_NAME'];

				$temp3_name=strip_tags($result_array_in_in[$k]['CLASS_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";}

					   //echo "old:".$old;

					  // echo "result_array".$result_array[$i][0];

					   

					   ?>

                            </option>

                            <?

						

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

							$j++;}//第三级

				      ?>

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

                            <? 							

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

							?>

        </select></td>

      <td width="113" ><input type="submit" name="Submit" value=" 搜  索 " class="input1"></td>

    </tr>

    <tr> 

      <td align="right">日期:</td>

      <td width="310"> <input name="newdate" type="text" class="input1">

        ( 年年年年月月日日)</td>

      <td width="268">最近: 

        <select name="days">

          <option value="0" selected>选择天数</option>

          <option value="1">1天</option>

          <option value="2">2天</option>

          <option value="3">3天</option>

          <option value="4">4天</option>

          <option value="5">5天</option>

          <option value="6">6天</option>

          <option value="7">一星期</option>

          <option value="15">半个月</option>

          <option value="30">一个月</option>

          <option value="60">两个月</option>

          <option value="90">三个月</option>

          <option value="180">半年</option>

          <option value="365">一年</option>

        </select></td>

      <td width="113"><input name="Submit2" type="reset" class="input1" value=" 取  消 "></td>

    </tr>

  </table>

</form>

<form name="form2" method="post" action="modify_news_result.php">

</form>

<form name="form1" method="post" action="delete_news_done1.php">

  <table width="772" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>

      <td bgcolor="#000000"><table width="772" border="0" cellspacing="1" cellpadding="0" align="center">

          <tr bgcolor="#efefef"> 

            <td width="46" height="19">序号</td>

            <td width="307">标题</td>

            <td width="313">上传时间</td>

            <td width="44">修改</td>

            <td width="50">删除</td>

            <td width="50">选择</td>

          </tr>

          <?$i=0;while ($array[$i][NEWSNAME]){?>

          <tr bgcolor="#FFFFFF"> 

            <td width="46" height="21"> <? echo $i+1; ?> </td>

            <td width="307"> 

              <?  echo substr($array[$i][NEWSNAME],9,(strlen($array[$i][NEWSNAME])-9));?>

            </td>

            <td width="313"> <?echo formdate($array[$i][UPLOADERTIME]);?> </td>

            <td width="44"><a href=modify_news_form.php?newid=<?echo $array[$i][NEWSID];?> >修改</a></td>

            <td width="50"><a href=delete_news_done.php?newid=<?echo $array[$i][NEWSID];?> >删除</a></td>

            <td width="50"><input name="ch<?echo $i;?>" type="checkbox"  value="<?echo $array[$i][NEWSID]; ?>"></td>

          </tr>

          <?$i++;}?>

        </table></td>

    </tr>

  </table>

  <center>

    <input type="hidden" name="total" value="<?echo $i;?>">

    <input name="Submit" type="submit" class="input1" value=" 删 除 " >

  <input name="Reset" type="reset" class="input1" value=" 取 消 ">

  </center>

</form>

	 

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

  

</body>

</html>

⌨️ 快捷键说明

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