EMPDATABASE

wednesday change

by PRAGADEESH S

HTML

<title> Employee Database</title>
<body>
  <header>
    <h3>
EMPLOYEE DATABASE
	</h3>
  </header>
			
			<div class="buttons1">
				<input type="button" onclick="hide()" value="Add Employee">
				<a id="pbutton"><input type="button" onclick="" value="Permanent Employees"></button>
				<a id="tbutton"><input type="button" onclick="tempemp" value="Temporary Employees"></a><br><br>
			</div>
	<div class="grid">
			<table id ="table"></table>
		</div>
		
		
		
		
<div id="hide">
		<div class="forms">
			<form action="#" method="get">
			
			
				<input type="hidden" id="id" name="Id" value="1002">
				Enter Your Name
				<br>
				<input type="text" id="name" name="Name">
				<br> Enter Your E-mail Id
				<br>
				<input type="email"; id="email" name="Email">
				<br> Enter Your Dept
				<br>
				<input type="text" id="dept" name="Dept">
				<br> Enter Your Package
				<br>
				<input type="text" id="package" name="Package">
				<br>
				<br>
				<div class="buttons">
					<input type="button" value="Submit" onclick="addRow()">
					<input type="reset" value="Cancel">
				</div>

			</form>
		</div>
  
</div>

CSS

body{
   background-color:#6699ff;
}
header{
  background-color:white;
}
h3 {
  text-align: center;
  
}

table,
th,
td {
  background-color:white;
  border: 3px solid black;
  border-collapse: collapse;
  width: 98.5%;
  margin:10px;
  padding: 15px;
  text-align: center;
  table-layout:fixed;
}
.grid{
	float:right;
	width:84%;
	
	
	
}



	
input[type=text],input[type=email]
{

  width: auto;
  padding: 12px 20px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
}
input[type=button],input[type=reset]
 {
    background-color: grey; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}
.buttons1{
	display:in-line;
	margin-left:25%;	
	
}
#pbutton:active {
  background: url(button.png) no-repeat bottom;
}

JavaScript

var data = [1000,"Prag","[email protected]","IT",2000,1001,"Dkay","[email protected]","IT",2500];
			   
				
				var html = "<tr><th>Id</th><th>Name</th><th>E-mail</th><th>Dept</th><th>Package</th></tr>";
				html += "<tr><td>"+data[0]+"</td><td>"+data[1]+"</td><td>"+data[2]+"</td><td>"+data[3]+"</td><td>"+data[4]+"</td></tr>";
				html += "<tr><td>"+data[5]+"</td><td>"+data[6]+"</td><td>"+data[7]+"</td><td>"+data[8]+"</td><td>"+data[9]+"</td></tr>";
				document.getElementById("table").innerHTML = html;
						
				/*function tempemp{
				var data1 = [1000,"Hugh","[email protected]","IT",20020,1001,"Xrow","[email protected]","ITIS",25050];
			    var html = "<tr><th>Id</th><th>Name</th><th>E-mail</th><th>Dept</th><th>Package</th></tr>";
				html += "<tr><td>"+data1[0]+"</td><td>"+data1[1]+"</td><td>"+data1[2]+"</td><td>"+data1[3]+"</td><td>"+data1[4]+"</td></tr>";
				html += "<tr><td>"+data1[5]+"</td><td>"+data1[6]+"</td><td>"+data1[7]+"</td><td>"+data1[8]+"</td><td>"+data1[9]+"</td></tr>";
				document.getElementById("table").innerHTML = html;	
								}*/
				
				function addRow(){
				
				var employee={};
					//data.push(ids.value,names.value,depts.value,packagess.value);
						employee.id=idincrementValue();
						employee.name= document.getElementById("name");
						employee.email= document.getElementById("email");
						employee.dept = document.getElementById("dept");
						employee.packagevalue = document.getElementById("package");
						data.push(employee);
						html += "<tr><td>"+data[10].id+"</td><td>"+data[10].name.value+"</td><td>"+data[10].email.value+"<td>"+data[10].dept.value+"</td><td>"+data[10].packagevalue.value+"</td></tr>";
						
						name.value=""; 
						email.value="";
						dept.value="";
						package.value="";

						
						document.getElementById("table").innerHTML = html;
						hide();
				}    
							function hide() {
								var x = document.getElementById('hide');
								if (x.style.display === 'none') {
								x.style.display =...