Example #1
0
function profile($twig)
{
    if ($_SESSION['type'] == "student") {
        echo $twig->render('user_profile.twig', getStudentProfile($_SESSION['id']));
    } else {
        if ($_SESSION['type'] == "enterprise") {
            echo $twig->render('enterprise_profile.twig', getEnterpriseProfile($_SESSION['id']));
        }
    }
}
require_once '../api/enterprise.php';
require_once '../api/student.php';
require_once '../api/casestudy.php';
if (!isset($_GET["type"]) || !isset($_GET["email"])) {
    header("Location: index.php");
}
include '../templates/includes/header.html';
?>
<style>
body{margin-left:25px}
</style>

<?php 
if ($_GET["type"] == "Enterprise") {
    $enterpriseID = enterpriseIdByEmail($_GET['email'])['id'];
    $enterprise = getEnterpriseProfile($enterpriseID);
    if (!empty($enterprise['enterprise']['id'])) {
        ?>

<h1><?php 
        echo $enterprise['enterprise']['name'];
        ?>
</h1>
<h4 title = "<?php 
        echo htmlentities($student['name']);
        ?>
's email"><i><?php 
        echo htmlentities($_GET["email"]);
        ?>
</i></h4>
<h3>This enterprise has:</h3>