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']));
        }
    }
}
<p><?php 
        echo countEnterpriseResolutions($enterprise['enterprise']['id'])['COUNT(*)'];
        ?>
 case study resolutions</p>
<p><?php 
        echo count(getStudentsWhoSolvedEnterpriseCases($enterprise['enterprise']['id']));
        ?>
 different students solving their case studies</p>

<?php 
    } else {
        echo "<h1>No company with such email</h1>";
    }
} else {
    $studentID = studentIdByEmail($_GET['email'])['id'];
    $student = getStudentProfile($studentID)['student'];
    if (!empty($student)) {
        ?>
       
<h1><?php 
        echo $student['name'];
        ?>
</h1>
<h4 title = "<?php 
        echo htmlentities($student['name']);
        ?>
's email"><i><?php 
        echo htmlentities($_GET["email"]);
        ?>
</i></h4>
<h3>This student has:</h3>