This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signupstd.link.php
62 lines (50 loc) · 1.62 KB
/
signupstd.link.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* Sign Up Student page submit data here
*/
//imports______________________________________________________________________
require_once($_SERVER['DOCUMENT_ROOT'].'/exam/logic/UserLogic.php');
//_____________________________________________________________________________
// create array
$arrStudent["usr_nic"] = $_POST["txtNIC"];
$arrStudent["usr_reg_no"] = $_POST["txtReg"];
$arrStudent["usr_password"] = $_POST["txtPwd"];
$arrStudent["usr_first_name"] = $_POST["txtFname"];
$arrStudent["usr_middle_name"] = $_POST["txtMname"];
$arrStudent["usr_last_name"] = $_POST["txtLname"];
$arrStudent["usr_gender"] = $_POST["rdoGender"];
$arrStudent["usr_dob"] = $_POST["txtDOBYear"] . "-" . $_POST["txtDOBMonth"] . "-" . $_POST["txtDOBDate"];
$arrStudent["usr_email"] = $_POST["txtEmail"];
$arrStudent["usr_crs_code"] = $_POST["drpDegree"];
// get optional subjects chosen by student
$arrSubjects;
if (isset($_POST["chgSubject"]))
{
$arrSubjects = $_POST["chgSubject"];
}
// checks
if($arrStudent["usr_nic"] != "" &&
$arrStudent["usr_reg_no"] != "" &&
$arrStudent["usr_password"] != "" &&
$arrStudent["usr_first_name"] != "" &&
$arrStudent["usr_last_name"] != "" &&
$arrStudent["usr_gender"] != "" &&
checkdate($_POST["txtDOBMonth"], $_POST["txtDOBDate"], $_POST["txtDOBYear"]) &&
$arrStudent["usr_email"] != "")
{
// add student
$UserLogic = new UserLogic();
if($UserLogic->addStudent($arrStudent, $arrSubjects))
{
include_once 'ui/signup.success.php';
}
else
{
include_once 'ui/signup.faliure.php';
}
}
else
{
include_once 'ui/signup.faliure.php';
}
?>