<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	End If
	if Trim(Request.QueryString("action"))="save" then
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from subject where id="&ReplaceBadChar(Trim(Request.Form("id")))&" and sid="&ReplaceBadChar(Request.Cookies("admin_school_id"))&""
		rs.open sql,conn,2,3
		lock1=rs("lock")
		rs("sname")=ReplaceBadChar(Trim(Request.Form("sname")))
		rs("xueli")=ReplaceBadChar(Trim(Request.Form("xueli")))
		rs("myear")=ReplaceBadChar(Trim(Request.Form("myear")))
		rs("shouke")=ReplaceBadChar(Trim(Request.Form("shouke")))
		rs("degree")=ReplaceBadChar(Trim(Request.Form("degree")))
		rs("goal")=ReplaceBadChar(Trim(Request.Form("goal")))
		rs("subject")=ReplaceBadChar(Trim(Request.Form("subject")))
		rs("job")=ReplaceBadChar(Trim(Request.Form("job")))
		rs.update
		
		if lock1=1 then
			response.redirect "view_school_subject_html.asp?id="&ReplaceBadChar(Trim(Request.Form("id")))&""
		else
			response.write"<SCRIPT language=JavaScript>alert('您的操作已完成');"
			response.write"this.location.href='department_all.asp';</SCRIPT>"
		end if
		
		response.end
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
	
	if Trim(Request.QueryString("id"))="" then
		response.write"<SCRIPT language=JavaScript>alert('非法操作');"
		response.write"this.location.href='department_all.asp';</SCRIPT>"
		response.end
	else
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from subject where sid="&ReplaceBadChar(Request.Cookies("admin_school_id"))&" and id="&ReplaceBadChar(Trim(Request.QueryString("id")))&""
		rs.open sql,conn,1,1
		if rs.eof then
			response.write"<SCRIPT language=JavaScript>alert('非法操作');"
			response.write"this.location.href='department_all.asp';</SCRIPT>"
			response.end
		else
