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

📄 mymsgadmin.php

📁 php做的一个同学录网站,功能齐全. 后台管理非常方便,有需要的同学可以下载测试.
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
include("pwdsuper.php");
include("connect.inc.php");
include("char.inc.php");
if (isset($op)){
switch ($op){
case "delete":
    $query=mysql_query('select * from message where id='.$id,$conn);
    $msgarray=mysql_fetch_array($query);
    if($msgarray["userid"]==$msgarray["msgtoid"]){
      $query="DELETE FROM message WHERE id=".$id." LIMIT 1";
    }else{    
    if(($msgarray["userid"]==$userid)&&($msgarray["senddel"]==0)){
      if($msgarray["inceptdel"]==0){
      $query="UPDATE message SET senddel=1 WHERE id=".$id." LIMIT 1"; 
      }else{
      $query="DELETE FROM message WHERE id=".$id." LIMIT 1";      
      }
    }else{
    if(($msgarray["msgtoid"]==$userid)&&($msgarray["inceptdel"]==0)){
      if($msgarray["senddel"]==0){
      $query="UPDATE message SET inceptdel=1 WHERE id=".$id." LIMIT 1"; 
      }else{
      $query="DELETE FROM message WHERE id=".$id." LIMIT 1";      
      }
    }else{$query="no";}
    }
    }
  if($query!="no"){
    if(mysql_query($query))
        echo " <!--zmis41197-->";
    else
        echo "<center>".mysql_error()."</center><br>";
    }
    break;
default:
    break;
}
}
$pagesize=15; //一页显示记录数
$queryone=mysql_query('select id from message where (userid='.$userid.' && senddel=0) ORDER BY senddt DESC, id desc',$conn);
$querytwo=mysql_query('select id from message where (msgtoid='.$userid.' && inceptdel=0) ORDER BY senddt DESC, id desc',$conn);
while ($idarrayone=mysql_fetch_array($queryone)){
$idone[]=$idarrayone["id"];
}
while ($idarraytwo=mysql_fetch_array($querytwo)){
$idtwo[]=$idarraytwo["id"];
}
if (isset($idone))sort($idone);
if (isset($idtwo))sort($idtwo);
if (isset($idone))reset($idone);
if (isset($idtwo))reset($idtwo);
if(isset($idone)&&isset($idtwo)){
$idonecount=count($idone);
$idtwocount=count($idtwo);
	for($i=0;$i<$idonecount;$i++){
	  for($j=0;$j<$idtwocount;$j++){
	    if($idone[$i]==$idtwo[$j]){
	      $idflag=1;
	      break;
	    }else{ 
	      $idflag=0;
	      }
	  }
	  if($idflag==0)$idc[]=$idone[$i];
	}	
if(isset($idtwo)&&isset($idc)){
  $sqlinstr=implode(",",$idtwo).",".implode(",",$idc);
  }else{
  if(isset($idtwo)&&!isset($idc))$sqlinstr=implode(",",$idtwo);
  if(!isset($idtwo)&&isset($idc))$sqlinstr=implode(",",$idc);
  }
  $querysql='select * from message where id IN ('.$sqlinstr.') ORDER BY senddt DESC, id desc';
}else{
  if(isset($idone)&&(!isset($idtwo)))$querysql='select * from message where id IN ('.implode(",",$idone).') ORDER BY senddt DESC, id desc';
  if(isset($idtwo)&&(!isset($idone)))$querysql='select * from message where id IN ('.implode(",",$idtwo).') ORDER BY senddt DESC, id desc';
  if(!isset($idone)&&!isset($idtwo))$querysql="select * from message where userid='没有数据' ORDER BY senddt DESC, id desc";
}
  $newsquery=mysql_query($querysql,$conn);
  $recordcount = mysql_num_rows($newsquery);
  $pagecount = bcdiv($recordcount+$pagesize-1,$pagesize,0); //算出总页数
  if(!isset($page)) $page = 1; //如果没有指定显示页码,缺省为显示第一页
  if($page<1) $page = 1; //如果页码比1小,则显示第一页
  if($page>$pagecount) $page = $pagecount; //如果页码比总页数大,则显示最后一页
  if($pagecount>0){
  if($page>0){ //页码比0大,表示有数据
   $firstimage='<a href="' . $PHP_SELF . '?page=1&userid='.$userid.'"><img name="listbm_r3_c4" src="images/listbm_r3_c4.gif" width="16" height="16" border="0" title="首页" alt="首页"></a>';
   if($page>1){
      $pimage='<a href="' . $PHP_SELF . '?page='. ($page-1) . '&userid='.$userid.'"><img name="listbm_r3_c6" src="images/listbm_r3_c6.gif" width="16" height="16" border="0" title="前页" alt="前页"></a>';
   }else{
      $pimage='<img name="listbm_r3_c6" src="images/listbm_r3_c6.gif" width="16" height="16" border="0" title="前页" alt="前页">';
   }
   if($page<$pagecount){
      $nimage='<a href="' . $PHP_SELF . '?page='. ($page+1) . '&userid='.$userid.'"><img name="listbm_r3_c8" src="images/listbm_r3_c8.gif" width="16" height="16" border="0" title="后页" alt="后页"></a>';
   }else{
      $nimage='<img name="listbm_r3_c8" src="images/listbm_r3_c8.gif" width="16" height="16" border="0" title="后页" alt="后页">';
   }
   $lastimage='<a href="' . $PHP_SELF . '?page=' . $pagecount . '&userid='.$userid.'"><img name="listbm_r3_c10" src="images/listbm_r3_c10.gif" width="16" height="16" border="0" title="最后页" alt="最后页"></a>';
   $pageinfo=$pagesize.'条/页 共'.$recordcount.'条 页数:'.$page.'/'.$pagecount.'页 ';
  }
}

