-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparseform.php
42 lines (32 loc) · 1 KB
/
parseform.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
use App\Student;
require_once __DIR__ . '/vendor/autoload.php';
$name = '';
$id = '';
$php = '';
$ruby='';
$java = '';
$nodejs = '';
$cplusplus = '';
$student = '';
$email = '';
if(isset($_POST['php'])){
$name = $_POST['name'];
$id = $_POST['id'];
$email = $_POST['email'];
$php = $_POST['php'];
$java = $_POST['java'];
$nodejs = $_POST['nodejs'];
$ruby = $_POST['ruby'];
$cplusplus = $_POST['cplusplus'];
$student = new Student($id, $name);
$student->setMarks($php, $java, $nodejs, $ruby, $cplusplus);
/**Notification class sends email to the student after each result is computed
* the email will contain a summary of the result: Final result and Remark
* a link in the email will lead to a page of the complete result
*/
$to = $email;
$subject = "Result";
$message = 'Your performance based on the test is \n Final Result:'. $student->finalResult(). '\n Remark: '.$student->remark();
mail($to,$subject,$message);
}