%>
<HTML>
<head>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link href="images/1.css" rel="stylesheet" type="text/css">
<link href="images/2.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkdepartment()
{
   if(checkspace(document.department.sname.value)) {
	document.department.sname.focus();
    alert("对不起，请填写专业名称！");
	return false;
  }
   if(checkspace(document.department.xueli.value)) {
	document.department.xueli.focus();
    alert("对不起，请填写学历！");
	return false;
  }
   if(checkspace(document.department.myear.value)) {
	document.department.myear.focus();
    alert("对不起，请填写学制！");
	return false;
  }
   if(checkspace(document.department.shouke.value)) {
	document.department.shouke.focus();
    alert("对不起，请填写授课形式！");
	return false;
  }
   if(checkspace(document.department.degree.value)) {
	document.department.degree.focus();
    alert("对不起，请填写学位证书！");
	return false;
  }
   if(checkspace(document.department.goal.value)) {
	document.department.goal.focus();
    alert("对不起，请填写培养目标！");
	return false;
  }
   if(checkspace(document.department.subject.value)) {
	document.department.subject.focus();
    alert("对不起，请填写主要课程！");
	return false;
  }
   if(checkspace(document.department.job.value)) {
	document.department.subject.focus();
    alert("对不起，请填写就业方向！");
	return false;
  }
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>
</head>
<body topmargin="0">
<table width="550"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/m_11.gif" width="550" height="9"></td>
  </tr>
  <tr>
    <td background="images/m_13.gif"><div align="left">
      <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="left"><img src="images/jianli-9.gif" width="136" height="33">
          </div>
            <TABLE width="100%" border=0 cellPadding=0 cellSpacing=1 bgColor=#83b629 align="center">
              <TBODY>
                <TR>
                  <TD height="358" vAlign=top bgColor=#ffffff><TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                    <TBODY>
                      <TR>
                        <TD vAlign=top width="100%" height="358"><TABLE height=24 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                            <TBODY>
                              <TR>
                                <TD bgColor=#83b629 height=21><FONT style="FONT-SIZE: 13px" face=Verdana color=#ffffff><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;添加专业</STRONG></FONT></TD>
                              </TR>
                              <TR>
                                <TD bgColor=#e2e2e2 height=2></TD>
                              </TR>
                            </TBODY>
                          </TABLE>
                            <DIV align=center>
                              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table2">
                                <tr>
                                  <td valign="top">
                              <form name="department" method="post" action="?action=save" onSubmit="return checkdepartment()">
							  <input name="id" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
                                        <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
                                          <tr>
                                            <td width="21%" height="30" bgcolor="#efefef"><div align="right">专业名称：</div></td>
                                            <td width="79%" bgcolor="#efefef"><input name="sname" type="text" id="sname" size="50" maxlength="50" value="<%= rs("sname") %>">
                                                <font color="#FF6600">*</font> </td>
                                          </tr>
                                          <tr>
                                            <td height="30" bgcolor="#f9f9f9"><div align="right">学历：</div></td>
                                            <td bgcolor="#f9f9f9"><select name="xueli">
                                                <option value="博士" <% If rs("xueli")="博士" Then Response.Write("selected")%>>博士</option>
                                                <option value="硕士" <% If rs("xueli")="硕士" Then Response.Write("selected")%>>硕士</option>
                                                <option value="大学本科" <% If rs("xueli")="大学本科" Then Response.Write("selected")%>>大学本科</option>
                                                <option value="大专" <% If rs("xueli")="大专" Then Response.Write("selected")%>>大专</option>
                                                <option value="中专" <% If rs("xueli")="中专" Then Response.Write("selected")%>>中专</option>
                                                <option value="职高/技校" <% If rs("xueli")="职高/技校" Then Response.Write("selected")%>>职高/技校</option>
                                                <option value="高中" <% If rs("xueli")="高中" Then Response.Write("selected")%>>高中</option>
                                                <option value="初中" <% If rs("xueli")="初中" Then Response.Write("selected")%>>初中</option>
                                              </select>                                            </td>
                                          </tr>
                                          <tr>
                                            <td height="30" bgcolor="#efefef"><div align="right">学制：</div></td>
                                            <td bgcolor="#efefef"><input size="10" name="myear" value="<%= rs("myear") %>">
                                              年 <font color="#FF6600">*</font></td>
                                          </tr>
                                          <tr>
                                            <td height="30" bgcolor="#f9f9f9"><div align="right">授课形式：</div></td>
                                            <td bgcolor="#f9f9f9"><select name="shouke">
                                                <option value="全日制" <% If rs("shouke")="全日制" Then Response.Write("selected")%>>全日制</option>
                                                <option value="业余" <% If rs("shouke")="业余" Then Response.Write("selected")%>>业余</option>
                                                <option value="函授" <% If rs("shouke")="函授" Then Response.Write("selected")%>>函授</option>
                                                <option value="远程" <% If rs("shouke")="远程" Then Response.Write("selected")%>>远程</option>
                                              </select></td>
                                          </tr>
										  <tr>
                                            <td height="30" bgcolor="#EFEFEF"><div align="right">学位证书：</div></td>
                                            <td bgcolor="#EFEFEF"><select name="degree">
                                                <option value="无" <% If rs("degree")="无" Then Response.Write("selected")%>>无</option>
                                                <option value="学士证书" <% If rs("degree")="学士证书" Then Response.Write("selected")%>>学士学位</option>
                                                <option value="硕士学位" <% If rs("degree")="硕士学位" Then Response.Write("selected")%>>硕士学位</option>
                                                <option value="博士学位" <% If rs("degree")="博士学位" Then Response.Write("selected")%>>博士学位</option>
                                                <option value="博士后学位" <% If rs("degree")="博士后学位" Then Response.Write("selected")%>>博士后学位</option>
                                            </select>										    </td>
										  </tr>
                                          <tr>
                                            <td height="18" bgcolor="#F9F9F9"><div align="right">培养目标：</div></td>
                                            <td bgcolor="#F9F9F9"><textarea name="goal" cols="55" rows="4" id="goal"><%= rs("goal") %></textarea>
                                            <font color="#FF6600">*</font> </td>
                                          </tr>
                                          <tr>
                                            <td height="18" bgcolor="#efefef"><div align="right">主要课程：</div></td>
                                            <td bgcolor="#efefef"><textarea name="subject" cols="55" rows="4" id="subject"><%= rs("subject") %></textarea>
                                                <font color="#FF6600">*</font> </td>
                                          </tr>
                                          <tr>
                                            <td height="18" bgcolor="#F9F9F9"><div align="right">就业方向：</div></td>
                                            <td bgcolor="#F9F9F9"><textarea name="job" cols="55" rows="4" id="job"><%= rs("job") %></textarea>
                                            <font color="#FF6600">*</font> </td>
                                          </tr>
                                          <tr bgcolor="#f9f9f9">
                                            <td height=30 colspan=2 valign=bottom><p align=center>&nbsp;&nbsp;&nbsp;
                                                    <input name="Submit" type="submit" class="inputa" value="修　改">
                                              &nbsp;&nbsp;
                                              <input name="Submit" type="button" class="inputa" value="退　出" onClick="javascript:window.location.href='department_all.asp';">
                                            </p></td>
                                          </tr>
                                        </table>
                                      </form></td>
                                </tr>
                              </table>
                            </DIV></TD>
                      </TR>
                    </TBODY>
                  </TABLE></TD>
                </TR>
              </TBODY>
            </TABLE>
            </td>
        </tr>
      </table>
    </div></td>
  </tr>
  <tr>
    <td background="images/m_13.gif"></td>
  </tr>
  <tr>
    <td><img src="images/m_12.gif" width="550" height="9"></td>
  </tr>
</table>
<%
		end if
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
%>
</body>
</html>