├── .idea
├── artifacts
│ └── uiuStudentRecordSystem_jar.xml
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── dataSources.ids
├── dataSources.xml
├── dataSources
│ ├── 160eb08f-45b1-4912-a3db-b256226624ee.xml
│ └── b46147f3-9e70-478c-a8de-22bdbf44c7bb.xml
├── description.html
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── uiDesigner.xml
└── vcs.xml
├── README.md
├── externalLibrary
├── TrayNotification.jar
└── mysql-connector-java-5.1.39-bin.jar
├── src
├── META-INF
│ └── MANIFEST.MF
├── admin
│ ├── Admin.fxml
│ ├── Admin.java
│ ├── AdminCourse.java
│ ├── AdminTable.java
│ ├── AdminTeacher.fxml
│ ├── AdminTeacherController.java
│ ├── AdminTeacherTable.java
│ ├── Course.fxml
│ └── CourseTable.java
├── database
│ └── DBConnection.java
├── image
│ ├── 011142032.jpg
│ ├── 011142047.jpg
│ ├── 011142052.jpg
│ ├── 011142053.jpg
│ ├── 011142077.jpg
│ ├── 011142153.jpg
│ ├── 011142501.jpg
│ ├── 011143087.jpg
│ ├── 011152064.jpg
│ ├── 011153033.jpg
│ ├── 114142010.jpg
│ └── default-user-icon.png
├── menuBar
│ ├── About.fxml
│ └── MenuBarControl.java
├── profileView
│ ├── Info.java
│ ├── ProfileView.java
│ └── profileView.fxml
├── recordSystemMain
│ ├── MainLogin.fxml
│ ├── MainLogin.java
│ └── MainLoginController.java
├── sqlSheet
│ ├── admin.sql
│ ├── course.sql
│ ├── student.sql
│ ├── studentgpa.sql
│ └── teacher.sql
├── student
│ ├── ChooseASection.fxml
│ ├── ChooseASectionController.java
│ ├── Registration.fxml
│ ├── RegistrationController.java
│ ├── RegistrationTableData.java
│ ├── Student.fxml
│ ├── Student.java
│ └── resultHistoryTableData.java
└── teacher
│ ├── Teacher.fxml
│ ├── TeacherController.java
│ └── TeacherTableData.java
└── uiuStudentRecordSystem.iml
/.idea/artifacts/uiuStudentRecordSystem_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | $PROJECT_DIR$/out/artifacts/uiuStudentRecordSystem_jar
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/dataSources.ids:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 1
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 1
20 | int(11)|0
21 | 1
22 |
23 |
24 | varchar(64)|0
25 |
26 |
27 | varchar(64)|0
28 |
29 |
30 | varchar(64)|0
31 |
32 |
33 | varchar(64)|0
34 | 'password'
35 |
36 |
37 | dbAdminSerialNo
38 | 1
39 |
40 |
41 | 1
42 | int(11)|0
43 | 1
44 |
45 |
46 | varchar(64)|0
47 |
48 |
49 | varchar(64)|0
50 |
51 |
52 | varchar(64)|0
53 |
54 |
55 | varchar(64)|0
56 | 'password'
57 |
58 |
59 | varchar(64)|0
60 |
61 |
62 | varchar(64)|0
63 |
64 |
65 | varchar(64)|0
66 |
67 |
68 | varchar(64)|0
69 |
70 |
71 | varchar(64)|0
72 |
73 |
74 | varchar(64)|0
75 |
76 |
77 | varchar(64)|0
78 |
79 |
80 | varchar(64)|0
81 |
82 |
83 | varchar(64)|0
84 |
85 |
86 | varchar(64)|0
87 | 'password'
88 |
89 |
90 | 1
91 | decimal(10,2)|0
92 | '0.00'
93 |
94 |
95 | 1
96 | decimal(10,2)|0
97 | '0.00'
98 |
99 |
100 | 1
101 | decimal(10,2)|0
102 | '0.00'
103 |
104 |
105 | 1
106 | decimal(10,2)|0
107 | '0.00'
108 |
109 |
110 | 1
111 | decimal(10,2)|0
112 | '0.00'
113 |
114 |
115 | 1
116 | decimal(10,2)|0
117 | '0.00'
118 |
119 |
120 | 1
121 | decimal(10,2)|0
122 | '0.00'
123 |
124 |
125 | 1
126 | decimal(10,2)|0
127 | '0.00'
128 |
129 |
130 | 1
131 | decimal(10,2)|0
132 | '0.00'
133 |
134 |
135 | 1
136 | decimal(10,2)|0
137 | '0.00'
138 |
139 |
140 | 1
141 | decimal(10,2)|0
142 | '0.00'
143 |
144 |
145 | 1
146 | decimal(10,2)|0
147 | '0.00'
148 |
149 |
150 | 1
151 | decimal(10,2)|0
152 | '0.00'
153 |
154 |
155 | dbStudentSerialNo
156 | 1
157 |
158 |
159 | 1
160 | int(11)|0
161 | 1
162 |
163 |
164 | varchar(64)|0
165 |
166 |
167 | varchar(64)|0
168 |
169 |
170 | varchar(64)|0
171 |
172 |
173 | varchar(64)|0
174 | 'password'
175 |
176 |
177 | dbTeacherSerialNo
178 | 1
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/.idea/dataSources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mysql
6 | true
7 | com.mysql.jdbc.Driver
8 | jdbc:mysql://localhost:3306/uiuStudentRecordSystem
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | mysql
20 | true
21 | com.mysql.jdbc.Driver
22 | jdbc:mysql://sql6.freemysqlhosting.net:3306/sql6133728
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/.idea/dataSources/b46147f3-9e70-478c-a8de-22bdbf44c7bb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 1
19 | int(11)|0
20 | 1
21 |
22 |
23 | varchar(64)|0
24 |
25 |
26 | varchar(64)|0
27 |
28 |
29 | varchar(64)|0
30 |
31 |
32 | varchar(64)|0
33 | 'password'
34 |
35 |
36 | dbAdminSerialNo
37 | 1
38 |
39 |
40 | 1
41 | int(11)|0
42 | 1
43 |
44 |
45 | varchar(64)|0
46 |
47 |
48 | varchar(64)|0
49 |
50 |
51 | varchar(64)|0
52 |
53 |
54 | varchar(64)|0
55 | 'password'
56 |
57 |
58 | varchar(64)|0
59 |
60 |
61 | varchar(64)|0
62 |
63 |
64 | varchar(64)|0
65 |
66 |
67 | varchar(64)|0
68 |
69 |
70 | varchar(64)|0
71 |
72 |
73 | varchar(64)|0
74 |
75 |
76 | varchar(64)|0
77 |
78 |
79 | varchar(64)|0
80 |
81 |
82 | varchar(64)|0
83 |
84 |
85 | varchar(64)|0
86 | 'password'
87 |
88 |
89 | 1
90 | decimal(10,2)|0
91 | '0.00'
92 |
93 |
94 | 1
95 | decimal(10,2)|0
96 | '0.00'
97 |
98 |
99 | 1
100 | decimal(10,2)|0
101 | '0.00'
102 |
103 |
104 | 1
105 | decimal(10,2)|0
106 | '0.00'
107 |
108 |
109 | 1
110 | decimal(10,2)|0
111 | '0.00'
112 |
113 |
114 | 1
115 | decimal(10,2)|0
116 | '0.00'
117 |
118 |
119 | 1
120 | decimal(10,2)|0
121 | '0.00'
122 |
123 |
124 | 1
125 | decimal(10,2)|0
126 | '0.00'
127 |
128 |
129 | 1
130 | decimal(10,2)|0
131 | '0.00'
132 |
133 |
134 | 1
135 | decimal(10,2)|0
136 | '0.00'
137 |
138 |
139 | 1
140 | decimal(10,2)|0
141 | '0.00'
142 |
143 |
144 | 1
145 | decimal(10,2)|0
146 | '0.00'
147 |
148 |
149 | 1
150 | decimal(10,2)|0
151 | '0.00'
152 |
153 |
154 | dbStudentSerialNo
155 | 1
156 |
157 |
158 | 1
159 | int(11)|0
160 | 1
161 |
162 |
163 | varchar(64)|0
164 |
165 |
166 | varchar(64)|0
167 |
168 |
169 | varchar(64)|0
170 |
171 |
172 | varchar(64)|0
173 | 'password'
174 |
175 |
176 | varchar(64)|0
177 |
178 |
179 | varchar(64)|0
180 |
181 |
182 | varchar(64)|0
183 |
184 |
185 | dbTeacherSerialNo
186 | 1
187 |
188 |
189 | 1
190 | int(11)|0
191 | 1
192 |
193 |
194 | varchar(64)|0
195 |
196 |
197 | int(11)|0
198 |
199 |
200 | varchar(64)|0
201 |
202 |
203 | varchar(64)|0
204 |
205 |
206 | dbCourseSerial
207 | 1
208 |
209 |
210 | 1
211 | int(11)|0
212 | 1
213 |
214 |
215 | varchar(64)|0
216 |
217 |
218 | varchar(64)|0
219 |
220 |
221 | varchar(64)|0
222 |
223 |
224 | varchar(64)|0
225 |
226 |
227 | varchar(64)|0
228 |
229 |
230 | varchar(64)|0
231 |
232 |
233 | varchar(64)|0
234 |
235 |
236 | varchar(64)|0
237 |
238 |
239 | varchar(64)|0
240 |
241 |
242 | varchar(64)|0
243 |
244 |
245 | varchar(64)|0
246 |
247 |
248 | varchar(64)|0
249 |
250 |
251 | varchar(64)|0
252 |
253 |
254 | varchar(64)|0
255 |
256 |
257 | varchar(64)|0
258 |
259 |
260 | varchar(64)|0
261 |
262 |
263 | varchar(64)|0
264 |
265 |
266 | varchar(64)|0
267 |
268 |
269 | varchar(64)|0
270 |
271 |
272 | varchar(64)|0
273 |
274 |
275 | dbstudentgpaSerial
276 | 1
277 |
278 |
279 |
--------------------------------------------------------------------------------
/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided.
2 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
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 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 1. First import all the SQLsheet in your mysql server.
2 |
3 | 2.Now run project
4 |
5 | 3.Log in as a Admin(a:1234), Teacher(t:1234), Student(011142052:1234)
6 |
7 | https://www.youtube.com/watch?v=oUqxClqGRTs
8 |
--------------------------------------------------------------------------------
/externalLibrary/TrayNotification.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/externalLibrary/TrayNotification.jar
--------------------------------------------------------------------------------
/externalLibrary/mysql-connector-java-5.1.39-bin.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/externalLibrary/mysql-connector-java-5.1.39-bin.jar
--------------------------------------------------------------------------------
/src/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Main-Class: recordSystemMain.MainLogin
3 |
4 |
--------------------------------------------------------------------------------
/src/admin/Admin.fxml:
--------------------------------------------------------------------------------
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 |
37 |
43 |
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/src/admin/AdminCourse.java:
--------------------------------------------------------------------------------
1 | package admin;
2 |
3 | import database.DBConnection;
4 | import javafx.collections.FXCollections;
5 | import javafx.collections.ObservableList;
6 | import javafx.event.Event;
7 | import javafx.fxml.FXML;
8 | import javafx.fxml.Initializable;
9 | import javafx.scene.control.Button;
10 | import javafx.scene.control.TableColumn;
11 | import javafx.scene.control.TableView;
12 | import javafx.scene.control.TextField;
13 | import javafx.scene.control.cell.PropertyValueFactory;
14 | import menuBar.MenuBarControl;
15 |
16 | import java.io.IOException;
17 | import java.net.URL;
18 | import java.sql.Connection;
19 | import java.sql.ResultSet;
20 | import java.sql.SQLException;
21 | import java.sql.Statement;
22 | import java.time.LocalDate;
23 | import java.util.ResourceBundle;
24 |
25 | /**
26 | * Created by Tanvir on 8/18/2016.
27 | */
28 | public class AdminCourse implements Initializable {
29 |
30 |
31 | private DBConnection database = new DBConnection();
32 | private Connection connection;
33 | private Statement statement;
34 | private ResultSet resultSet;
35 | private boolean isSetCourseAddNewButtonClick;
36 | private boolean isSetCourseEditButtonClick;
37 | private MenuBarControl menuBarControl = new MenuBarControl();
38 | private String temp ;
39 |
40 | @FXML
41 | TableView adminCourseTableView;
42 | @FXML
43 | TableColumn adminCourseTableNo;
44 | @FXML
45 | TableColumn adminCourseTableCode;
46 | @FXML
47 | TableColumn adminCourseTableTitle;
48 | @FXML
49 | TableColumn adminCourseTableCredit;
50 | @FXML
51 | TableColumn adminCourseTableSec;
52 |
53 |
54 | @FXML
55 | private TextField courseTFCode;
56 | @FXML
57 | private TextField courseTFTitle;
58 | @FXML
59 | private TextField courseTFCredit;
60 | @FXML
61 | private TextField courseTFSec;
62 | @FXML
63 | private TextField courseTFSearch;
64 |
65 |
66 | @FXML
67 | private Button courseClearButtonClick;
68 | @FXML
69 | private Button courseSaveButtonClick;
70 |
71 |
72 | private ObservableList getDataFromCourseAndAddToObservableList(String query){
73 | ObservableList courseTableData = FXCollections.observableArrayList();
74 | try {
75 |
76 | connection = database.getConnection();
77 | statement = connection.createStatement();
78 | resultSet = statement.executeQuery(query);//"SELECT * FROM cource;"
79 | while(resultSet.next()){
80 | courseTableData.add(new CourseTable(
81 | resultSet.getInt("dbCourseSerial"),
82 | resultSet.getString("dbCourseCode"),
83 | resultSet.getString("dbCourseTitle"),
84 | resultSet.getInt("dbCourseCredit"),
85 | resultSet.getString("dbCourseSec")
86 |
87 | ));
88 | }
89 | connection.close();
90 | statement.close();
91 | resultSet.close();
92 | } catch (SQLException e) {
93 | e.printStackTrace();
94 | }
95 | return courseTableData;
96 |
97 | }
98 |
99 | @Override
100 | public void initialize(URL location, ResourceBundle resources) {
101 |
102 | adminCourseTableNo.setCellValueFactory(new PropertyValueFactory("courseTableDataNo"));
103 | adminCourseTableCode.setCellValueFactory(new PropertyValueFactory("courseTableDataCode"));
104 | adminCourseTableTitle.setCellValueFactory(new PropertyValueFactory("courseTableDataTitle"));
105 | adminCourseTableCredit.setCellValueFactory(new PropertyValueFactory("courseTableDataCredit"));
106 | adminCourseTableSec.setCellValueFactory(new PropertyValueFactory("courseTableDataSec"));
107 |
108 | adminCourseTableView.setItems(getDataFromCourseAndAddToObservableList("SELECT * FROM course;"));
109 |
110 | }
111 |
112 | @FXML
113 | private void setCourseAddNewButtonClick(Event event){
114 | courseSetAllEnable();
115 | isSetCourseAddNewButtonClick = true;
116 | }
117 |
118 | private void courseSetAllEnable(){
119 |
120 | courseTFCode.setDisable(false);
121 | courseTFTitle.setDisable(false);
122 | courseTFCredit.setDisable(false);
123 | courseTFSec.setDisable(false);
124 |
125 | courseClearButtonClick.setDisable(false);
126 | courseSaveButtonClick.setDisable(false);
127 | }
128 |
129 | private void courseSetAllDisable(){
130 | courseTFCode.setDisable(true);
131 | courseTFTitle.setDisable(true);
132 | courseTFCredit.setDisable(true);
133 | courseTFSec.setDisable(true);
134 |
135 | courseClearButtonClick.setDisable(true);
136 | courseSaveButtonClick.setDisable(true);
137 | }
138 |
139 | @FXML
140 | private void setCourseEditButtonClick(Event event){
141 | CourseTable getSelectedRow = adminCourseTableView.getSelectionModel().getSelectedItem();
142 |
143 |
144 | String sqlQuery = "select * FROM course where dbCourseCode = '"+getSelectedRow.getCourseTableDataCode()+"';";
145 |
146 | try {
147 | connection = database.getConnection();
148 | statement = connection.createStatement();
149 | resultSet = statement.executeQuery(sqlQuery);
150 | courseSetAllEnable();
151 | while(resultSet.next()) {
152 | courseTFCode.setText(resultSet.getString("dbCourseCode"));
153 | courseTFTitle.setText(resultSet.getString("dbCourseTitle"));
154 | courseTFCredit.setText(resultSet.getString("dbCourseCredit"));
155 | courseTFSec.setText(resultSet.getString("dbCourseSec"));
156 |
157 | }
158 |
159 | temp =courseTFCode.getText();
160 | isSetCourseEditButtonClick = true;
161 | }
162 | catch (SQLException e) {
163 | e.printStackTrace();
164 | }
165 |
166 | }
167 |
168 | @FXML
169 | private void setCourseDeleteButtonClick(Event event){
170 | CourseTable getSelectedRow = adminCourseTableView.getSelectionModel().getSelectedItem();
171 | String sqlQuery = "delete from course where dbCourseCode = '"+getSelectedRow.getCourseTableDataCode()+"';";
172 | try {
173 | connection = database.getConnection();
174 | statement = connection.createStatement();
175 |
176 | int rowsAffected = statement.executeUpdate(sqlQuery);
177 | adminCourseTableView.setItems(getDataFromCourseAndAddToObservableList("SELECT * FROM course;"));
178 |
179 | }
180 | catch (SQLException e) {
181 | e.printStackTrace();
182 | }
183 | }
184 |
185 | @FXML
186 | private void setCourseSaveButtonClick(Event event){
187 |
188 | try{
189 | connection = database.getConnection();
190 | statement = connection.createStatement();
191 |
192 | if(isSetCourseAddNewButtonClick){
193 | int rowsAffected = statement.executeUpdate("insert into `course` (`dbCourseCode`,`dbCourseTitle`,`dbCourseCredit`,`dbCourseSec`) values ('"+
194 | courseTFCode.getText()+"','"+courseTFTitle.getText()+"','"+courseTFCredit.getText()+"','"+courseTFSec.getText()+"') ;");
195 | }
196 | else if (isSetCourseEditButtonClick){
197 | int rowsAffected = statement.executeUpdate("update course set "+
198 | "dbCourseCode = '"+courseTFCode.getText()+"',"+
199 | "dbCourseTitle = '"+courseTFTitle.getText()+"',"+
200 | "dbCourseCredit = '"+courseTFCredit.getText()+"',"+
201 | "dbCourseSec = '"+courseTFSec.getText()+
202 |
203 | "' where dbCourseCode = '"+
204 | temp+"';");
205 | }
206 |
207 |
208 | connection.close();
209 | statement.close();
210 | resultSet.close();
211 | }
212 | catch (SQLException e){
213 | e.printStackTrace();
214 | }
215 | courseSetAllClear();
216 | courseSetAllDisable();
217 | adminCourseTableView.setItems(getDataFromCourseAndAddToObservableList("SELECT * FROM course;"));
218 | isSetCourseAddNewButtonClick=false;
219 | isSetCourseEditButtonClick = false;
220 |
221 | }
222 |
223 | private void courseSetAllClear(){
224 | courseTFCode.clear();
225 | courseTFTitle.clear();
226 | courseTFCredit.clear();
227 | courseTFSec.clear();
228 | }
229 |
230 | @FXML
231 | private void setCourseClearButtonClick(Event event){
232 | courseSetAllClear();
233 | courseSetAllDisable();
234 | isSetCourseEditButtonClick=false;
235 | isSetCourseAddNewButtonClick = false;
236 | }
237 |
238 | @FXML
239 | private void setCourseRefreshButtonClick(Event event){
240 | adminCourseTableView.setItems(getDataFromCourseAndAddToObservableList("SELECT * FROM course;"));//sql Query
241 | courseTFSearch.clear();
242 | }
243 |
244 | @FXML
245 | private void setCourseSearchButtonClick(Event event){
246 | String sqlQuery = "select * FROM course where dbCourseCode = '"+courseTFSearch.getText()+"';";
247 | adminCourseTableView.setItems(getDataFromCourseAndAddToObservableList(sqlQuery));
248 | }
249 |
250 | @FXML
251 | private void setCourseAboutButtonClick(Event event) throws IOException {
252 | menuBarControl.about();
253 | }
254 |
255 | @FXML
256 | private void setCourseCloseButtonClick(Event event){
257 | menuBarControl.close();
258 | }
259 |
260 |
261 |
262 |
263 |
264 | }
265 |
--------------------------------------------------------------------------------
/src/admin/AdminTable.java:
--------------------------------------------------------------------------------
1 | package admin;
2 |
3 | import javafx.beans.property.SimpleDoubleProperty;
4 | import javafx.beans.property.SimpleIntegerProperty;
5 | import javafx.beans.property.SimpleStringProperty;
6 |
7 | /**
8 | * Created by Tanvir on 7/25/2016.
9 | */
10 | public class AdminTable {
11 | private final SimpleIntegerProperty adminTableDataNo;
12 | private final SimpleStringProperty adminTableDataStudentName;
13 | private final SimpleStringProperty adminTableDataStudentID;
14 | private final SimpleStringProperty adminTableDataStudentDepartment;
15 | private final SimpleDoubleProperty adminTableDataStudentCGPA;
16 | private final SimpleStringProperty adminTableDataStudentPhone;
17 | private final SimpleStringProperty adminTableDataStudentDOB;
18 | private final SimpleStringProperty adminTableDataGuardianName;
19 | private final SimpleStringProperty adminTableDataGuardianEmail;
20 | private final SimpleStringProperty adminTableDataGuardianPhone;
21 | private final SimpleStringProperty adminTableDataStudentAddress;
22 |
23 | public AdminTable(int adminTableDataNo, String adminTableDataStudentName, String adminTableDataStudentID, String adminTableDataStudentDepartment, Double adminTableDataStudentCGPA, String adminTableDataStudentPhone, String adminTableDataStudentDOB, String adminTableDataGuardianName, String adminTableDataGuardianEmail, String adminTableDataGuardianPhone, String adminTableDataStudentAddress) {
24 | this.adminTableDataNo = new SimpleIntegerProperty(adminTableDataNo);
25 | this.adminTableDataStudentName = new SimpleStringProperty(adminTableDataStudentName);
26 | this.adminTableDataStudentID = new SimpleStringProperty(adminTableDataStudentID);
27 | this.adminTableDataStudentDepartment = new SimpleStringProperty(adminTableDataStudentDepartment);
28 | this.adminTableDataStudentCGPA = new SimpleDoubleProperty(adminTableDataStudentCGPA);
29 | this.adminTableDataStudentPhone = new SimpleStringProperty(adminTableDataStudentPhone);
30 | this.adminTableDataStudentDOB = new SimpleStringProperty(adminTableDataStudentDOB);
31 | this.adminTableDataGuardianName = new SimpleStringProperty(adminTableDataGuardianName);
32 | this.adminTableDataGuardianEmail = new SimpleStringProperty(adminTableDataGuardianEmail);
33 | this.adminTableDataGuardianPhone = new SimpleStringProperty(adminTableDataGuardianPhone);
34 | this.adminTableDataStudentAddress = new SimpleStringProperty(adminTableDataStudentAddress);
35 | }
36 |
37 |
38 |
39 |
40 | public Integer getAdminTableDataNo() {
41 |
42 | return adminTableDataNo.get();
43 | }
44 |
45 | public SimpleIntegerProperty adminTableDataNoProperty() {
46 | return adminTableDataNo;
47 | }
48 |
49 | public void setAdminTableDataNo(Integer adminTableDataNo) {
50 | this.adminTableDataNo.set(adminTableDataNo);
51 | }
52 |
53 | public String getAdminTableDataStudentName() {
54 | return adminTableDataStudentName.get();
55 | }
56 |
57 | public SimpleStringProperty adminTableDataStudentNameProperty() {
58 | return adminTableDataStudentName;
59 | }
60 |
61 | public void setAdminTableDataStudentName(String adminTableDataStudentName) {
62 | this.adminTableDataStudentName.set(adminTableDataStudentName);
63 | }
64 |
65 | public String getAdminTableDataStudentID() {
66 | return adminTableDataStudentID.get();
67 | }
68 |
69 | public SimpleStringProperty adminTableDataStudentIDProperty() {
70 | return adminTableDataStudentID;
71 | }
72 |
73 | public void setAdminTableDataStudentID(String adminTableDataStudentID) {
74 | this.adminTableDataStudentID.set(adminTableDataStudentID);
75 | }
76 |
77 | public String getAdminTableDataStudentDepartment() {
78 | return adminTableDataStudentDepartment.get();
79 | }
80 |
81 | public SimpleStringProperty adminTableDataStudentDepartmentProperty() {
82 | return adminTableDataStudentDepartment;
83 | }
84 |
85 | public void setAdminTableDataStudentDepartment(String adminTableDataStudentDepartment) {
86 | this.adminTableDataStudentDepartment.set(adminTableDataStudentDepartment);
87 | }
88 |
89 | public Double getAdminTableDataStudentCGPA() {
90 | return adminTableDataStudentCGPA.get();
91 | }
92 |
93 | public SimpleDoubleProperty adminTableDataStudentCGPAProperty() {
94 | return adminTableDataStudentCGPA;
95 | }
96 |
97 | public void setAdminTableDataStudentCGPA(Double adminTableDataStudentCGPA) {
98 | this.adminTableDataStudentCGPA.set(adminTableDataStudentCGPA);
99 | }
100 |
101 | public String getAdminTableDataStudentPhone() {
102 | return adminTableDataStudentPhone.get();
103 | }
104 |
105 | public SimpleStringProperty adminTableDataStudentPhoneProperty() {
106 | return adminTableDataStudentPhone;
107 | }
108 |
109 | public void setAdminTableDataStudentPhone(String adminTableDataStudentPhone) {
110 | this.adminTableDataStudentPhone.set(adminTableDataStudentPhone);
111 | }
112 |
113 | public String getAdminTableDataStudentDOB() {
114 | return adminTableDataStudentDOB.get();
115 | }
116 |
117 | public SimpleStringProperty adminTableDataStudentDOBProperty() {
118 | return adminTableDataStudentDOB;
119 | }
120 |
121 | public void setAdminTableDataStudentDOB(String adminTableDataStudentDOB) {
122 | this.adminTableDataStudentDOB.set(adminTableDataStudentDOB);
123 | }
124 |
125 | public String getAdminTableDataGuardianName() {
126 | return adminTableDataGuardianName.get();
127 | }
128 |
129 | public SimpleStringProperty adminTableDataGuardianNameProperty() {
130 | return adminTableDataGuardianName;
131 | }
132 |
133 | public void setAdminTableDataGuardianName(String adminTableDataGuardianName) {
134 | this.adminTableDataGuardianName.set(adminTableDataGuardianName);
135 | }
136 |
137 | public String getAdminTableDataGuardianEmail() {
138 | return adminTableDataGuardianEmail.get();
139 | }
140 |
141 | public SimpleStringProperty adminTableDataGuardianEmailProperty() {
142 | return adminTableDataGuardianEmail;
143 | }
144 |
145 | public void setAdminTableDataGuardianEmail(String adminTableDataGuardianEmail) {
146 | this.adminTableDataGuardianEmail.set(adminTableDataGuardianEmail);
147 | }
148 |
149 | public String getAdminTableDataGuardianPhone() {
150 | return adminTableDataGuardianPhone.get();
151 | }
152 |
153 | public SimpleStringProperty adminTableDataGuardianPhoneProperty() {
154 | return adminTableDataGuardianPhone;
155 | }
156 |
157 | public void setAdminTableDataGuardianPhone(String adminTableDataGuardianPhone) {
158 | this.adminTableDataGuardianPhone.set(adminTableDataGuardianPhone);
159 | }
160 |
161 | public String getAdminTableDataStudentAddress() {
162 | return adminTableDataStudentAddress.get();
163 | }
164 |
165 | public SimpleStringProperty adminTableDataStudentAddressProperty() {
166 | return adminTableDataStudentAddress;
167 | }
168 |
169 | public void setAdminTableDataStudentAddress(String adminTableDataStudentAddress) {
170 | this.adminTableDataStudentAddress.set(adminTableDataStudentAddress);
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/src/admin/AdminTeacher.fxml:
--------------------------------------------------------------------------------
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 |
33 |
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/src/admin/AdminTeacherController.java:
--------------------------------------------------------------------------------
1 | package admin;
2 |
3 | import database.DBConnection;
4 | import javafx.collections.FXCollections;
5 | import javafx.collections.ObservableList;
6 | import javafx.event.Event;
7 | import javafx.fxml.FXML;
8 | import javafx.fxml.Initializable;
9 | import javafx.scene.control.Button;
10 | import javafx.scene.control.TableColumn;
11 | import javafx.scene.control.TableView;
12 | import javafx.scene.control.TextField;
13 | import javafx.scene.control.cell.PropertyValueFactory;
14 | import menuBar.MenuBarControl;
15 |
16 | import java.io.IOException;
17 | import java.net.URL;
18 | import java.sql.Connection;
19 | import java.sql.ResultSet;
20 | import java.sql.SQLException;
21 | import java.sql.Statement;
22 | import java.util.ResourceBundle;
23 |
24 | /**
25 | * Created by Tanvir on 8/19/2016.
26 | */
27 | public class AdminTeacherController implements Initializable {
28 |
29 | private DBConnection database = new DBConnection();
30 | private Connection connection;
31 | private Statement statement;
32 | private ResultSet resultSet;
33 | private boolean isAdminTeacherAddNewButtonClick;
34 | private boolean isAdminTeacherEditButtonClick;
35 | private MenuBarControl menuBarControl = new MenuBarControl();
36 | private String temp ;
37 |
38 |
39 |
40 | @FXML
41 | TableView adminTeacherTableView;
42 | @FXML
43 | TableColumn adminTeacherColumnNo;
44 | @FXML
45 | TableColumn adminTeacherColumnName;
46 | @FXML
47 | TableColumn adminTeacherColumnID;
48 | @FXML
49 | TableColumn adminTeacherColumnEmail;
50 | @FXML
51 | TableColumn adminTeacherColumnDepartment;
52 | @FXML
53 | TableColumn adminTeacherColumnRunningCourse;
54 |
55 |
56 | @FXML
57 | private TextField adminTeacherTFFname;
58 | @FXML
59 | private TextField adminTeacherTFLname;
60 | @FXML
61 | private TextField adminTeacherTFID;
62 | @FXML
63 | private TextField adminTeacherTFEmail;
64 | @FXML
65 | private TextField adminTeacherTFDepartment;
66 | @FXML
67 | private TextField adminTeacherTFSec;
68 | @FXML
69 | private TextField adminTeacherTFSearch;
70 |
71 |
72 | @FXML
73 | private Button adminTeacherClearButtonClick;
74 | @FXML
75 | private Button adminTeacherSaveButtonClick;
76 |
77 |
78 | private ObservableList getDataFromTeacherAndAddToObservableList(String query){
79 | ObservableList adminTeacherTableData = FXCollections.observableArrayList();
80 | try {
81 |
82 | connection = database.getConnection();
83 | statement = connection.createStatement();
84 | resultSet = statement.executeQuery(query);//"SELECT * FROM teacher;"
85 | while(resultSet.next()){
86 | adminTeacherTableData.add(new AdminTeacherTable(
87 | resultSet.getInt("dbTeacherSerialNo"),
88 | resultSet.getString("dbTeacherFname")+" "+resultSet.getString("dbTeacherLname"),
89 | resultSet.getString("dbTeacherID"),
90 | resultSet.getString("dbTeacherEmail"),
91 | resultSet.getString("dbTeacherDepartment"),
92 | resultSet.getString("dbTeacherCourse")
93 | ));
94 | }
95 | connection.close();
96 | statement.close();
97 | resultSet.close();
98 | } catch (SQLException e) {
99 | e.printStackTrace();
100 | }
101 | return adminTeacherTableData;
102 | }
103 |
104 | @Override
105 | public void initialize(URL location, ResourceBundle resources) {
106 |
107 | adminTeacherColumnNo.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataNo"));
108 | adminTeacherColumnName.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataName"));
109 | adminTeacherColumnID.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataID"));
110 | adminTeacherColumnEmail.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataEmail"));
111 | adminTeacherColumnDepartment.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataDepartment"));
112 | adminTeacherColumnRunningCourse.setCellValueFactory(new PropertyValueFactory("AdminTeacherTableDataSec"));
113 |
114 | adminTeacherTableView.setItems(getDataFromTeacherAndAddToObservableList("SELECT * FROM teacher;"));
115 |
116 | }
117 |
118 | @FXML
119 | private void setAdminTeacherAddNewButtonClick(Event event){
120 | adminTeacherSetAllEnable();
121 | isAdminTeacherAddNewButtonClick = true;
122 | }
123 |
124 | private void adminTeacherSetAllEnable(){
125 | adminTeacherTFFname.setDisable(false);
126 | adminTeacherTFLname.setDisable(false);
127 | adminTeacherTFID.setDisable(false);
128 | adminTeacherTFEmail.setDisable(false);
129 | adminTeacherTFDepartment.setDisable(false);
130 | adminTeacherTFSec.setDisable(false);
131 |
132 | adminTeacherClearButtonClick.setDisable(false);
133 | adminTeacherSaveButtonClick.setDisable(false);
134 | }
135 |
136 | private void adminTeacherSetAllDisable(){
137 | adminTeacherTFFname.setDisable(true);
138 | adminTeacherTFLname.setDisable(true);
139 | adminTeacherTFID.setDisable(true);
140 | adminTeacherTFEmail.setDisable(true);
141 | adminTeacherTFDepartment.setDisable(true);
142 | adminTeacherTFSec.setDisable(true);
143 |
144 | adminTeacherClearButtonClick.setDisable(true);
145 | adminTeacherSaveButtonClick.setDisable(true);
146 | }
147 |
148 | private void adminTeacherSetAllClear(){
149 | adminTeacherTFFname.clear();
150 | adminTeacherTFLname.clear();
151 | adminTeacherTFID.clear();
152 | adminTeacherTFDepartment.clear();
153 | adminTeacherTFEmail.clear();
154 | adminTeacherTFSec.clear();
155 |
156 | }
157 |
158 | @FXML
159 | private void setAdminTeacherEditButtonClick(Event event){
160 | AdminTeacherTable getSelectedRow = adminTeacherTableView.getSelectionModel().getSelectedItem();
161 |
162 |
163 | String sqlQuery = "select * FROM teacher where dbTeacherID = '"+getSelectedRow.getAdminTeacherTableDataID()+"';";
164 |
165 | try {
166 | connection = database.getConnection();
167 | statement = connection.createStatement();
168 | resultSet = statement.executeQuery(sqlQuery);
169 | adminTeacherSetAllEnable();
170 | while(resultSet.next()) {
171 | adminTeacherTFFname.setText(resultSet.getString("dbTeacherFname"));
172 | adminTeacherTFLname.setText(resultSet.getString("dbTeacherLname"));
173 | adminTeacherTFID.setText(resultSet.getString("dbTeacherID"));
174 | adminTeacherTFEmail.setText(resultSet.getString("dbTeacherEmail"));
175 | adminTeacherTFDepartment.setText(resultSet.getString("dbTeacherDepartment"));
176 | adminTeacherTFSec.setText(resultSet.getString("dbTeacherCourse"));
177 |
178 | }
179 |
180 | temp =adminTeacherTFID.getText();
181 | isAdminTeacherEditButtonClick = true;
182 | }
183 | catch (SQLException e) {
184 | e.printStackTrace();
185 | }
186 |
187 | }
188 |
189 | @FXML
190 | private void setAdminTeacherSaveButtonClick(Event event){
191 |
192 | try{
193 | connection = database.getConnection();
194 | statement = connection.createStatement();
195 | if(isAdminTeacherAddNewButtonClick){
196 | int rowsAffected = statement.executeUpdate("insert into `teacher` (`dbTeacherFname`,`dbTeacherLname`,`dbTeacherID`,`dbTeacherEmail`,`dbTeacherDepartment`,`dbTeacherCourse`) values ('"+
197 | adminTeacherTFFname.getText()+"','"+adminTeacherTFLname.getText()+"','"+adminTeacherTFID.getText()+"','"+adminTeacherTFEmail.getText()
198 | +"','"+adminTeacherTFDepartment.getText()+"','"+adminTeacherTFSec.getText()+"') ;");
199 | }
200 | else if (isAdminTeacherEditButtonClick){
201 | int rowsAffected = statement.executeUpdate("update teacher set "+
202 | "dbTeacherFname = '"+adminTeacherTFFname.getText()+"',"+
203 | "dbTeacherLname = '"+adminTeacherTFLname.getText()+"',"+
204 | "dbTeacherID = '"+adminTeacherTFID.getText()+"',"+
205 | "dbTeacherEmail = '"+adminTeacherTFEmail.getText()+"',"+
206 | "dbTeacherDepartment = '"+adminTeacherTFDepartment.getText()+"',"+
207 | "dbTeacherCourse = '"+adminTeacherTFSec.getText()+
208 |
209 | "' where dbTeacherID = '"+
210 | temp+"';");
211 | }
212 |
213 |
214 | connection.close();
215 | statement.close();
216 | resultSet.close();
217 | }
218 | catch (SQLException e){
219 | e.printStackTrace();
220 | }
221 | adminTeacherSetAllClear();
222 | adminTeacherSetAllDisable();
223 | adminTeacherTableView.setItems(getDataFromTeacherAndAddToObservableList("SELECT * FROM teacher;"));
224 | isAdminTeacherAddNewButtonClick=false;
225 | isAdminTeacherEditButtonClick = false;
226 |
227 | }
228 |
229 | @FXML
230 | private void setAdminTeacherClearButtonClick(Event event){
231 | adminTeacherSetAllClear();
232 | adminTeacherSetAllDisable();
233 | isAdminTeacherAddNewButtonClick = false;
234 | isAdminTeacherEditButtonClick = false;
235 | }
236 |
237 | @FXML
238 | private void setAdminTeacherDeleteButtonClick(Event event){
239 | AdminTeacherTable getSelectedRow = adminTeacherTableView.getSelectionModel().getSelectedItem();
240 | String sqlQuery = "delete from teacher where dbTeacherID = '"+getSelectedRow.getAdminTeacherTableDataID()+"';";
241 | try {
242 | connection = database.getConnection();
243 | statement = connection.createStatement();
244 | int rowsAffected = statement.executeUpdate(sqlQuery);
245 | adminTeacherTableView.setItems(getDataFromTeacherAndAddToObservableList("SELECT * FROM teacher;"));
246 |
247 | }
248 | catch (SQLException e) {
249 | e.printStackTrace();
250 | }
251 | }
252 |
253 | @FXML
254 | private void setAdminTeacherRefreshButtonClick(Event event){
255 | adminTeacherTableView.setItems(getDataFromTeacherAndAddToObservableList("SELECT * FROM teacher;"));//sql Query
256 | adminTeacherTFSearch.clear();
257 | }
258 |
259 | @FXML
260 | private void setAdminTeacherSearchButtonClick(Event event){
261 | String sqlQuery = "select * FROM teacher where dbTeacherID = '"+adminTeacherTFSearch.getText()+"';";
262 | adminTeacherTableView.setItems(getDataFromTeacherAndAddToObservableList(sqlQuery));
263 | adminTeacherTFSearch.clear();
264 | }
265 |
266 | @FXML
267 | private void setCourseAboutButtonClick(Event event) throws IOException {
268 | menuBarControl.about();
269 | }
270 |
271 | @FXML
272 | private void setCourseCloseButtonClick(Event event){
273 | menuBarControl.close();
274 | }
275 |
276 | }
277 |
--------------------------------------------------------------------------------
/src/admin/AdminTeacherTable.java:
--------------------------------------------------------------------------------
1 | package admin;
2 |
3 | import javafx.beans.property.SimpleIntegerProperty;
4 | import javafx.beans.property.SimpleStringProperty;
5 |
6 | /**
7 | * Created by Tanvir on 8/19/2016.
8 | */
9 | public class AdminTeacherTable {
10 |
11 | private final SimpleIntegerProperty AdminTeacherTableDataNo;
12 | private final SimpleStringProperty AdminTeacherTableDataName;
13 | private final SimpleStringProperty AdminTeacherTableDataID;
14 | private final SimpleStringProperty AdminTeacherTableDataEmail;
15 | private final SimpleStringProperty AdminTeacherTableDataDepartment;
16 | private final SimpleStringProperty AdminTeacherTableDataSec;
17 |
18 | public AdminTeacherTable(int adminTeacherTableDataNo, String adminTeacherTableDataName, String adminTeacherTableDataID, String adminTeacherTableDataEmail, String adminTeacherTableDataDepartment, String adminTeacherTableDataSec) {
19 | AdminTeacherTableDataNo = new SimpleIntegerProperty(adminTeacherTableDataNo);
20 | AdminTeacherTableDataName = new SimpleStringProperty(adminTeacherTableDataName);
21 | AdminTeacherTableDataID = new SimpleStringProperty(adminTeacherTableDataID);
22 | AdminTeacherTableDataEmail = new SimpleStringProperty(adminTeacherTableDataEmail);
23 | AdminTeacherTableDataDepartment = new SimpleStringProperty(adminTeacherTableDataDepartment);
24 | AdminTeacherTableDataSec = new SimpleStringProperty(adminTeacherTableDataSec);
25 | }
26 |
27 | public int getAdminTeacherTableDataNo() {
28 | return AdminTeacherTableDataNo.get();
29 | }
30 |
31 | public SimpleIntegerProperty adminTeacherTableDataNoProperty() {
32 | return AdminTeacherTableDataNo;
33 | }
34 |
35 | public void setAdminTeacherTableDataNo(int adminTeacherTableDataNo) {
36 | this.AdminTeacherTableDataNo.set(adminTeacherTableDataNo);
37 | }
38 |
39 | public String getAdminTeacherTableDataName() {
40 | return AdminTeacherTableDataName.get();
41 | }
42 |
43 | public SimpleStringProperty adminTeacherTableDataNameProperty() {
44 | return AdminTeacherTableDataName;
45 | }
46 |
47 | public void setAdminTeacherTableDataName(String adminTeacherTableDataName) {
48 | this.AdminTeacherTableDataName.set(adminTeacherTableDataName);
49 | }
50 |
51 | public String getAdminTeacherTableDataID() {
52 | return AdminTeacherTableDataID.get();
53 | }
54 |
55 | public SimpleStringProperty adminTeacherTableDataIDProperty() {
56 | return AdminTeacherTableDataID;
57 | }
58 |
59 | public void setAdminTeacherTableDataID(String adminTeacherTableDataID) {
60 | this.AdminTeacherTableDataID.set(adminTeacherTableDataID);
61 | }
62 |
63 | public String getAdminTeacherTableDataEmail() {
64 | return AdminTeacherTableDataEmail.get();
65 | }
66 |
67 | public SimpleStringProperty adminTeacherTableDataEmailProperty() {
68 | return AdminTeacherTableDataEmail;
69 | }
70 |
71 | public void setAdminTeacherTableDataEmail(String adminTeacherTableDataEmail) {
72 | this.AdminTeacherTableDataEmail.set(adminTeacherTableDataEmail);
73 | }
74 |
75 | public String getAdminTeacherTableDataDepartment() {
76 | return AdminTeacherTableDataDepartment.get();
77 | }
78 |
79 | public SimpleStringProperty adminTeacherTableDataDepartmentProperty() {
80 | return AdminTeacherTableDataDepartment;
81 | }
82 |
83 | public void setAdminTeacherTableDataDepartment(String adminTeacherTableDataDepartment) {
84 | this.AdminTeacherTableDataDepartment.set(adminTeacherTableDataDepartment);
85 | }
86 |
87 | public String getAdminTeacherTableDataSec() {
88 | return AdminTeacherTableDataSec.get();
89 | }
90 |
91 | public SimpleStringProperty adminTeacherTableDataSecProperty() {
92 | return AdminTeacherTableDataSec;
93 | }
94 |
95 | public void setAdminTeacherTableDataSec(String adminTeacherTableDataSec) {
96 | this.AdminTeacherTableDataSec.set(adminTeacherTableDataSec);
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/src/admin/Course.fxml:
--------------------------------------------------------------------------------
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 |
33 |
38 |
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/src/admin/CourseTable.java:
--------------------------------------------------------------------------------
1 | package admin;
2 |
3 |
4 | import javafx.beans.property.SimpleIntegerProperty;
5 | import javafx.beans.property.SimpleStringProperty;
6 |
7 | /**
8 | * Created by Tanvir on 8/18/2016.
9 | */
10 | public class CourseTable {
11 | private final SimpleIntegerProperty courseTableDataNo;
12 | private final SimpleStringProperty courseTableDataCode;
13 | private final SimpleStringProperty courseTableDataTitle;
14 | private final SimpleIntegerProperty courseTableDataCredit;
15 | private final SimpleStringProperty courseTableDataSec;
16 |
17 |
18 | public CourseTable(int courseTableDataNo, String courseTableDataCode, String courseTableDataTitle, int courseTableDataCredit, String courseTableDataSec) {
19 | this.courseTableDataNo = new SimpleIntegerProperty(courseTableDataNo);
20 | this.courseTableDataCode = new SimpleStringProperty(courseTableDataCode);
21 | this.courseTableDataTitle = new SimpleStringProperty(courseTableDataTitle);
22 | this.courseTableDataCredit = new SimpleIntegerProperty(courseTableDataCredit);
23 | this.courseTableDataSec = new SimpleStringProperty(courseTableDataSec);
24 | }
25 |
26 | public int getCourseTableDataNo() {
27 | return courseTableDataNo.get();
28 | }
29 |
30 | public SimpleIntegerProperty courseTableDataNoProperty() {
31 | return courseTableDataNo;
32 | }
33 |
34 | public void setCourseTableDataNo(int courseTableDataNo) {
35 | this.courseTableDataNo.set(courseTableDataNo);
36 | }
37 |
38 | public String getCourseTableDataCode() {
39 | return courseTableDataCode.get();
40 | }
41 |
42 | public SimpleStringProperty courseTableDataCodeProperty() {
43 | return courseTableDataCode;
44 | }
45 |
46 | public void setCourseTableDataCode(String courseTableDataCode) {
47 | this.courseTableDataCode.set(courseTableDataCode);
48 | }
49 |
50 | public String getCourseTableDataTitle() {
51 | return courseTableDataTitle.get();
52 | }
53 |
54 | public SimpleStringProperty courseTableDataTitleProperty() {
55 | return courseTableDataTitle;
56 | }
57 |
58 | public void setCourseTableDataTitle(String courseTableDataTitle) {
59 | this.courseTableDataTitle.set(courseTableDataTitle);
60 | }
61 |
62 | public int getCourseTableDataCredit() {
63 | return courseTableDataCredit.get();
64 | }
65 |
66 | public SimpleIntegerProperty courseTableDataCreditProperty() {
67 | return courseTableDataCredit;
68 | }
69 |
70 | public void setCourseTableDataCredit(int courseTableDataCredit) {
71 | this.courseTableDataCredit.set(courseTableDataCredit);
72 | }
73 |
74 | public String getCourseTableDataSec() {
75 | return courseTableDataSec.get();
76 | }
77 |
78 | public SimpleStringProperty courseTableDataSecProperty() {
79 | return courseTableDataSec;
80 | }
81 |
82 | public void setCourseTableDataSec(String courseTableDataSec) {
83 | this.courseTableDataSec.set(courseTableDataSec);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/src/database/DBConnection.java:
--------------------------------------------------------------------------------
1 | package database;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 | import java.sql.SQLException;
6 |
7 | /**
8 | * Created by Tanvir on 7/23/2016.
9 | */
10 |
11 |
12 | /*private String url = "jdbc:mysql://localhost:3306/uiuStudentRecordSystem";
13 | private String user = "root";
14 | private String pass = "1234";*/
15 |
16 | /*private String url = "jdbc:mysql://sql6.freemysqlhosting.net:3306/sql6133728";
17 | private String user = "sql6133728";
18 | private String pass = "2TzHWLPjxB";*/
19 |
20 |
21 |
22 | public class DBConnection {
23 | private Connection connection;
24 | private String url = "jdbc:mysql://localhost:3306/uiuStudentRecordSystem";
25 | private String user = "root";
26 | private String pass = "1234";
27 |
28 | public Connection getConnection() throws SQLException {
29 | connection = DriverManager.getConnection(url,user,pass);
30 | return connection;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/image/011142032.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142032.jpg
--------------------------------------------------------------------------------
/src/image/011142047.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142047.jpg
--------------------------------------------------------------------------------
/src/image/011142052.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142052.jpg
--------------------------------------------------------------------------------
/src/image/011142053.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142053.jpg
--------------------------------------------------------------------------------
/src/image/011142077.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142077.jpg
--------------------------------------------------------------------------------
/src/image/011142153.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142153.jpg
--------------------------------------------------------------------------------
/src/image/011142501.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011142501.jpg
--------------------------------------------------------------------------------
/src/image/011143087.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011143087.jpg
--------------------------------------------------------------------------------
/src/image/011152064.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011152064.jpg
--------------------------------------------------------------------------------
/src/image/011153033.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/011153033.jpg
--------------------------------------------------------------------------------
/src/image/114142010.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/114142010.jpg
--------------------------------------------------------------------------------
/src/image/default-user-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0xTanvir/uiuStudentRecordSystem/313c4a5af61b55b6263e2689caf0f8698cf92486/src/image/default-user-icon.png
--------------------------------------------------------------------------------
/src/menuBar/About.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/menuBar/MenuBarControl.java:
--------------------------------------------------------------------------------
1 | package menuBar;
2 |
3 | import javafx.application.Platform;
4 | import javafx.fxml.FXMLLoader;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 | import javafx.stage.StageStyle;
9 |
10 | import java.io.IOException;
11 |
12 | /**
13 | * Created by Tanvir on 8/16/2016.
14 | */
15 | public class MenuBarControl {
16 |
17 | public void close(){
18 | Platform.exit();
19 | System.exit(0);
20 | }
21 |
22 | public void about() throws IOException {
23 | FXMLLoader loader = new FXMLLoader();
24 | loader.setLocation(getClass().getResource("/menuBar/About.fxml"));
25 | loader.load();
26 | Parent p = loader.getRoot();
27 | Stage stage = new Stage();
28 | stage.initStyle(StageStyle.UTILITY);
29 | stage.setScene(new Scene(p));
30 | stage.show();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/profileView/Info.java:
--------------------------------------------------------------------------------
1 | package profileView;
2 |
3 | import database.DBConnection;
4 |
5 | import java.sql.Connection;
6 | import java.sql.ResultSet;
7 | import java.sql.SQLException;
8 | import java.sql.Statement;
9 |
10 | /**
11 | * Created by Tanvir on 8/13/2016.
12 | */
13 | public class Info {
14 | private String id,name,department,cgpa,vemail,dob,email,phone;
15 | private String gname,gemail,gphone,address;
16 |
17 | DBConnection database = new DBConnection();
18 | Connection connection;
19 | Statement statement;
20 | ResultSet resultSet;
21 |
22 | public Info() {
23 | }
24 |
25 | public Info(String id) {
26 | this.id = id;
27 | setOtherField();
28 |
29 | }
30 |
31 |
32 | private void setOtherField(){
33 | try {
34 | connection = database.getConnection();
35 | statement = connection.createStatement();
36 | resultSet = statement.executeQuery("SELECT * FROM student where dbStudentID = '"+id+"';");
37 | while (resultSet.next()){
38 | name=resultSet.getString("dbStudentFname")+" "+resultSet.getString("dbStudentLname");
39 | department = resultSet.getString("dbStudentDepartment");
40 | cgpa = resultSet.getString("dbStudentCgpa");
41 | vemail=name.substring(0,1)+resultSet.getString("dbStudentLname")+id.substring(3)+"@bs"+department.toLowerCase()+".uiu.ac.bd";
42 | dob = resultSet.getString("dbStudentDOB");//resultSet.getString("");
43 | email = resultSet.getString("dbStudentEmail");
44 | phone = resultSet.getString("dbStudentPhone");
45 | address = resultSet.getString("dbStudentAddress");
46 |
47 | gname = resultSet.getString("dbGuardianFname")+" "+resultSet.getString("dbGuardianLname");
48 | gemail = resultSet.getString("dbGuardianEmail");
49 | gphone = resultSet.getString("dbGuardianPhone");
50 |
51 |
52 | }
53 | } catch (SQLException e) {
54 | e.printStackTrace();
55 | }
56 |
57 |
58 | }
59 |
60 |
61 |
62 |
63 | public String getId() {
64 | return id.substring(0,3)+" "+id.substring(3,6)+" "+id.substring(6);
65 | }
66 |
67 | public String getfullId() {
68 | return id;
69 | }
70 |
71 | public void setId(String id) {
72 | this.id = id;
73 | }
74 |
75 | public String getName() {
76 | return name;
77 | }
78 |
79 | public String getDepartment() {
80 | return department;
81 | }
82 |
83 | public String getCgpa() {
84 | return "("+cgpa+")";
85 | }
86 |
87 | public String getVemail() {
88 | return vemail;
89 | }
90 |
91 | public String getDob() {
92 | return dob;
93 | }
94 |
95 | public String getEmail() {
96 | return email;
97 | }
98 |
99 | public String getPhone() {
100 | return phone;
101 | }
102 |
103 | public String getGname() {
104 | return gname;
105 | }
106 |
107 | public String getGemail() {
108 | return gemail;
109 | }
110 |
111 | public String getGphone() {
112 | return gphone;
113 | }
114 |
115 | public String getAddress() {
116 | return address;
117 | }
118 |
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/src/profileView/ProfileView.java:
--------------------------------------------------------------------------------
1 | package profileView;
2 |
3 | import database.DBConnection;
4 | import javafx.event.Event;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.chart.LineChart;
7 | import javafx.scene.chart.XYChart;
8 | import javafx.scene.image.Image;
9 | import javafx.scene.image.ImageView;
10 | import javafx.scene.text.Text;
11 | import sun.tracing.NullProviderFactory;
12 |
13 | import java.lang.reflect.InvocationTargetException;
14 | import java.sql.Connection;
15 | import java.sql.ResultSet;
16 | import java.sql.SQLException;
17 | import java.sql.Statement;
18 |
19 | /**
20 | * Created by Tanvir on 8/13/2016.
21 | */
22 | public class ProfileView {
23 |
24 | @FXML
25 | private ImageView profilePic;
26 |
27 | @FXML
28 | Text tID;
29 | @FXML
30 | Text tName;
31 | @FXML
32 | Text tDepartment;
33 | @FXML
34 | Text tCGPA;
35 | @FXML
36 | Text tDOB;
37 | @FXML
38 | Text tEmail;
39 | @FXML
40 | Text tVEmail;
41 | @FXML
42 | Text tPhone;
43 | @FXML
44 | Text tAddress;
45 | @FXML
46 | Text tGName;
47 | @FXML
48 | Text tGEmail;
49 | @FXML
50 | Text tGPhone;
51 |
52 | DBConnection database = new DBConnection();
53 | Connection connection;
54 | Statement statement;
55 | ResultSet resultSet;
56 |
57 | @FXML
58 | private LineChart gpaVisualization;
59 |
60 |
61 |
62 | private Info currentInfo;
63 |
64 | public void setCurrentInfo(Info currentInfo) {
65 | tID.setText(currentInfo.getId());
66 | tName.setText(currentInfo.getName());
67 | tDepartment.setLayoutX(tName.getLayoutX()+10+tName.getBoundsInParent().getWidth());//Adjust Layout with name
68 | tDepartment.setText(currentInfo.getDepartment());
69 | tCGPA.setText(currentInfo.getCgpa());
70 | tVEmail.setText(currentInfo.getVemail());
71 | tDOB.setText(currentInfo.getDob());
72 | tEmail.setText(currentInfo.getEmail());
73 | tPhone.setText(currentInfo.getPhone());
74 | tAddress.setText(currentInfo.getAddress());
75 |
76 |
77 | tGName.setText(currentInfo.getGname());
78 | tGEmail.setText(currentInfo.getGemail());
79 | tGPhone.setText(currentInfo.getGphone());
80 |
81 |
82 |
83 | try {
84 | Image image = new Image("/image/"+currentInfo.getfullId()+".jpg");
85 | profilePic.setImage(image);
86 | }
87 | catch (Exception e){
88 | profilePic.setImage(new Image("/image/default-user-icon.png"));
89 | }
90 |
91 |
92 |
93 |
94 |
95 | this.currentInfo = currentInfo;
96 |
97 | }
98 |
99 | @FXML
100 | private void setLoadGpaButtonClcik(Event event){
101 | gpaVisualization.getData().clear();
102 | XYChart.Series gpaLineChart = new XYChart.Series();
103 |
104 | try {
105 | connection = database.getConnection();
106 | statement = connection.createStatement();
107 | resultSet = statement.executeQuery("SELECT * FROM student where dbStudentID = '"+currentInfo.getfullId()+"';");
108 |
109 | while (resultSet.next()){
110 |
111 | for (int i = 1; i <12 ; i++) {
112 | if(resultSet.getDouble("dbStudent"+i+"thSemGpa")!=0.00){
113 | gpaLineChart.getData().add(new XYChart.Data(i+"th", resultSet.getDouble("dbStudent"+i+"thSemGpa")));
114 | }
115 | }
116 |
117 | gpaLineChart.setName("All GPA");
118 | gpaVisualization.getData().add(gpaLineChart);
119 |
120 | }
121 |
122 | } catch (SQLException e) {
123 | e.printStackTrace();
124 | }
125 |
126 |
127 | }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/src/profileView/profileView.fxml:
--------------------------------------------------------------------------------
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
130 |
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/src/recordSystemMain/MainLogin.fxml:
--------------------------------------------------------------------------------
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 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/recordSystemMain/MainLogin.java:
--------------------------------------------------------------------------------
1 | package recordSystemMain;
2 |
3 | /**
4 | * Created by Tanvir on 7/22/2016.
5 | */
6 | import javafx.application.Application;
7 | import javafx.fxml.FXMLLoader;
8 | import javafx.scene.Parent;
9 | import javafx.scene.Scene;
10 | import javafx.stage.Stage;
11 |
12 | public class MainLogin extends Application {
13 |
14 | public static void main(String[] args) {
15 | launch(args);
16 | }
17 |
18 | @Override
19 | public void start(Stage primaryStage) throws Exception{
20 | Parent root = FXMLLoader.load(getClass().getResource("MainLogin.fxml"));
21 | primaryStage.setTitle("UIU Student Record System");
22 | primaryStage.setScene(new Scene(root, 650, 400));
23 | primaryStage.show();
24 | }
25 |
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/recordSystemMain/MainLoginController.java:
--------------------------------------------------------------------------------
1 | package recordSystemMain;
2 |
3 |
4 | import database.DBConnection;
5 | import javafx.event.Event;
6 | import javafx.fxml.FXML;
7 | import javafx.fxml.FXMLLoader;
8 | import javafx.scene.Node;
9 | import javafx.scene.Parent;
10 | import javafx.scene.Scene;
11 | import javafx.scene.control.ChoiceBox;
12 | import javafx.scene.control.PasswordField;
13 | import javafx.scene.control.TextField;
14 | import javafx.stage.Stage;
15 | import javafx.util.Duration;
16 | import student.Student;
17 | import teacher.TeacherController;
18 | import tray.notification.NotificationType;
19 | import tray.notification.TrayNotification;
20 |
21 | import java.io.IOException;
22 | import java.sql.Connection;
23 | import java.sql.ResultSet;
24 | import java.sql.SQLException;
25 | import java.sql.Statement;
26 |
27 | /**
28 | * Created by Tanvir on 7/22/2016.
29 | */
30 |
31 |
32 | public class MainLoginController {
33 |
34 | @FXML
35 | private TextField tfEmailID;
36 | @FXML
37 | private PasswordField pfPassword;
38 | @FXML
39 | private ChoiceBox cbUser;
40 |
41 | @FXML
42 | private void loginButtonClick(Event event) throws SQLException{
43 | if(isAllFieldFillup()){
44 | String userName = tfEmailID.getText().trim();
45 | String password = pfPassword.getText();
46 | String userType = cbUser.getValue().toString().trim();
47 |
48 |
49 |
50 |
51 | switch (userType){
52 | case "Admin":
53 | if (isValidCredentials(userType,userName,password,"Email")){
54 | try {
55 | Parent adminParent = FXMLLoader.load(getClass().getResource("/admin/Admin.fxml"));
56 | Scene adminScene = new Scene(adminParent);
57 | Stage adminStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
58 | adminStage.hide();
59 | adminStage.setScene(adminScene);
60 | adminStage.setTitle("Admin Panel");
61 | adminStage.show();
62 |
63 | } catch (IOException e) {
64 | e.printStackTrace();
65 | }
66 |
67 | }
68 | break;
69 | case "Guardian":
70 | System.out.println("I am now on Guardian");
71 | break;
72 | case "Student":
73 | if(isValidCredentials(userType,userName,password,"ID")){
74 | try {
75 | Student student = new Student();
76 | student.setStudentId(userName);
77 | Parent studentParent = FXMLLoader.load(getClass().getResource("/student/Student.fxml"));
78 | Scene studentScene = new Scene(studentParent);
79 | Stage studentStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
80 | studentStage.hide();
81 | studentStage.setScene(studentScene);
82 | studentStage.setTitle("Student Panel");
83 | studentStage.show();
84 |
85 | }
86 | catch (IOException e){
87 | e.printStackTrace();
88 | }
89 | }
90 | break;
91 | case "Teacher":
92 | if (isValidCredentials(userType,userName,password,"Email")){
93 | try {
94 | TeacherController teacherController = new TeacherController();
95 | teacherController.setEmail(userName);
96 | Parent teacherParent = FXMLLoader.load(getClass().getResource("/teacher/Teacher.fxml"));
97 | Scene teacherScene = new Scene(teacherParent);
98 | Stage teacherStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
99 | teacherStage.hide();
100 | teacherStage.setScene(teacherScene);
101 | teacherStage.setTitle("Teacher Panel");
102 | teacherStage.show();
103 |
104 | } catch (IOException e) {
105 | e.printStackTrace();
106 | }
107 |
108 | }
109 | break;
110 |
111 | }
112 |
113 | }
114 |
115 | }
116 |
117 |
118 | private boolean isValidCredentials(String userType, String userName, String password,String loginType) throws SQLException {
119 | boolean userPassOk = false;
120 |
121 | DBConnection database = new DBConnection();
122 | Connection connection = database.getConnection();
123 | Statement statement = connection.createStatement();
124 | ResultSet resultSet = statement.executeQuery("select * from "+userType.toLowerCase()+" where db"+userType
125 | +loginType+" = '"+userName+"' and db"+userType+"Password = '"+password+"';");
126 |
127 |
128 | while (resultSet.next()){
129 |
130 | if(resultSet.getString("db"+userType+loginType)!=null && resultSet.getString("db"+userType+"Password")!=null){
131 | userPassOk = true;
132 | }
133 |
134 | }
135 |
136 | if(!userPassOk) {
137 |
138 | NotificationType notificationType = NotificationType.ERROR;
139 | TrayNotification tray = new TrayNotification();
140 | tray.setTitle("Wrong Information");
141 | tray.setMessage("Incorrect email or password");
142 | tray.setNotificationType(notificationType);
143 | tray.showAndDismiss(Duration.millis(3000));
144 |
145 | tfEmailID.clear();
146 | pfPassword.clear();
147 |
148 | userPassOk = false;
149 |
150 | }
151 |
152 |
153 | return userPassOk;
154 | }
155 |
156 |
157 |
158 | private boolean isAllFieldFillup(){
159 | boolean fillup;
160 | if(tfEmailID.getText().trim().isEmpty()||pfPassword.getText().isEmpty()){
161 |
162 | NotificationType notificationType = NotificationType.INFORMATION;
163 | TrayNotification tray = new TrayNotification();
164 | tray.setTitle("Attention!!!");
165 | tray.setMessage("Email or Password should not Empty.");
166 | tray.setNotificationType(notificationType);
167 | tray.showAndDismiss(Duration.millis(3000));
168 |
169 | fillup = false;
170 | }
171 | else fillup = true;
172 | return fillup;
173 | }
174 | }
175 |
--------------------------------------------------------------------------------
/src/sqlSheet/admin.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: uiustudentrecordsystem
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.13-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `admin`
20 | --
21 |
22 | DROP TABLE IF EXISTS `admin`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `admin` (
26 | `dbAdminSerialNo` int(11) NOT NULL AUTO_INCREMENT,
27 | `dbAdminFname` varchar(64) DEFAULT NULL,
28 | `dbAdminLname` varchar(64) DEFAULT NULL,
29 | `dbAdminEmail` varchar(64) DEFAULT NULL,
30 | `dbAdminPassword` varchar(64) DEFAULT 'password',
31 | PRIMARY KEY (`dbAdminSerialNo`)
32 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
33 | /*!40101 SET character_set_client = @saved_cs_client */;
34 |
35 | --
36 | -- Dumping data for table `admin`
37 | --
38 |
39 | LOCK TABLES `admin` WRITE;
40 | /*!40000 ALTER TABLE `admin` DISABLE KEYS */;
41 | INSERT INTO `admin` VALUES (1,'Munir','Hasan','a','1234'),(2,'Tanjina','Helaly','h','1234');
42 | /*!40000 ALTER TABLE `admin` ENABLE KEYS */;
43 | UNLOCK TABLES;
44 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
45 |
46 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
47 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
48 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
49 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
50 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
51 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
52 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
53 |
54 | -- Dump completed on 2016-08-24 10:12:46
55 |
--------------------------------------------------------------------------------
/src/sqlSheet/course.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: uiustudentrecordsystem
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.13-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `course`
20 | --
21 |
22 | DROP TABLE IF EXISTS `course`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `course` (
26 | `dbCourseSerial` int(11) NOT NULL AUTO_INCREMENT,
27 | `dbCourseSec` varchar(64) DEFAULT NULL,
28 | `dbCourseCredit` int(11) DEFAULT NULL,
29 | `dbCourseCode` varchar(64) DEFAULT NULL,
30 | `dbCourseTitle` varchar(64) DEFAULT NULL,
31 | PRIMARY KEY (`dbCourseSerial`)
32 | ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
33 | /*!40101 SET character_set_client = @saved_cs_client */;
34 |
35 | --
36 | -- Dumping data for table `course`
37 | --
38 |
39 | LOCK TABLES `course` WRITE;
40 | /*!40000 ALTER TABLE `course` DISABLE KEYS */;
41 | INSERT INTO `course` VALUES (1,'SB,A,B',1,'CSE211','OOP LAB'),(2,'SC,D,E',3,'CSE212','OOP'),(4,'C,D,E',1,'CSE111','SPL LAB'),(5,'A,B,C,D',3,'CSE112','SPL'),(6,'A,B,C,SD',3,'CSE123','Electronics'),(7,'A,B,C,D',1,'CSE124','Electronics Laboratory'),(8,'A,B,SC',3,'ACT111','Financial and Managerial Accounting'),(9,'NA,NB,NC,ND',3,'MATH187','Fourier & Laplace Transformations & Complex Variable'),(10,'A,SB,C',3,'CSI233','Theory of Computing');
42 | /*!40000 ALTER TABLE `course` ENABLE KEYS */;
43 | UNLOCK TABLES;
44 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
45 |
46 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
47 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
48 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
49 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
50 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
51 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
52 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
53 |
54 | -- Dump completed on 2016-08-24 10:13:45
55 |
--------------------------------------------------------------------------------
/src/sqlSheet/student.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: uiustudentrecordsystem
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.13-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `student`
20 | --
21 |
22 | DROP TABLE IF EXISTS `student`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `student` (
26 | `dbStudentSerialNo` int(11) NOT NULL AUTO_INCREMENT,
27 | `dbStudentFname` varchar(64) DEFAULT NULL,
28 | `dbStudentLname` varchar(64) DEFAULT NULL,
29 | `dbStudentID` varchar(64) DEFAULT NULL,
30 | `dbStudentPassword` varchar(64) DEFAULT 'password',
31 | `dbStudentDepartment` varchar(64) DEFAULT NULL,
32 | `dbStudentEmail` varchar(64) DEFAULT NULL,
33 | `dbStudentPhone` varchar(64) DEFAULT NULL,
34 | `dbStudentAddress` varchar(64) DEFAULT NULL,
35 | `dbStudentDOB` varchar(64) DEFAULT NULL,
36 | `dbGuardianFname` varchar(64) DEFAULT NULL,
37 | `dbGuardianLname` varchar(64) DEFAULT NULL,
38 | `dbGuardianEmail` varchar(64) DEFAULT NULL,
39 | `dbGuardianPhone` varchar(64) DEFAULT NULL,
40 | `dbGuardianPassword` varchar(64) DEFAULT 'password',
41 | `dbStudent1stSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
42 | `dbStudent2ndSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
43 | `dbStudent3rdSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
44 | `dbStudent4thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
45 | `dbStudent5thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
46 | `dbStudent6thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
47 | `dbStudent7thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
48 | `dbStudent8thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
49 | `dbStudent9thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
50 | `dbStudent10thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
51 | `dbStudent11thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
52 | `dbStudent12thSemGpa` decimal(10,2) NOT NULL DEFAULT '0.00',
53 | `dbStudentCgpa` decimal(10,2) NOT NULL DEFAULT '0.00',
54 | PRIMARY KEY (`dbStudentSerialNo`)
55 | ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
56 | /*!40101 SET character_set_client = @saved_cs_client */;
57 |
58 | --
59 | -- Dumping data for table `student`
60 | --
61 |
62 | LOCK TABLES `student` WRITE;
63 | /*!40000 ALTER TABLE `student` DISABLE KEYS */;
64 | INSERT INTO `student` VALUES (1,'Tanvir','Rahman','011142053','1234','CSE','tanvir3080@gmail.com','01750 943080','House no 307, Dhanmondi 15','1995-02-05','Mokaddesh','Hossain','Mokaddesh.hossain@gmail.com','01748 737217','password',3.67,2.00,2.67,3.67,4.00,3.33,2.33,0.00,0.00,0.00,0.00,0.00,3.33),(2,'Mustafizur','Rahman','011142047','1234','CSE','mustafizur.rahman@gmail.com','01676 338612','House no.71, Zigatola, Dhaka','1995-06-15','Name','JaniNa','sofisF@gmail.com','01799 556644','password',2.00,4.00,3.67,4.00,3.67,2.33,3.67,0.00,0.00,0.00,0.00,0.00,3.67),(3,'Saimoon','Imran','011142153','1234','CSE','saimoon.imran@gmail.com','01818 556699','House no.336, Dhanmondi 15, Dhaka','2010-07-14','Saimoons','Father','his.father@gmail.com','01775 442255','password',2.67,3.67,1.67,4.00,3.67,2.33,0.00,0.00,0.00,0.00,0.00,0.00,3.33),(4,'Jubair','Joy','114142010','1234','BBA','J.joy@gmail.com','01687 176783','House no.30, Dhanmondi 15, Dhaka','2007-07-26','His','Father','janina@gmail.com','01745 556689','password',4.00,2.00,3.67,1.33,2.33,4.00,0.00,0.00,0.00,0.00,0.00,0.00,3.00),(5,'Chowdhury ','Sohag ','011142080','1234','EEE','c.shoag@gmail.com','01748 454525','House no.12, Dhanmondi 15, Dhaka','2016-07-06','Father','Name','sjdfsd@gmail.com','01855 223355','password',3.33,1.00,3.67,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.67),(6,'Wakib ','Avro','011142032','1234','CSE','wakib.avro@gmail.com','01799 666331','House no.111, Dhanmondi 15, Dhaka','2016-07-06','Father','Name','uyygbgc@gmail.com','01698 556611','password',3.33,4.00,1.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,3.00),(7,'Faarid ','Alin','011143087','1234','CSE','asdsad@asdfsaf.com','01897 523656','House no.87, Zigatola, Dhaka','2016-07-07','Sdssd','Asdsa','asdsad@asdfsaf.com','01742 258899','password',3.67,1.33,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,3.33),(8,'Shaikh ','Maruf ','011142052','1234','CSE','adsas@gjsal.com','01744 526655','House no.94, Zigatola, Dhaka','2016-07-21','Aasds','Fsdssd','adsas@gjsal.com','01425 522236','password',1.00,2.67,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,3.67),(9,'Tarek ','Mahmud','011142501','1234','CSE','tmahmud@gmail.com','01552 558877','House no.65, Farmghate, Dhaka','2016-07-05','Bdfgf','Ddfgdf','wefsfvfx@gmail.com','01866 222354','password',2.00,4.00,4.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.67),(10,'Wahid ','Raj','011152064','1234','CSE','wahidraj@gmail.com','01557 881122','House no.7/A, Farmghate, Dhaka','2016-06-29','Edfgf','Tdfgdg','sfdsdg@gmail.com','01924 223344','password',2.67,3.67,3.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.33),(11,'Mohammad ','Osman','011153033','1234','EEE','m.osman@gmail.com','01745 256353','House no.87, Motijheel, Dhaka','2016-07-09','Janina','Ami','rsdtrgf@gmail.com','01748 557788','password',2.33,4.00,1.33,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,3.00);
65 | /*!40000 ALTER TABLE `student` ENABLE KEYS */;
66 | UNLOCK TABLES;
67 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
68 |
69 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
70 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
71 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
72 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
73 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
74 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
75 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
76 |
77 | -- Dump completed on 2016-08-24 10:14:01
78 |
--------------------------------------------------------------------------------
/src/sqlSheet/studentgpa.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: uiustudentrecordsystem
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.13-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `studentgpa`
20 | --
21 |
22 | DROP TABLE IF EXISTS `studentgpa`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `studentgpa` (
26 | `dbstudentgpaSerial` int(11) NOT NULL AUTO_INCREMENT,
27 | `dbstudentgpaID` varchar(64) DEFAULT NULL,
28 | `dbstudentgpaCurrentCourse` varchar(64) DEFAULT NULL,
29 | `dbstudentgpaCurrentCourseGPA` varchar(64) DEFAULT NULL,
30 | `dbstudentgpa1stSem` varchar(64) DEFAULT NULL,
31 | `dbstudentgpa2ndSem` varchar(64) DEFAULT NULL,
32 | `dbstudentgpa3rdSem` varchar(64) DEFAULT NULL,
33 | `dbstudentgpa4thSem` varchar(64) DEFAULT NULL,
34 | `dbstudentgpa5thSem` varchar(64) DEFAULT NULL,
35 | `dbstudentgpa6thSem` varchar(64) DEFAULT NULL,
36 | `dbstudentgpa7thSem` varchar(64) DEFAULT NULL,
37 | `dbstudentgpa8thSem` varchar(64) DEFAULT NULL,
38 | `dbstudentgpa9thSem` varchar(64) DEFAULT NULL,
39 | `dbstudentgpa10thSem` varchar(64) DEFAULT NULL,
40 | `dbstudentgpa11thSem` varchar(64) DEFAULT NULL,
41 | `dbstudentgpa12thSem` varchar(64) DEFAULT NULL,
42 | `dbstudentgpa13thSem` varchar(64) DEFAULT NULL,
43 | `dbstudentgpa14thSem` varchar(64) DEFAULT NULL,
44 | `dbstudentgpa15thSem` varchar(64) DEFAULT NULL,
45 | `dbstudentgpa16thSem` varchar(64) DEFAULT NULL,
46 | `dbstudentCGPA` varchar(64) DEFAULT NULL,
47 | PRIMARY KEY (`dbstudentgpaSerial`)
48 | ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
49 | /*!40101 SET character_set_client = @saved_cs_client */;
50 |
51 | --
52 | -- Dumping data for table `studentgpa`
53 | --
54 |
55 | LOCK TABLES `studentgpa` WRITE;
56 | /*!40000 ALTER TABLE `studentgpa` DISABLE KEYS */;
57 | INSERT INTO `studentgpa` VALUES (1,'011142053','CSE111:C,CSE211:A','CSE211:A:3.40,CSE111:C:2.40',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'011142047',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'011142153','CSE111:C','CSE111:C:4.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'114142010','CSE111:C','CSE111:C:3.33',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'011142080','CSE111:C','CSE111:C:3.67',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'011142032','CSE111:C,MATH187:NB,CSE124:B','MATH187:NB:2.67,CSE124:B:3.00,CSE111:C:4.0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'011143087',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'011142052','CSE212:D,MATH187:NB,CSE124:B','CSE211:A:2.66',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,'011142501',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,'011152064',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,'011153033',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
58 | /*!40000 ALTER TABLE `studentgpa` ENABLE KEYS */;
59 | UNLOCK TABLES;
60 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
61 |
62 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
63 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
64 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
65 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
66 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
67 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
68 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
69 |
70 | -- Dump completed on 2016-08-24 10:14:25
71 |
--------------------------------------------------------------------------------
/src/sqlSheet/teacher.sql:
--------------------------------------------------------------------------------
1 | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
2 | --
3 | -- Host: localhost Database: uiustudentrecordsystem
4 | -- ------------------------------------------------------
5 | -- Server version 5.7.13-log
6 |
7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 | /*!40101 SET NAMES utf8 */;
11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 | /*!40103 SET TIME_ZONE='+00:00' */;
13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17 |
18 | --
19 | -- Table structure for table `teacher`
20 | --
21 |
22 | DROP TABLE IF EXISTS `teacher`;
23 | /*!40101 SET @saved_cs_client = @@character_set_client */;
24 | /*!40101 SET character_set_client = utf8 */;
25 | CREATE TABLE `teacher` (
26 | `dbTeacherSerialNo` int(11) NOT NULL AUTO_INCREMENT,
27 | `dbTeacherFname` varchar(64) DEFAULT NULL,
28 | `dbTeacherLname` varchar(64) DEFAULT NULL,
29 | `dbTeacherEmail` varchar(64) DEFAULT NULL,
30 | `dbTeacherPassword` varchar(64) DEFAULT 'password',
31 | `dbTeacherDepartment` varchar(64) DEFAULT NULL,
32 | `dbTeacherID` varchar(64) DEFAULT NULL,
33 | `dbTeacherCourse` varchar(64) DEFAULT NULL,
34 | PRIMARY KEY (`dbTeacherSerialNo`)
35 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
36 | /*!40101 SET character_set_client = @saved_cs_client */;
37 |
38 | --
39 | -- Dumping data for table `teacher`
40 | --
41 |
42 | LOCK TABLES `teacher` WRITE;
43 | /*!40000 ALTER TABLE `teacher` DISABLE KEYS */;
44 | INSERT INTO `teacher` VALUES (1,'Masudur','Rahman','t','1234','CSE','111023','CSE211:A,CSE111:C'),(2,'Adnan','Rahman','te','1234','CSE','111089','CSE112:C'),(3,'Mahbubur','Alam','m.alam@gmail.com','1234','EEE','111055','CSE111:D,CSE111:C');
45 | /*!40000 ALTER TABLE `teacher` ENABLE KEYS */;
46 | UNLOCK TABLES;
47 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
48 |
49 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
50 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
51 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
52 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
53 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
54 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
55 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
56 |
57 | -- Dump completed on 2016-08-24 10:14:46
58 |
--------------------------------------------------------------------------------
/src/student/ChooseASection.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/student/ChooseASectionController.java:
--------------------------------------------------------------------------------
1 | package student;
2 |
3 | import javafx.application.Platform;
4 | import javafx.event.Event;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.Parent;
7 | import javafx.scene.control.ComboBox;
8 | import javafx.stage.Stage;
9 |
10 | import java.sql.SQLException;
11 |
12 | /**
13 | * Created by Tanvir on 8/20/2016.
14 | */
15 | public class ChooseASectionController {
16 | static String allSection;
17 | static Stage stage;
18 | public void setStage(Stage stage){
19 | this.stage=stage;
20 | }
21 |
22 | public void setAllSection(String s){
23 | this.allSection = s;
24 | }
25 |
26 | @FXML
27 | ComboBox chooseASection;
28 | @FXML
29 | private void setTakeButtonClick(Event event) throws SQLException {
30 | RegistrationController registrationController = new RegistrationController();
31 | registrationController.setChoosingSec(chooseASection.getValue());
32 | stage.close();
33 | registrationController.studentRegistrationSectionUpdate();
34 | }
35 |
36 | @FXML
37 | private void initialize(){
38 | chooseASection.getItems().addAll(allSection.split(",",0));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/student/Registration.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
28 |
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 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/student/RegistrationController.java:
--------------------------------------------------------------------------------
1 | package student;
2 |
3 | import database.DBConnection;
4 | import javafx.collections.FXCollections;
5 | import javafx.collections.ObservableList;
6 | import javafx.event.Event;
7 | import javafx.fxml.FXML;
8 | import javafx.fxml.FXMLLoader;
9 | import javafx.fxml.Initializable;
10 | import javafx.scene.Parent;
11 | import javafx.scene.Scene;
12 | import javafx.scene.control.TableColumn;
13 | import javafx.scene.control.TableView;
14 | import javafx.scene.control.TextField;
15 | import javafx.scene.control.cell.PropertyValueFactory;
16 | import javafx.stage.Modality;
17 | import javafx.stage.Stage;
18 | import javafx.stage.StageStyle;
19 | import menuBar.MenuBarControl;
20 |
21 | import java.io.IOException;
22 | import java.net.URL;
23 | import java.sql.Connection;
24 | import java.sql.ResultSet;
25 | import java.sql.SQLException;
26 | import java.sql.Statement;
27 | import java.util.ResourceBundle;
28 |
29 | /**
30 | * Created by Tanvir on 8/20/2016.
31 | */
32 | public class RegistrationController implements Initializable {
33 |
34 | private DBConnection database = new DBConnection();
35 | private Connection connection;
36 | private Statement statement;
37 | private ResultSet resultSet,resultSet1;
38 | private MenuBarControl menuBarControl = new MenuBarControl();
39 |
40 |
41 | private static String ID,ChoosingSec,finalAllCourse="empty",courseCode;
42 | static Stage stage;
43 | public void setStage(Stage stage){
44 | this.stage=stage;
45 | }
46 |
47 | public void setID(String ID){
48 | this.ID = ID;
49 | }
50 | public void setChoosingSec(String ChoosingSec){
51 | this.ChoosingSec=ChoosingSec;
52 | }
53 |
54 |
55 | @FXML
56 | TextField registrationTFSearch;
57 |
58 |
59 | @FXML
60 | TableView studentCurrentCourseTableView;
61 | @FXML
62 | TableColumn studentCCourseColumnCode;
63 | @FXML
64 | TableColumn studentCCourseColumnTitle;
65 | @FXML
66 | TableColumn studentCCourseColumnCredit;
67 | @FXML
68 | TableColumn studentCCourseColumnSec;
69 |
70 |
71 |
72 | @FXML
73 | TableView studentAllCourseTableView;
74 | @FXML
75 | TableColumn studentACourseColumnCode;
76 | @FXML
77 | TableColumn studentACourseColumnTitle;
78 | @FXML
79 | TableColumn studentACourseColumnCredit;
80 | @FXML
81 | TableColumn studentACourseColumnSec;
82 |
83 | private static TableView tanother;
84 | public void setTanother(TableView a){
85 | this.tanother = a;
86 | }
87 |
88 |
89 | private ObservableList getDataFromAllCourseAndAddToObservableList(String query){
90 | ObservableList allCourseTableData = FXCollections.observableArrayList();
91 | try {
92 |
93 | connection = database.getConnection();
94 | statement = connection.createStatement();
95 | resultSet = statement.executeQuery(query);//"SELECT * FROM cource;"
96 | while(resultSet.next()){
97 | allCourseTableData.add(new RegistrationTableData(
98 | resultSet.getString("dbCourseCode"),
99 | resultSet.getString("dbCourseTitle"),
100 | resultSet.getInt("dbCourseCredit"),
101 | resultSet.getString("dbCourseSec")
102 |
103 | ));
104 | }
105 | connection.close();
106 | statement.close();
107 | resultSet.close();
108 | } catch (SQLException e) {
109 | e.printStackTrace();
110 | }
111 | return allCourseTableData;
112 | }
113 |
114 | public ObservableList getDataFromCurrentCourseAndAddToObservableList(String query){
115 | ObservableList currentCourseTableData = FXCollections.observableArrayList();
116 | try {
117 |
118 | connection = database.getConnection();
119 | statement = connection.createStatement();
120 | resultSet = statement.executeQuery(query);//"SELECT * FROM cource;"
121 | String allCourse = null;
122 |
123 | while(resultSet.next()){
124 | allCourse = "a"+resultSet.getString("dbStudentgpaCurrentCourse");
125 | }
126 |
127 | if (!(allCourse.equals("anull"))&&!(allCourse.equals("a"))){
128 | allCourse=allCourse.substring(1);
129 | finalAllCourse = allCourse;
130 | String cCode = null,cSec = null,cName = null;
131 | int cCredit = 0;
132 | String[] Courses = allCourse.split(",", 0);
133 | for (String s:Courses) {
134 | cCode=s.substring(0,s.indexOf(":"));
135 | cSec=s.substring(s.indexOf(":")+1);
136 | resultSet1 = statement.executeQuery("SELECT * FROM course WHERE dbCourseCode = '"+cCode+"';");
137 | while (resultSet1.next()){
138 | cName = resultSet1.getString("dbCourseTitle");
139 | cCredit = resultSet1.getInt("dbCourseCredit");
140 | }
141 | currentCourseTableData.add(new RegistrationTableData(cCode,cName,cCredit,cSec));
142 | }
143 | }
144 |
145 | connection.close();
146 | statement.close();
147 | resultSet.close();
148 | } catch (SQLException e) {
149 | e.printStackTrace();
150 | }
151 | return currentCourseTableData;
152 | }
153 |
154 | public void studentRegistrationSectionUpdate() throws SQLException {
155 | connection = database.getConnection();
156 | statement = connection.createStatement();
157 |
158 | if (!finalAllCourse.equals("empty")){
159 | finalAllCourse=finalAllCourse+","+courseCode+":"+ChoosingSec;
160 |
161 | int rowsAffected = statement.executeUpdate("update studentgpa set "+"dbStudentgpaCurrentCourse"+
162 | " ='"+finalAllCourse+"' where dbstudentgpaID = '"+ID+"';");
163 | }
164 |
165 | else {
166 | finalAllCourse = courseCode+":"+ChoosingSec;
167 | int rowsAffected = statement.executeUpdate("update studentgpa set dbStudentgpaCurrentCourse ='"+finalAllCourse+"' where dbstudentgpaID = '"+ID+"';");
168 | }
169 |
170 | }
171 |
172 | @Override
173 | public void initialize(URL location, ResourceBundle resources) {
174 | studentACourseColumnCode.setCellValueFactory(new PropertyValueFactory("courseTableDataCode"));
175 | studentACourseColumnTitle.setCellValueFactory(new PropertyValueFactory("courseTableDataTitle"));
176 | studentACourseColumnCredit.setCellValueFactory(new PropertyValueFactory("courseTableDataCredit"));
177 | studentACourseColumnSec.setCellValueFactory(new PropertyValueFactory("courseTableDataSec"));
178 |
179 | studentAllCourseTableView.setItems(getDataFromAllCourseAndAddToObservableList("SELECT * FROM course;"));
180 |
181 |
182 | studentCCourseColumnCode.setCellValueFactory(new PropertyValueFactory("courseTableDataCode"));
183 | studentCCourseColumnTitle.setCellValueFactory(new PropertyValueFactory("courseTableDataTitle"));
184 | studentCCourseColumnCredit.setCellValueFactory(new PropertyValueFactory("courseTableDataCredit"));
185 | studentCCourseColumnSec.setCellValueFactory(new PropertyValueFactory("courseTableDataSec"));
186 |
187 | studentCurrentCourseTableView.setItems(getDataFromCurrentCourseAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
188 |
189 | }
190 |
191 | @FXML
192 | private void setRegistrationRefreshClick(Event event){
193 | studentCurrentCourseTableView.setItems(getDataFromCurrentCourseAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
194 | studentAllCourseTableView.setItems(getDataFromAllCourseAndAddToObservableList("SELECT * FROM course;"));
195 | }
196 |
197 | @FXML
198 | private void setRegistrationTakeClick(Event event) throws Exception{
199 | RegistrationTableData getSelectedCourse = studentAllCourseTableView.getSelectionModel().getSelectedItem();
200 | ChooseASectionController chooseASectionController = new ChooseASectionController();
201 | chooseASectionController.setAllSection(getSelectedCourse.getCourseTableDataSec());
202 | courseCode = getSelectedCourse.getCourseTableDataCode();
203 |
204 |
205 | FXMLLoader loader = new FXMLLoader();
206 | loader.setLocation(getClass().getResource("/student/ChooseASection.fxml"));
207 | loader.load();
208 | Parent p = loader.getRoot();
209 | Stage stage = new Stage();
210 | stage.initModality(Modality.APPLICATION_MODAL);
211 | stage.initStyle(StageStyle.UTILITY);
212 | stage.setScene(new Scene(p));
213 | chooseASectionController.setStage(stage);
214 | stage.show();
215 |
216 | }
217 |
218 | @FXML
219 | private void setRegistrationDeleteClick(Event event) throws SQLException {
220 | RegistrationTableData getSelectedCourse = studentCurrentCourseTableView.getSelectionModel().getSelectedItem();
221 | String primaryCourse = null,finalCourse;
222 | connection = database.getConnection();
223 | statement = connection.createStatement();
224 | resultSet = statement.executeQuery("SELECT * FROM studentgpa where dbstudentgpaID = '"+ID+"';");
225 | while (resultSet.next()){
226 | primaryCourse = resultSet.getString("dbStudentgpaCurrentCourse");
227 | }
228 | finalCourse = getSelectedCourse.getCourseTableDataCode()+":"+getSelectedCourse.getCourseTableDataSec();
229 |
230 | if (!(primaryCourse.contains(","))){
231 | finalAllCourse="empty";
232 | }
233 | else if(primaryCourse.startsWith(finalCourse)){
234 | finalCourse=finalCourse+",";
235 | }
236 | else {
237 | finalCourse=","+finalCourse;
238 | }
239 | finalCourse = primaryCourse.replace(finalCourse,"");
240 | statement.executeUpdate("update studentgpa set dbStudentgpaCurrentCourse ='"+finalCourse+"' where dbstudentgpaID = '"+ID+"';");
241 | studentCurrentCourseTableView.setItems(getDataFromCurrentCourseAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
242 |
243 |
244 | }
245 |
246 | @FXML
247 | private void setRegistrationDoneClick(Event event){
248 | stage.close();
249 | tanother.setItems(getDataFromCurrentCourseAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
250 | }
251 |
252 | @FXML
253 | private void setRegistrationSearchClick(Event event){
254 | String sqlQuery = "select * FROM course where dbCourseCode = '"+registrationTFSearch.getText()+"';";
255 | studentAllCourseTableView.setItems(getDataFromAllCourseAndAddToObservableList(sqlQuery));
256 | registrationTFSearch.clear();
257 | }
258 |
259 | @FXML
260 | private void setCourseAboutButtonClick(Event event) throws IOException {
261 | menuBarControl.about();
262 | }
263 |
264 | @FXML
265 | private void setCourseCloseButtonClick(Event event){
266 | menuBarControl.close();
267 | }
268 |
269 |
270 |
271 | }
272 |
--------------------------------------------------------------------------------
/src/student/RegistrationTableData.java:
--------------------------------------------------------------------------------
1 | package student;
2 |
3 | import javafx.beans.property.SimpleIntegerProperty;
4 | import javafx.beans.property.SimpleStringProperty;
5 |
6 | /**
7 | * Created by Tanvir on 8/20/2016.
8 | */
9 | public class RegistrationTableData {
10 |
11 | private final SimpleStringProperty courseTableDataCode;
12 | private final SimpleStringProperty courseTableDataTitle;
13 | private final SimpleIntegerProperty courseTableDataCredit;
14 | private final SimpleStringProperty courseTableDataSec;
15 |
16 | public RegistrationTableData(String courseTableDataCode, String courseTableDataTitle, int courseTableDataCredit, String courseTableDataSec) {
17 | this.courseTableDataCode = new SimpleStringProperty(courseTableDataCode);
18 | this.courseTableDataTitle = new SimpleStringProperty(courseTableDataTitle);
19 | this.courseTableDataCredit = new SimpleIntegerProperty(courseTableDataCredit);
20 | this.courseTableDataSec = new SimpleStringProperty(courseTableDataSec);
21 | }
22 |
23 | public String getCourseTableDataCode() {
24 | return courseTableDataCode.get();
25 | }
26 |
27 | public SimpleStringProperty courseTableDataCodeProperty() {
28 | return courseTableDataCode;
29 | }
30 |
31 | public void setCourseTableDataCode(String courseTableDataCode) {
32 | this.courseTableDataCode.set(courseTableDataCode);
33 | }
34 |
35 | public String getCourseTableDataTitle() {
36 | return courseTableDataTitle.get();
37 | }
38 |
39 | public SimpleStringProperty courseTableDataTitleProperty() {
40 | return courseTableDataTitle;
41 | }
42 |
43 | public void setCourseTableDataTitle(String courseTableDataTitle) {
44 | this.courseTableDataTitle.set(courseTableDataTitle);
45 | }
46 |
47 | public int getCourseTableDataCredit() {
48 | return courseTableDataCredit.get();
49 | }
50 |
51 | public SimpleIntegerProperty courseTableDataCreditProperty() {
52 | return courseTableDataCredit;
53 | }
54 |
55 | public void setCourseTableDataCredit(int courseTableDataCredit) {
56 | this.courseTableDataCredit.set(courseTableDataCredit);
57 | }
58 |
59 | public String getCourseTableDataSec() {
60 | return courseTableDataSec.get();
61 | }
62 |
63 | public SimpleStringProperty courseTableDataSecProperty() {
64 | return courseTableDataSec;
65 | }
66 |
67 | public void setCourseTableDataSec(String courseTableDataSec) {
68 | this.courseTableDataSec.set(courseTableDataSec);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/student/Student.fxml:
--------------------------------------------------------------------------------
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 |
31 |
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
--------------------------------------------------------------------------------
/src/student/Student.java:
--------------------------------------------------------------------------------
1 | package student;
2 |
3 | import database.DBConnection;
4 | import javafx.collections.FXCollections;
5 | import javafx.collections.ObservableList;
6 | import javafx.event.Event;
7 | import javafx.fxml.FXML;
8 | import javafx.fxml.FXMLLoader;
9 | import javafx.scene.Parent;
10 | import javafx.scene.Scene;
11 | import javafx.scene.control.Button;
12 | import javafx.scene.control.TableColumn;
13 | import javafx.scene.control.TableView;
14 | import javafx.scene.control.TextField;
15 | import javafx.scene.control.cell.PropertyValueFactory;
16 | import javafx.stage.Modality;
17 | import javafx.stage.Stage;
18 | import javafx.stage.StageStyle;
19 | import menuBar.MenuBarControl;
20 | import profileView.Info;
21 | import profileView.ProfileView;
22 |
23 | import java.io.IOException;
24 | import java.sql.Connection;
25 | import java.sql.ResultSet;
26 | import java.sql.SQLException;
27 | import java.sql.Statement;
28 |
29 | /**
30 | * Created by Tanvir on 8/3/2016.
31 | */
32 | public class Student {
33 |
34 | @FXML
35 | TableView studentRunningCourseTableView;
36 | @FXML
37 | TableColumn studentRCourseColumnCode;
38 | @FXML
39 | TableColumn studentRCourseColumnTitle;
40 | @FXML
41 | TableColumn studentRCourseColumnCredit;
42 | @FXML
43 | TableColumn studentRCourseColumnSec;
44 |
45 |
46 | @FXML
47 | TableView resultHistoryTableView;
48 | @FXML
49 | TableColumn resultHistoryColumnCode;
50 | @FXML
51 | TableColumn resultHistoryColumnSec;
52 | @FXML
53 | TableColumn resultHistoryColumnGPA;
54 |
55 | @FXML
56 | TextField studentTFFname;
57 | @FXML
58 | TextField studentTFLname;
59 | @FXML
60 | TextField studentTFID;
61 | @FXML
62 | TextField studentTFEmail;
63 | @FXML
64 | TextField studentTFPhone;
65 | @FXML
66 | TextField studentTFGFname;
67 | @FXML
68 | TextField studentTFGLname;
69 | @FXML
70 | TextField studentTFAddress;
71 | @FXML
72 | TextField studentTFPassword;
73 | @FXML
74 | TextField studentTFPicChooser;
75 |
76 | @FXML
77 | Button studentSaveClick;
78 | @FXML
79 | Button studentCancelClick;
80 |
81 |
82 | private DBConnection database = new DBConnection();
83 | private Connection connection;
84 | private Statement statement;
85 | private ResultSet resultSet;
86 | RegistrationController registrationController;
87 |
88 | private MenuBarControl menuBarControl = new MenuBarControl();
89 |
90 | static String ID;
91 | public void setStudentId(String ID){
92 | this.ID = ID;
93 | }
94 |
95 |
96 |
97 | private ObservableList getDataFromResultHistoryAndAddToObservableList(String query) {
98 | ObservableList resultHistoryTableData = FXCollections.observableArrayList();
99 |
100 |
101 |
102 | try {
103 | connection = database.getConnection();
104 | statement = connection.createStatement();
105 | resultSet = statement.executeQuery(query);
106 |
107 | String columnNo = null;
108 | String[] devide = null,partPart = null;
109 | while (resultSet.next()){
110 | for (int i = 1; i < 16; i++) {
111 | columnNo = resultSet.getString("dbstudentgpa"+i+"thSem");
112 |
113 | String temp = "a"+columnNo;
114 | temp = temp.substring(1);
115 | if (temp.equals("null")||temp.isEmpty()){
116 | break;
117 | }
118 | else {
119 | devide = columnNo.split(",", 0);
120 | for (String s : devide) {
121 | partPart = s.split(":", 0);
122 | resultHistoryTableData.add(new resultHistoryTableData(partPart[0], partPart[1], partPart[2]));
123 | }
124 | }
125 |
126 | }
127 | }
128 |
129 |
130 |
131 |
132 | } catch (SQLException e) {
133 | e.printStackTrace();
134 | }
135 |
136 |
137 |
138 | return resultHistoryTableData;
139 | }
140 |
141 |
142 |
143 | private void setAllEnable(){
144 | studentTFFname.setDisable(false);
145 | studentTFLname.setDisable(false);
146 | //studentTFID.setDisable(false);
147 | studentTFEmail.setDisable(false);
148 | studentTFPhone.setDisable(false);
149 | studentTFGFname.setDisable(false);
150 | studentTFGLname.setDisable(false);
151 | studentTFAddress.setDisable(false);
152 | studentTFPassword.setDisable(false);
153 | studentTFPicChooser.setDisable(false);
154 |
155 | studentSaveClick.setDisable(false);
156 | studentCancelClick.setDisable(false);
157 | }
158 |
159 | private void setAllDisable(){
160 | studentTFFname.setDisable(true);
161 | studentTFLname.setDisable(true);
162 | //studentTFID.setDisable(true);
163 | studentTFEmail.setDisable(true);
164 | studentTFPhone.setDisable(true);
165 | studentTFGFname.setDisable(true);
166 | studentTFGLname.setDisable(true);
167 | studentTFAddress.setDisable(true);
168 | studentTFPassword.setDisable(true);
169 | studentTFPicChooser.setDisable(true);
170 |
171 | studentSaveClick.setDisable(true);
172 | studentCancelClick.setDisable(true);
173 | }
174 |
175 | private void setAllClear(){
176 | studentTFFname.clear();
177 | studentTFLname.clear();
178 | studentTFID.clear();
179 | studentTFEmail.clear();
180 | studentTFPhone.clear();
181 | studentTFGFname.clear();
182 | studentTFGLname.clear();
183 | studentTFAddress.clear();
184 | studentTFPassword.clear();
185 | studentTFPassword.clear();
186 | studentTFPicChooser.clear();
187 | }
188 |
189 | @FXML
190 | private void setStudentEditProfileClick(Event event){
191 | setAllEnable();
192 | String sqlQuery = "select * FROM student where dbStudentID = '"+ID+"';";
193 | try {
194 | connection = database.getConnection();
195 | statement = connection.createStatement();
196 | resultSet = statement.executeQuery(sqlQuery);
197 | while(resultSet.next()) {
198 | studentTFFname.setText(resultSet.getString("dbStudentFname"));
199 | studentTFLname.setText(resultSet.getString("dbStudentLname"));
200 | studentTFID.setText(resultSet.getString("dbStudentID"));
201 | studentTFEmail.setText(resultSet.getString("dbStudentEmail"));
202 | studentTFPassword.setText(resultSet.getString("dbStudentPassword"));
203 | studentTFPhone.setText(resultSet.getString("dbStudentPhone"));
204 | studentTFAddress.setText(resultSet.getString("dbStudentAddress"));
205 | studentTFGFname.setText(resultSet.getString("dbGuardianFname"));
206 | studentTFGLname.setText(resultSet.getString("dbGuardianLname"));
207 | }
208 |
209 | } catch (SQLException e) {
210 | e.printStackTrace();
211 | }
212 |
213 | }
214 |
215 | @FXML
216 | private void setStudentViewProfileClick(Event event) throws IOException {
217 |
218 | Info info = new Info(ID);
219 | FXMLLoader loader = new FXMLLoader();
220 | loader.setLocation(getClass().getResource("/profileView/profileView.fxml"));
221 | loader.load();
222 | Parent p = loader.getRoot();
223 | Stage stage = new Stage();
224 | stage.setScene(new Scene(p));
225 |
226 | ProfileView profileView = loader.getController();
227 | profileView.setCurrentInfo(info);
228 | stage.show();
229 | }
230 |
231 | @FXML
232 | private void setStudentCancelClick(Event event){
233 | setAllDisable();
234 | setAllClear();
235 | }
236 |
237 | @FXML
238 | private void setStudentSaveClick(Event event){
239 | try {
240 | connection = database.getConnection();
241 | statement = connection.createStatement();
242 |
243 | int rowsAffected = statement.executeUpdate("update student set "+
244 | "dbStudentFname = '"+studentTFFname.getText()+"',"+
245 | "dbStudentLname = '"+studentTFLname.getText()+"',"+
246 | "dbStudentID = '"+studentTFID.getText()+"',"+
247 | "dbStudentEmail = '"+studentTFEmail.getText()+"',"+
248 | "dbStudentPassword = '"+studentTFPassword.getText()+"',"+
249 | "dbStudentPhone = '"+studentTFPhone.getText()+"',"+
250 | "dbStudentAddress = '"+studentTFAddress.getText()+"',"+
251 | "dbGuardianFname = '"+studentTFGFname.getText()+"',"+
252 | "dbGuardianLname = '"+studentTFGLname.getText()+
253 | "' where dbStudentID = '"+
254 | ID+"';");
255 |
256 | connection.close();
257 | statement.close();
258 |
259 | } catch (SQLException e) {
260 | e.printStackTrace();
261 | }
262 | setAllClear();
263 | setAllDisable();
264 |
265 | }
266 |
267 | @FXML
268 | private void setStudentRegistrationClick(Event event)throws IOException{
269 | RegistrationController re = new RegistrationController();
270 | re.setID(ID);
271 | FXMLLoader loader = new FXMLLoader();
272 | loader.setLocation(getClass().getResource("/student/Registration.fxml"));
273 | loader.load();
274 | Parent p = loader.getRoot();
275 | Stage stage = new Stage();
276 | stage.setScene(new Scene(p));
277 | stage.setResizable(false);
278 | stage.initModality(Modality.APPLICATION_MODAL);
279 | RegistrationController registrationController = new RegistrationController();
280 | registrationController.setStage(stage);
281 | registrationController.setTanother(studentRunningCourseTableView);
282 | stage.show();
283 |
284 | }
285 |
286 | @FXML
287 | private void initialize(){
288 | studentRCourseColumnCode.setCellValueFactory(new PropertyValueFactory("courseTableDataCode"));
289 | studentRCourseColumnTitle.setCellValueFactory(new PropertyValueFactory("courseTableDataTitle"));
290 | studentRCourseColumnCredit.setCellValueFactory(new PropertyValueFactory("courseTableDataCredit"));
291 | studentRCourseColumnSec.setCellValueFactory(new PropertyValueFactory("courseTableDataSec"));
292 |
293 | registrationController = new RegistrationController();
294 | studentRunningCourseTableView.setItems(registrationController.getDataFromCurrentCourseAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
295 |
296 |
297 | resultHistoryColumnCode.setCellValueFactory(new PropertyValueFactory("resultHistoryTableCourseCode"));
298 | resultHistoryColumnSec.setCellValueFactory(new PropertyValueFactory("resultHistoryTableSec"));
299 | resultHistoryColumnGPA.setCellValueFactory(new PropertyValueFactory("resultHistoryTableGPA"));
300 |
301 | resultHistoryTableView.setItems(getDataFromResultHistoryAndAddToObservableList("SELECT * FROM studentgpa WHERE dbstudentgpaID = '"+ID+"';"));
302 |
303 | }
304 |
305 |
306 | @FXML
307 | private void setCourseAboutButtonClick(Event event) throws IOException {
308 | menuBarControl.about();
309 | }
310 |
311 | @FXML
312 | private void setCourseCloseButtonClick(Event event){
313 | menuBarControl.close();
314 | }
315 |
316 |
317 |
318 |
319 | }
320 |
--------------------------------------------------------------------------------
/src/student/resultHistoryTableData.java:
--------------------------------------------------------------------------------
1 | package student;
2 |
3 | import javafx.beans.property.SimpleStringProperty;
4 |
5 | /**
6 | * Created by Tanvir on 8/25/2016.
7 | */
8 | public class resultHistoryTableData {
9 | private final SimpleStringProperty resultHistoryTableCourseCode;
10 | private final SimpleStringProperty resultHistoryTableSec;
11 | private final SimpleStringProperty resultHistoryTableGPA;
12 |
13 | public resultHistoryTableData(String resultHistoryTableCourseCode, String resultHistoryTableSec, String resultHistoryTableGPA) {
14 | this.resultHistoryTableCourseCode = new SimpleStringProperty(resultHistoryTableCourseCode);
15 | this.resultHistoryTableSec = new SimpleStringProperty(resultHistoryTableSec);
16 | this.resultHistoryTableGPA = new SimpleStringProperty(resultHistoryTableGPA);
17 | }
18 |
19 | public String getResultHistoryTableCourseCode() {
20 | return resultHistoryTableCourseCode.get();
21 | }
22 |
23 | public SimpleStringProperty resultHistoryTableCourseCodeProperty() {
24 | return resultHistoryTableCourseCode;
25 | }
26 |
27 | public void setResultHistoryTableCourseCode(String resultHistoryTableCourseCode) {
28 | this.resultHistoryTableCourseCode.set(resultHistoryTableCourseCode);
29 | }
30 |
31 | public String getResultHistoryTableSec() {
32 | return resultHistoryTableSec.get();
33 | }
34 |
35 | public SimpleStringProperty resultHistoryTableSecProperty() {
36 | return resultHistoryTableSec;
37 | }
38 |
39 | public void setResultHistoryTableSec(String resultHistoryTableSec) {
40 | this.resultHistoryTableSec.set(resultHistoryTableSec);
41 | }
42 |
43 | public String getResultHistoryTableGPA() {
44 | return resultHistoryTableGPA.get();
45 | }
46 |
47 | public SimpleStringProperty resultHistoryTableGPAProperty() {
48 | return resultHistoryTableGPA;
49 | }
50 |
51 | public void setResultHistoryTableGPA(String resultHistoryTableGPA) {
52 | this.resultHistoryTableGPA.set(resultHistoryTableGPA);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/teacher/Teacher.fxml:
--------------------------------------------------------------------------------
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 |
33 |
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 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
129 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/src/teacher/TeacherTableData.java:
--------------------------------------------------------------------------------
1 | package teacher;
2 |
3 | import javafx.beans.property.SimpleStringProperty;
4 |
5 | /**
6 | * Created by Tanvir on 8/21/2016.
7 | */
8 | public class TeacherTableData {
9 | private final SimpleStringProperty teacherTableDataID;
10 | private final SimpleStringProperty teacherTableDataName;
11 | private final SimpleStringProperty teacherTableDataGPA;
12 | private final SimpleStringProperty teacherTableDataPhone;
13 | private final SimpleStringProperty teacherTableDataEmail;
14 |
15 | public TeacherTableData(String teacherTableDataID, String teacherTableDataName, String teacherTableDataGPA, String teacherTableDataPhone, String teacherTableDataEmail) {
16 | this.teacherTableDataID = new SimpleStringProperty(teacherTableDataID);
17 | this.teacherTableDataName = new SimpleStringProperty(teacherTableDataName);
18 | this.teacherTableDataGPA = new SimpleStringProperty(teacherTableDataGPA);
19 | this.teacherTableDataPhone = new SimpleStringProperty(teacherTableDataPhone);
20 | this.teacherTableDataEmail = new SimpleStringProperty(teacherTableDataEmail);
21 | }
22 |
23 | public String getTeacherTableDataID() {
24 | return teacherTableDataID.get();
25 | }
26 |
27 | public SimpleStringProperty teacherTableDataIDProperty() {
28 | return teacherTableDataID;
29 | }
30 |
31 | public void setTeacherTableDataID(String teacherTableDataID) {
32 | this.teacherTableDataID.set(teacherTableDataID);
33 | }
34 |
35 | public String getTeacherTableDataName() {
36 | return teacherTableDataName.get();
37 | }
38 |
39 | public SimpleStringProperty teacherTableDataNameProperty() {
40 | return teacherTableDataName;
41 | }
42 |
43 | public void setTeacherTableDataName(String teacherTableDataName) {
44 | this.teacherTableDataName.set(teacherTableDataName);
45 | }
46 |
47 | public String getTeacherTableDataGPA() {
48 | return teacherTableDataGPA.get();
49 | }
50 |
51 | public SimpleStringProperty teacherTableDataGPAProperty() {
52 | return teacherTableDataGPA;
53 | }
54 |
55 | public void setTeacherTableDataGPA(String teacherTableDataGPA) {
56 | this.teacherTableDataGPA.set(teacherTableDataGPA);
57 | }
58 |
59 | public String getTeacherTableDataPhone() {
60 | return teacherTableDataPhone.get();
61 | }
62 |
63 | public SimpleStringProperty teacherTableDataPhoneProperty() {
64 | return teacherTableDataPhone;
65 | }
66 |
67 | public void setTeacherTableDataPhone(String teacherTableDataPhone) {
68 | this.teacherTableDataPhone.set(teacherTableDataPhone);
69 | }
70 |
71 | public String getTeacherTableDataEmail() {
72 | return teacherTableDataEmail.get();
73 | }
74 |
75 | public SimpleStringProperty teacherTableDataEmailProperty() {
76 | return teacherTableDataEmail;
77 | }
78 |
79 | public void setTeacherTableDataEmail(String teacherTableDataEmail) {
80 | this.teacherTableDataEmail.set(teacherTableDataEmail);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/uiuStudentRecordSystem.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------