Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
4 changes: 2 additions & 2 deletions out/production/ClockInMachine/sample/views/AdminPane.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<Line endX="127.29290771484375" endY="-5.020804405212402" startX="-100.74752807617188" startY="-5.020802974700928" />
<TextField editable="false" text="Check clock by date ? Set date :" />
<TextField fx:id="dateInput" promptText="YYYY-MM-DD" />
<Button fx:id="dateCheckButton" mnemonicParsing="false" prefHeight="25.0" prefWidth="230.0" text="Check" />
<Button fx:id="dateCheckButton" mnemonicParsing="false" onAction="#dateCheckButton" prefHeight="25.0" prefWidth="230.0" text="Check" />
<Line endX="127.29290771484375" endY="-5.020804405212402" startX="-100.74752807617188" startY="-5.020802974700928" />
<TextField editable="false" text="Check clock by email? Set email:" />
<TextField fx:id="emaiInput" promptText="Email" />
<Button fx:id="emailCheckButton" mnemonicParsing="false" prefHeight="25.0" prefWidth="229.0" text="Check" />
<Button fx:id="emailCheckButton" mnemonicParsing="false" onAction="#emailCheckButton" prefHeight="25.0" prefWidth="229.0" text="Check" />
</children>
</VBox>
</children>
Expand Down
25 changes: 15 additions & 10 deletions src/sample/controllers/AdminPaneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import sample.controllers.Classes.Clocks;

import java.io.IOException;
import java.sql.PreparedStatement;
Expand Down Expand Up @@ -60,23 +61,29 @@ void backButtonAction(ActionEvent event) throws IOException {

}


@FXML
void isNullButton(ActionEvent event) throws SQLException, ClassNotFoundException {
String query = "select * from `30712964_clock_in`.clocks where clock_out is null or clock_in is null";
void dateCheckButton(ActionEvent event) throws SQLException, ClassNotFoundException {

String query = "select * from `30712964_clock_in`.clocks where date='"+dateInput.getText()+"'";
setupList(query, emailTable, dateTable, clockInTable, clockOutTable, serverConnect, fullTable);
System.out.println("Tu jestem 1");
}

private void update_list(String query) throws SQLException, ClassNotFoundException {
@FXML
void isNullButton(ActionEvent event) throws SQLException, ClassNotFoundException {
String query = "select * from `30712964_clock_in`.clocks where clock_out is null or clock_in is null";

setupList(query, emailTable, dateTable, clockInTable, clockOutTable, serverConnect, fullTable);

//setupList(query, emailTable, dateTable, clockInTable, clockOutTable, serverConnect, fullTable);
}

@FXML
void emailCheckButton(ActionEvent event) throws SQLException, ClassNotFoundException {
String query = "select * from `30712964_clock_in`.clocks where username='"+emaiInput.getText()+"'";

setupList(query, emailTable, dateTable, clockInTable, clockOutTable, serverConnect, fullTable);
}


static void setupList(String query, TableColumn<Clocks, String> emailTable, TableColumn<Clocks, String> dateTable, TableColumn<Clocks, String> clockInTable, TableColumn<Clocks, String> clockOutTable, ServerConnect serverConnect, TableView<Clocks> fullTable) throws SQLException, ClassNotFoundException {

emailTable.setCellValueFactory(new PropertyValueFactory<>("email"));
Expand All @@ -86,13 +93,11 @@ static void setupList(String query, TableColumn<Clocks, String> emailTable, Tabl
clockInTable.setCellValueFactory(new PropertyValueFactory<>("clockIn"));
clockOutTable.setCellValueFactory(new PropertyValueFactory<>("clockOut"));
ObservableList<Clocks> observableList = FXCollections.observableArrayList();
System.out.println("Tu jestem 2");
serverConnect.getConnection();
System.out.println("Tu jestem 3");
PreparedStatement statement = serverConnect.connection.prepareCall(query);
System.out.println("Tu jestem 4");

ResultSet rs = statement.executeQuery();
System.out.println("Tu jestem 5");


while (rs.next()){

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sample.controllers;
package sample.controllers.Classes;

public class Clocks {
private String email;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sample.controllers;
package sample.controllers.Classes;

public class User {
private String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sample.controllers;
package sample.controllers.FxScenes;

import javafx.scene.control.Alert;

Expand Down
9 changes: 3 additions & 6 deletions src/sample/controllers/LogInPaneController.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package sample.controllers;

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import sample.controllers.Classes.Clocks;
import sample.controllers.Classes.User;

import java.io.IOException;
import java.net.URL;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ResourceBundle;

Expand All @@ -39,7 +36,7 @@ public class LogInPaneController implements Initializable {
private TableColumn<Clocks, String> clock_out_table;
@FXML
private TextField infoField;
private User user;
private User user;

public User getUser() {
return user;
Expand Down
2 changes: 2 additions & 0 deletions src/sample/controllers/MainPaneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.stage.Stage;
import sample.controllers.Classes.User;
import sample.controllers.FxScenes.AlertWindow;


import java.io.IOException;
Expand Down
1 change: 1 addition & 0 deletions src/sample/controllers/RegistryPaneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javafx.scene.control.CheckBox;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import sample.controllers.FxScenes.AlertWindow;

import java.io.IOException;
import java.sql.CallableStatement;
Expand Down
4 changes: 2 additions & 2 deletions src/sample/views/AdminPane.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<Line endX="127.29290771484375" endY="-5.020804405212402" startX="-100.74752807617188" startY="-5.020802974700928" />
<TextField editable="false" text="Check clock by date ? Set date :" />
<TextField fx:id="dateInput" promptText="YYYY-MM-DD" />
<Button fx:id="dateCheckButton" mnemonicParsing="false" prefHeight="25.0" prefWidth="230.0" text="Check" />
<Button fx:id="dateCheckButton" mnemonicParsing="false" onAction="#dateCheckButton" prefHeight="25.0" prefWidth="230.0" text="Check" />
<Line endX="127.29290771484375" endY="-5.020804405212402" startX="-100.74752807617188" startY="-5.020802974700928" />
<TextField editable="false" text="Check clock by email? Set email:" />
<TextField fx:id="emaiInput" promptText="Email" />
<Button fx:id="emailCheckButton" mnemonicParsing="false" prefHeight="25.0" prefWidth="229.0" text="Check" />
<Button fx:id="emailCheckButton" mnemonicParsing="false" onAction="#emailCheckButton" prefHeight="25.0" prefWidth="229.0" text="Check" />
</children>
</VBox>
</children>
Expand Down