include_once 'nurses.php';
                    $user_nurse = new nurses();
                    $user_nurse->get_nurse($id);
                    $user_row = $user_nurse->fetch();
                    $_SESSION['user'] = $user;
                    $_SESSION['fname'] = $user_row['nurse_fname'];
                    $_SESSION['sname'] = $user_row['nurse_sname'];
                    $_SESSION['id'] = $id;
                    $_SESSION['admin'] = false;
                    header('Location: index.php');
                } else {
                    session_start();
                    $id = $row['id'];
                    include_once 'administrator.php';
                    $user_admin = new administrator();
                    $user_admin->get_administrator($id);
                    $user_row = $user_admin->fetch();
                    session_start();
                    $_SESSION['user'] = $user;
                    $_SESSION['fname'] = $user_row['admin_fname'];
                    $_SESSION['sname'] = $user_row['admin_sname'];
                    $_SESSION['id'] = $id;
                    $_SESSION['admin'] = true;
                    header('Location: index.php');
                }
            }
        }
    }
}
?>
        
       }
    }
    xmlhttp.open("GET","adminFunctions.php?cmd=4&fn="+fn+"&sn="+sn
    +"&gender="+g+"&dpt="+d+"&nid="+nid,true);
    xmlhttp.send();

}

</script>

        <?php 
$nid = intval($_REQUEST['id']);
include_once "administrator.php";
include_once 'department.php';
$obj = new administrator();
if (!$obj->get_administrator($nid)) {
    echo 'could not find';
}
$row = $obj->fetch();
$sname = $row['admin_sname'];
$fname = $row['admin_fname'];
$gender = $row['gender'];
$department = intval($row['department']);
$deptment = new departments();
?>
        <form action="nursesupdate.php" method="post" id="add-form">
           
                
                <legend> Update Nurse Information </legend>
                <table class="add">
                    <tr id="add-icon">