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

📄 edit_userq.php

📁 Oracle源码:Oracle 数据库管理与应用系统开发代码
💻 PHP
字号:
<?  

require "inc/check.php";

require "inc/error.php";

require "inc/func_s.php";

require "inc/func.php";

function query_getarr($sqldo){

               $result=mysql_query($sqldo);

			   return mysql_fetch_array($result);

			   }

?>

<html>

<head>

<title>"追风"--晨风创意</title>

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

<STYLE type=text/css>BODY {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px; scrollbar-face-color: ffffff; scrollbar-shadow-color: C1C1BB; scrollbar-highlight-color: C1C1BB; scrollbar-3dlight-color: EBEBE4; scrollbar-darkshadow-color: EBEBE4; scrollbar-track-color: F4F4F0; scrollbar-arrow-color: CACAB7

}

P {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

INPUT {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

FONT {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

SELECT {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

OPTION {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

TEXTAREA {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

FORM {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px

}

TD {

	FONT-FAMILY: "宋体"; FONT-SIZE: 12px; TABLE-LAYOUT: fixed; WORD-BREAK: break-all

}

A:link {

	TEXT-DECORATION: none

}

A:visited {

	TEXT-DECORATION: none

}

A:hover {

	TEXT-DECORATION: underline

}

A:active {

	FONT-SIZE: 12px; TEXT-DECORATION: none

}

.border {

	BACKGROUND-COLOR: #efefef; BORDER-BOTTOM: 1px dotted; BORDER-COLLAPSE: collapse; BORDER-LEFT: 1px dotted; BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; COLOR: #000000

}

.shadow1 {

	COLOR: #ffffff; FILTER: dropshadow(color=#000000,offx=1,offy=1); FONT-SIZE: 12px

}

.shadow2 {

	COLOR: #000000; FILTER: dropshadow(color=#d5d5d5,offx=1,offy=1); FONT-SIZE: 12px

}

.p1 {

	COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none

}

.p2 {

	COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none

}

.p3 {

	COLOR: #004080; FONT-SIZE: 14px; TEXT-DECORATION: none

}

</STYLE>







<script language="JavaScript">

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

// -->

</script>

<body bgcolor="#FFFFFF">

<?

if($submit1<>""){ 



           $sqldo="select right_level from users where user_id='$edit_userid'";

		   $result_array=$cla->db_query($sqldo);

		   if($result_array[0][0]=="管理员")

		   {

		   show_msg("此人为管理员,拥有所有权限。不可修改!<br><br>建议:如果一定要修改,可先降低其权限级别(如降到组长),再修改。");exit;

           }

         if($real_name=="")

		 {

		  show_msg("真实姓名不可为空!");   exit;      

		 }

		 		 

         if(($user_email<>"")and(!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$",$user_email))){

		  show_msg("邮箱错误!");  exit;

		 }

		 	

           if($action=="qedit"){ //如果是权限修改

            //获得操作权限

		   $operate_right="";			

           $sqldo="select act_id from baseact";

		  $i=0;

		  $baseact=$cla->db_query($sqldo);

		  while($baseact[$i][0]){

	       if(${chk1.$baseact[$i][0]}==$baseact[$i][0]){

           $operate_right=$operate_right.$baseact[$i][0].",";

		      }

		  $i++;

		  }

            //获得栏目权限

           $sqldo="select class_id from baseclass";

		   $class_right="";

		   $i=0;

		   $baseclass=$cla->db_query($sqldo);

		   while($baseclass[$i][0]){

		      if(${chk2.$baseclass[$i][0]}==$baseclass[$i][0]){

				       $class_right=$class_right.$baseclass[$i][0].",";					  

		      }

		  $i++;	  

		  }

   		

		  $sqldo="update users set real_name='$real_name',email='$user_email',operate_right='$operate_right',class_right='$class_right',user_description='$user_description' where user_id='$edit_userid'";

		  }

		 if($cla->db_update($sqldo))

		 {

		 $cla->db_commit();

		  show_msg("用户 ".$real_name." 权限修改成功!");  exit;

		 }	

     }	



   ?>



<center>

  <table width="100%" border="0" height="488">

    <tr> 

      <td height="541"  width="5%"> 

        <p align="center">&nbsp;</p>

        <p align="center">&nbsp;</p>

      </td>

      <td height="541" width="15%" valign="top"> <table border=1 bordercolor=#111111 cellpadding=3 cellspacing=0 

      class=border width="85%" height="257">

          <tbody>

            <tr> 

              <td bgcolor=#efefef width="100%"> <div align="center"><img src="images/list.gif" width="16" height="16"> 

                  控制面板</div></td>

            </tr>

            <tr> 

              <td align=middle class=shadow2 height=230 valign=middle 

            width="100%"> <div align="center"> 

                  <? if($ses_right=="管理员"){ ?>

                  <p><br>

                  </p>

                  <p><img src="images/edit.gif" width="18" height="13"> <a href="add_grp.php" >增 

                    加 新 组</a></p>

                  <? }?>

                  <p><br>

                    <img src="images/edit.gif" width="18" height="13"> <a href="add_usr.php"  >增 

                    加 成 员</a></p>

                  <?if($ses_right=="管理员"){ ?>

                  <p><br>

                    <img src="images/edit.gif" width="18" height="13"> <a href="user_mag_view.php">查 

                    看 某 组</a></p>

                  <? }?>

                  <p><br>

                    <img src="images/edit.gif" width="18" height="13"> <a href="user_view.php" target="_self">查 

                    看 成 员</a><br>

                    <br>

                    <br>

                    <br>

                  </p>

                </div></td>

            </tr>

          </tbody>

        </table></td>

      <td width="734" height="541" valign="top"> 

        <?      $edit_userid=$uid;

                $sqldo="select user_id,real_name,login_name,login_password,email,right_level,group_id,class_right,operate_right,user_description from users where user_id='$edit_userid'";

				$user_edit=$cla->db_query($sqldo);

				

		?>

        <form name="listmail" method="post" action="edit_userq.php?action=<? echo $action;?>&edit_userid=<?echo $uid;?>&sel_groupname=<?echo $sel_groupname;?>"  onSubmit="return checkblank()">

          <div align="right">

            <table width="100%" border="1" bordercolor="#111111" cellpadding="3" cellspacing="0"  class=border>

              <tr> 

                <td colspan="3" bgcolor="#f7f7f7"> 

                  <div align="center"> 

                    <p>&nbsp;</p>

                    <p><b><font size="4">修改用户</font></b> </p>

                    <p>&nbsp;</p>

                  </div>

                </td>

              </tr>

              <tr> 

                <td width="11%" bgcolor="#f7f7f7"> 

                  <div align="right">登 录 名:</div>

                </td>

                <td bgcolor="#f7f7f7" colspan="2"> <?echo trim($user_edit[0]['LOGIN_NAME']);?></td>

              </tr>

              <tr> 

                <td width="11%" bgcolor="#f7f7f7" height="39"> 

                  <div align="right">真实姓名:</div>

                </td>

                <td bgcolor="#f7f7f7" height="39" colspan="2"> 

                  <input type="text" name="real_name" class="border" size="20" value="<?echo trim($user_edit[0]['REAL_NAME']);?>">

                  (*) </td>

              </tr>

              <tr> 

                <td width="11%"> 

                  <div align="right">邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</div>

                </td>

                <td colspan="2"> 

                  <input type="text" name="user_email" class="border" size="20" value="<?echo trim($user_edit[0]['EMAIL']);?>">

                </td>

              </tr>

              <tr> 

                <td width="11%" bgcolor="#f7f7f7"> 

                  <div align="right">操作权限:</div>

                </td>

                <td bgcolor="#f7f7f7" width="76%"> 

                  <? 

                    //

                    $userid=$ses_uid;

                    $right=get_o_right($cla,$userid);

					$cnt=0;

					while($right["id$cnt"]<>""){

					//判断是否为checked

                    $right_in=get_o_right($cla,$uid);

					$flg=0;

					$cnt_in=0;

					while($right_in["id$cnt_in"]<>"")

					{

					   if($right_in["id$cnt_in"]==$right["id$cnt"]){

					   $flg=1;

				    	}					

					$cnt_in++;

					}

		           ?>

                  <input type="checkbox" name=<? echo "chk1".$right["id$cnt"];?> value=<? echo $right["id$cnt"];?> <? if($flg==1){ echo " checked";} ?> >

                  <? echo $right["name$cnt"];?>

                  <?  $cnt=$cnt+1;}?>

                </td>

                <td bgcolor="#f7f7f7" rowspan="2" width="12%">

                  <input type="checkbox" name="allbox" value="Check All" onClick="CheckAll();">

                  <a href="javascript:CheckAll();" onClick="allbox.checked=!allbox.checked">选中全部</a> 

                </td>

              </tr>

              <tr> 

                <td width="11%"> 

                  <div align="right">栏目权限:</div>

                </td>

                <td width="76%"> 

                  <? 

                    //判断是否该组拥有此权限,如果有,则打勾

                    $right=get_c_right($cla,$userid);

					$cnt=0;

					while($right["id$cnt"]<>""){

					//判断是否为checked

                    $right_in=get_c_right($cla,$uid);

					$flg=0;

					$cnt_in=0;

					while($right_in["id$cnt_in"]<>"")

					{

					   if($right_in["id$cnt_in"]==$right["id$cnt"]){

					   $flg=1;

				    	}					

					$cnt_in++;

					}

		           ?>

                  <input type="checkbox" name=<? echo "chk2".$right["id$cnt"];?> value=<? echo $right["id$cnt"];?> <? if($flg==1){ echo " checked";} ?> >

                  <? echo $right["name$cnt"]; ?>

                  <?  $cnt=$cnt+1;}?>

                </td>

              </tr>

              <tr> 

                <td width="11%"> 

                  <div align="right">备&nbsp;&nbsp;&nbsp;&nbsp;注:</div>

                </td>

                <td colspan="2"> 

                  <input type="text" name="user_description" class="border" size="60" value="<?echo $user_edit[0]['USER_DESCRIPTION'];?>">

                </td>

              </tr>

            </table>

          </div>

          <p align="center"> 

            <input type="submit" name="submit1" value="确定" >

            <input type="reset" name="Submit2" value="重置">

          </p>

        </form>

  </table>

</center>

<div align="center">  <br>

  <p>&nbsp;</p>

</div>



<script language="JavaScript">



<!--



function CheckAll()

  {

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

    {

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

      if (e.name != 'allbox')

        e.checked = document.listmail.allbox.checked;

    }

  }

//-->



</script>



<SCRIPT language="JavaScript">

<!--

 function checkblank()



 {

    //if(listmail.login_name.value=="") {

    // alert("组名不可为空!")

   //  form1.login_name.focus()

	// return false



	//  }

   if(document.listmail.real_name.value==""){

      alert("真实姓名不可为空!")

     listmail.real_name.focus()  

	 return false

	 }



  }	 

-->

</SCRIPT>

<? $cla->db_logoff();

?>

</body>

</html>

⌨️ 快捷键说明

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