?>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
 <!--
 function dispfile(vid,usid) {
   window.open('dispmsg.php?id='+vid+'&userid='+usid,'refile','resizable=1,scrollbars=1,width=450,height=400');
 }
 function openw(url,n,w,h) {
   window.open(url,n,'resizable=1,scrollbars=1,width='+w+',height='+h)
 }
 function high(which2){
 theobject=which2
 highlighting=setInterval("highlightit(theobject)",50)
 }
 function low(which2){
 clearInterval(highlighting)
 which2.filters.alpha.opacity=60
 }
 function highlightit(cur2){
 if (cur2.filters.alpha.opacity<100)
 cur2.filters.alpha.opacity+=10
 else if (window.highlighting)
 clearInterval(highlighting)
 }
 //-->
 </script>
<style type="text/css">
<!--
td{font-size:12px;line-height:17px;}
a:active {text-decoration: none;}
a:link {text-decoration: none;}
a:hover{text-decoration: underline;}
a:visited {text-decoration: none;}
BODY{font-size:12px;line-height:17px;SCROLLBAR-FACE-COLOR: #83d160; SCROLLBAR-HIGHLIGHT-COLOR: #CCFF00; SCROLLBAR-SHADOW-COLOR: #CCFF00; SCROLLBAR-3DLIGHT-COLOR: #009900; SCROLLBAR-ARROW-COLOR:  #006600; SCROLLBAR-TRACK-COLOR: ##99FF00; SCROLLBAR-DARKSHADOW-COLOR: #009900; }
-->
</style>
<title>::::集中营我的消息管理::::</title>
<meta http-equiv="Content-Type" content="text/html;">
<!-- Fireworks 4.0  Dreamweaver 4.0 target.  Created Wed Mar 20 14:48:27 GMT+0800 (?D1ú±ê×?ê±??) 2002-->
</head>
<body bgcolor="#dcf6ce" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#666600" link="#009900" alink="#00FF00" vlink="#006600">
<table border="0" cellpadding="0" cellspacing="0" width="621">
<!-- fwtable fwsrc="无标题" fwbase="right.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
  <tr>
   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="15" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="2" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="38" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="55" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="82" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="96" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="87" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="115" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="65" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="30" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="15" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="6" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>

  <tr>
   <td colspan="15" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="621" height="5" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="5" border="0"></td>
  </tr>
  <tr>
   <td colspan="4" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="27" height="19" border="0"></td>
   <td colspan="3"><img name="right_r2_c5" src="images/right_r2_c5.gif" width="175" height="19" border="0"></td>
    <td colspan="8" bgcolor="#dcf6ce">
      <div align="right">::::集中营我的消息管理::::&nbsp;&nbsp;</div>
    </td>
   <td><img src="images/spacer.gif" width="1" height="19" border="0"></td>
  </tr>
  <tr>
   <td rowspan="9" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="5" height="425" border="0"></td>
   <td colspan="3"><img name="right_r3_c2" src="images/right_r3_c2.gif" width="22" height="16" border="0"></td>
    <td colspan="2" bgcolor="#83d160"><img src="images/spacer.gif" width="93" height="16" border="0"></td>
   <td><img name="right_r3_c7" src="images/right_r3_c7.gif" width="82" height="16" border="0"></td>
   <td><img name="right_r3_c8" src="images/right_r3_c8.gif" width="96" height="16" border="0"></td>
   <td><img name="right_r3_c9" src="images/right_r3_c9.gif" width="87" height="16" border="0"></td>
   <td><img name="right_r3_c10" src="images/right_r3_c10.gif" width="115" height="16" border="0"></td>
   <td colspan="3"><img name="right_r3_c11" src="images/right_r3_c11.gif" width="100" height="16" border="0"></td>
   <td><img name="right_r3_c14" src="images/right_r3_c14.gif" width="15" height="16" border="0"></td>
   <td rowspan="9" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="6" height="425" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="16" border="0"></td>
  </tr>
  <tr>
   <td colspan="3"><img name="right_r4_c2" src="images/right_r4_c2.gif" width="22" height="60" border="0"></td>
   <td><img name="right_r4_c5" src="images/right_r4_c5.gif" width="38" height="60" border="0"></td>
   <td colspan="6" bgcolor="#dcf6ce"><img src="images/ad.gif" width="500" height="60" border="0"></td>
   <td colspan="2"><img name="right_r4_c12" src="images/right_r4_c12.gif" width="35" height="60" border="0"></td>
   <td><img name="right_r4_c14" src="images/right_r4_c14.gif" width="15" height="60" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="60" border="0"></td>
  </tr>
  <tr>
   <td colspan="3"><img name="right_r5_c2" src="images/right_r5_c2.gif" width="22" height="19" border="0"></td>
   <td colspan="3"><img name="right_r5_c5" src="images/right_r5_c5.gif" width="175" height="19" border="0"></td>
   <td><img name="right_r5_c8" src="images/right_r5_c8.gif" width="96" height="19" border="0"></td>
   <td><img name="right_r5_c9" src="images/right_r5_c9.gif" width="87" height="19" border="0"></td>
   <td><img name="right_r5_c10" src="images/right_r5_c10.gif" width="115" height="19" border="0"></td>
   <td colspan="3"><img name="right_r5_c11" src="images/right_r5_c11.gif" width="100" height="19" border="0"></td>
   <td><img name="right_r5_c14" src="images/right_r5_c14.gif" width="15" height="19" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="19" border="0"></td>
  </tr>
  <tr>
   <td rowspan="6" bgcolor="#dcf6ce"><img src="images/spacer.gif" width="15" height="330" border="0"></td>
    <td rowspan="2" background="images/box2.gif"><img name="right_r6_c3" src="images/right_r6_c3.gif" width="5" height="302" border="0"></td>
    <td rowspan="2" colspan="9" bgcolor="#dcf6ce" valign="top" align="center"> 
<?php
if($recordcount!=0){
?>
      <form action=mymsgadmin.php method=GET>
      <table border="0" cellpadding="0" cellspacing="0" width="567" name="list_top">
        <!-- fwtable fwsrc="无标题" fwbase="list.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
        <tr> 
          <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="6" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="22" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="2" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="9" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="109" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="3" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="23" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="171" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="27" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="16" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="6" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="16" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="6" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="3" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="13" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="3" height="1" border="0"></td>
          <td><img src="images/spacer.gif" width="3" height="1" border="0"></td>

⌨️ 快捷键说明

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