class_management_system

Senior Project - Spring 2019
Log | Files | Refs | README

javascript.js (4049B)


      1 function openPage(pageName, elmnt, color) 
      2 {
      3 	var i, tabcontent, tablinks;
      4 	tabcontent = document.getElementsByClassName("tabcontent");
      5 	for (i = 0; i < tabcontent.length; i++) 
      6 	{
      7 		tabcontent[i].style.display = "none";
      8 	}
      9 
     10 	tablinks = document.getElementsByClassName("tablink");
     11 	for (i = 0; i < tablinks.length; i++) 
     12 	{
     13 		tablinks[i].style.backgroundColor = "";
     14 	}
     15 
     16 	document.getElementById(pageName).style.display = "block";
     17 
     18 	elmnt.style.backgroundColor = color;
     19 }
     20 
     21 document.getElementById("defaultOpen").click();
     22 
     23 function fieldappear(that) 
     24 {
     25     if (that.value == "form_A") 
     26 	{
     27         document.getElementById("fadeableA").style.display = "block";
     28 		document.getElementById("fadeableB").style.display = "none";
     29 		document.getElementById("fadeableC").style.display = "none";
     30 		document.getElementById("fadeableD").style.display = "none";
     31 		document.getElementById("fadeableE").style.display = "none";
     32 		document.getElementById("fadeableF").style.display = "none";
     33     } 
     34 	else if (that.value == "form_B") 
     35 	{
     36 		document.getElementById("fadeableA").style.display = "none";
     37         document.getElementById("fadeableB").style.display = "block";
     38 		document.getElementById("fadeableC").style.display = "none";
     39 		document.getElementById("fadeableD").style.display = "none";
     40 		document.getElementById("fadeableE").style.display = "none";
     41 		document.getElementById("fadeableF").style.display = "none";
     42     } 
     43 	else if (that.value == "form_C") 
     44 	{
     45 		document.getElementById("fadeableA").style.display = "none";
     46         document.getElementById("fadeableB").style.display = "none";
     47 		document.getElementById("fadeableC").style.display = "block";
     48 		document.getElementById("fadeableD").style.display = "none";
     49 		document.getElementById("fadeableE").style.display = "none";
     50 		document.getElementById("fadeableF").style.display = "none";
     51     } 
     52 	else if (that.value == "form_D") 
     53 	{
     54 		document.getElementById("fadeableA").style.display = "none";
     55         document.getElementById("fadeableB").style.display = "none";
     56 		document.getElementById("fadeableC").style.display = "none";
     57 		document.getElementById("fadeableD").style.display = "block";
     58 		document.getElementById("fadeableE").style.display = "none";
     59 		document.getElementById("fadeableF").style.display = "none";
     60     } 
     61 	else if (that.value == "form_E") 
     62 	{
     63 		document.getElementById("fadeableA").style.display = "none";
     64         document.getElementById("fadeableB").style.display = "none";
     65 		document.getElementById("fadeableC").style.display = "none";
     66 		document.getElementById("fadeableD").style.display = "none";
     67 		document.getElementById("fadeableE").style.display = "block";
     68 		document.getElementById("fadeableF").style.display = "none";
     69     } 
     70 	else if (that.value == "form_F") 
     71 	{
     72 		document.getElementById("fadeableA").style.display = "none";
     73         document.getElementById("fadeableB").style.display = "none";
     74 		document.getElementById("fadeableC").style.display = "none";
     75 		document.getElementById("fadeableD").style.display = "none";
     76 		document.getElementById("fadeableE").style.display = "none";
     77 		document.getElementById("fadeableF").style.display = "block";
     78     } 
     79 	else 
     80 	{
     81         document.getElementById("fadeableA").style.display = "none";
     82 		document.getElementById("fadeableB").style.display = "none";
     83 		document.getElementById("fadeableC").style.display = "none";
     84 		document.getElementById("fadeableD").style.display = "none";
     85 		document.getElementById("fadeableE").style.display = "none";
     86 		document.getElementById("fadeableF").style.display = "none";
     87     }
     88 }
     89 
     90 function mainappear(pass, dep, that) 
     91 {
     92     if (pass.value == dep.value && pass.value != "") 
     93 	{
     94         document.getElementById("fadeableMain").style.display = "block";
     95 		document.getElementById("fadeableMain2").style.display = "none";
     96 		document.getElementById("department_name").text = dep.value;
     97 		that.style.display = "none";
     98     } 
     99 	else 
    100 	{
    101 		document.getElementById("fadeableMain").style.display = "none";
    102 		document.getElementById("fadeableMain2").style.display = "block";
    103 		alert("wrong password");
    104     }
    105 }