コード例 #1
0
 case studies published<p/>
<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>
コード例 #2
0
	<p>Best reagards, </p>
	<p>The CASE Platform Team</p>
    </body>
    </html>
    ';
    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    // Additional headers
    $headers .= 'From: case.shareup@gmail.com' . "\r\n" . 'Reply-To: case.shareup@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
}
if (isset($body)) {
    $json = json_decode($body);
    if (isset($json)) {
        $userid = studentIdByEmail($json->email);
        if (empty($userid)) {
            $userid = enterpriseIdByEmail($json->email);
            if (empty($userid)) {
                echo json_encode(array('error' => 'No entity registered with the given email'));
                return;
            }
            $type = 'enterprise';
        } else {
            $type = 'student';
        }
        $token = rand(100000000000000.0, 999999999999999.0);
        $token = substr($token, 1, -1);
        $hashed_token = hash("sha256", $token);
        generateRecovery($userid['id'], $hashed_token, $type);
        // get base url
コード例 #3
0
    ';
    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    // Additional headers
    $headers .= 'From: case.shareup@gmail.com' . "\r\n" . 'Reply-To: case.shareup@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
}
if (isset($body)) {
    $json = json_decode($body);
    $pw = generateRandomString(6);
    if (existsStudent($json->email)) {
        $message = array('error' => 'Student already exists');
    } else {
        if (createStudent($json->name, $pw, $json->birthdate, $json->university, $json->email, $json->cellphone, $json->cv, $json->linkedin)) {
            $student = studentIdByEmail($json->email);
            $studentID = $student['id'];
            $message = array('success' => 'Student was successfully created', 'userid' => $studentID);
            sendWelcomeMail($json->email, $pw);
            if (isset($json->hasPicture)) {
                $message = array('success' => 'Student was successfully created and id will be set', 'userid' => $studentID);
                $_SESSION['id'] = $studentID;
                $_SESSION['email'] = $json->email;
                $_SESSION['type'] = "student";
                $_SESSION['burner'] = "";
            }
        } else {
            $message = array('error' => 'Student was not created');
        }
    }
} else {