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

📄 classmod.php

📁 修正了多处BUG
💻 PHP
字号:
<?
include('session.php');
include('../function.php');
include('../config.php');
include('../addclass.php'); 
$add=new addclass($dbname);
if (islogin($_SESSION['username'],$_SESSION['userpass'])&&isadmin($_SESSION['username'],1))
$accept=true;
else 
{
$accept=false;

echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>部门操作</title>
<link href="../css.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F3F7FC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_kuang">
  <tr> 
    <td background="../images/dmid.jpg" class="tianchong"><font class="size10">部门操作</font></td>
  </tr>
  <tr> 
    <td class="tianchong"><form name="form2" method="post" action="">
        <!-- 添加部门 -->
        <table width="96%" border="0" cellspacing="0" cellpadding="0" class="table_kuang">
          <tr> 
            <td colspan="2" class="tianchong">添加部门</td>
          </tr>
          <tr> 
            <td width="27%" class="tianchong">部门名称:</td>
            <td width="73%" class="tianchong"><input name="classname" type="text" id="classname" size="20"></td>
          </tr>
          <tr> 
            <td class="tianchong" valign="top">部门简介:</td>
            <td class="tianchong"><textarea name="classinfo" cols="30" rows="5" id="classinfo"></textarea> 
              <input name="min_mod" type="hidden" id="min_mod" value="addclass"></td>
          </tr>
          <tr> 
            <td class="tianchong"> 
              <? 
						if ($accept&&$_POST['min_mod']=="addclass")
						{
							$class_name=$_POST['classname'];
							$class_info=$_POST['classinfo'];
							if (!isin(" * ","class_list"," where class_name='".$class_name."' "))
							{
								$add->addsql("class_list"," '$class_name','$class_info' ");
								$errormeg="部门添加成功";
								}
							else 
								$errormeg="已在部门列表中";
							}
						
						?>
            </td>
            <td class="tianchong"> <input type="submit" name="Submit2" value="添加"> 
              <font color="#FF0000" size="5" class="size10">提示信息</font><font class="size10">:<?php echo $errormeg;?></font> 
            </td>
          </tr>
          <tr> 
            <td colspan="2" class="tianchong">&nbsp;</td>
          </tr>
        </table>
      </form></td>
  </tr>
  <tr> 
    <td class="tianchong"><form name="form3" method="post" action="">
        <!-- 删除部门 -->
		 <?php 
						if ($accept&&$_POST['min_mod']=="delclass")
						{
							$class_name=$_POST['classlist'];
							if (isin(" * ","class_list"," where class_name='".$class_name."' "))
							{	
								if($add->delsql("class_list","where class_name='".$class_name."' "))
									$errormeg="部门删除成功";
								}
							else 
								$errormeg="已删除";
							}
						
						?>
        <table width="96%" border="0" cellspacing="0" cellpadding="0"  class="table_kuang">
          <tr> 
            <td width="40%" class="tianchong">删除部门</td>
            <td width="60%" class="tianchong">&nbsp;</td>
          </tr>
          <tr> 
            <td colspan="2" class="tianchong"> 对: 
              <select name="classlist" id="classlist">
                <option value="no" selected>部门列表</option>
                <?php 
				
					classlist();
							?>
              </select> <input type="submit" name="Submit3" value="删除"> <input name="min_mod" type="hidden" id="min_mod" value="delclass"> 
            </td>
          </tr>
          <tr> 
            <td colspan="2" class="tianchong"> 
             
              <font color="#FF0000" size="5" class="size10">提示信息</font><font class="size10">:<?php echo $errormeg;?></font> 
            </td>
          </tr>
        </table>
      </form></td>
  </tr>
  <tr> 
    <td class="tianchong">&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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