-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseeder.php
95 lines (76 loc) · 2.29 KB
/
seeder.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
ini_set('display_errors', 1);
include_once './models/AdminModel.php';
include_once './DTOs/Student.php';
include_once './DTOs/Admin.php';
include_once './models/StudentModel.php';
include_once './models/AdminModel.php';
$adminModel = new AdminModel();
// ---------------------------------------------
$admin = new Admin();
$admin->firstName = 'Sam';
$admin->lastName = 'Mukuka';
$admin->email = '[email protected]';
$admin->gender = 'male';
$admin->adminRole = 'hod';
$admin->password = '123456789';
$adminModel->add($admin);
// ---------------------------------------------
$admin = new Admin();
$admin->firstName = 'John';
$admin->lastName = 'Doe';
$admin->email = '[email protected]';
$admin->gender = 'male';
$admin->adminRole = 'accountant';
$admin->password = '123456789';
$adminModel->add($admin);
// ---------------------------------------------
$admin = new Admin();
$admin->firstName = 'Mary';
$admin->lastName = 'Doe';
$admin->email = '[email protected]';
$admin->gender = 'female';
$admin->adminRole = 'hostel_representative';
$admin->password = '123456789';
$adminModel->add($admin);
// ---------------------------------------------
$admin = new Admin();
$admin->firstName = 'Jack';
$admin->lastName = 'Doe';
$admin->email = '[email protected]';
$admin->gender = 'male';
$admin->adminRole = 'librarian';
$admin->password = '123456789';
$adminModel->add($admin);
// ---------------------------------------------
$admin = new Admin();
$admin->firstName = 'James';
$admin->lastName = 'Bond';
$admin->email = '[email protected]';
$admin->gender = 'male';
$admin->adminRole = 'super';
$admin->password = '123456789';
$adminModel->add($admin);
// ---------------------------------------------
$s = new Student();
$s->studentID = '11111';
$s->firstName = 'Bright';
$s->lastName = 'Mumbi';
$s->gender = 'male';
$s->program = 'BSE';
$s->residentialAddress = 'somewhere in lusaka';
$s->postalAddress = '';
$s->email = '[email protected]';
$s->password = '123456789';
// ------------------------------------------------
$s = new Student();
$s->studentID = '12345';
$s->firstName = 'Test';
$s->lastName = 'Student';
$s->gender = 'male';
$s->program = 'BSE';
$s->residentialAddress = 'somewhere in lusaka';
$s->postalAddress = '';
$s->email = '[email protected]';
$s->password = '123456789';
(new StudentModel())->add($s);