0451skyteacher.js

来自「0451sky高校教务管理系统2008 v3.3」· JavaScript 代码 · 共 167 行

JS
167
字号
function isValidCode(strCode)
{
   var i, cChar
   var strValidID = "0123456789-.";
   for (i = 0; i < strCode.length; i ++ )
   {
      cChar = strCode.charAt(i);
      if(strValidID.indexOf(cChar) == - 1) return false;
   }
   return true;
}
function  SkyTeacher()
{
   var info, s, ad;
   ad = "〖学校教务管理系统提示您!〗\n";
   info = ad + "您确实要批量增加信息吗?";
   s = document.getElementById("TxtAddNum")
   if(s.value == "" || ! isValidCode(s.value) || s.value.length < 4)
   {
      alert(ad + "教师编号前缀不能为空,并且必须是数字(4位)!\n请选择相应的院系自动生成编号!\n并手动增加教师来学校的时间年(2位)\n例如:2005年=05");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtENum")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教师编号结束不能为空,并且必须是数字(3位)!");
      s.focus();
      return false;
   }
   // #####################################################
   s = document.getElementById("TxtXZ")
   if(s.value == "")
   {
      alert(ad + "教师学制不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtXL")
   if(s.value == "")
   {
      alert(ad + "教师学历不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtMZ")
   if(s.value == "")
   {
      alert(ad + "教师民族不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   if(confirm(info))
   {
      return true;
   }
   else
   {
      return false;
   }
}

// ###########################################
function  SkyTeacherreg()
{
   var info, s, ad;
   ad = "〖学校教务管理系统提示您!〗\n";
   info = ad + "您确实要批量增加信息吗?";
   s = document.getElementById("TxtAddNum")
   if(s.value == "" || ! isValidCode(s.value) || s.value.length < 8)
   {
      alert(ad + "教师编号不能为空,并且必须是数字(8位)!\n请选择相应的院系自动生成编号!\n并手动增加教师来学校的时间年(2位)\n例如:2005年=05");
      s.focus();
      return false;
   }
   s = document.getElementById("TxtENum")
   if(s.value == "" || ! isValidCode(s.value))
   {
      alert(ad + "教师编号结束不能为空,并且必须是数字(3位)!");
      s.focus();
      return false;
   }
   // #####################################################
   s = document.getElementById("TxtXZ")
   if(s.value == "")
   {
      alert(ad + "教师学制不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtXL")
   if(s.value == "")
   {
      alert(ad + "教师学历不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtMZ")
   if(s.value == "")
   {
      alert(ad + "教师民族不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   if(confirm(info))
   {
      return true;
   }
   else
   {
      return false;
   }
}
// ###########################################
function  SkyTeacherregs()
{
   var info, s, ad;
   ad = "〖学校教务管理系统提示您!〗\n";
   info = ad + "您确实要批量增加信息吗?";
   s = document.getElementById("TxtAddNum")
   if(s.value == "" || ! isValidCode(s.value) || s.value.length < 8)
   {
      alert(ad + "学生编号不能为空,并且必须是数字(8位)!\n请选择相应的院系自动生成编号!\n并手动增加教师来学校的时间年(2位)\n例如:2005年=05");
      s.focus();
      return false;
   }
   // #####################################################
   s = document.getElementById("TxtXZ")
   if(s.value == "")
   {
      alert(ad + "教师学制不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtXL")
   if(s.value == "")
   {
      alert(ad + "教师学历不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   s = document.getElementById("TxtMZ")
   if(s.value == "")
   {
      alert(ad + "教师民族不能为空)!");
      s.focus();
      return false;
   }
   // ######################################################
   if(confirm(info))
   {
      return true;
   }
   else
   {
      return false;
   }
}

⌨️ 快捷键说明

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