<?php

require_once ('dbh.php');

$firstname = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$gender = $_POST['gender'];
$dept = $_POST['dept'];
$degree = $_POST['degree'];
$birthday =$_POST['birthday'];





      $sql = "INSERT INTO `employee`(`id`, `firstName`, `lastName`, `email`, `birthday`, `gender`, `dept`, `degree`) VALUES ('','$firstname','$lastName','$email','$birthday','$gender','$dept','$degree')";

$result = mysqli_query($conn, $sql);

$last_id = $conn->insert_id;


$rank = mysqli_query($conn, "INSERT INTO `score`(`eid`) VALUES ('$last_id')");

if(($result) == 1){
    
    echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('Succesfully Registered')
    window.location.href='..//viewemp.php';
    </SCRIPT>");
   
}









?>