Guest User

Untitled

a guest
Jan 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.98 KB | None | 0 0
  1. package tele.communication.system.application;
  2.  
  3. /**
  4. *
  5. * @author HAROLD FINCH
  6. */
  7. //import static com.sun.corba.se.impl.util.Utility.printStackTrace;
  8. import java.sql.CallableStatement;
  9. import java.sql.Connection;
  10. import java.sql.PreparedStatement;
  11. import java.sql.ResultSet;
  12. import java.sql.SQLException;
  13. import java.util.logging.Level;
  14. import java.util.logging.Logger;
  15. import javafx.application.Application;
  16. import javafx.beans.value.ObservableValue;
  17. import javafx.scene.Group;
  18. import javafx.scene.Scene;
  19. import javafx.scene.control.Button;
  20. import javafx.scene.control.PasswordField;
  21. import javafx.scene.control.RadioButton;
  22. import javafx.scene.control.TextField;
  23. import javafx.scene.control.Toggle;
  24. import javafx.scene.control.ToggleGroup;
  25. import javafx.scene.image.Image;
  26. import javafx.scene.image.ImageView;
  27. import javafx.scene.input.KeyEvent;
  28. import javafx.scene.input.MouseEvent;
  29. import javafx.scene.paint.Color;
  30. import javafx.scene.shape.Rectangle;
  31. import javafx.scene.text.Font;
  32. import javafx.scene.text.Text;
  33. import javafx.stage.Modality;
  34. import javafx.stage.Stage;
  35. import javafx.util.Duration;
  36. import org.controlsfx.control.Notifications;
  37.  
  38. public class Employee_UI extends Application {
  39.  
  40. public static Stage stage;
  41. public static Stage stage2;
  42. public static Group root;
  43. public static Scene scene;
  44. public static String name;
  45. public static String Job_ID;
  46. public static String passcode;
  47. public String jobtype;
  48. public String nid1;
  49. public String nid2;
  50. public String street;
  51. public String mail;
  52. public String city;
  53. ResultSet rs;
  54. Connection con;
  55. PreparedStatement pst;
  56.  
  57. @Override
  58. public void start(Stage primaryStage) throws Exception {
  59. stage = primaryStage;
  60. stage.initModality(Modality.APPLICATION_MODAL);
  61. LoginScene();
  62. }
  63.  
  64. public void go() throws Exception {
  65. stage2 = new Stage();
  66. start(stage2);
  67. }
  68.  
  69. public static void BackSceneOnly() {
  70. root = new Group();
  71. //Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
  72. scene = new Scene(root, 1800, 900);
  73. scene.setFill(Color.rgb(255, 255, 255));//rgb(red, green, blue) // 396490 - torrentbd blue // 00666a torrentbd green
  74. }
  75.  
  76. public static void StageShow() {
  77. stage.setTitle("EMPLOYEE UI");
  78. stage.setScene(scene);
  79. Image logo = new Image("file:comlogo.png");
  80. stage.getIcons().add(logo);
  81. stage.show();
  82. }
  83.  
  84. private void LoginScene() {
  85. int posX = 350, posY = 300;
  86. int textFieldPosX = posX + 455, textFieldPosY = posY - 20;
  87. BackSceneOnly();
  88. ImageView toppart = new ImageView("file:tbdgreen.png");
  89. ImageView tbdlogin = new ImageView("file:tbdlogin.jpg");
  90. name = new String();
  91. passcode = new String();
  92. TextField username = new TextField();
  93. username.setLayoutX(textFieldPosX);
  94. username.setLayoutY(textFieldPosY);
  95. username.setScaleX(2.65);
  96. username.setScaleY(2);
  97. PasswordField password = new PasswordField();
  98. password.setLayoutX(textFieldPosX);
  99. password.setLayoutY(textFieldPosY + 100);
  100. password.setScaleX(2.65);
  101. password.setScaleY(2);
  102. Rectangle loginBox = new Rectangle(480, 45);
  103. loginBox.setFill(Color.rgb(32, 155, 146));
  104. loginBox.setX(660);
  105. loginBox.setY(482);
  106. Rectangle applyBox = new Rectangle(680, 75);
  107. applyBox.setX(560);
  108. applyBox.setY(582);
  109. applyBox.setFill(Color.rgb(32, 155, 146));
  110. Text applytext = new Text(750, 635, "APPLY FOR A JOB");
  111. applytext.setFont(Font.font(40));
  112. applytext.setFill(Color.WHITE);
  113. applyBox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  114. applyBox.setFill(Color.rgb(17, 119, 112));
  115. });
  116. applytext.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  117. applyBox.setFill(Color.rgb(17, 119, 112));
  118. });
  119. applytext.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  120. applyBox.setFill(Color.rgb(32, 155, 146));
  121. });
  122. applyBox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  123. applyBox.setFill(Color.rgb(32, 155, 146));
  124. });
  125. applyBox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  126. signupscene();
  127. });
  128. Text login = new Text(850, 515, "LOG IN");
  129. login.setFont(Font.font(30));
  130. login.setFill(Color.WHITE);
  131. loginBox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  132. loginBox.setFill(Color.rgb(17, 119, 112));
  133. });
  134. login.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  135. loginBox.setFill(Color.rgb(17, 119, 112));
  136. });
  137. loginBox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  138. loginBox.setFill(Color.rgb(32, 155, 146));
  139. });
  140. loginBox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  141. continueLogIn(username, password);
  142. });
  143. scene.setOnKeyPressed((KeyEvent event) -> {
  144. switch (event.getCode()) {
  145. case ENTER:
  146. continueLogIn(username, password);
  147. break;
  148. }
  149. });
  150. root.getChildren().add(tbdlogin);
  151. root.getChildren().add(toppart);
  152. root.getChildren().add(loginBox);
  153. root.getChildren().add(username);
  154. root.getChildren().add(password);
  155. root.getChildren().add(login);
  156. root.getChildren().add(applyBox);
  157. root.getChildren().add(applytext);
  158. StageShow();
  159. }
  160.  
  161. public void continueLogIn(TextField username, PasswordField password) {
  162. name = username.getText();
  163. passcode = password.getText();
  164. String sql = "SELECT * FROM EMPLOYEES WHERE EMPLOYEE_NAME = ? AND NID_NO = ?";
  165. try {
  166. con = new DataBase("TELECOM", "hr").getConnection();
  167. pst = con.prepareStatement(sql);
  168. pst.setString(1, name);
  169. pst.setString(2, passcode);
  170. rs = pst.executeQuery();
  171. if (rs.next()) {
  172. System.out.println("success");
  173. SuccessMsg("Success", "LogIn Successful");
  174. pst.close();
  175. con.close();
  176. LogIn(name, passcode);
  177. } else {
  178. InvalidLogInMsg("Failed", "Invalid Log In");
  179. }
  180. } catch (SQLException ex) {
  181. System.out.println("doesn,t work");
  182. }
  183. }
  184.  
  185. private void signupscene() {
  186. BackSceneOnly();
  187. ImageView back = new ImageView("file:mainback.jpg");
  188. root.getChildren().add(back);
  189. int posX = 100, posY = 185, diffy = 42, i = 1;
  190. int tx = posX + 350, ty = posY - 20;
  191. Text fillform = new Text("FILL THE FOLLOWING FIELDS CORRECTLY");
  192. fillform.setX(50);
  193. fillform.setY(posY - 15);
  194. fillform.setFont(Font.font(30));
  195. fillform.setFill(Color.rgb(255, 255, 255));
  196. root.getChildren().add(fillform);
  197. Text backtext = new Text("BACK");
  198. backtext.setX(1670);
  199. backtext.setY(posY - 15);
  200. backtext.setFont(Font.font(30));
  201. backtext.setFill(Color.rgb(0, 0, 0));
  202. root.getChildren().add(backtext);
  203. Text Name = new Text("NAME : ");
  204. SetThisText(Name, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  205. TextField fName = new TextField();
  206. SetThisField(fName, tx, ty + (diffy * (i - 1)));
  207. Text fn = new Text("FATHER'S NAME : ");
  208. SetThisText(fn, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  209. TextField ffn = new TextField();
  210. SetThisField(ffn, tx, ty + (diffy * (i - 1)));
  211. Text mn = new Text("MOTHER'S NAME : ");
  212. SetThisText(mn, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  213. TextField fmn = new TextField();
  214. SetThisField(fmn, tx, ty + (diffy * (i - 1)));
  215. Text bd = new Text("BIRTH DATE (MMM DD, YYYY): ");
  216. SetThisText(bd, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  217. TextField fbd = new TextField();
  218. SetThisField(fbd, tx, ty + (diffy * (i - 1)));
  219. Text st = new Text("STREET ADDRESS : ");
  220. SetThisText(st, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  221. TextField fst = new TextField();
  222. SetThisField(fst, tx, ty + (diffy * (i - 1)));
  223. Text ct = new Text("CITY : ");
  224. SetThisText(ct, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  225. TextField fct = new TextField();
  226. SetThisField(fct, tx, ty + (diffy * (i - 1)));
  227. Text nid = new Text("NID : ");
  228. SetThisText(nid, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  229. TextField fnid = new TextField();
  230. SetThisField(fnid, tx, ty + (diffy * (i - 1)));
  231. Text mail = new Text("EMAIL : ");
  232. SetThisText(mail, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  233. TextField fmail = new TextField();
  234. SetThisField(fmail, tx, ty + (diffy * (i - 1)));
  235. Text acc = new Text("ACC NO : ");
  236. SetThisText(acc, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  237. TextField facc = new TextField();
  238. SetThisField(facc, tx, ty + (diffy * (i - 1)));
  239. Text ssc = new Text("SSC PASSING YEAR : ");
  240. SetThisText(ssc, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  241. TextField fssc = new TextField();
  242. SetThisField(fssc, tx, ty + (diffy * (i - 1)));
  243. Text sscg = new Text("GPA OF SSC : ");
  244. SetThisText(sscg, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  245. TextField fsscg = new TextField();
  246. SetThisField(fsscg, tx, ty + (diffy * (i - 1)));
  247. Text hsc = new Text("HSC PASSING YEAR : ");
  248. SetThisText(hsc, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  249. TextField fhsc = new TextField();
  250. SetThisField(fhsc, tx, ty + (diffy * (i - 1)));
  251. Text hscg = new Text("GPA OF HSC : ");
  252. SetThisText(hscg, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  253. TextField fhscg = new TextField();
  254. SetThisField(fhscg, tx, ty + (diffy * (i - 1)));
  255. Text uni = new Text("UNIVERSITY : ");
  256. SetThisText(uni, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  257. TextField funi = new TextField();
  258. SetThisField(funi, tx, ty + (diffy * (i - 1)));
  259. Text unicg = new Text("CGPA OF UNIVERSITY : ");
  260. SetThisText(unicg, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  261. TextField funicg = new TextField();
  262. SetThisField(funicg, tx, ty + (diffy * (i - 1)));
  263. Text exp = new Text("EXPERIENCE : ");
  264. SetThisText(exp, posX, posY + (diffy * (i++)), 20, Color.BLACK);
  265. TextField fexp = new TextField();
  266. SetThisField(fexp, tx, ty + (diffy * (i - 1)));
  267. Text jt = new Text("DESIRED JOB TYPE : ");
  268. SetThisText(jt, posX + 800, posY + 42, 20, Color.BLACK);
  269. final ToggleGroup p = new ToggleGroup();
  270. RadioButton rb1 = new RadioButton("ADMINISTRATOR");
  271. rb1.setToggleGroup(p);
  272. rb1.setFont(Font.font(20));
  273. rb1.setUserData("101");
  274. rb1.setLayoutX(posX + 1000);
  275. rb1.setLayoutY(posY + 20);
  276. RadioButton rb2 = new RadioButton("ENGINEER");
  277. rb2.setToggleGroup(p);
  278. rb2.setFont(Font.font(20));
  279. rb2.setUserData("102");
  280. rb2.setLayoutX(posX + 1000);
  281. rb2.setLayoutY(posY + 60);
  282. RadioButton rb3 = new RadioButton("HUMAN RESOURCES REPRESENTATIVE");
  283. rb3.setToggleGroup(p);
  284. rb3.setFont(Font.font(20));
  285. rb3.setUserData("103");
  286. rb3.setLayoutX(posX + 1000);
  287. rb3.setLayoutY(posY + 100);
  288. RadioButton rb4 = new RadioButton("ACCOUNTING MANAGER");
  289. rb4.setToggleGroup(p);
  290. rb4.setFont(Font.font(20));
  291. rb4.setUserData("104");
  292. rb4.setLayoutX(posX + 1000);
  293. rb4.setLayoutY(posY + 140);
  294. RadioButton rb5 = new RadioButton("CUSTOMER CARE");
  295. rb5.setToggleGroup(p);
  296. rb5.setFont(Font.font(20));
  297. rb5.setUserData("105");
  298. rb5.setLayoutX(posX + 1000);
  299. rb5.setLayoutY(posY + 180);
  300. p.selectedToggleProperty().addListener((ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) -> {
  301. if (p.getSelectedToggle() != null) {
  302. jobtype = new String();
  303. jobtype = p.getSelectedToggle().getUserData().toString();
  304. }
  305. });
  306. root.getChildren().add(rb1);
  307. root.getChildren().add(rb2);
  308. root.getChildren().add(rb3);
  309. root.getChildren().add(rb4);
  310. root.getChildren().add(rb5);
  311. ImageView backpage = new ImageView("file:previous.png");
  312. backpage.setX(1600);
  313. backpage.setY(130);
  314. backpage.setFitHeight(60);
  315. backpage.setFitWidth(60);
  316. root.getChildren().add(backpage);
  317. Rectangle backbox = new Rectangle(155, 50);
  318. backbox.setFill(Color.rgb(0, 0, 0, 0));
  319. backbox.setX(1600);
  320. backbox.setY(135);
  321. root.getChildren().add(backbox);
  322. backbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  323. backtext.setFont(Font.font(40));
  324. backtext.setX(1665);
  325. backtext.setY(posY - 12);
  326. });
  327. backbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  328. backtext.setFont(Font.font(30));
  329. backtext.setX(1670);
  330. backtext.setY(posY - 15);
  331. });
  332. backbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  333. LoginScene();
  334. });
  335. Text applytext = new Text("APPLY");
  336. applytext.setX(1130);
  337. applytext.setY(450);
  338. applytext.setFill(Color.WHITE);
  339. applytext.setFont(Font.font(35));
  340. Rectangle applyboxdown = new Rectangle(150, 50);
  341. applyboxdown.setFill(Color.rgb(32, 155, 146));
  342. applyboxdown.setX(1105);
  343. applyboxdown.setY(412);
  344. Rectangle applyboxup = new Rectangle(150, 50);
  345. applyboxup.setFill(Color.rgb(0, 0, 0, 0));
  346. applyboxup.setX(1105);
  347. applyboxup.setY(412);
  348. applyboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  349. applyboxdown.setFill(Color.rgb(17, 119, 112));
  350. });
  351. applyboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  352. applyboxdown.setFill(Color.rgb(32, 155, 146));
  353. });
  354. applyboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  355. String sql = "INSERT INTO PENDING_JOB_REQ (EMP_NAME,FATHER_NAME,"
  356. + "MOTHER_NAME,BIRTH_DATE,STREET_ADDRESS,CITY,NID_NO,"
  357. + "EMAIL,ACC_NO,SSC_YEAR,SSC_GPA,HSC_YEAR,HSC_GPA,UNIVERSITY,"
  358. + "CGPA,EXPERIENCE,JOB_ID) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  359. try {
  360. con = new DataBase("TELECOM", "hr").getConnection();
  361. pst = con.prepareStatement(sql);
  362. System.out.println(fName.getText());
  363. pst.setString(1, fName.getText());
  364. pst.setString(2, ffn.getText());
  365. pst.setString(3, fmn.getText());
  366. pst.setString(4, fbd.getText());
  367. pst.setString(5, fst.getText());
  368. pst.setString(6, fct.getText());
  369. pst.setString(7, fnid.getText());
  370. pst.setString(8, fmail.getText());
  371. pst.setString(9, facc.getText());
  372. pst.setString(10, fssc.getText());
  373. pst.setString(11, fsscg.getText());
  374. pst.setString(12, fhsc.getText());
  375. pst.setString(13, fhscg.getText());
  376. pst.setString(14, funi.getText());
  377. pst.setString(15, funicg.getText());
  378. pst.setString(16, fexp.getText());
  379. pst.setString(17, jobtype);
  380. pst.executeQuery();
  381. SuccessMsg("Success", "Successfully Applied for the job");
  382. pst.close();
  383. con.close();
  384. } catch (SQLException ex) {
  385. InvalidLogInMsg("Failed", "Wrong Credential");
  386. //printStackTrace();
  387. }
  388. });
  389. ImageView toppart = new ImageView("file:tbdgreen.png");
  390. root.getChildren().add(toppart);
  391. root.getChildren().add(applyboxdown);
  392. root.getChildren().add(applytext);
  393. root.getChildren().add(applyboxup);
  394. StageShow();
  395. }
  396.  
  397. public void LogIn(String User_Name, String NID_No) {
  398. BackSceneOnly();
  399. ImageView back = new ImageView("file:mainback.jpg");
  400. root.getChildren().add(back);
  401. int move = 175;
  402. double tabpaneX = 45, tabpaneY = 150;
  403.  
  404. Profile(User_Name, NID_No); // HomePage of User = User Profile
  405. ImageView profileimg = new ImageView("file:profile.png");
  406. root.getChildren().add(profileimg);
  407. profileimg.relocate(tabpaneX, tabpaneY);
  408. profileimg.setFitHeight(40);
  409. profileimg.setFitWidth(160);
  410. Text profiletext = new Text("PROFILE");
  411. SetThisText(profiletext, 85, 175, 20);
  412. Rectangle profilebox = new Rectangle(150, 40);
  413. SetThisBox(profilebox, 50, 170);
  414. //profilebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {profilebox.setFill(Color.rgb(255, 255, 255, 0.1));});
  415. //profilebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {profilebox.setFill(Color.rgb(255, 255, 255, 0));});
  416. profilebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  417. Profile(User_Name, NID_No);
  418. root.getChildren().add(profileimg);
  419. root.getChildren().remove(profiletext);
  420. root.getChildren().add(profiletext);
  421. });
  422. ImageView approveimg = new ImageView("file:profile.png");
  423. //root.getChildren().add(logoutimg);
  424. approveimg.relocate(tabpaneX + (move * 1), tabpaneY);
  425. approveimg.setFitHeight(40);
  426. approveimg.setFitWidth(160);
  427. Text approvetext = new Text("ISSUE SIM");
  428. SetThisText(approvetext, 80 + (move * 1), 175, 20);
  429. Rectangle approvebox = new Rectangle(150, 40);
  430. SetThisBox(approvebox, 50 + (move * 1), 170);
  431. approvebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  432. approvebox.setFill(Color.rgb(255, 255, 255, 0.1));
  433. });
  434. approvebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  435. approvebox.setFill(Color.rgb(255, 255, 255, 0));
  436. });
  437. approvebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  438. try {
  439. ApproveScene(User_Name, NID_No);
  440. } catch (SQLException ex) {
  441. Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  442. }
  443. });
  444. ImageView jobapproveimg = new ImageView("file:profile.png");
  445. //root.getChildren().add(logoutimg);
  446. jobapproveimg.relocate(tabpaneX + (move * 2), tabpaneY);
  447. jobapproveimg.setFitHeight(40);
  448. jobapproveimg.setFitWidth(160);
  449. Text jobapprovetext = new Text("JOB REQ");
  450. SetThisText(jobapprovetext, 80 + (move * 2), 175, 20);
  451. Rectangle jobapprovebox = new Rectangle(150, 40);
  452. SetThisBox(jobapprovebox, 50 + (move * 2), 170);
  453. jobapprovebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  454. jobapprovebox.setFill(Color.rgb(255, 255, 255, 0.1));
  455. });
  456. jobapprovebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  457. jobapprovebox.setFill(Color.rgb(255, 255, 255, 0));
  458. });
  459. jobapprovebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  460. try {
  461. jobApproveScene(User_Name, NID_No);
  462. } catch (SQLException ex) {
  463. Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  464. }
  465. });
  466. ImageView logoutimg = new ImageView("file:profile.png");
  467. //root.getChildren().add(logoutimg);
  468. logoutimg.relocate(tabpaneX + (move * 3), tabpaneY);
  469. logoutimg.setFitHeight(40);
  470. logoutimg.setFitWidth(160);
  471. Text logouttext = new Text("LOG OUT");
  472. SetThisText(logouttext, 85 + (move * 3), 175, 20);
  473. Rectangle logoutbox = new Rectangle(150, 40);
  474. SetThisBox(logoutbox, 50 + (move * 3), 170);
  475. logoutbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  476. logoutbox.setFill(Color.rgb(255, 255, 255, 0.1));
  477. });
  478. logoutbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  479. logoutbox.setFill(Color.rgb(255, 255, 255, 0));
  480. });
  481. logoutbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> LogOut());
  482. ImageView toppart = new ImageView("file:tbdgreen.png");
  483. root.getChildren().add(toppart);
  484. StageShow();
  485. }
  486.  
  487. void LogOut() {
  488. LoginScene();
  489. SuccessMsg("Success", "Log Out Successful");
  490. }
  491.  
  492. public void Profile(String User_Name, String NID_No) {
  493. userprofile(User_Name, NID_No);
  494. empprofile(User_Name, NID_No);
  495. }
  496.  
  497. public void userprofile(String User_Name, String NID_No) {
  498. try {
  499. String sql = "SELECT * FROM USER_DATA WHERE USER_NAME = ? AND NID_NO = ?";
  500. int posX = 100, posY = 270, fonts = 20;
  501. con = new DataBase("TELECOM", "hr").getConnection();
  502. pst = con.prepareStatement(sql);
  503. pst.setString(1, User_Name);
  504. pst.setString(2, NID_No);
  505. rs = pst.executeQuery();
  506. rs.next();
  507. Text Name = new Text("USER NAME : " + rs.getString(1));
  508. Name.setX(posX);
  509. Name.setY(posY);
  510. Name.setFont(Font.font(fonts));
  511. Name.setFill(Color.rgb(0, 0, 0));
  512. Text nid = new Text("NID NO : " + rs.getString(2));
  513. nid.setX(posX);
  514. nid.setY(posY + 50);
  515. nid.setFont(Font.font(fonts));
  516. nid.setFill(Color.rgb(0, 0, 0));
  517. Text db = new Text("DATE OF BIRTH (MMM DD, YYYY) : " + rs.getString(3));
  518. db.setX(posX);
  519. db.setY(posY + 100);
  520. db.setFont(Font.font(fonts));
  521. db.setFill(Color.rgb(0, 0, 0));
  522. Text fn = new Text("FATHER'S NAME : " + rs.getString(4));
  523. fn.setX(posX);
  524. fn.setY(posY + 150);
  525. fn.setFont(Font.font(fonts));
  526. fn.setFill(Color.rgb(0, 0, 0));
  527. Text mn = new Text("MOTHER'S NAME : " + rs.getString(5));
  528. mn.setX(posX);
  529. mn.setY(posY + 200);
  530. mn.setFont(Font.font(fonts));
  531. mn.setFill(Color.rgb(0, 0, 0));
  532. Text add = new Text("ADRESS : " + rs.getString(6));
  533. add.setX(posX);
  534. add.setY(posY + 250);
  535. add.setFont(Font.font(fonts));
  536. add.setFill(Color.rgb(0, 0, 0));
  537. Text ct = new Text("CITY : " + rs.getString(7));
  538. ct.setX(posX);
  539. ct.setY(posY + 300);
  540. ct.setFont(Font.font(fonts));
  541. ct.setFill(Color.rgb(0, 0, 0));
  542. Text type;
  543. if (rs.getString(8).equals("NO")) {
  544. type = new Text("User Type: " + "Not Employee");
  545. } else {
  546. type = new Text("User Type: " + "Employee");
  547. }
  548. type.setFont(Font.font(fonts));
  549. type.setX(posX);
  550. type.setY(posY + 350);
  551. type.setFill(Color.rgb(0, 0, 0));
  552.  
  553. Text applytext = new Text("APPLY");
  554. applytext.setX(posX + 25);
  555. applytext.setY(posY + 450);
  556. applytext.setFill(Color.WHITE);
  557. applytext.setFont(Font.font(35));
  558. Rectangle applyboxdown = new Rectangle(150, 50);
  559. applyboxdown.setFill(Color.rgb(32, 155, 146));
  560. applyboxdown.setX(posX);
  561. applyboxdown.setY(posY + 412);
  562. Rectangle applyboxup = new Rectangle(150, 50);
  563. applyboxup.setFill(Color.rgb(0, 0, 0, 0));
  564. applyboxup.setX(posX);
  565. applyboxup.setY(posY + 412);
  566. applyboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  567. applyboxdown.setFill(Color.rgb(17, 119, 112));
  568. });
  569. applyboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  570. applyboxdown.setFill(Color.rgb(32, 155, 146));
  571. });
  572. TextField newstf = new TextField();
  573. TextField newctf = new TextField();
  574.  
  575. applyboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  576. street = newstf.getText();
  577. city = newctf.getText();
  578. String sql2 = "UPDATE USER_DATA SET STREET_ADDRESS = ?, CITY = ? WHERE NID_NO = ?";
  579. try {
  580. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  581. PreparedStatement pst2 = con2.prepareStatement(sql2);
  582. pst2.setString(1, street);
  583. pst2.setString(2, city);
  584. pst2.setString(3, NID_No);
  585. pst2.executeQuery();
  586. SuccessMsg("Success", "Please Log In Again to View Changes.");
  587. LoginScene();
  588. pst2.close();
  589. con2.close();
  590. } catch (SQLException ex) {
  591. InvalidLogInMsg("Failed", "Wrong Credential");
  592. //printStackTrace();
  593. }
  594. });
  595.  
  596. Text canceltext = new Text("CANCEL");
  597. canceltext.setX(posX + 10 + 180);
  598. canceltext.setY(posY + 450);
  599. canceltext.setFill(Color.WHITE);
  600. canceltext.setFont(Font.font(35));
  601. Rectangle cancelboxdown = new Rectangle(150, 50);
  602. cancelboxdown.setFill(Color.rgb(32, 155, 146));
  603. cancelboxdown.setX(posX + 180);
  604. cancelboxdown.setY(posY + 412);
  605. Rectangle cancelboxup = new Rectangle(150, 50);
  606. cancelboxup.setFill(Color.rgb(0, 0, 0, 0));
  607. cancelboxup.setX(posX + 180);
  608. cancelboxup.setY(posY + 412);
  609. cancelboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  610. cancelboxdown.setFill(Color.rgb(17, 119, 112));
  611. });
  612. cancelboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  613. cancelboxdown.setFill(Color.rgb(32, 155, 146));
  614. });
  615. Text newst = new Text("Street :");
  616. Text newct = new Text("City :");
  617. Text chadd = new Text("Change Address");
  618. Rectangle chaddbox = new Rectangle(110, 15);
  619. cancelboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  620. root.getChildren().add(chadd);
  621. root.getChildren().add(chaddbox);
  622. root.getChildren().add(add);
  623. root.getChildren().add(ct);
  624. root.getChildren().remove(newct);
  625. root.getChildren().remove(newst);
  626. root.getChildren().remove(newstf);
  627. root.getChildren().remove(newctf);
  628. root.getChildren().remove(applyboxdown);
  629. root.getChildren().remove(applytext);
  630. root.getChildren().remove(applyboxup);
  631. root.getChildren().remove(cancelboxdown);
  632. root.getChildren().remove(canceltext);
  633. root.getChildren().remove(cancelboxup);
  634. });
  635.  
  636. newst.setFill(Color.BLACK);
  637. newst.setX(posX);
  638. newst.setY(posY + 250);
  639. newst.setFont(Font.font(20));
  640. newct.setFill(Color.BLACK);
  641. newct.setX(posX);
  642. newct.setY(posY + 300);
  643. newct.setFont(Font.font(20));
  644. SetThisFieldvir(newstf, posX + 200, posY + 230);
  645. SetThisFieldvir(newctf, posX + 200, posY + 280);
  646.  
  647. chadd.setFill(Color.BLUE);
  648. chadd.setX(posX);
  649. chadd.setY(posY + 412);
  650. chadd.setFont(Font.font(15));
  651.  
  652. chaddbox.setFill(Color.rgb(0, 0, 0, 0));
  653. chaddbox.relocate(posX, posY + 400);
  654. chaddbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  655. chadd.setFill(Color.BLUEVIOLET);
  656. });
  657. chaddbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  658. chadd.setFill(Color.BLUE);
  659. });
  660. chaddbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  661. root.getChildren().remove(chadd);
  662. root.getChildren().remove(chaddbox);
  663. root.getChildren().remove(add);
  664. root.getChildren().remove(ct);
  665. root.getChildren().add(newct);
  666. root.getChildren().add(newst);
  667. root.getChildren().add(newstf);
  668. root.getChildren().add(newctf);
  669. root.getChildren().add(applyboxdown);
  670. root.getChildren().add(applytext);
  671. root.getChildren().add(applyboxup);
  672. root.getChildren().add(cancelboxdown);
  673. root.getChildren().add(canceltext);
  674. root.getChildren().add(cancelboxup);
  675. });
  676.  
  677. root.getChildren().add(chadd);
  678. root.getChildren().add(chaddbox);
  679. root.getChildren().add(Name);
  680. root.getChildren().add(nid);
  681. root.getChildren().add(db);
  682. root.getChildren().add(fn);
  683. root.getChildren().add(mn);
  684. root.getChildren().add(add);
  685. root.getChildren().add(ct);
  686. root.getChildren().add(type);
  687. pst.close();
  688. con.close();
  689. } catch (SQLException ex) {
  690. System.out.println("USER DATA ERROR!!");
  691. }
  692. }
  693.  
  694. public void empprofile(String User_Name, String NID_No) {
  695. try {
  696. String sql = "SELECT * FROM EMPLOYEES WHERE EMPLOYEE_NAME = ? AND NID_NO = ?";
  697. int posX = 800, posY = 270, fonts = 20;
  698. con = new DataBase("TELECOM", "hr").getConnection();
  699. pst = con.prepareStatement(sql);
  700. pst.setString(1, User_Name);
  701. pst.setString(2, NID_No);
  702. rs = pst.executeQuery();
  703. rs.next();
  704. Job_ID = rs.getString(14);
  705. Text id = new Text("EMPLOYEE ID : " + rs.getString(1));
  706. id.setX(posX);
  707. id.setY(posY);
  708. id.setFont(Font.font(fonts));
  709. id.setFill(Color.rgb(0, 0, 0));
  710. Text email = new Text("EMAIL ID : " + rs.getString(4));
  711. email.setX(posX);
  712. email.setY(posY + 50);
  713. email.setFont(Font.font(fonts));
  714. email.setFill(Color.rgb(0, 0, 0));
  715. Text ac = new Text("BANK ACC NO : " + rs.getString(5));
  716. ac.setX(posX);
  717. ac.setY(posY + 100);
  718. ac.setFont(Font.font(fonts));
  719. ac.setFill(Color.rgb(0, 0, 0));
  720. Text sy = new Text("SSC YEAR : " + rs.getString(7));
  721. sy.setX(posX);
  722. sy.setY(posY + 150);
  723. sy.setFont(Font.font(fonts));
  724. sy.setFill(Color.rgb(0, 0, 0));
  725. Text sg = new Text("SSC GPA : " + rs.getString(8));
  726. sg.setX(posX);
  727. sg.setY(posY + 200);
  728. sg.setFont(Font.font(fonts));
  729. sg.setFill(Color.rgb(0, 0, 0));
  730. Text hy = new Text("HSC YEAR : " + rs.getString(9));
  731. hy.setX(posX);
  732. hy.setY(posY + 250);
  733. hy.setFont(Font.font(fonts));
  734. hy.setFill(Color.rgb(0, 0, 0));
  735. Text hg = new Text("HSC GPA : " + rs.getString(10));
  736. hg.setX(posX);
  737. hg.setY(posY + 300);
  738. hg.setFont(Font.font(fonts));
  739. hg.setFill(Color.rgb(0, 0, 0));
  740. Text uni = new Text("UNIVERSITY : " + rs.getString(11));
  741. uni.setX(posX);
  742. uni.setY(posY + 350);
  743. uni.setFont(Font.font(fonts));
  744. uni.setFill(Color.rgb(0, 0, 0));
  745. Text ug = new Text("CGPA : " + rs.getString(12));
  746. ug.setX(posX);
  747. ug.setY(posY + 400);
  748. ug.setFont(Font.font(fonts));
  749. ug.setFill(Color.rgb(0, 0, 0));
  750. Text sal = new Text("SALARY : " + rs.getString(15) + " tk/-");
  751. sal.setX(posX);
  752. sal.setY(posY + 450);
  753. sal.setFont(Font.font(fonts));
  754. sal.setFill(Color.rgb(0, 0, 0));
  755.  
  756.  
  757. Rectangle chmailbox = new Rectangle(110, 15);
  758. Text chmail = new Text("Change Mail.");
  759. Text newm = new Text("Mail :");
  760.  
  761.  
  762. Text Admtext = new Text("Administration");
  763. Admtext.setX(posX + 25 + 600);
  764. Admtext.setY(posY + 550);
  765. Admtext.setFill(Color.WHITE);
  766. Admtext.setFont(Font.font(35));
  767. Rectangle admboxdown = new Rectangle(280, 50);
  768. admboxdown.setFill(Color.rgb(32, 155, 146));
  769. admboxdown.setX(posX + 600);
  770. admboxdown.setY(posY + 512);
  771. Rectangle admboxup = new Rectangle(280, 50);
  772. admboxup.setFill(Color.rgb(0, 0, 0, 0));
  773. admboxup.setX(posX + 600);
  774. admboxup.setY(posY + 512);
  775. if("101".equals(Job_ID)) {
  776. root.getChildren().add(admboxdown);
  777. root.getChildren().add(Admtext);
  778. root.getChildren().add(admboxup);
  779. }
  780. admboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  781. admboxdown.setFill(Color.rgb(17, 119, 112));
  782. });
  783. admboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  784. admboxdown.setFill(Color.rgb(32, 155, 146));
  785. });
  786.  
  787. admboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  788. AdmScene(User_Name, NID_No);
  789. });
  790.  
  791. Text applytext = new Text("APPLY");
  792. applytext.setX(posX + 25);
  793. applytext.setY(posY + 550);
  794. applytext.setFill(Color.WHITE);
  795. applytext.setFont(Font.font(35));
  796. Rectangle applyboxdown = new Rectangle(150, 50);
  797. applyboxdown.setFill(Color.rgb(32, 155, 146));
  798. applyboxdown.setX(posX);
  799. applyboxdown.setY(posY + 512);
  800. Rectangle applyboxup = new Rectangle(150, 50);
  801. applyboxup.setFill(Color.rgb(0, 0, 0, 0));
  802. applyboxup.setX(posX);
  803. applyboxup.setY(posY + 512);
  804. applyboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  805. applyboxdown.setFill(Color.rgb(17, 119, 112));
  806. });
  807. applyboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  808. applyboxdown.setFill(Color.rgb(32, 155, 146));
  809. });
  810. TextField newstf = new TextField();
  811. TextField newctf = new TextField();
  812.  
  813. applyboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  814. mail = newstf.getText();
  815. String sql2 = "UPDATE EMPLOYEES SET EMAIL = ? WHERE NID_NO = ?";
  816. try {
  817. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  818. PreparedStatement pst2 = con2.prepareStatement(sql2);
  819. pst2.setString(1, mail);
  820. pst2.setString(2, NID_No);
  821. pst2.executeQuery();
  822. SuccessMsg("Success", "Please Log In Again to View Changes.");
  823. LoginScene();
  824. pst2.close();
  825. con2.close();
  826. } catch (SQLException ex) {
  827. InvalidLogInMsg("Failed", "Wrong Credential");
  828. //printStackTrace();
  829. }
  830. });
  831.  
  832. Text canceltext = new Text("CANCEL");
  833. canceltext.setX(posX + 10 + 180);
  834. canceltext.setY(posY + 550);
  835. canceltext.setFill(Color.WHITE);
  836. canceltext.setFont(Font.font(35));
  837. Rectangle cancelboxdown = new Rectangle(150, 50);
  838. cancelboxdown.setFill(Color.rgb(32, 155, 146));
  839. cancelboxdown.setX(posX + 180);
  840. cancelboxdown.setY(posY + 512);
  841. Rectangle cancelboxup = new Rectangle(150, 50);
  842. cancelboxup.setFill(Color.rgb(0, 0, 0, 0));
  843. cancelboxup.setX(posX + 180);
  844. cancelboxup.setY(posY + 512);
  845. cancelboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  846. cancelboxdown.setFill(Color.rgb(17, 119, 112));
  847. });
  848. cancelboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  849. cancelboxdown.setFill(Color.rgb(32, 155, 146));
  850. });
  851. TextField newmf = new TextField();
  852. cancelboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  853. root.getChildren().add(email);
  854. root.getChildren().remove(newm);
  855. root.getChildren().remove(newmf);
  856. root.getChildren().add(chmail);
  857. root.getChildren().add(chmailbox);
  858. root.getChildren().remove(applyboxdown);
  859. root.getChildren().remove(applytext);
  860. root.getChildren().remove(applyboxup);
  861. root.getChildren().remove(cancelboxdown);
  862. root.getChildren().remove(canceltext);
  863. root.getChildren().remove(cancelboxup);
  864. });
  865. SetThisFieldvir(newmf, posX + 200, posY + 30);
  866. newm.setFill(Color.BLACK);
  867. newm.setX(posX);
  868. newm.setY(posY + 50);
  869. newm.setFont(Font.font(20));
  870. chmail.setX(posX);
  871. chmail.setY(posY + 512);
  872. chmail.setFont(Font.font(15));
  873. chmail.setFill(Color.BLUE);
  874.  
  875. chmailbox.setFill(Color.rgb(0, 0, 0, 0));
  876. chmailbox.relocate(posX, posY + 500);
  877. chmailbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  878. chmail.setFill(Color.BLUEVIOLET);
  879. });
  880. chmailbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  881. chmail.setFill(Color.BLUE);
  882. });
  883. chmailbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  884. root.getChildren().remove(email);
  885. root.getChildren().add(newm);
  886. root.getChildren().add(newmf);
  887. root.getChildren().remove(chmail);
  888. root.getChildren().remove(chmailbox);
  889. root.getChildren().add(applyboxdown);
  890. root.getChildren().add(applytext);
  891. root.getChildren().add(applyboxup);
  892. root.getChildren().add(cancelboxdown);
  893. root.getChildren().add(canceltext);
  894. root.getChildren().add(cancelboxup);
  895. });
  896.  
  897.  
  898. root.getChildren().add(chmail);
  899. root.getChildren().add(chmailbox);
  900. root.getChildren().add(id);
  901. root.getChildren().add(email);
  902. root.getChildren().add(ac);
  903. root.getChildren().add(sy);
  904. root.getChildren().add(sg);
  905. root.getChildren().add(hy);
  906. root.getChildren().add(hg);
  907. root.getChildren().add(uni);
  908. root.getChildren().add(ug);
  909. root.getChildren().add(sal);
  910. pst.close();
  911. con.close();
  912. } catch (SQLException ex) {
  913. System.out.println("EMPLOYYE DATA ERROR!!");
  914. }
  915. }
  916.  
  917. private void ApproveScene(String User_Name, String NID_No) throws SQLException {
  918. BackSceneOnly();
  919. ImageView back = new ImageView("file:mainback.jpg");
  920. root.getChildren().add(back);
  921. int buttonPosX = 300, buttonPosY = 150, move = 175;
  922. double tabpaneX = 45, tabpaneY = 150;
  923.  
  924. String sql = "SELECT * FROM PENDING_SIM_REQ WHERE ROWNUM = 1";
  925. try {
  926. con = new DataBase("TELECOM", "hr").getConnection();
  927. pst = con.prepareStatement(sql);
  928. rs = pst.executeQuery();
  929. System.out.println("success");
  930. //rs.next();
  931. //System.out.println("Boro Mara");
  932. boolean x;
  933. x = false;
  934. if (rs.next()) {
  935. x = true;
  936. nid1 = rs.getString(2);
  937. }
  938. if (x) {
  939. pending_profile();
  940. System.out.println("success");
  941. } else {
  942. InvalidLogInMsg("Failed", "No More Sim Req");
  943. }
  944. //Profile(User_Name, NID_No); // HomePage of User = User Profile
  945. ImageView profileimg = new ImageView("file:profile.png");
  946. //root.getChildren().add(profileimg);
  947. profileimg.relocate(tabpaneX, tabpaneY);
  948. profileimg.setFitHeight(40);
  949. profileimg.setFitWidth(160);
  950. Text profiletext = new Text("PROFILE");
  951. SetThisText(profiletext, 85, 175, 20);
  952. Rectangle profilebox = new Rectangle(150, 40);
  953. SetThisBox(profilebox, 50, 170);
  954. profilebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  955. profilebox.setFill(Color.rgb(255, 255, 255, 0.1));
  956. });
  957. profilebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  958. profilebox.setFill(Color.rgb(255, 255, 255, 0));
  959. });
  960. profilebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  961. LogIn(User_Name, NID_No);
  962. });
  963.  
  964. ImageView approveimg = new ImageView("file:profile.png");
  965. root.getChildren().add(approveimg);
  966. approveimg.relocate(tabpaneX + (move * 1), tabpaneY);
  967. approveimg.setFitHeight(40);
  968. approveimg.setFitWidth(160);
  969. Text approvetext = new Text("ISSUE SIM");
  970. SetThisText(approvetext, 80 + (move * 1), 175, 20);
  971. Rectangle approvebox = new Rectangle(150, 40);
  972. SetThisBox(approvebox, 50 + (move * 1), 170);
  973. //approvebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {approvebox.setFill(Color.rgb(255, 255, 255, 0.1));});
  974. //approvebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {approvebox.setFill(Color.rgb(255, 255, 255, 0));});
  975. //approvebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> ApproveScene(User_Name, NID_No));
  976.  
  977. ImageView jobapproveimg = new ImageView("file:profile.png");
  978. //root.getChildren().add(logoutimg);
  979. jobapproveimg.relocate(tabpaneX + (move * 2), tabpaneY);
  980. jobapproveimg.setFitHeight(40);
  981. jobapproveimg.setFitWidth(160);
  982. Text jobapprovetext = new Text("JOB REQ");
  983. SetThisText(jobapprovetext, 80 + (move * 2), 175, 20);
  984. Rectangle jobapprovebox = new Rectangle(150, 40);
  985. SetThisBox(jobapprovebox, 50 + (move * 2), 170);
  986. jobapprovebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  987. jobapprovebox.setFill(Color.rgb(255, 255, 255, 0.1));
  988. });
  989. jobapprovebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  990. jobapprovebox.setFill(Color.rgb(255, 255, 255, 0));
  991. });
  992. jobapprovebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  993. try {
  994. jobApproveScene(User_Name, NID_No);
  995. } catch (SQLException ex) {
  996. Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  997. }
  998. });
  999.  
  1000. ImageView logoutimg = new ImageView("file:profile.png");
  1001. //root.getChildren().add(logoutimg);
  1002. logoutimg.relocate(tabpaneX + (move * 3), tabpaneY);
  1003. logoutimg.setFitHeight(40);
  1004. logoutimg.setFitWidth(160);
  1005. Text logouttext = new Text("LOG OUT");
  1006. SetThisText(logouttext, 85 + (move * 3), 175, 20);
  1007. Rectangle logoutbox = new Rectangle(150, 40);
  1008. SetThisBox(logoutbox, 50 + (move * 3), 170);
  1009. logoutbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1010. logoutbox.setFill(Color.rgb(255, 255, 255, 0.1));
  1011. });
  1012. logoutbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1013. logoutbox.setFill(Color.rgb(255, 255, 255, 0));
  1014. });
  1015. logoutbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> LogOut());
  1016.  
  1017. Rectangle confirmboxup = new Rectangle(200, 60);
  1018. Text confirmtext = new Text("APPROVE");
  1019. confirmtext.setX(1015);
  1020. confirmtext.setY(343);
  1021. confirmtext.setFill(Color.WHITE);
  1022. confirmtext.setFont(Font.font(40));
  1023. Rectangle confirmboxdown = new Rectangle(200, 60);
  1024. confirmboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1025. confirmboxdown.setX(1000);
  1026. confirmboxdown.setY(300);
  1027. confirmboxup.setFill(Color.rgb(0, 0, 0, 0));
  1028. confirmboxup.setX(1000);
  1029. confirmboxup.setY(300);
  1030. confirmboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1031. confirmboxdown.setFill(Color.rgb(17, 119, 112, 1));
  1032. });
  1033. confirmboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1034. confirmboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1035. });
  1036. //rs.next();
  1037. //System.out.println(rs.getString(1));
  1038.  
  1039. confirmboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1040.  
  1041.  
  1042. try {
  1043.  
  1044. Class.forName("oracle.jdbc.driver.OracleDriver");
  1045. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  1046.  
  1047. CallableStatement stmt = con2.prepareCall("{call APPROVE_THIS_PENDING_SIM(?,?)}");
  1048.  
  1049.  
  1050. stmt.setInt(1, Integer.parseInt(Job_ID));
  1051. stmt.setInt(2, Integer.parseInt(nid1));
  1052.  
  1053. System.out.println(nid1 + " jsgdfkhaj " + passcode);
  1054. System.out.println("execute hoitese na");
  1055. stmt.executeUpdate();
  1056. System.out.println("execute hoise re!!!!");
  1057.  
  1058. stmt.close();
  1059. con2.close();
  1060.  
  1061. ApproveScene(User_Name, NID_No);
  1062.  
  1063. SuccessMsg("Approved", "This SIM Was Issued By Employee No." + passcode);
  1064. } catch (SQLException ex2) {
  1065. System.out.println("doesn't work");
  1066. InvalidLogInMsg("Approve Failed", "Didn't Work");
  1067. } catch (ClassNotFoundException ex) {
  1068. Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  1069. }
  1070. });
  1071.  
  1072. Rectangle disapproveboxup = new Rectangle(200, 60);
  1073. Text disapprovetext = new Text("DELETE");
  1074. disapprovetext.setX(1035);
  1075. disapprovetext.setY(443);
  1076. disapprovetext.setFill(Color.WHITE);
  1077. disapprovetext.setFont(Font.font(40));
  1078. Rectangle disapproveboxdown = new Rectangle(200, 60);
  1079. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1080. disapproveboxdown.setX(1000);
  1081. disapproveboxdown.setY(400);
  1082. disapproveboxup.setFill(Color.rgb(0, 0, 0, 0));
  1083. disapproveboxup.setX(1000);
  1084. disapproveboxup.setY(400);
  1085. disapproveboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1086. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 1));
  1087. });
  1088. disapproveboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1089. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1090. });
  1091. //rs.next();
  1092. //System.out.println(rs.getString(1));
  1093.  
  1094. disapproveboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1095. String sql2 = "DELETE FROM PENDING_SIM_REQ WHERE NID_NO = ?";
  1096. try {
  1097. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  1098. PreparedStatement pst2 = con2.prepareStatement(sql2);
  1099. pst2.setString(1, nid1);
  1100. //ResultSet rs2 = pst2.executeQuery();
  1101. //if (rs2.next()) {
  1102.  
  1103. //} else {
  1104. // InvalidLogInMsg("Failed", "Invalid Log In");
  1105. //}
  1106. pst2.executeQuery();
  1107. pst2.close();
  1108. con2.close();
  1109. ApproveScene(User_Name, NID_No);
  1110. } catch (SQLException ex2) {
  1111. System.out.println("doesn't work");
  1112. }
  1113. });
  1114.  
  1115. if (x) {
  1116. root.getChildren().add(confirmboxdown);
  1117. root.getChildren().add(confirmtext);
  1118. root.getChildren().add(confirmboxup);
  1119. root.getChildren().add(disapproveboxdown);
  1120. root.getChildren().add(disapprovetext);
  1121. root.getChildren().add(disapproveboxup);
  1122.  
  1123. }
  1124. ImageView toppart = new ImageView("file:tbdgreen.png");
  1125. root.getChildren().add(toppart);
  1126. pst.close();
  1127. con.close();
  1128. StageShow();
  1129. } catch (SQLException ex) {
  1130. System.out.println("doesn't work");
  1131. }
  1132. }
  1133.  
  1134. private void pending_profile() throws SQLException {
  1135. int posX = 100, posY = 270, fonts = 20;
  1136. Text Name = new Text("USER NAME : " + rs.getString(1));
  1137. System.out.println(rs.getString(1));
  1138. Name.setX(posX);
  1139. Name.setY(posY);
  1140. Name.setFont(Font.font(fonts));
  1141. Name.setFill(Color.rgb(0, 0, 0));
  1142. Text nid = new Text("NID NO : " + rs.getString(2));
  1143. nid.setX(posX);
  1144. nid.setY(posY + 50);
  1145. nid.setFont(Font.font(fonts));
  1146. nid.setFill(Color.rgb(0, 0, 0));
  1147.  
  1148. Text db = new Text("DATE OF BIRTH (MMM DD, YYYY) : " + rs.getString(3));
  1149.  
  1150. db.setX(posX);
  1151. db.setY(posY + 100);
  1152. db.setFont(Font.font(fonts));
  1153. db.setFill(Color.rgb(0, 0, 0));
  1154.  
  1155. Text fn = new Text("FATHER'S NAME : " + rs.getString(4));
  1156. fn.setX(posX);
  1157. fn.setY(posY + 150);
  1158. fn.setFont(Font.font(fonts));
  1159. fn.setFill(Color.rgb(0, 0, 0));
  1160.  
  1161. Text mn = new Text("MOTHER'S NAME : " + rs.getString(5));
  1162. mn.setX(posX);
  1163. mn.setY(posY + 200);
  1164. mn.setFont(Font.font(fonts));
  1165. mn.setFill(Color.rgb(0, 0, 0));
  1166.  
  1167. Text add = new Text("ADRESS : " + rs.getString(6));
  1168. add.setX(posX);
  1169. add.setY(posY + 250);
  1170. add.setFont(Font.font(fonts));
  1171. add.setFill(Color.rgb(0, 0, 0));
  1172.  
  1173. Text ct = new Text("CITY : " + rs.getString(7));
  1174. ct.setX(posX);
  1175. ct.setY(posY + 300);
  1176. ct.setFont(Font.font(fonts));
  1177. ct.setFill(Color.rgb(0, 0, 0));
  1178. Text type;
  1179. if (rs.getString(8).equals("NO")) {
  1180. type = new Text("User Type: " + "Not Employee");
  1181. } else {
  1182. type = new Text("User Type: " + "Employee");
  1183. }
  1184. type.setFont(Font.font(fonts));
  1185. type.setX(posX);
  1186. type.setY(posY + 350);
  1187. type.setFill(Color.rgb(0, 0, 0));
  1188. Text simtype = new Text("Applied for : " + rs.getString(9) + " Sim");
  1189. simtype.setX(posX);
  1190. simtype.setY(posY + 400);
  1191. simtype.setFont(Font.font(fonts));
  1192. simtype.setFill(Color.rgb(0, 0, 0));
  1193. root.getChildren().add(Name);
  1194. root.getChildren().add(nid);
  1195. root.getChildren().add(db);
  1196. root.getChildren().add(fn);
  1197. root.getChildren().add(mn);
  1198. root.getChildren().add(add);
  1199. root.getChildren().add(ct);
  1200. root.getChildren().add(type);
  1201. }
  1202.  
  1203. private void pending_job() throws SQLException {
  1204. int posX = 100, posY = 270, fonts = 20;
  1205. Text Name = new Text("USER NAME : " + rs.getString(1));
  1206. System.out.println(rs.getString(1));
  1207. Name.setX(posX);
  1208. Name.setY(posY);
  1209. Name.setFont(Font.font(fonts));
  1210. Name.setFill(Color.rgb(0, 0, 0));
  1211. Text nid = new Text("NID NO : " + rs.getString(7));
  1212. nid.setX(posX);
  1213. nid.setY(posY + 40);
  1214. nid.setFont(Font.font(fonts));
  1215. nid.setFill(Color.rgb(0, 0, 0));
  1216.  
  1217. Text db = new Text("DATE OF BIRTH (MMM DD, YYYY) : " + rs.getString(4));
  1218.  
  1219. db.setX(posX);
  1220. db.setY(posY + 80);
  1221. db.setFont(Font.font(fonts));
  1222. db.setFill(Color.rgb(0, 0, 0));
  1223.  
  1224. Text fn = new Text("FATHER'S NAME : " + rs.getString(2));
  1225. fn.setX(posX);
  1226. fn.setY(posY + 120);
  1227. fn.setFont(Font.font(fonts));
  1228. fn.setFill(Color.rgb(0, 0, 0));
  1229.  
  1230. Text mn = new Text("MOTHER'S NAME : " + rs.getString(3));
  1231. mn.setX(posX);
  1232. mn.setY(posY + 160);
  1233. mn.setFont(Font.font(fonts));
  1234. mn.setFill(Color.rgb(0, 0, 0));
  1235.  
  1236. Text add = new Text("ADRESS : " + rs.getString(5));
  1237. add.setX(posX);
  1238. add.setY(posY + 200);
  1239. add.setFont(Font.font(fonts));
  1240. add.setFill(Color.rgb(0, 0, 0));
  1241.  
  1242. Text ct = new Text("CITY : " + rs.getString(6));
  1243. ct.setX(posX);
  1244. ct.setY(posY + 240);
  1245. ct.setFont(Font.font(fonts));
  1246. ct.setFill(Color.rgb(0, 0, 0));
  1247.  
  1248. Text em = new Text("EMAIL : " + rs.getString(8));
  1249. em.setX(posX);
  1250. em.setY(posY + 280);
  1251. em.setFont(Font.font(fonts));
  1252. em.setFill(Color.rgb(0, 0, 0));
  1253.  
  1254. Text ac = new Text("ACC NO : " + rs.getString(9));
  1255. ac.setX(posX);
  1256. ac.setY(posY + 320);
  1257. ac.setFont(Font.font(fonts));
  1258. ac.setFill(Color.rgb(0, 0, 0));
  1259.  
  1260. Text sy = new Text("SSC YEAR : " + rs.getString(10));
  1261. sy.setX(posX);
  1262. sy.setY(posY + 360);
  1263. sy.setFont(Font.font(fonts));
  1264. sy.setFill(Color.rgb(0, 0, 0));
  1265.  
  1266. Text sg = new Text("SSC GPA : " + rs.getString(11));
  1267. sg.setX(posX);
  1268. sg.setY(posY + 400);
  1269. sg.setFont(Font.font(fonts));
  1270. sg.setFill(Color.rgb(0, 0, 0));
  1271.  
  1272. Text hy = new Text("HSC YEAR : " + rs.getString(12));
  1273. hy.setX(posX);
  1274. hy.setY(posY + 440);
  1275. hy.setFont(Font.font(fonts));
  1276. hy.setFill(Color.rgb(0, 0, 0));
  1277.  
  1278. Text hg = new Text("HSC GPA : " + rs.getString(13));
  1279. hg.setX(posX);
  1280. hg.setY(posY + 480);
  1281. hg.setFont(Font.font(fonts));
  1282. hg.setFill(Color.rgb(0, 0, 0));
  1283.  
  1284. Text un = new Text("UNIVERSITY : " + rs.getString(14));
  1285. un.setX(posX);
  1286. un.setY(posY + 520);
  1287. un.setFont(Font.font(fonts));
  1288. un.setFill(Color.rgb(0, 0, 0));
  1289.  
  1290. Text ug = new Text("CGPA : " + rs.getString(15));
  1291. ug.setX(posX);
  1292. ug.setY(posY + 560);
  1293. ug.setFont(Font.font(fonts));
  1294. ug.setFill(Color.rgb(0, 0, 0));
  1295.  
  1296. Text exp = new Text("Experience : " + rs.getString(16));
  1297. exp.setX(posX);
  1298. exp.setY(posY + 600);
  1299. exp.setFont(Font.font(fonts));
  1300. exp.setFill(Color.rgb(0, 0, 0));
  1301.  
  1302. root.getChildren().add(Name);
  1303. root.getChildren().add(nid);
  1304. root.getChildren().add(db);
  1305. root.getChildren().add(fn);
  1306. root.getChildren().add(mn);
  1307. root.getChildren().add(add);
  1308. root.getChildren().add(ct);
  1309. root.getChildren().add(em);
  1310. root.getChildren().add(ac);
  1311. root.getChildren().add(sy);
  1312. root.getChildren().add(sg);
  1313. root.getChildren().add(hy);
  1314. root.getChildren().add(hg);
  1315. root.getChildren().add(un);
  1316. root.getChildren().add(ug);
  1317. root.getChildren().add(exp);
  1318. }
  1319.  
  1320. private void jobApproveScene(String User_Name, String NID_No) throws SQLException {
  1321. BackSceneOnly();
  1322. ImageView back = new ImageView("file:mainback.jpg");
  1323. root.getChildren().add(back);
  1324. int move = 175;
  1325. double tabpaneX = 45, tabpaneY = 150;
  1326. String sql = "SELECT * FROM PENDING_JOB_REQ WHERE ROWNUM = 1";
  1327. try {
  1328. con = new DataBase("TELECOM", "hr").getConnection();
  1329. pst = con.prepareStatement(sql);
  1330. rs = pst.executeQuery();
  1331. boolean x;
  1332. x = false;
  1333. if (rs.next()) {
  1334. x = true;
  1335. nid2 = rs.getString(7);
  1336. }
  1337. if (x) {
  1338. pending_job();
  1339. } else {
  1340. InvalidLogInMsg("Failed", "No More Job Req");
  1341. }
  1342. //Profile(User_Name, NID_No); // HomePage of User = User Profile
  1343. ImageView profileimg = new ImageView("file:profile.png");
  1344. //root.getChildren().add(profileimg);
  1345. profileimg.relocate(tabpaneX, tabpaneY);
  1346. profileimg.setFitHeight(40);
  1347. profileimg.setFitWidth(160);
  1348. Text profiletext = new Text("PROFILE");
  1349. SetThisText(profiletext, 85, 175, 20);
  1350. Rectangle profilebox = new Rectangle(150, 40);
  1351. SetThisBox(profilebox, 50, 170);
  1352. profilebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1353. profilebox.setFill(Color.rgb(255, 255, 255, 0.1));
  1354. });
  1355. profilebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1356. profilebox.setFill(Color.rgb(255, 255, 255, 0));
  1357. });
  1358. profilebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1359. LogIn(User_Name, NID_No);
  1360. });
  1361.  
  1362. ImageView approveimg = new ImageView("file:profile.png");
  1363. //root.getChildren().add(approveimg);
  1364. approveimg.relocate(tabpaneX + (move * 1), tabpaneY);
  1365. approveimg.setFitHeight(40);
  1366. approveimg.setFitWidth(160);
  1367. Text approvetext = new Text("ISSUE SIM");
  1368. SetThisText(approvetext, 80 + (move * 1), 175, 20);
  1369. Rectangle approvebox = new Rectangle(150, 40);
  1370. SetThisBox(approvebox, 50 + (move * 1), 170);
  1371. approvebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1372. approvebox.setFill(Color.rgb(255, 255, 255, 0.1));
  1373. });
  1374. approvebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1375. approvebox.setFill(Color.rgb(255, 255, 255, 0));
  1376. });
  1377. approvebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1378. try {
  1379. ApproveScene(User_Name, NID_No);
  1380. } catch (SQLException ex) {
  1381. Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  1382. }
  1383. });
  1384.  
  1385. ImageView jobapproveimg = new ImageView("file:profile.png");
  1386. root.getChildren().add(jobapproveimg);
  1387. jobapproveimg.relocate(tabpaneX + (move * 2), tabpaneY);
  1388. jobapproveimg.setFitHeight(40);
  1389. jobapproveimg.setFitWidth(160);
  1390. Text jobapprovetext = new Text("JOB REQ");
  1391. SetThisText(jobapprovetext, 80 + (move * 2), 175, 20);
  1392. Rectangle jobapprovebox = new Rectangle(150, 40);
  1393. SetThisBox(jobapprovebox, 50 + (move * 2), 170);
  1394. // jobapprovebox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1395. // jobapprovebox.setFill(Color.rgb(255, 255, 255, 0.1));
  1396. // });
  1397. // jobapprovebox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1398. // jobapprovebox.setFill(Color.rgb(255, 255, 255, 0));
  1399. // });
  1400. // jobapprovebox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1401. // try {
  1402. // jobApproveScene(User_Name, NID_No);
  1403. // } catch (SQLException ex) {
  1404. // Logger.getLogger(Employee_UI.class.getName()).log(Level.SEVERE, null, ex);
  1405. // }
  1406. // });
  1407.  
  1408. ImageView logoutimg = new ImageView("file:profile.png");
  1409. //root.getChildren().add(logoutimg);
  1410. logoutimg.relocate(tabpaneX + (move * 3), tabpaneY);
  1411. logoutimg.setFitHeight(40);
  1412. logoutimg.setFitWidth(160);
  1413. Text logouttext = new Text("LOG OUT");
  1414. SetThisText(logouttext, 85 + (move * 3), 175, 20);
  1415. Rectangle logoutbox = new Rectangle(150, 40);
  1416. SetThisBox(logoutbox, 50 + (move * 3), 170);
  1417. logoutbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1418. logoutbox.setFill(Color.rgb(255, 255, 255, 0.1));
  1419. });
  1420. logoutbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1421. logoutbox.setFill(Color.rgb(255, 255, 255, 0));
  1422. });
  1423. logoutbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> LogOut());
  1424.  
  1425. Rectangle confirmboxup = new Rectangle(200, 60);
  1426. Text confirmtext = new Text("APPROVE");
  1427. confirmtext.setX(1015);
  1428. confirmtext.setY(343);
  1429. confirmtext.setFill(Color.WHITE);
  1430. confirmtext.setFont(Font.font(40));
  1431. Rectangle confirmboxdown = new Rectangle(200, 60);
  1432. confirmboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1433. confirmboxdown.setX(1000);
  1434. confirmboxdown.setY(300);
  1435. confirmboxup.setFill(Color.rgb(0, 0, 0, 0));
  1436. confirmboxup.setX(1000);
  1437. confirmboxup.setY(300);
  1438. confirmboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1439. confirmboxdown.setFill(Color.rgb(17, 119, 112, 1));
  1440. });
  1441. confirmboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1442. confirmboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1443. });
  1444. //rs.next();
  1445. //System.out.println(rs.getString(1));
  1446.  
  1447. confirmboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1448.  
  1449. // EIKHANE TRIGGER ER KAJ KORE PORE KORA LAGBE
  1450. String sql2 = "DELETE FROM ";
  1451. try {
  1452. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  1453. PreparedStatement pst2 = con2.prepareStatement(sql2);
  1454. ResultSet rs2 = pst2.executeQuery();
  1455. if (rs2.next()) {
  1456.  
  1457. } else {
  1458. InvalidLogInMsg("Failed", "Invalid Log In");
  1459. }
  1460.  
  1461. pst2.close();
  1462. con2.close();
  1463. } catch (SQLException ex2) {
  1464. System.out.println("doesn't work");
  1465. }
  1466. });
  1467.  
  1468. Rectangle disapproveboxup = new Rectangle(200, 60);
  1469. Text disapprovetext = new Text("DELETE");
  1470. disapprovetext.setX(1035);
  1471. disapprovetext.setY(443);
  1472. disapprovetext.setFill(Color.WHITE);
  1473. disapprovetext.setFont(Font.font(40));
  1474. Rectangle disapproveboxdown = new Rectangle(200, 60);
  1475. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1476. disapproveboxdown.setX(1000);
  1477. disapproveboxdown.setY(400);
  1478. disapproveboxup.setFill(Color.rgb(0, 0, 0, 0));
  1479. disapproveboxup.setX(1000);
  1480. disapproveboxup.setY(400);
  1481. disapproveboxup.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1482. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 1));
  1483. });
  1484. disapproveboxup.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1485. disapproveboxdown.setFill(Color.rgb(17, 119, 112, 0.7));
  1486. });
  1487. //rs.next();
  1488. //System.out.println(rs.getString(1));
  1489.  
  1490. disapproveboxup.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1491. String sql2 = "DELETE FROM PENDING_JOB_REQ WHERE NID_NO = ?";
  1492. try {
  1493. Connection con2 = new DataBase("TELECOM", "hr").getConnection();
  1494. PreparedStatement pst2 = con2.prepareStatement(sql2);
  1495. pst2.setString(1, nid2);
  1496. //ResultSet rs2 = pst2.executeQuery();
  1497. //if (rs2.next()) {
  1498.  
  1499. //} else {
  1500. // InvalidLogInMsg("Failed", "Invalid Log In");
  1501. //}
  1502. pst2.executeQuery();
  1503. pst2.close();
  1504. con2.close();
  1505. jobApproveScene(User_Name, NID_No);
  1506. } catch (SQLException ex2) {
  1507. System.out.println("doesn't work");
  1508. }
  1509. });
  1510.  
  1511. if (x) {
  1512. root.getChildren().add(confirmboxdown);
  1513. root.getChildren().add(confirmtext);
  1514. root.getChildren().add(confirmboxup);
  1515. root.getChildren().add(disapproveboxdown);
  1516. root.getChildren().add(disapprovetext);
  1517. root.getChildren().add(disapproveboxup);
  1518.  
  1519. }
  1520. ImageView toppart = new ImageView("file:tbdgreen.png");
  1521. root.getChildren().add(toppart);
  1522. pst.close();
  1523. con.close();
  1524. StageShow();
  1525. } catch (SQLException ex) {
  1526. System.out.println("doesn't work");
  1527. }
  1528. }
  1529.  
  1530. public static void SuccessMsg(String title, String msg) {
  1531. ImageView img = new ImageView("file:Success.png");
  1532. Notifications not = Notifications.create()
  1533. .title(title)
  1534. .text(msg)
  1535. .graphic(img)
  1536. .hideAfter(Duration.seconds(3));
  1537. not.darkStyle();
  1538. not.show();
  1539. }
  1540.  
  1541. public static void InvalidLogInMsg(String title, String msg) {
  1542. Notifications not = Notifications.create()
  1543. .title(title)
  1544. .text(msg)
  1545. .hideAfter(Duration.seconds(3));
  1546. not.darkStyle();
  1547. not.showError();
  1548. }
  1549.  
  1550. public void SetThisText(Text t, double x, double y, int s, Color c) {
  1551. t.setLayoutX(x);
  1552. t.setLayoutY(y);
  1553. t.setFont(Font.font(s));
  1554. t.setFill(c);
  1555. root.getChildren().add(t);
  1556. }
  1557.  
  1558. public void SetThisField(TextField t, double x, double y) {
  1559. t.setLayoutX(x);
  1560. t.setLayoutY(y);
  1561. t.setScaleX(1.5);
  1562. //t.setScaleY(2);
  1563. root.getChildren().add(t);
  1564. }
  1565.  
  1566. public void SetThisButton(Button b, double x, double y) {
  1567. b.setLayoutX(x);
  1568. b.setLayoutY(y);
  1569. root.getChildren().add(b);
  1570. }
  1571.  
  1572. public void SetThisText(Text t, double x, double y, int s) {
  1573. t.setLayoutX(x);
  1574. t.setLayoutY(y);
  1575. t.setFont(Font.font(s));
  1576. t.setFill(Color.BLACK);
  1577. root.getChildren().add(t);
  1578. }
  1579.  
  1580. public void SetThisBox(Rectangle t, double x, double y) {
  1581. t.setFill(Color.rgb(255, 255, 255, 0));
  1582. t.setX(x);
  1583. t.setY(y - 20);
  1584. root.getChildren().add(t);
  1585. }
  1586.  
  1587. public void setchText(Text t, double x, double y) {
  1588. t.setX(x);
  1589. t.setY(y);
  1590. t.setFont(Font.font(15));
  1591. t.setFill(Color.BLUE);
  1592. root.getChildren().add(t);
  1593. }
  1594.  
  1595. private void SetThisFieldvir(TextField t, int x, int y) {
  1596. t.setLayoutX(x);
  1597. t.setLayoutY(y);
  1598. t.setScaleX(1.5);
  1599. }
  1600.  
  1601. private void AdmScene(String User_Name, String NID_No) {
  1602. BackSceneOnly();
  1603. int posX = 100, posY = 185, diffy = 42, i = 1;
  1604. int tx = posX + 350, ty = posY - 20;
  1605. ImageView back = new ImageView("file:mainback.jpg");
  1606. root.getChildren().add(back);
  1607. int move = 175;
  1608. double tabpaneX = 45, tabpaneY = 150;
  1609. ImageView toppart = new ImageView("file:tbdgreen.png");
  1610. root.getChildren().add(toppart);
  1611. Text backtext = new Text("BACK");
  1612. backtext.setX(1670);
  1613. backtext.setY(posY - 15);
  1614. backtext.setFont(Font.font(30));
  1615. backtext.setFill(Color.rgb(0, 0, 0));
  1616. root.getChildren().add(backtext);
  1617. ImageView backpage = new ImageView("file:previous.png");
  1618. backpage.setX(1600);
  1619. backpage.setY(130);
  1620. backpage.setFitHeight(60);
  1621. backpage.setFitWidth(60);
  1622. root.getChildren().add(backpage);
  1623. Rectangle backbox = new Rectangle(155, 50);
  1624. backbox.setFill(Color.rgb(0, 0, 0, 0));
  1625. backbox.setX(1600);
  1626. backbox.setY(135);
  1627. root.getChildren().add(backbox);
  1628. backbox.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> {
  1629. backtext.setFont(Font.font(40));
  1630. backtext.setX(1665);
  1631. backtext.setY(posY - 12);
  1632. });
  1633. backbox.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
  1634. backtext.setFont(Font.font(30));
  1635. backtext.setX(1670);
  1636. backtext.setY(posY - 15);
  1637. });
  1638. backbox.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
  1639. LogIn(User_Name, NID_No);
  1640. });
  1641.  
  1642.  
  1643.  
  1644. StageShow();
  1645. }
  1646.  
  1647. }
Add Comment
Please, Sign In to add comment