0% found this document useful (0 votes)
13 views

Group3 Puso

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Group3 Puso

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

Technological Institute of the Philippines

Quezon City
College of Information Technology Education

CS201 – Data Structures and


Algorithms

TITLE OF PROJECT
Project Documentation

Tulagan, Robert

Panganiban, Alexius Arielle B.

Sayo, Keith

Omana,Luis

Salta, Myke
Second Semester SY 2020-2021

Submitted to

Dr. Rosmina Joy M. Cabauatan

Table of Contents
Page No.
I. Course Objectives
………………………….
- See syllabus
II. Course Outcomes
…………………………..
- See syllabus
III. Project
Rationale……………………………
IV. Project Objectives …………………………
V. Conceptual Framework (With
Description)……
VI. Screenshots (With Descriptions of each
frame/applet/window)…....
VII. Source
Code………………………………….
- with class name as heading and
description of function of the class in the
form of a Java comment in the code
(before the import package line)
VIII. Screenshot of Project Explorer in Eclipse
Editor ………………………………….
- with description of each package and
each class in the Java project.
IX. Installation Guide
- instructions if there are files that are
necessary to be copied or transferred to a
folder before system execution.
X. Members Information …………………..
- Name of Leader –
- Email Address and Contact Number
- Name of Member 1
- Email Address and Contact Number
- Name of Member 2
- Email Address and Contact Number

Course Objectives
The course aims to provide students with the knowledge and skills in data structures
and algorithms and their implementations in Java programming. It also aims to develop
the affective domain learning abilities of students such as receiving, responding,
valuing, organizing, and characterizing as they perform the course learning activities
and assessment tasks.

Course Outcomes
By the end of the course, the students will be able to:

1. Examine the fundamentals and core concepts of Java Programming in the


implementation of different data structures;
2. Apply data structures in solving problems using Java programming language;
3. Design Java programs using appropriate methods and operations of different
data structures and algorithms;
4. Measure the complexity of algorithms by expressing the efficiency in terms of
time complexity and big-O notation;
5. Develop an application using different data structures and algorithms; and
6. Reflect on personal transformation along with the TIP graduate attributes.
Project Rationale
(The Project Rationale is a statement of facts explaining the background of the
project)

The development of the Inventory Management System (IMS) by 2nd-year IT students in Java
is driven by the necessity to address the limitations and inefficiencies inherent in manual
inventory management processes. Traditional methods are error-prone, time-consuming, and
lack the scalability required to meet the demands of modern businesses. The IMS aims to
automate and streamline inventory-related tasks, providing a robust and user-friendly solution
for businesses to manage their inventory efficiently.

The key problems the IMS seeks to solve include discrepancies in inventory levels, delayed
order processing, and the absence of real-time tracking. By automating these processes, the
system aims to enhance accuracy, reduce lead times, and enable businesses to make informed
decisions based on up-to-date inventory data. The scope of the project encompasses inventory
tracking and control, order processing, reporting, and analytics, with a focus on delivering a
user-friendly interface for all stakeholders.

Project Objectives
(These are the objectives that you want the project to accomplish.)

● Ensure Sustainability in Supply Chain.


● Optimize Supplier Management.
● Enhance the Supplier's Collaboration.
● Improve visibility and transparency.
● Ensure Quality Control.
Conceptual Framework

Input Process Output

(List of attributes (Procedure of each (Output of each module


module of the
and their purpose) application) of the application)

Product information (e.g., Handles basic storage Storage and retrieval of


name, quantity, price) stored of data, especially useful inventory data using
in a fixed-size array. for fixed-size datasets. arrays.

Dynamic product information It accommodates Flexible storage and


that may vary in quantity and scenarios where the retrieval of variable-sized
attributes. number of products can product information from
change over time. The the dynamic array list.
productArrayList
attribute facilitates the
flexible storage and
retrieval of product
information.

Unsorted product lists. attribute defines the Sorted lists of product


criteria for sorting, such information based on
as sorting products by specified sorting criteria.
name, quantity, or price.
The output is a sorted
list for easier navigation
and analysis.
Order information, requiring The orderQueue Sequential processing of
sequential processing. attribute manages the orders using the queue
sequential processing of and linked list.
orders, while the
linkedOrderList attribute
maintains linked lists for
managing related data,
enhancing efficiency in
order management.

Hierarchical organization Inserts for the Tree-based representation


requirements for product hierarchical organization of product categories and
categorization. of product data. The subcategories for efficient
productTree attribute organization.
represents a tree-based
structure that efficiently
categorizes products
into different levels,
facilitating organized
navigation and
management.

Screenshots
Procurement

SupplierSide
ClientInterface
Logistics

AdminSide_Client
AdminSide
Source Code
AdminSide_Client
/*
AdminSide_Client - Represents a GUI application for managing inventory information.

This class sets up a graphical user interface (GUI) for handling inventory
management tasks. It includes functionality for displaying, updating,
deleting, and fetching inventory data stored in a MySQL database. The GUI includes
various components such as text fields, buttons, and a table
to interact with the database and perform CRUD (Create, Read, Update, Delete)
operations on inventory information.
*/

package logistics;

// Import statements remain unchanged.


import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.sql.*;
import java.util.Vector;
import javax.swing.border.TitledBorder;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AdminSide_Client extends JFrame {

private JTable dataTable;


private JTextField ordernumber;
private JTextField customerName;
private JTextField customerAddress;
private JTextField productOrder;
private JTextField customerID;

public AdminSide_Client() {
getContentPane().setBackground(Color.WHITE);
setTitle("Database Table Example");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(971, 494);

dataTable = new JTable();


JScrollPane scrollPane = new JScrollPane(dataTable);
scrollPane.setBounds(30, 144, 406, 259);
scrollPane.setPreferredSize(new Dimension(580, 300));
getContentPane().setLayout(null);
getContentPane().add(scrollPane);

JPanel panel = new JPanel();


panel.setBackground(Color.BLACK);
panel.setBounds(10, 0, 945, 90);
getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("INVENTORY MANAGEMENT (ADMIN)");


lblNewLabel.setBounds(105, 27, 489, 39);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 33));
lblNewLabel.setForeground(Color.YELLOW);

JPanel panel_1 = new JPanel();


panel_1.setLayout(null);
panel_1.setBackground(Color.BLACK);
panel_1.setBounds(10, 101, 945, 21);
getContentPane().add(panel_1);

JLabel lblITE = new JLabel("C U S T O M E R I N F O R M A T I O N");


lblITE.setForeground(SystemColor.controlShadow);
lblITE.setFont(new Font("Dialog", Font.BOLD, 14));
lblITE.setBounds(468, 164, 272, 14);
getContentPane().add(lblITE);

ordernumber = new JTextField();


ordernumber.setForeground(Color.BLACK);
ordernumber.setFont(new Font("Dialog", Font.PLAIN, 14));
ordernumber.setColumns(10);
ordernumber.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Order Number", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
ordernumber.setBounds(468, 189, 114, 36);
getContentPane().add(ordernumber);

customerName = new JTextField();


customerName.setForeground(Color.BLACK);
customerName.setFont(new Font("Dialog", Font.PLAIN, 14));
customerName.setColumns(10);
customerName.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Name", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
customerName.setBounds(713, 189, 204, 36);
getContentPane().add(customerName);

JLabel lblNewLabel_1 = new JLabel("Product Quanity");


lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 16));
lblNewLabel_1.setBounds(668, 283, 152, 30);
getContentPane().add(lblNewLabel_1);

JSpinner spinner = new JSpinner();


spinner.setBounds(797, 283, 42, 36);
getContentPane().add(spinner);

customerAddress = new JTextField();


customerAddress.setForeground(Color.BLACK);
customerAddress.setFont(new Font("Dialog", Font.PLAIN, 14));
customerAddress.setColumns(10);
customerAddress.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Address", TitledBorder.LEADING, TitledBorder.TOP, null,
new Color(0, 0, 0)));
customerAddress.setBounds(468, 236, 450, 36);
getContentPane().add(customerAddress);

JButton btnUpdate = new JButton("Update");


btnUpdate.setForeground(Color.WHITE);
btnUpdate.setFont(new Font("Dialog", Font.BOLD, 14));
btnUpdate.setBorder(null);
btnUpdate.setBackground(Color.BLACK);
btnUpdate.setBounds(810, 345, 95, 36);
getContentPane().add(btnUpdate);

JButton btnDisplay = new JButton("Display");


btnDisplay.setForeground(Color.WHITE);
btnDisplay.setFont(new Font("Dialog", Font.BOLD, 14));
btnDisplay.setBorder(null);
btnDisplay.setBackground(Color.BLACK);
btnDisplay.setBounds(563, 345, 95, 36);
getContentPane().add(btnDisplay);

JButton btnDelete = new JButton("Delete");

btnDelete.setForeground(Color.WHITE);
btnDelete.setFont(new Font("Dialog", Font.BOLD, 14));
btnDelete.setBorder(null);
btnDelete.setBackground(Color.BLACK);
btnDelete.setBounds(810, 392, 95, 36);
getContentPane().add(btnDelete);

JButton btnFetch = new JButton("Fetch");

btnFetch.setForeground(Color.WHITE);
btnFetch.setFont(new Font("Dialog", Font.BOLD, 14));
btnFetch.setBorder(null);
btnFetch.setBackground(Color.BLACK);
btnFetch.setBounds(690, 345, 95, 36);
getContentPane().add(btnFetch);
productOrder = new JTextField();
productOrder.setForeground(Color.BLACK);
productOrder.setFont(new Font("Dialog", Font.PLAIN, 14));
productOrder.setColumns(10);
productOrder.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product to Order", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
productOrder.setBounds(468, 281, 190, 36);
getContentPane().add(productOrder);

customerID = new JTextField();


customerID.setForeground(Color.BLACK);
customerID.setFont(new Font("Dialog", Font.PLAIN, 14));
customerID.setColumns(10);
customerID.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer ID", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
customerID.setBounds(590, 189, 114, 36);
getContentPane().add(customerID);

btnDisplay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

try (Connection connection =


DriverManager.getConnection("jdbc:mysql://localhost:3306/database1", "root",
"password")) {
String query = "SELECT * FROM customer_crud";
try (PreparedStatement preparedStatement =
connection.prepareStatement(query)) {
ResultSet resultSet = preparedStatement.executeQuery();

// Get metadata to determine column names


ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
Vector<String> columnNames = new Vector<>();

for (int i = 1; i <= columnCount; i++) {


columnNames.add(metaData.getColumnName(i));
}

// Create DefaultTableModel with column names


DefaultTableModel tableModel = new
DefaultTableModel(columnNames, 0);

// Populate the table with data


while (resultSet.next()) {
Vector<Object> rowData = new Vector<>();
for (int i = 1; i <= columnCount; i++) {
rowData.add(resultSet.getObject(i));
}
tableModel.addRow(rowData);
}

// Set the model to the JTable


dataTable.setModel(tableModel);
}
} catch (SQLException e1) {
e1.printStackTrace();
JOptionPane.showMessageDialog(null, "Error fetching data from the
database");
}

}
});

btnUpdate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {

Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/database1","root",
"password");
PreparedStatement pstmt =
conn.prepareStatement("UPDATE customer_crud SET `ordernumber`=?, `customerid`
= ?, customername = ?, customeraddress = ?, productorder=?, quantity=? WHERE
`ordernumber`=" + ordernumber.getText()+"");
pstmt.setInt(1,
Integer.parseInt(ordernumber.getText()));
pstmt.setInt(2,
Integer.parseInt(customerID.getText()));
pstmt.setString(3, customerName.getText());
pstmt.setString(4, customerAddress.getText());
pstmt.setString(5, productOrder.getText());
pstmt.setInt(6, (int) spinner.getValue());

pstmt.executeUpdate();
JOptionPane.showMessageDialog(null,
"Records have been updated");

}catch(Exception e1) {
System.out.println(e1);
}
}
});

btnFetch.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/database1","root",
"password");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT
`ordernumber` ,`customerid`,customername, customeraddress, productorder, `quantity`
FROM customer_crud WHERE `ordernumber`=" + ordernumber.getText()+"");

while (rs.next()) {

ordernumber.setText(Integer.toString(rs.getInt("ordernumber")));

customerID.setText(Integer.toString(rs.getInt("customerid")));

customerName.setText(rs.getString("customername"));

customerAddress.setText(rs.getString("customeraddress"));
productOrder.setText(rs.getString("productorder"));
spinner.setValue(rs.getInt("quantity"));
}

}catch(Exception e9) {
System.out.println(e9);
}

}
});

btnDelete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/database1","root",
"password");
Statement st = conn.createStatement();
st.executeUpdate("Delete FROM customer_crud
WHERE `ordernumber`=" + ordernumber.getText()+"");

JOptionPane.showMessageDialog(null, "Record
Successfully deleted");

} catch (Exception e1) {


System.out.println(e1);
}
}
});

// Fetch data from the database and populate the table

setLocationRelativeTo(null);
setVisible(true);
}

public static void main(String[] args) {


SwingUtilities.invokeLater(AdminSide_Client::new);
}
}

AdminSide
/*
AdminSide - Manages inventory information through a graphical user interface.

This class creates a graphical user interface (GUI) for managing inventory
information. It includes functionalities such as displaying, updating,
deleting, and fetching data related to items stored in a MySQL database. The GUI
contains various components like text fields, buttons, tables,
and log displays to facilitate CRUD (Create, Read, Update, Delete) operations on
item data.
*/

package logistics;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.sql.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Vector;
import javax.swing.border.TitledBorder;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.List;

public class AdminSide extends JFrame {


private ArrayList<String[]> logList;

private DefaultTableModel logTableModel;


private JTable logTable;

private DefaultTableModel tableModel;


private JTable dataTable;
private JTextField itemCode;
private JTextField itemName;
private JTextField itemPrice;
private DefaultTableModel dataTableModel;

public AdminSide() {

logTableModel = new DefaultTableModel(new Object[]{"Log"}, 0);


logTable = new JTable(logTableModel);
JScrollPane logScrollPane = new JScrollPane(logTable);
logScrollPane.setBounds(30, 460, 888, 120);
getContentPane().add(logScrollPane);

getContentPane().setBackground(Color.WHITE);
setTitle("Database Table Example");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(971, 637);

dataTable = new JTable();


JScrollPane scrollPane = new JScrollPane(dataTable);
scrollPane.setBounds(30, 144, 406, 259);
scrollPane.setPreferredSize(new Dimension(580, 300));
getContentPane().setLayout(null);
getContentPane().add(scrollPane);

JPanel panel = new JPanel();


panel.setBackground(Color.BLACK);
panel.setBounds(10, 0, 945, 90);
getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("INVENTORY MANAGEMENT (ADMIN)");


lblNewLabel.setBounds(105, 27, 489, 39);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 33));
lblNewLabel.setForeground(Color.YELLOW);

JPanel panel_1 = new JPanel();


panel_1.setLayout(null);
panel_1.setBackground(Color.BLACK);
panel_1.setBounds(10, 101, 945, 21);
getContentPane().add(panel_1);

JLabel lblITE = new JLabel("I T E M I N F O R M A T I O N");


lblITE.setForeground(SystemColor.controlShadow);
lblITE.setFont(new Font("Dialog", Font.BOLD, 14));
lblITE.setBounds(468, 164, 272, 14);
getContentPane().add(lblITE);

itemCode = new JTextField();


itemCode.setForeground(Color.BLACK);
itemCode.setFont(new Font("Dialog", Font.PLAIN, 14));
itemCode.setColumns(10);
itemCode.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Item Code",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
itemCode.setBounds(468, 189, 152, 36);
getContentPane().add(itemCode);

itemName = new JTextField();


itemName.setForeground(Color.BLACK);
itemName.setFont(new Font("Dialog", Font.PLAIN, 14));
itemName.setColumns(10);
itemName.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Item Name",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
itemName.setBounds(640, 189, 278, 36);
getContentPane().add(itemName);

JLabel lblNewLabel_1 = new JLabel("Product Quanity");


lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 16));
lblNewLabel_1.setBounds(686, 236, 152, 30);
getContentPane().add(lblNewLabel_1);

JSpinner spinner = new JSpinner();


spinner.setBounds(810, 236, 42, 36);
getContentPane().add(spinner);

itemPrice = new JTextField();


itemPrice.setForeground(Color.BLACK);
itemPrice.setFont(new Font("Dialog", Font.PLAIN, 14));
itemPrice.setColumns(10);
itemPrice.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Item Price",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
itemPrice.setBounds(468, 229, 198, 36);
getContentPane().add(itemPrice);

JButton btnRestock = new JButton("Restock");

int val = (int) spinner.getValue();

btnRestock.setForeground(Color.WHITE);
btnRestock.setFont(new Font("Dialog", Font.BOLD, 14));
btnRestock.setBorder(null);
btnRestock.setBackground(Color.BLACK);
btnRestock.setBounds(466, 312, 95, 36);
getContentPane().add(btnRestock);

JButton btnUpdate = new JButton("Update");

btnUpdate.setForeground(Color.WHITE);
btnUpdate.setFont(new Font("Dialog", Font.BOLD, 14));
btnUpdate.setBorder(null);
btnUpdate.setBackground(Color.BLACK);
btnUpdate.setBounds(810, 312, 95, 36);
getContentPane().add(btnUpdate);

JButton btnDisplay = new JButton("Display");

String url = "jdbc:mysql://localhost:3306/your_database";


String username = "your_username";
String password = "your_password";
btnDisplay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try (Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567")) {
String query = "SELECT * FROM admin_crud";
try (PreparedStatement preparedStatement =
connection.prepareStatement(query)) {
ResultSet resultSet = preparedStatement.executeQuery();

// Get metadata to determine column names


ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
Vector<String> columnNames = new Vector<>();

for (int i = 1; i <= columnCount; i++) {


columnNames.add(metaData.getColumnName(i));
}

DefaultTableModel tableModel = new DefaultTableModel(columnNames,


0);

while (resultSet.next()) {
Vector<Object> rowData = new Vector<>();
for (int i = 1; i <= columnCount; i++) {
rowData.add(resultSet.getObject(i));
}
tableModel.addRow(rowData);
}

logTableModel.addRow(new Object[]{"Displayed row for item code: " +


itemCode.getText() });

// Set the model to the JTable


dataTable.setModel(tableModel);
}
} catch (SQLException e2) {
e2.printStackTrace();
JOptionPane.showMessageDialog( null, "Error fetching data from the
database");
}

}
});
btnDisplay.setForeground(Color.WHITE);
btnDisplay.setFont(new Font("Dialog", Font.BOLD, 14));
btnDisplay.setBorder(null);
btnDisplay.setBackground(Color.BLACK);
btnDisplay.setBounds(581, 312, 95, 36);
getContentPane().add(btnDisplay);

JButton btnDelete = new JButton("Delete");

btnDelete.setForeground(Color.WHITE);
btnDelete.setFont(new Font("Dialog", Font.BOLD, 14));
btnDelete.setBorder(null);
btnDelete.setBackground(Color.BLACK);
btnDelete.setBounds(810, 367, 95, 36);
getContentPane().add(btnDelete);

JButton btnFetch = new JButton("Fetch");

btnFetch.setForeground(Color.WHITE);
btnFetch.setFont(new Font("Dialog", Font.BOLD, 14));
btnFetch.setBorder(null);
btnFetch.setBackground(Color.BLACK);
btnFetch.setBounds(694, 312, 95, 36);
getContentPane().add(btnFetch);

JLabel lblADM = new JLabel("A D M I N L O G S");


lblADM.setForeground(SystemColor.controlShadow);
lblADM.setFont(new Font("Dialog", Font.BOLD, 14));
lblADM.setBounds(30, 441, 272, 14);
getContentPane().add(lblADM);

JPanel panel_1_1 = new JPanel();


panel_1_1.setLayout(null);
panel_1_1.setBackground(Color.BLACK);
panel_1_1.setBounds(0, 414, 955, 21);
getContentPane().add(panel_1_1);

JButton btnSort = new JButton("Sort");

btnSort.setForeground(Color.WHITE);
btnSort.setFont(new Font("Dialog", Font.BOLD, 14));
btnSort.setBorder(null);
btnSort.setBackground(Color.BLACK);
btnSort.setBounds(694, 367, 95, 36);
getContentPane().add(btnSort);

logList = new ArrayList<>();

btnRestock.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
String query= "INSERT INTO admin_crud (itemCode,
itemName, itemPrice, productQuantity) VALUES (?, ?, ?, ?)";
PreparedStatement ps=con.prepareStatement(query);
ps.setInt(1, Integer.parseInt(itemCode.getText()));
ps.setString(2, itemName.getText());
ps.setInt(3, Integer.parseInt(itemPrice.getText()));
ps.setInt(4, (int)spinner.getValue());

ps.executeUpdate();

String[] logData = {
itemCode.getText(),
itemName.getText(),
itemPrice.getText(),
String.valueOf(spinner.getValue())
};
logList.add(logData);

logTableModel.addRow(new Object[]{"Restocked: " +


Arrays.toString(logData)});

} catch (Exception e1) {


System.out.println(e1);
}

}
});

btnDelete.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();
st.executeUpdate("Delete FROM admin_crud
WHERE `itemCode`=" + itemCode.getText()+"");

logTableModel.addRow(new Object[]{"Deleted row for


item code: " + itemCode.getText() });
} catch (Exception e1) {
System.out.println(e1);
}

}
});

btnFetch.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT `itemCode`,
itemName, `itemPrice`, `productQuantity` FROM admin_crud WHERE `itemCode`=" +
itemCode.getText()+"");

while (rs.next()) {

itemCode.setText(Integer.toString(rs.getInt("itemCode")));
itemName.setText(rs.getString("itemName"));
itemPrice.setText(Integer.toString(rs.getInt("itemPrice")));
spinner.setValue(rs.getInt("productQuantity"));
}

logTableModel.addRow(new Object[]{"Fetched data


for item code: " + itemCode.getText() });
}catch(Exception e9) {
System.out.println(e9);
}
}
});

btnUpdate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {

Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
PreparedStatement pstmt =
conn.prepareStatement("UPDATE admin_crud SET `itemCode` = ?, itemName = ?,
`itemPrice` = ?, `productQuantity`=? WHERE `itemCode`=" + itemCode.getText()+"");
pstmt.setInt(1,
Integer.parseInt(itemCode.getText()));
pstmt.setString(2, itemName.getText());
pstmt.setInt(3,
Integer.parseInt(itemPrice.getText()));
pstmt.setInt(4, (int)spinner.getValue());

pstmt.executeUpdate();

logTableModel.addRow(new Object[]{"Updated
row for item code:" + itemCode.getText() + " [" + itemCode.getText() + "," +
itemName.getText() + "," + itemPrice.getText() + "," + spinner.getValue() + "]" });

}catch(Exception e1) {
System.out.println(e1);
}
}
});

btnSort.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
fetchDataAndSort();
}
});

// Fetch data from the database and populate the table

setLocationRelativeTo(null);
setVisible(true);
}

public static void main(String[] args) {


SwingUtilities.invokeLater(AdminSide::new);
}

private void fetchDataAndSort() {


try (Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567")) {
String query = "SELECT * FROM admin_crud";
try (PreparedStatement preparedStatement =
connection.prepareStatement(query)) {
ResultSet resultSet = preparedStatement.executeQuery();

// Get data from ResultSet and store it in a List


List<String[]> dataList = new ArrayList<>();
while (resultSet.next()) {
String[] rowData = {
String.valueOf(resultSet.getInt("itemCode")),
resultSet.getString("itemName"),
String.valueOf(resultSet.getInt("itemPrice")),
String.valueOf(resultSet.getInt("productQuantity"))
};
dataList.add(rowData);
}

// Sort the data based on item price in descending order using quicksort
quickSort(dataList, 0, dataList.size() - 1, 2); // Assuming item price is at index
2
// Update the JTable with the sorted data
DefaultTableModel tableModel = new DefaultTableModel(new Object[]{"Item
Code", "Item Name", "Item Price", "Product Quantity"}, 0);
for (String[] rowData : dataList) {
tableModel.addRow(rowData);
}
dataTable.setModel(tableModel);

// Update the database with the sorted data


updateDatabase(dataList);
}
} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Error fetching or sorting data from the
database");
}
}

private void quickSort(List<String[]> data, int low, int high, int sortIndex) {
if (low < high) {
int partitionIndex = partition(data, low, high, sortIndex);

quickSort(data, low, partitionIndex - 1, sortIndex);


quickSort(data, partitionIndex + 1, high, sortIndex);
}
}

private int partition(List<String[]> data, int low, int high, int sortIndex) {
String[] pivot = data.get(high);
int i = low - 1;

for (int j = low; j < high; j++) {


if (Integer.parseInt(data.get(j)[sortIndex]) >= Integer.parseInt(pivot[sortIndex])) {
i++;

String[] temp = data.get(i);


data.set(i, data.get(j));
data.set(j, temp);
}
}

String[] temp = data.get(i + 1);


data.set(i + 1, data.get(high));
data.set(high, temp);
return i + 1;
}

private void updateDatabase(List<String[]> data) {


// Update the database with the sorted data
try (Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567")) {
// Clear existing data in the table
try (PreparedStatement clearStatement =
connection.prepareStatement("TRUNCATE TABLE admin_crud")) {
clearStatement.executeUpdate();
}

// Insert the sorted data into the table


try (PreparedStatement insertStatement = connection.prepareStatement(
"INSERT INTO admin_crud (itemCode, itemName, itemPrice,
productQuantity) VALUES (?, ?, ?, ?)")) {
for (String[] row : data) {
insertStatement.setInt(1, Integer.parseInt(row[0]));
insertStatement.setString(2, row[1]);
insertStatement.setInt(3, Integer.parseInt(row[2]));
insertStatement.setInt(4, Integer.parseInt(row[3]));

insertStatement.executeUpdate();
}
}
} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Error updating data in the database");
}
}
}

ClientInterface
// Class: ClientInterface
// Description: Manages the inventory system and customer orders through a Swing-
based interface.
package logistics;

import java.sql.*;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Toolkit;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.JRadioButton;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.awt.event.ActionEvent;
import javax.swing.ButtonGroup;
import javax.swing.SwingConstants;
import java.awt.SystemColor;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import javax.swing.border.BevelBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.JToggleButton;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.JSpinner;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;

public class ClientInterface extends JFrame {


private static String url = "\"jdbc:mysql://localhost:3306/sys";
private static String userid = "root";
private static String password = "1234567";
private JPanel contentPane;
private JTextField customerName;
private final ButtonGroup buttonGroup = new ButtonGroup();
private JTextField customerAddress;
private JTextField productOrder;
private static int spinnerValue;
private JTextField customerID;
private static int add = 0;
private JTextField productOrder1;
private JTextField productOrder_2;
private JTextField productOrder_3;
private LinkedList<OrderDetails> orderList;
private JSpinner spinner;
private JSpinner spinner_1;
private JSpinner spinner_2;
private JSpinner spinner_3;
private JLabel productQuantity_1;
private JLabel productQuantity_2;
private JLabel productQuantity_3;

/**
* Launch the application.
* @return
*/

// You may need to adjust the positions and sizes based on your layout
preferences

public static void main(String[] args) {


EventQueue.invokeLater(new Runnable() {
public void run() {
try {

ClientInterface frame = new ClientInterface();


frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public ClientInterface() {

orderList = new LinkedList<>();

setBackground(UIManager.getColor("Button.shadow"));

setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\tipqc\\Downloads\\i
con.jpg"));
setTitle("Registration form");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 647, 512);
contentPane = new JPanel();
contentPane.setBackground(SystemColor.controlHighlight);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);
contentPane.setLayout(null);

JPanel panel = new JPanel();


panel.setBackground(Color.BLACK);
panel.setBounds(0, 0, 803, 84);
contentPane.add(panel);
panel.setLayout(null);

JLabel lblNewLabel_2_1 = new JLabel("INVENTORY MANAGEMENT");


lblNewLabel_2_1.setForeground(Color.YELLOW);
lblNewLabel_2_1.setFont(new Font("Impact", Font.PLAIN, 38));
lblNewLabel_2_1.setBounds(224, 11, 477, 66);
panel.add(lblNewLabel_2_1);

JPanel panel_1 = new JPanel();


panel_1.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(39, 205, 155), null, null, new Color(39,
205, 155)), "", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(39, 205,
155)));
panel_1.setBackground(Color.WHITE);
panel_1.setBounds(0, 137, 803, 350);
contentPane.add(panel_1);
panel_1.setLayout(null);

JLabel customerInfo = new JLabel("C U S T O M E R I N F O R M A T I O


N");
customerInfo.setForeground(SystemColor.controlShadow);
customerInfo.setFont(new Font("Dialog", Font.BOLD, 14));
customerInfo.setBounds(20, 23, 272, 14);
panel_1.add(customerInfo);

customerName = new JTextField();


customerName.setForeground(Color.BLACK);
customerName.setFont(new Font("Dialog", Font.PLAIN, 14));
customerName.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Name", TitledBorder.LEADING, TitledBorder.TOP, null,
Color.BLACK));
customerName.setBounds(187, 48, 568, 36);
panel_1.add(customerName);
customerName.setColumns(10);

JButton btnOrder = new JButton("Finalize");


btnOrder.setEnabled(false);
btnOrder.setForeground(new Color(0, 0, 0));
btnOrder.setBackground(new Color(0, 250, 154));
btnOrder.setBorder(null);
btnOrder.setBounds(646, 290, 111, 36);
panel_1.add(btnOrder);

JButton btnReset = new JButton("Reset");


btnReset.setBackground(new Color(250, 128, 114));
btnReset.setBorder(null);
btnReset.setForeground(Color.WHITE);
btnReset.setBounds(646, 242, 109, 36);
panel_1.add(btnReset);

btnOrder.setFont(new Font("Dialog", Font.BOLD, 14));


customerAddress = new JTextField();
customerAddress.setForeground(Color.BLACK);
customerAddress.setFont(new Font("Dialog", Font.PLAIN, 14));
customerAddress.setColumns(10);
customerAddress.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Address", TitledBorder.LEADING, TitledBorder.TOP, null,
new Color(0, 0, 0)));
customerAddress.setBounds(20, 95, 735, 36);
panel_1.add(customerAddress);

productOrder = new JTextField();


productOrder.setForeground(Color.BLACK);
productOrder.setFont(new Font("Dialog", Font.PLAIN, 14));
productOrder.setColumns(10);
productOrder.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product to Order", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
productOrder.setBounds(20, 142, 130, 36);
panel_1.add(productOrder);

JSpinner spinner = new JSpinner();

spinner.setBounds(295, 142, 42, 36);


panel_1.add(spinner);
int spinnerVal = (int) spinner.getValue();

JLabel productQuantity = new JLabel("Product Quantity");


productQuantity.setFont(new Font("Dialog", Font.PLAIN, 16));
productQuantity.setBounds(173, 142, 119, 30);
panel_1.add(productQuantity);

JPanel jpanel2ndheader = new JPanel();


jpanel2ndheader.setBounds(0, 89, 803, 56);
contentPane.add(jpanel2ndheader);
jpanel2ndheader.setLayout(null);
jpanel2ndheader.setBorder(new LineBorder(Color.BLACK, 2));
jpanel2ndheader.setBackground(Color.BLACK);

JLabel jlabelagent = new JLabel("Customer Order Form. Please fill up the


necessary information below.");
jlabelagent.setForeground(Color.YELLOW);
jlabelagent.setFont(new Font("Dialog", Font.PLAIN, 13));
jlabelagent.setBounds(195, 11, 522, 43);
jpanel2ndheader.add(jlabelagent);

btnReset.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

customerID.setText("");
customerName.setText("");
customerAddress.setText("");
productOrder.setText("");

productOrder.setText("");
buttonGroup.clearSelection();

spinner.setValue(0);

main(null);

}
});
btnReset.setFont(new Font("Dialog", Font.BOLD, 14));

btnOrder.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection(url, userid, password);

for (OrderDetails orderDetails : orderList) {


String query = "INSERT INTO customer_crud (customerid ,
customerName, customerAddress, productorder, quantity, paymentStatus,
deliveryStatus) " +
"VALUES (?, ?, ?, ?,?,?,?)";
PreparedStatement ps = con.prepareStatement(query);
ps.setInt(1, Integer.parseInt(customerID.getText()));
ps.setString(2, orderDetails.getCustomerName());
ps.setString(3, orderDetails.getCustomerAddress());
ps.setString(6, "Paid");
ps.setString(7, "Pending");

List<String> productOrders = orderDetails.getProductOrders();


List<Integer> spinners = orderDetails.getSpinners();

// Insert orders dynamically based on the size of the lists


for (int i = 0; i < Math.min(productOrders.size(), spinners.size()); i++) {
ps.setString(4, productOrders.get(i));
ps.setInt(5, spinners.get(i));
ps.executeUpdate();
}
}

JOptionPane.showMessageDialog(null, "Orders finalized");

orderList.clear();

} catch (Exception e1) {


System.out.println(e1);
}
}

});

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(819, 526);
setLocationRelativeTo(null);
setVisible(true);

customerID = new JTextField();


customerID.setForeground(Color.BLACK);
customerID.setFont(new Font("Dialog", Font.PLAIN, 14));
customerID.setColumns(10);
customerID.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer ID:", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
customerID.setBounds(20, 48, 157, 36);
panel_1.add(customerID);

JButton btnAddAnotherProduct = new JButton("Add Item");


btnAddAnotherProduct.setEnabled(true);

btnAddAnotherProduct.setForeground(Color.WHITE);
btnAddAnotherProduct.setFont(new Font("Dialog", Font.BOLD, 14));
btnAddAnotherProduct.setBorder(null);
btnAddAnotherProduct.setBackground(Color.BLACK);
btnAddAnotherProduct.setBounds(403, 242, 111, 36);
panel_1.add(btnAddAnotherProduct);

JButton btnLockOrder = new JButton("Lock Order");

btnLockOrder.setForeground(Color.WHITE);
btnLockOrder.setFont(new Font("Dialog", Font.BOLD, 14));
btnLockOrder.setBorder(null);
btnLockOrder.setBackground(Color.BLACK);
btnLockOrder.setBounds(524, 242, 111, 36);
panel_1.add(btnLockOrder);

JButton btnPay = new JButton("Pay");


btnPay.setEnabled(false);

btnPay.setForeground(Color.WHITE);
btnPay.setFont(new Font("Dialog", Font.BOLD, 14));
btnPay.setBorder(null);
btnPay.setBackground(Color.BLACK);
btnPay.setBounds(525, 290, 111, 36);
panel_1.add(btnPay);

JLabel lblNewLabel_1_2_1_1 = new JLabel("Payment Method\r\n");


lblNewLabel_1_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 13));
lblNewLabel_1_2_1_1.setBounds(34, 253, 254, 30);
panel_1.add(lblNewLabel_1_2_1_1);

JRadioButton rdbtnPaymaya = new JRadioButton("Paymaya\r\n");


rdbtnPaymaya.setBackground(Color.WHITE);
rdbtnPaymaya.setBounds(61, 277, 77, 23);
panel_1.add(rdbtnPaymaya);

JRadioButton rdbtnGcash = new JRadioButton("GCash\r\n");


rdbtnGcash.setBackground(Color.WHITE);
rdbtnGcash.setBounds(149, 277, 120, 23);
panel_1.add(rdbtnGcash);

JButton btnInventory = new JButton("Show Inventory\r\n");


btnInventory.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
InventoryDisplay inventoryDisplay = new InventoryDisplay();
inventoryDisplay.setVisible(true);

}
});
btnInventory.setForeground(Color.WHITE);
btnInventory.setFont(new Font("Dialog", Font.BOLD, 14));
btnInventory.setEnabled(true);
btnInventory.setBorder(null);
btnInventory.setBackground(Color.BLACK);
btnInventory.setBounds(403, 290, 111, 36);
panel_1.add(btnInventory);

btnPay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

JFrame frame;
if(rdbtnPaymaya.isSelected()) {
frame = new JFrame();

frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JTextField skrantut = new JTextField();


skrantut.setBounds(120, 102, 153, 26);
frame.getContentPane().add(skrantut);
skrantut.setColumns(10);
JLabel lblNewLabel_1 = new JLabel("Authorize
transaction in App");
lblNewLabel_1.setBounds(21, 58, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your


Maya number and receive an authorization request on your Maya app.");
lblNewLabel_1_1.setBounds(21, 77, 413, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile


Number");
lblNewLabel_1_2.setFont(new Font("Dialog",
Font.PLAIN, 13));
lblNewLabel_1_2.setBounds(21, 107, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment


is pending");
lblPaymayaIsPending.setFont(new Font("Dialog",
Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(115, 211, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

JButton pay = new JButton("Pay");


pay.setForeground(new Color(255, 255, 0));
pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

JOptionPane.showMessageDialog(null,
"Payment Succesful!");

btnOrder.setEnabled(true);

frame.dispose();

}
});
pay.setBackground(new Color(0, 0, 0));
pay.setBounds(323, 210, 89, 33);
frame.getContentPane().add(pay);
JLabel lblNewLabel_2 = new JLabel("Make sure you
have the Maya app installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 139, 668, 14);
frame.getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_2_1 = new JLabel("If you are


using multiple devices, If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 154, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the


device where you last login to Maya.");
lblNewLabel_2_1_1.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 171, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);

JPanel panel = new JPanel();


panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 434, 47);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("PayMaya");


lblNewLabel.setForeground(new Color(255, 255, 0));
lblNewLabel.setBounds(25, 11, 141, 24);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN,
21));

frame.setVisible(true);

}else if(rdbtnGcash.isSelected()) {
frame = new JFrame();
frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JTextField skrantat = new JTextField();


skrantat.setBounds(120, 102, 153, 26);
frame.getContentPane().add(skrantat);
skrantat.setColumns(10);

JLabel lblNewLabel_1 = new JLabel("Authorize transaction in


App");
lblNewLabel_1.setBounds(21, 58, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your GCash number


and receive an authorization request on your GCash app.");
lblNewLabel_1_1.setBounds(21, 77, 413, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile Number");


lblNewLabel_1_2.setFont(new Font("Dialog", Font.PLAIN, 13));
lblNewLabel_1_2.setBounds(21, 107, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment is pending");


lblPaymayaIsPending.setFont(new Font("Dialog", Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(115, 211, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

JButton pay = new JButton("Pay");


pay.setForeground(new Color(255, 255, 255));
pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

lblPaymayaIsPending.setText("Payment Succesful!");
JOptionPane.showMessageDialog(null, "Payment
Succesful!");

btnOrder.setEnabled(true);

frame.dispose();
}
});
pay.setBackground(new Color(0, 0, 0));
pay.setBounds(323, 210, 89, 33);
frame.getContentPane().add(pay);

JLabel lblNewLabel_2 = new JLabel("Make sure you have the


GCash app installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 139, 668, 14);
frame.getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_2_1 = new JLabel("If you are using multiple


devices, If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 154, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the device where you


last login to GCash.");
lblNewLabel_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 171, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);

JPanel panel = new JPanel();


panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 434, 47);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("GCash");


lblNewLabel.setForeground(new Color(255, 255, 0));
lblNewLabel.setBounds(25, 11, 141, 24);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 21));

frame.setVisible(true);
}

}
});
btnAddAnotherProduct.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

if (add < 1) {

productOrder1 = new JTextField();


productOrder1 = new JTextField();
productOrder1.setForeground(Color.BLACK);
productOrder1.setFont(new Font("Dialog", Font.PLAIN, 14));
productOrder1.setColumns(10);
productOrder1.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product to Order", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
productOrder1.setBounds(373, 142, 130, 36);
panel_1.add(productOrder1);

productQuantity_1 = new JLabel("Product Quantity");


productQuantity_1.setFont(new Font("Dialog", Font.PLAIN, 16));
productQuantity_1.setBounds(526, 142, 119, 30);
panel_1.add(productQuantity_1);

spinner_1 = new JSpinner();


spinner_1.setBounds(648, 142, 42, 36);
panel_1.add(spinner_1);

revalidate();
repaint();

add = 2;
} else if (add == 2) {

productOrder_2 = new JTextField();


productOrder_2.setForeground(Color.BLACK);
productOrder_2.setFont(new Font("Dialog", Font.PLAIN, 14));
productOrder_2.setColumns(10);
productOrder_2.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product to Order", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
productOrder_2.setBounds(20, 189, 130, 36);
panel_1.add(productOrder_2);
productQuantity_2 = new JLabel("Product Quantity");
productQuantity_2.setFont(new Font("Dialog", Font.PLAIN, 16));
productQuantity_2.setBounds(173, 189, 119, 30);
panel_1.add(productQuantity_2);

spinner_2 = new JSpinner();


spinner_2.setBounds(295, 189, 42, 36);
panel_1.add(spinner_2);

revalidate();
repaint();

add = 3;
} else if (add == 3) {

productOrder_3 = new JTextField();


productOrder_3.setForeground(Color.BLACK);
productOrder_3.setFont(new Font("Dialog", Font.PLAIN, 14));
productOrder_3.setColumns(10);
productOrder_3.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product to Order", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
productOrder_3.setBounds(374, 190, 130, 36);
panel_1.add(productOrder_3);

productQuantity_3 = new JLabel("Product Quantity");


productQuantity_3.setFont(new Font("Dialog", Font.PLAIN, 16));
productQuantity_3.setBounds(527, 190, 119, 30);
panel_1.add(productQuantity_3);

spinner_3 = new JSpinner();


spinner_3.setBounds(649, 190, 42, 36);
panel_1.add(spinner_3);

add = 4;
revalidate();
repaint();

btnAddAnotherProduct.setEnabled(false);
}
}
});

btnLockOrder.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
List<String> productOrders = new LinkedList<>();
List<Integer> spinners = new LinkedList<>();

btnPay.setEnabled(true);

productOrders.add(productOrder.getText()); // First product


order
spinners.add((int) spinner.getValue()); // First spinner value

if (add > 1) {
productOrders.add(productOrder1.getText()); // Second
product order
spinners.add((int) spinner_1.getValue()); // Second
spinner value
}

if (add > 2) {
productOrders.add(productOrder_2.getText()); // Third
product order
spinners.add((int) spinner_2.getValue()); // Third spinner
value
}

if (add > 3) {
productOrders.add(productOrder_3.getText()); // Fourth
product order
spinners.add((int) spinner_3.getValue()); // Fourth
spinner value
}

OrderDetails orderDetails = new OrderDetails(


customerName.getText(),
customerAddress.getText(),
productOrders,
spinners
);
orderList.add(orderDetails);
btnAddAnotherProduct.setEnabled(false);
btnReset.setEnabled(false);

}
});

private class OrderDetails {


private String customerName;
private String customerAddress;
private List<String> productOrders;
private List<Integer> spinners;

public OrderDetails(String customerName, String


customerAddress, List<String> productOrders, List<Integer> spinners) {
this.customerName = customerName;
this.customerAddress = customerAddress;
this.productOrders = productOrders;
this.spinners = spinners;
}

public String getCustomerName() {


return customerName;
}

public void setCustomerName(String customerName)


{
this.customerName = customerName;
}

public String getCustomerAddress() {


return customerAddress;
}

public void setCustomerAddress(String


customerAddress) {
this.customerAddress = customerAddress;
}

public List<String> getProductOrders() {


return productOrders;
}

public void setProductOrders(List<String>


productOrders) {
this.productOrders = productOrders;
}

public List<Integer> getSpinners() {


return spinners;
}

public void setSpinners(List<Integer> spinners) {


this.spinners = spinners;
}

}
}

GCASH

// Class: Gcash
// Description: Manages a payment interface using GCash for authorization and
transaction processing.

import java.awt.EventQueue;

package logistics;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Gcash {

private JFrame frame;


private JTextField textField;

/**
* Launch the application.
* Initializes and displays the GCash payment interface.
*/

public static void main(String[] args) {


EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Gcash window = new Gcash();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the application.
*/
public Gcash() {
initialize();
}

/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

textField = new JTextField();


textField.setBounds(120, 102, 153, 26);
frame.getContentPane().add(textField);
textField.setColumns(10);

JLabel lblNewLabel_1 = new JLabel("Authorize transaction in App");


lblNewLabel_1.setBounds(21, 58, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your GCash number and


receive an authorization request on your GCash app.");
lblNewLabel_1_1.setBounds(21, 77, 413, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile Number");


lblNewLabel_1_2.setFont(new Font("Dialog", Font.PLAIN, 13));
lblNewLabel_1_2.setBounds(21, 107, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment is pending");


lblPaymayaIsPending.setFont(new Font("Dialog", Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(115, 211, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

JButton pay = new JButton("Pay");


pay.setForeground(new Color(255, 255, 255));
pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

lblPaymayaIsPending.setText("Payment Succesful!");
}
});
pay.setBackground(new Color(0, 0, 0));
pay.setBounds(323, 210, 89, 33);
frame.getContentPane().add(pay);

JLabel lblNewLabel_2 = new JLabel("Make sure you have the GCash app
installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 139, 668, 14);
frame.getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_2_1 = new JLabel("If you are using multiple devices,


If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 154, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the device where you last


login to GCash.");
lblNewLabel_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 171, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);

JPanel panel = new JPanel();


panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 434, 47);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("GCash");


lblNewLabel.setForeground(new Color(255, 255, 0));
lblNewLabel.setBounds(25, 11, 141, 24);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 21));

}
}

InventoryDisplay
// Class: InventoryDisplay
// Description: Displays an inventory from a database using Swing components.

package logistics;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.sql.*;

public class InventoryDisplay extends JFrame {


private JPanel panel;
private JTable table;

public InventoryDisplay() {
panel = new JPanel(new BorderLayout());
table = new JTable();

panel.add(new JScrollPane(table), BorderLayout.CENTER);

add(panel);

setTitle("Database Panel");
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setVisible(true);

// Connect to the database and retrieve data


try {
Class.forName("com.mysql.cj.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/sys";
Connection connection = DriverManager.getConnection(url, "root", "1234567");

String query = "SELECT itemCode, itemName, itemPrice, productQuantity


FROM admin_crud";
try (Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query)) {

// Create a table model and set it to the JTable


table.setModel(buildTableModel(resultSet));
}

connection.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}

/**
* Converts a ResultSet to a TableModel for display in the JTable.
* @param resultSet The ResultSet obtained from the database query.
* @return TableModel containing the data retrieved from the database.
* @throws SQLException If an SQL exception occurs during ResultSet processing.
*/

private static TableModel buildTableModel(ResultSet resultSet) throws SQLException


{
ResultSetMetaData metaData = resultSet.getMetaData();

// Get column names


int columnCount = metaData.getColumnCount();
String[] columnNames = new String[columnCount];
for (int i = 1; i <= columnCount; i++) {
columnNames[i - 1] = metaData.getColumnName(i);
}

// Get data
Object[][] data = new Object[100][columnCount]; // Adjust the array size based on
your needs
int rowCount = 0;
while (resultSet.next()) {
for (int i = 1; i <= columnCount; i++) {
data[rowCount][i - 1] = resultSet.getObject(i);
}
rowCount++;
}

return new DefaultTableModel(data, columnNames);


}

/**
* Entry point to start the InventoryDisplay GUI.
* @param args Command-line arguments.
*/

public static void main(String[] args) {


SwingUtilities.invokeLater(() -> new InventoryDisplay());
}
}
Logistics
// Class: Logistics
// Description: Manages logistics information and provides functionality for tracking
orders and updating their status.

package logistics;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import com.mysql.cj.jdbc.result.ResultSetMetaData;
import javax.swing.border.BevelBorder;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import java.awt.event.ActionEvent;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import java.awt.Component;
import java.awt.Dimension;

public class Logistics {


private JFrame frame;
private JTextField textField;
private JTextField customerID;
private JTextField customerName;
private JTextField itemName;
private JTextField customerAddress;
private JComboBox<String> comboBox;
private JLabel statusLabel;

/**
* Converts a ResultSet to a TableModel for display in the JTable.
* @param rs The ResultSet obtained from the database query.
* @return TableModel containing the data retrieved from the database.
* @throws SQLException If an SQL exception occurs during ResultSet processing.
*/

private DefaultTableModel buildTableModel(ResultSet rs) throws SQLException {


ResultSetMetaData metaData = (ResultSetMetaData) rs.getMetaData();

Vector<String> columnNames = new Vector<>();


int columnCount = metaData.getColumnCount();
for (int column = 1; column <= columnCount; column++) {
columnNames.add(metaData.getColumnName(column));
}

Vector<Vector<Object>> data = new Vector<>();


while (rs.next()) {
Vector<Object> vector = new Vector<>();
for (int columnIndex = 1; columnIndex <= columnCount; columnIndex++) {
vector.add(rs.getObject(columnIndex));
}
data.add(vector);
}

return new DefaultTableModel(data, columnNames);


}

/**
* Launches the Logistics application.
* @param args Command-line arguments.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Logistics window = new Logistics();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the application.
*/
public Logistics() {

initialize();
}

/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.getContentPane().setBackground(new Color(255, 255, 255));
frame.setBounds(100, 100, 927, 453);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JPanel panel = new JPanel();


panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 913, 49);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("Logistics");


lblNewLabel.setForeground(Color.YELLOW);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 27));
lblNewLabel.setBounds(27, 11, 154, 23);
panel.add(lblNewLabel);

JPanel panel_1 = new JPanel();


panel_1.setLayout(null);
panel_1.setBackground(Color.BLACK);
panel_1.setBounds(0, 60, 913, 18);
frame.getContentPane().add(panel_1);

textField = new JTextField();


textField.setForeground(Color.BLACK);
textField.setFont(new Font("Dialog", Font.PLAIN, 14));
textField.setColumns(10);
textField.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer ID", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
textField.setBounds(10, 104, 152, 36);
frame.getContentPane().add(textField);

JButton btnRestock = new JButton("Track");


btnRestock.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String inputCustomerID = textField.getText().trim();

if (inputCustomerID.isEmpty() || !inputCustomerID.matches("\\d+")) {
JOptionPane.showMessageDialog(frame, "Please enter a valid customer
ID.", "Invalid Input", JOptionPane.ERROR_MESSAGE);
return;
}

int customerId = Integer.parseInt(inputCustomerID);

try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT `ordernumber`, `customerid`,
customername, customeraddress, productorder, `quantity`, deliveryStatus FROM
customer_crud WHERE `customerid` = " + customerId);

if (!rs.next()) {
JOptionPane.showMessageDialog(frame, "ID not found.", "ID Not
Found", JOptionPane.ERROR_MESSAGE);
return;
}
do {
customerID.setText(String.valueOf(rs.getInt("customerid")));
customerName.setText(rs.getString("customername"));
itemName.setText(rs.getString("productorder"));
customerAddress.setText(rs.getString("customeraddress"));
String deliveryStatus = rs.getString("deliveryStatus");
if (deliveryStatus != null) {
statusLabel.setText(deliveryStatus);
switch (deliveryStatus) {
case "Pending":
statusLabel.setForeground(Color.RED);
break;
case "Picked Up":
statusLabel.setForeground(Color.ORANGE);
break;
case "In-Transit":
statusLabel.setForeground(Color.YELLOW);
break;
case "Delivered":
statusLabel.setForeground(Color.GREEN);
break;
default:
statusLabel.setForeground(Color.BLACK);
break;
}
} else {
statusLabel.setText("Pending");
statusLabel.setForeground(Color.RED); // Default to red for pending
status
}
} while (rs.next());

} catch (Exception ex) {


System.out.println(ex);
}

frame.repaint();
frame.revalidate();
}
});
btnRestock.setForeground(Color.WHITE);
btnRestock.setFont(new Font("Dialog", Font.BOLD, 14));
btnRestock.setBorder(null);
btnRestock.setBackground(Color.BLACK);
btnRestock.setBounds(172, 108, 95, 36);
frame.getContentPane().add(btnRestock);

customerID = new JTextField();


customerID.setForeground(Color.BLACK);
customerID.setFont(new Font("Dialog", Font.PLAIN, 14));
customerID.setColumns(10);
customerID.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer ID", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
customerID.setBounds(-1, 152, 92, 36);
frame.getContentPane().add(customerID);

customerName = new JTextField();


customerName.setForeground(Color.BLACK);
customerName.setFont(new Font("Dialog", Font.PLAIN, 14));
customerName.setColumns(10);
customerName.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Name", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
customerName.setBounds(101, 152, 122, 36);
frame.getContentPane().add(customerName);

itemName = new JTextField();


itemName.setForeground(Color.BLACK);
itemName.setFont(new Font("Dialog", Font.PLAIN, 14));
itemName.setColumns(10);
itemName.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Item Name", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
itemName.setBounds(233, 152, 143, 36);
frame.getContentPane().add(itemName);

customerAddress = new JTextField();


customerAddress.setForeground(Color.BLACK);
customerAddress.setFont(new Font("Dialog", Font.PLAIN, 14));
customerAddress.setColumns(10);
customerAddress.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Customer Address", TitledBorder.LEADING, TitledBorder.TOP, null,
new Color(0, 0, 0)));
customerAddress.setBounds(-1, 186, 377, 36);
frame.getContentPane().add(customerAddress);

JLabel lblNewLabel_1 = new JLabel("Status:");


lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 22));
lblNewLabel_1.setBounds(111, 244, 74, 36);
frame.getContentPane().add(lblNewLabel_1);

statusLabel = new JLabel("");


statusLabel.setForeground(Color.GREEN);
statusLabel.setFont(new Font("Dialog", Font.PLAIN, 22));
statusLabel.setBounds(186, 244, 300, 36);
frame.getContentPane().add(statusLabel);

JButton btnUpdate = new JButton("Update");


btnUpdate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String inputCustomerID = customerID.getText().trim();

if (inputCustomerID.isEmpty() || !inputCustomerID.matches("\\d+")) {
JOptionPane.showMessageDialog(frame, "Please enter a valid customer
ID.", "Invalid Input", JOptionPane.ERROR_MESSAGE);
return;
}

int customerId = Integer.parseInt(inputCustomerID);

try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();

ResultSet rs = st.executeQuery("SELECT `customerid` FROM


customer_crud WHERE `customerid` = " + customerId);
if (!rs.next()) {
JOptionPane.showMessageDialog(frame, "Please enter a valid customer
ID.", "Invalid Customer ID", JOptionPane.ERROR_MESSAGE);
return;
}
String selectedStatus = (String) comboBox.getSelectedItem();
String query = "UPDATE customer_crud SET deliveryStatus = '" +
selectedStatus + "' WHERE customerid = " + customerId;
int rowsAffected = st.executeUpdate(query);
if (rowsAffected > 0) {
statusLabel.setText(selectedStatus);
switch (selectedStatus) {
case "Pending":
statusLabel.setForeground(Color.RED);
break;
case "Picked Up":
statusLabel.setForeground(Color.ORANGE);
break;
case "In-Transit":
statusLabel.setForeground(Color.YELLOW);
break;
case "Delivered":
statusLabel.setForeground(Color.GREEN);
break;
default:
statusLabel.setForeground(Color.BLACK);
break;
}
} else {
statusLabel.setText("Failed to update status.");
}
} catch(Exception ex) {
System.out.println(ex);
}
}
});

btnUpdate.setForeground(Color.WHITE);
btnUpdate.setFont(new Font("Dialog", Font.BOLD, 14));
btnUpdate.setBorder(null);
btnUpdate.setBackground(Color.BLACK);
btnUpdate.setBounds(377, 107, 95, 37);
frame.getContentPane().add(btnUpdate);

comboBox = new JComboBox<String>();


comboBox.setModel(new DefaultComboBoxModel(new String[]
{null,"Pending" ,"Picked Up", "In-Transit","Delivered"}));
comboBox.setBounds(379, 156, 106, 33);
frame.getContentPane().add(comboBox);
JScrollPane scrollPane = new JScrollPane((Component) null);
scrollPane.setPreferredSize(new Dimension(580, 300));
scrollPane.setBounds(493, 89, 406, 259);
frame.getContentPane().add(scrollPane);

JButton btnDisplay = new JButton("Display");


btnDisplay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();

ResultSet rs = st.executeQuery("SELECT * FROM


customer_crud");
JTable table = new JTable(buildTableModel(rs));
scrollPane.setViewportView(table);

} catch(Exception ex) {
System.out.println(ex);
}
}
});
btnDisplay.setForeground(Color.WHITE);
btnDisplay.setFont(new Font("Dialog", Font.BOLD, 14));
btnDisplay.setBorder(null);
btnDisplay.setBackground(Color.BLACK);
btnDisplay.setBounds(272, 108, 95, 36);
frame.getContentPane().add(btnDisplay);
}
}
Paymaya
// Class: Paymaya
// Description: Manages PayMaya transactions and provides functionality for
authorization via the app.

package logistics;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Paymaya {

private JFrame frame;


private JTextField textField;

/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Paymaya window = new Paymaya();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the application.
*/
public Paymaya() {
initialize();
}

/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JLabel lblNewLabel = new JLabel("PayMaya");


lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 18));
lblNewLabel.setBounds(21, 11, 89, 45);
frame.getContentPane().add(lblNewLabel);

textField = new JTextField();


textField.setBounds(139, 87, 125, 20);
frame.getContentPane().add(textField);
textField.setColumns(10);

JLabel lblNewLabel_1 = new JLabel("Authorize transaction in App");


lblNewLabel_1.setBounds(51, 52, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your Maya number and


receive an authorization request on your Maya app.");
lblNewLabel_1_1.setBounds(51, 69, 334, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile Number");


lblNewLabel_1_2.setBounds(51, 90, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment is pending");


lblPaymayaIsPending.setFont(new Font("Dialog", Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(139, 180, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

JButton pay = new JButton("Pay");


pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

lblPaymayaIsPending.setText("Payment Succesful!");
}
});
pay.setBackground(new Color(43, 174, 132));
pay.setBounds(216, 216, 89, 23);
frame.getContentPane().add(pay);

JLabel lblNewLabel_2 = new JLabel("Make sure you have the Maya app
installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 123, 668, 14);
frame.getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_2_1 = new JLabel("If you are using multiple devices,


If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 138, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the device where you last


login to Maya.");
lblNewLabel_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 155, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);

}
}

Procurement
// Description: This class handles procurement-related functionalities such as fetching
details, settling payments, and completing transactions.

package logistics;

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;

import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import javax.swing.border.BevelBorder;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;

public class Procurement {


private JFrame frame;
JButton btnBuy = new JButton("Buy\r\n");
private JComboBox<String> comboBox_1_1 = new JComboBox<String>();
private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;
private JTextField textField_3;
private JTextField textField_4;
private JTextField textField_5;
private JTextField textField_6;
private JTextField textField_7;
private int ctr = 0;
private double balance;
private int price;

public static void main(String[] args) {


EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Procurement window = new Procurement();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

public Procurement() {
initialize();
}

private void initialize() {

frame = new JFrame();


frame.getContentPane().setBackground(new Color(255, 255, 255));
frame.setBounds(100, 100, 748, 437);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JPanel panel = new JPanel();
panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 732, 66);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("Procurement");


lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 33));
lblNewLabel.setBounds(23, 11, 358, 41);
lblNewLabel.setForeground(new Color(255, 255, 0));
panel.add(lblNewLabel);

JLabel lblNewLabel_1_2_1 = new JLabel("Full Product Details");


lblNewLabel_1_2_1.setFont(new Font("Dialog", Font.PLAIN, 17));
lblNewLabel_1_2_1.setBounds(24, 168, 162, 30);
frame.getContentPane().add(lblNewLabel_1_2_1);

JPanel panel_1_1 = new JPanel();


panel_1_1.setBackground(Color.BLACK);
panel_1_1.setBounds(0, 77, 732, 22);
frame.getContentPane().add(panel_1_1);

JLabel lblNewLabel_1 = new JLabel("Supplier:");


lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 17));
lblNewLabel_1.setBounds(40, 121, 84, 30);
frame.getContentPane().add(lblNewLabel_1);

JComboBox<String> comboBox = new JComboBox<String>();

comboBox.setModel(new DefaultComboBoxModel(new String[] {null ,"Nike",


"Adidas"}));
comboBox.setBounds(110, 121, 106, 33);
frame.getContentPane().add(comboBox);

JLabel lblNewLabel_1_1 = new JLabel("Product Line:");


lblNewLabel_1_1.setFont(new Font("Dialog", Font.PLAIN, 17));
lblNewLabel_1_1.setBounds(230, 121, 124, 30);
frame.getContentPane().add(lblNewLabel_1_1);

JComboBox<String> comboBox_1 = new JComboBox<String>();


comboBox_1.setModel(new DefaultComboBoxModel(new String[] {null ,"Shoes"}));
comboBox_1.setBounds(333, 121, 106, 33);
frame.getContentPane().add(comboBox_1);
JLabel lblNewLabel_1_1_1 = new JLabel("Product Number:");
lblNewLabel_1_1_1.setFont(new Font("Dialog", Font.PLAIN, 17));
lblNewLabel_1_1_1.setBounds(461, 121, 124, 30);
frame.getContentPane().add(lblNewLabel_1_1_1);

comboBox_1_1.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
String selectedItem = (String) comboBox_1_1.getSelectedItem();

if(comboBox.getSelectedItem()=="Nike") {
fetchDetailsFromDatabase(selectedItem, "nike");
}
else if(comboBox.getSelectedItem()=="Adidas") {
fetchDetailsFromDatabase(selectedItem, "adidas");
}

}
});

comboBox_1_1.setBounds(593, 121, 106, 33);


frame.getContentPane().add(comboBox_1_1);

textField = new JTextField();


textField.setEditable(false);
textField.setForeground(Color.BLACK);
textField.setFont(new Font("Dialog", Font.PLAIN, 14));
textField.setColumns(10);
textField.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Product Number",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
textField.setBounds(24, 209, 110, 36);
frame.getContentPane().add(textField);

textField_1 = new JTextField();


textField_1.setEditable(false);
textField_1.setForeground(Color.BLACK);
textField_1.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_1.setColumns(10);
textField_1.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product Name", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
textField_1.setBounds(144, 209, 173, 36);
frame.getContentPane().add(textField_1);

textField_2 = new JTextField();


textField_2.setEditable(false);
textField_2.setForeground(Color.BLACK);
textField_2.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_2.setColumns(10);
textField_2.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product Line", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
textField_2.setBounds(325, 209, 114, 36);
frame.getContentPane().add(textField_2);

textField_3 = new JTextField();


textField_3.setEditable(false);
textField_3.setForeground(Color.BLACK);
textField_3.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_3.setColumns(10);
textField_3.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Supplier", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0,
0, 0)));
textField_3.setBounds(449, 209, 114, 36);
frame.getContentPane().add(textField_3);

textField_4 = new JTextField();


textField_4.setEditable(false);
textField_4.setForeground(Color.BLACK);
textField_4.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_4.setColumns(10);
textField_4.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Quantity", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0,
0, 0)));
textField_4.setBounds(573, 209, 114, 36);
frame.getContentPane().add(textField_4);

textField_5 = new JTextField();


textField_5.setEditable(false);
textField_5.setForeground(Color.BLACK);
textField_5.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_5.setColumns(10);
textField_5.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Manufacturer (Country)", TitledBorder.LEADING, TitledBorder.TOP,
null, new Color(0, 0, 0)));
textField_5.setBounds(24, 256, 150, 36);
frame.getContentPane().add(textField_5);

textField_6 = new JTextField();


textField_6.setEditable(false);
textField_6.setForeground(Color.BLACK);
textField_6.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_6.setColumns(10);
textField_6.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Manufacturing Date", TitledBorder.LEADING, TitledBorder.TOP, null,
new Color(0, 0, 0)));
textField_6.setBounds(184, 256, 150, 36);
frame.getContentPane().add(textField_6);

JLabel lblNewLabel_1_2_1_1 = new JLabel("Payment Method\r\n");


lblNewLabel_1_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 13));
lblNewLabel_1_2_1_1.setBounds(478, 256, 254, 30);
frame.getContentPane().add(lblNewLabel_1_2_1_1);

JRadioButton rdbtnPaymaya = new JRadioButton("Paymaya\r\n");


rdbtnPaymaya.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
rdbtnPaymaya.setBackground(new Color(255, 255, 255));
rdbtnPaymaya.setBounds(505, 280, 77, 23);
frame.getContentPane().add(rdbtnPaymaya);

JRadioButton rdbtnGcash = new JRadioButton("GCash\r\n");


rdbtnGcash.setBackground(new Color(255, 255, 255));
rdbtnGcash.setBounds(593, 280, 120, 23);
frame.getContentPane().add(rdbtnGcash);

ButtonGroup btnGroup = new ButtonGroup();


btnGroup.add(rdbtnPaymaya);
btnGroup.add(rdbtnGcash);
JButton btnBuy = new JButton("Buy\r\n");
btnBuy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try (Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567")) {

// SQL query to insert data into admin_crud table


String sql = "INSERT INTO admin_crud (itemCode, itemName, itemPrice,
productQuantity, supplier, manufacturingCountry, manufacturingDate,
statusOfPayment, productLine) VALUES (?, ?, ?, ?, ?, ?, ?, ?,?)";

try (PreparedStatement preparedStatement =


connection.prepareStatement(sql)) {
// Set values for each parameter
preparedStatement.setInt(1, Integer.parseInt(textField.getText()) );
preparedStatement.setString(2, textField_1.getText());
preparedStatement.setInt(3, Integer.parseInt(textField_7.getText()) );
preparedStatement.setInt(4, Integer.parseInt(textField_4.getText()));
preparedStatement.setString(5, textField_3.getText());
preparedStatement.setString(6, textField_5.getText());
preparedStatement.setString(7, textField_6.getText()); //
preparedStatement.setString(8, "Paid");
preparedStatement.setString(9, textField_2.getText());

// Execute the SQL query


int rowsAffected = preparedStatement.executeUpdate();

if (rowsAffected > 0) {
JOptionPane.showMessageDialog(null, "Transaction Succesful");
} else {
System.out.println("Failed to insert data.");
}
}

} catch (SQLException e2) {


e2.printStackTrace();
}

}
});
btnBuy.setEnabled(false);
btnBuy.setForeground(Color.WHITE);
btnBuy.setFont(new Font("Dialog", Font.BOLD, 14));
btnBuy.setBorder(null);
btnBuy.setBackground(Color.BLACK);
btnBuy.setBounds(592, 331, 95, 36);
frame.getContentPane().add(btnBuy);

JButton btnSettlePayment = new JButton("Settle Payment\r\n");

btnSettlePayment.setForeground(Color.WHITE);
btnSettlePayment.setFont(new Font("Dialog", Font.BOLD, 14));
btnSettlePayment.setBorder(null);
btnSettlePayment.setBackground(Color.BLACK);
btnSettlePayment.setBounds(436, 331, 135, 36);
frame.getContentPane().add(btnSettlePayment);

btnSettlePayment.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

price = Integer.parseInt(textField_7.getText());

if(rdbtnPaymaya.isSelected()) {
frame = new JFrame();

frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JTextField skrantut = new JTextField();


skrantut.setBounds(120, 102, 153, 26);
frame.getContentPane().add(skrantut);
skrantut.setColumns(10);

JLabel lblNewLabel_1 = new JLabel("Authorize


transaction in App");
lblNewLabel_1.setBounds(21, 58, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your


Maya number and receive an authorization request on your Maya app.");
lblNewLabel_1_1.setBounds(21, 77, 413, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile


Number");
lblNewLabel_1_2.setFont(new Font("Dialog",
Font.PLAIN, 13));
lblNewLabel_1_2.setBounds(21, 107, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment


is pending");
lblPaymayaIsPending.setFont(new Font("Dialog",
Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(115, 211, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

JButton pay = new JButton("Pay");


pay.setForeground(new Color(255, 255, 0));
pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

JOptionPane.showMessageDialog(null,
"Payment Succesful!");

btnBuy.setEnabled(true);

frame.dispose();

}
});
pay.setBackground(new Color(0, 0, 0));
pay.setBounds(323, 210, 89, 33);
frame.getContentPane().add(pay);

JLabel lblNewLabel_2 = new JLabel("Make sure you


have the Maya app installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 139, 668, 14);
frame.getContentPane().add(lblNewLabel_2);
JLabel lblNewLabel_2_1 = new JLabel("If you are
using multiple devices, If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 154, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the


device where you last login to Maya.");
lblNewLabel_2_1_1.setFont(new Font("Dialog",
Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 171, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);

JPanel panel = new JPanel();


panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 434, 47);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("PayMaya");


lblNewLabel.setForeground(new Color(255, 255, 0));
lblNewLabel.setBounds(25, 11, 141, 24);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN,
21));

frame.setVisible(true);

}else if(rdbtnGcash.isSelected()) {
frame = new JFrame();
frame.getContentPane().setBackground(Color.WHITE);
frame.setBounds(100, 100, 450, 293);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);

JTextField skrantat = new JTextField();


skrantat.setBounds(120, 102, 153, 26);
frame.getContentPane().add(skrantat);
skrantat.setColumns(10);

JLabel lblNewLabel_1 = new JLabel("Authorize transaction in


App");
lblNewLabel_1.setBounds(21, 58, 232, 14);
frame.getContentPane().add(lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Enter your GCash number


and receive an authorization request on your GCash app.");
lblNewLabel_1_1.setBounds(21, 77, 413, 14);
frame.getContentPane().add(lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Mobile Number");


lblNewLabel_1_2.setFont(new Font("Dialog", Font.PLAIN, 13));
lblNewLabel_1_2.setBounds(21, 107, 89, 14);
frame.getContentPane().add(lblNewLabel_1_2);

JLabel lblPaymayaIsPending = new JLabel("Payment is pending");


lblPaymayaIsPending.setFont(new Font("Dialog", Font.PLAIN, 18));
lblPaymayaIsPending.setBounds(115, 211, 168, 24);
frame.getContentPane().add(lblPaymayaIsPending);

String number = skrantat.getText();

JButton pay = new JButton("Pay");


pay.setForeground(new Color(255, 255, 255));
pay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

String number = skrantat.getText();

try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT `balance`
FROM gcash_users_list WHERE `number`= " + number +"");

while (rs.next()) {
balance = rs.getDouble("balance");
}
if(balance>=5000) {
JOptionPane.showMessageDialog(null,
"Payment Succesful");
JOptionPane.showMessageDialog(null,
balance);
}else {
JOptionPane.showMessageDialog(null,
"Insufficient Balance");
}

}catch(Exception e9) {
e9.printStackTrace();
}

}
});

pay.setBackground(new Color(0, 0, 0));


pay.setBounds(323, 210, 89, 33);
frame.getContentPane().add(pay);

JLabel lblNewLabel_2 = new JLabel("Make sure you have the


GCash app installed and the notification is not muted . ");
lblNewLabel_2.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2.setBounds(21, 139, 668, 14);
frame.getContentPane().add(lblNewLabel_2);

JLabel lblNewLabel_2_1 = new JLabel("If you are using multiple


devices, If you are using multiple devices, we will send");
lblNewLabel_2_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1.setBounds(21, 154, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1);

JLabel lblNewLabel_2_1_1 = new JLabel("to the device where you


last login to GCash.");
lblNewLabel_2_1_1.setFont(new Font("Dialog", Font.PLAIN, 10));
lblNewLabel_2_1_1.setBounds(21, 171, 668, 14);
frame.getContentPane().add(lblNewLabel_2_1_1);
JPanel panel = new JPanel();
panel.setBackground(new Color(0, 0, 0));
panel.setBounds(0, 0, 434, 47);
frame.getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("GCash");


lblNewLabel.setForeground(new Color(255, 255, 0));
lblNewLabel.setBounds(25, 11, 141, 24);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 21));

frame.setVisible(true);
}

}
});

textField_7 = new JTextField();


textField_7.setForeground(Color.BLACK);
textField_7.setFont(new Font("Dialog", Font.PLAIN, 14));
textField_7.setEditable(false);
textField_7.setColumns(10);
textField_7.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Price", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0,
0)));
textField_7.setBounds(349, 256, 95, 36);
frame.getContentPane().add(textField_7);

comboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if(comboBox.getSelectedItem()=="Nike") {
populateComboBox("nike");
}else if(comboBox.getSelectedItem()=="Adidas") {
populateComboBox("adidas");
}
}
});
}

private void populateComboBox(String table1) {


try {
// Establish a database connection
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");

// Query to fetch item_code values from the "nike" table


String query = "SELECT item_code FROM "+table1;

// Create a PreparedStatement
PreparedStatement statement = connection.prepareStatement(query);

// Execute the query


ResultSet resultSet = statement.executeQuery();

// Clear existing items in the comboBox_1_1


comboBox_1_1.removeAllItems();
comboBox_1_1.addItem(null);

// Populate comboBox_1_1 with the fetched values


while (resultSet.next()) {
String itemCode = resultSet.getString("item_code");
comboBox_1_1.addItem(itemCode);
}

// Close the resources


resultSet.close();
statement.close();
connection.close();

} catch (SQLException ex) {


ex.printStackTrace();
// Handle any SQL exception here
}
}
public void fetchDetailsFromDatabase(String selectedItem, String table) {
try {
// Establish a database connection
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");

// Query to fetch details from the "nike" table based on the selected item_code

String query = "SELECT * FROM " + ""+ table + "" +" WHERE `item_code` = ?";

// Create a PreparedStatement
PreparedStatement statement = connection.prepareStatement(query);

// Set the parameter for the item_code


statement.setString(1, selectedItem);

// Execute the query


ResultSet resultSet = statement.executeQuery();

// Check if there are results


if (resultSet.next()) {
// Retrieve values from the result set
String itemName = resultSet.getString("item_name");
String productLine = resultSet.getString("product_line");
String supplier = resultSet.getString("supplier");
int quantity = resultSet.getInt("quantity");
String manufacturingDate = resultSet.getString("manufacturing_date");
int itemPrice = resultSet.getInt("item_price");
String manufacturingCountry = resultSet.getString("manufacturing_country");

// Display or use the retrieved values as needed


// For example, you can set the values in text fields or labels
textField.setText(selectedItem);
textField_1.setText(itemName);
textField_2.setText(productLine);
textField_3.setText(supplier);
textField_4.setText(String.valueOf(quantity));
textField_5.setText(manufacturingDate.toString());
textField_7.setText(String.valueOf(itemPrice));
textField_6.setText(manufacturingCountry);
}

// Close the resources


resultSet.close();
statement.close();
connection.close();

}catch(Exception e1) {
e1.printStackTrace();
}
}
}

SupplierSide

// Class handling Supplier-side functionality and database operations


package logistics;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.sql.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Vector;
import javax.swing.border.TitledBorder;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class SupplierSide extends JFrame {


private ArrayList<String[]> logList;
private DefaultTableModel logTableModel;
private JTable logTable;

private JTextField item_code;


private JTextField supplier;
private JTextField manufacturing_date;
private JTextField quantity;
private JTextField item_name;
private JTextField manufacturing_country;
private JTextField product_line;
private JTextField item_price;

// Method to apply data to the specified table in the database


public void apply(String table) {

// Database connection and insertion of data into the specified table


// ...
// Handle insertion and update of the table model
// ...

try { Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sys","root", "1234567");
String query= "INSERT INTO "+ table +" (item_code, item_name,
product_line, supplier, manufacturing_date, quantity, manufacturing_country,
item_price) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
PreparedStatement ps=con.prepareStatement(query);
ps.setInt(1, Integer.parseInt(item_code.getText()));
ps.setString(2, item_name.getText());
ps.setString(3, product_line.getText());
ps.setString(4, supplier.getText());
ps.setString(5, manufacturing_date.getText());
ps.setInt(6, Integer.parseInt(quantity.getText()));
ps.setString(7, manufacturing_country.getText());
ps.setInt(8, Integer.parseInt(item_price.getText()));

ps.executeUpdate();

String[] logData = {
item_code.getText(),
item_name.getText(),
supplier.getText(),
manufacturing_date.getText(),
quantity.getText(),
manufacturing_country.getText(),

};
logList.add(logData);

logTableModel.addRow(new Object[]{"Updated: " + Arrays.toString(logData)});

JOptionPane.showMessageDialog(null, "Records Inserted");

} catch (Exception e1) {


JOptionPane.showMessageDialog(null, e1);
}

public SupplierSide() {
getContentPane().setBackground(Color.WHITE);
setTitle("Database Table Example");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
logList = new ArrayList<>();
logTableModel = new DefaultTableModel();
setSize(835, 423);
getContentPane().setLayout(null);

JPanel panel = new JPanel();


panel.setBackground(Color.BLACK);
panel.setBounds(10, 0, 945, 90);
getContentPane().add(panel);
panel.setLayout(null);

JLabel lblNewLabel = new JLabel("INVENTORY MANAGEMENT (SUPPLIER)");


lblNewLabel.setBounds(105, 27, 489, 39);
panel.add(lblNewLabel);
lblNewLabel.setFont(new Font("Impact", Font.PLAIN, 33));
lblNewLabel.setForeground(Color.YELLOW);

JPanel panel_1 = new JPanel();


panel_1.setLayout(null);
panel_1.setBackground(Color.BLACK);
panel_1.setBounds(10, 101, 945, 21);
getContentPane().add(panel_1);

JLabel lblITE = new JLabel("INSERT SUPPLIER INFORMATION");


lblITE.setForeground(SystemColor.controlShadow);
lblITE.setFont(new Font("Dialog", Font.BOLD, 14));
lblITE.setBounds(10, 133, 272, 14);
getContentPane().add(lblITE);

item_code = new JTextField();


item_code.setForeground(Color.BLACK);
item_code.setFont(new Font("Dialog", Font.PLAIN, 14));
item_code.setColumns(10);
item_code.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Item Code",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
item_code.setBounds(178, 200, 145, 36);
getContentPane().add(item_code);

supplier = new JTextField();


supplier.setForeground(Color.BLACK);
supplier.setFont(new Font("Dialog", Font.PLAIN, 14));
supplier.setColumns(10);
supplier.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Supplier's Name",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
supplier.setBounds(20, 158, 303, 36);
getContentPane().add(supplier);

manufacturing_date = new JTextField();


manufacturing_date.setForeground(Color.BLACK);
manufacturing_date.setFont(new Font("Dialog", Font.PLAIN, 14));
manufacturing_date.setColumns(10);
manufacturing_date.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Manufacturing Date of Product", TitledBorder.LEADING,
TitledBorder.TOP, null, new Color(0, 0, 0)));
manufacturing_date.setBounds(360, 158, 450, 36);
getContentPane().add(manufacturing_date);

JButton btnDisplay = new JButton("Add Stock");


btnDisplay.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

String sup = supplier.getText();


if(sup.equals("Nike")) {

apply(sup);
}else if(sup.equals("Adidas")) {

apply(sup);

}
});
btnDisplay.setForeground(Color.WHITE);
btnDisplay.setFont(new Font("Dialog", Font.BOLD, 14));
btnDisplay.setBorder(null);
btnDisplay.setBackground(Color.BLACK);
btnDisplay.setBounds(577, 315, 95, 36);
getContentPane().add(btnDisplay);

quantity = new JTextField();


quantity.setForeground(Color.BLACK);
quantity.setFont(new Font("Dialog", Font.PLAIN, 14));
quantity.setColumns(10);
quantity.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Quantity",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
quantity.setBounds(360, 247, 204, 36);
getContentPane().add(quantity);

item_name = new JTextField();


item_name.setForeground(Color.BLACK);
item_name.setFont(new Font("Dialog", Font.PLAIN, 14));
item_name.setColumns(10);
item_name.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Name of Item", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
item_name.setBounds(20, 200, 145, 36);
getContentPane().add(item_name);

manufacturing_country = new JTextField();


manufacturing_country.setForeground(Color.BLACK);
manufacturing_country.setFont(new Font("Dialog", Font.PLAIN, 14));
manufacturing_country.setColumns(10);
manufacturing_country.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Manufacturing Location (Country)", TitledBorder.LEADING,
TitledBorder.TOP, null, new Color(0, 0, 0)));
manufacturing_country.setBounds(20, 247, 303, 36);
getContentPane().add(manufacturing_country);

product_line = new JTextField();


product_line.setForeground(Color.BLACK);
product_line.setFont(new Font("Dialog", Font.PLAIN, 14));
product_line.setColumns(10);
product_line.setBorder(new TitledBorder(new
BevelBorder(BevelBorder.LOWERED, new Color(0, 0, 0), null, new Color(0, 0, 0), new
Color(0, 0, 0)), "Product Line", TitledBorder.LEADING, TitledBorder.TOP, null, new
Color(0, 0, 0)));
product_line.setBounds(360, 200, 204, 36);
getContentPane().add(product_line);

item_price = new JTextField();


item_price.setForeground(Color.BLACK);
item_price.setFont(new Font("Dialog", Font.PLAIN, 14));
item_price.setColumns(10);
item_price.setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED,
new Color(0, 0, 0), null, new Color(0, 0, 0), new Color(0, 0, 0)), "Item Price",
TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
item_price.setBounds(574, 200, 139, 36);
getContentPane().add(item_price);

// Fetch data from the database and populate the table

setLocationRelativeTo(null);
setVisible(true);
}

public static void main(String[] args) {


SwingUtilities.invokeLater(SupplierSide::new);
}
}
Database MySql
-- MySQL dump 10.13 Distrib 8.0.34, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: database1
-- ------------------------------------------------------
-- Server version 8.0.35

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT


*/;
/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION
*/;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS,
UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `adidas`
--

DROP TABLE IF EXISTS `adidas`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `adidas` (
`item_code` int NOT NULL,
`item_name` varchar(45) NOT NULL,
`product_line` varchar(45) NOT NULL,
`supplier` varchar(45) NOT NULL,
`quantity` int NOT NULL,
`manufacturing_date` varchar(45) NOT NULL,
`item_price` int NOT NULL,
`manufacturing_country` varchar(45) NOT NULL,
PRIMARY KEY (`item_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `adidas`
--

LOCK TABLES `adidas` WRITE;


/*!40000 ALTER TABLE `adidas` DISABLE KEYS */;
INSERT INTO `adidas` VALUES
(28374610,'Ultraboost','Shoes','Adidas',600,'08/14/2021',4500,'United
States'),(47365534,'NMD','Shoes','Adidas',550,'05/05/2015',6500,'Canada'),(192837465
,'Classic','Pants','Adidas',400,'12/23/2021',500,'United
States'),(295628463,'Superstar','Shoes','Adidas',500,'12/12/2016',5000,'Canada'),(3182
19381,'Luis V','Shoes','Adidas',300,'03/21/2022',6500,'United States'),(384950183,'Stan
Smith','Shoes','Adidas',450,'10/21/2018',6000,'United States'),(638493728,'Forest
Hills','Shoes','Adidas',500,'09/17/2020',5500,'Canada'),(869475635,'Gazelle','Shoes','Adi
das',400,'02/20/2020',5500,'United States'),(873625476,'Myke Air','T-
shirt','Adidas',300,'11/12/2021',6000,'United
States'),(927364528,'Feather','Socks','Adidas',450,'10/23/2021',400,'United
States'),(954857648,'Robert
Air','Watch','Adidas',400,'11/12/2021',7000,'Canada'),(986767583,'Alexius
Air','Shoes','Adidas',500,'11/12/2021',5000,'United States');
/*!40000 ALTER TABLE `adidas` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admin_crud`
--

DROP TABLE IF EXISTS `admin_crud`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin_crud` (
`itemCode` int NOT NULL,
`itemName` varchar(45) NOT NULL,
`itemPrice` int NOT NULL,
`productQuantity` int NOT NULL,
`supplier` varchar(45) NOT NULL,
`manufacturingDate` varchar(45) NOT NULL,
`manufacturingCountry` varchar(45) NOT NULL,
`productLine` varchar(45) NOT NULL,
`statusOfPayment` varchar(45) NOT NULL,
PRIMARY KEY (`itemCode`),
UNIQUE KEY `itemCode_UNIQUE` (`itemCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_crud`
--

LOCK TABLES `admin_crud` WRITE;


/*!40000 ALTER TABLE `admin_crud` DISABLE KEYS */;
INSERT INTO `admin_crud` VALUES (111111111,'Rosmina',5000,466,'Nike','United
States','11/23/2023','Shoes','Paid');
/*!40000 ALTER TABLE `admin_crud` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customer_crud`
--

DROP TABLE IF EXISTS `customer_crud`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer_crud` (
`ordernumber` int NOT NULL AUTO_INCREMENT,
`customerid` int NOT NULL,
`customername` varchar(45) NOT NULL,
`customeraddress` varchar(100) NOT NULL,
`productorder` varchar(45) NOT NULL,
`quantity` int NOT NULL,
`paymentStatus` varchar(45) NOT NULL,
`deliveryStatus` varchar(45) NOT NULL,
PRIMARY KEY
(`ordernumber`,`customerid`,`customername`,`customeraddress`,`productorder`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_crud`
--

LOCK TABLES `customer_crud` WRITE;


/*!40000 ALTER TABLE `customer_crud` DISABLE KEYS */;
INSERT INTO `customer_crud` VALUES (1,10,'Myke Salta','18 Lower Sitio Buntong
Palay, Antipolo City, Rizal.','Air Jordan',2,'Paid','Pending'),(2,15,'Jemuel
Santiago','Marikina City near SM.','Keith Sakura',1,'Paid','Pending'),(3,3,'Caitlyn
madredeo','893 Gen Luna ','Air Jordan',1,'Paid','Pending'),(4,3,'Caitlyn madredeo','893
Gen Luna ','Air Jordan',1,'Paid','Pending'),(5,23,'Rev Moto','123 rawraw','Air
Jordan',1,'Paid','Pending');
/*!40000 ALTER TABLE `customer_crud` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `gcash_users_list`
--

DROP TABLE IF EXISTS `gcash_users_list`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gcash_users_list` (
`number` double NOT NULL,
`balance` double NOT NULL,
PRIMARY KEY (`number`,`balance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `gcash_users_list`
--

LOCK TABLES `gcash_users_list` WRITE;


/*!40000 ALTER TABLE `gcash_users_list` DISABLE KEYS */;
INSERT INTO `gcash_users_list` VALUES (9392888084,7000);
/*!40000 ALTER TABLE `gcash_users_list` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `login`
--

DROP TABLE IF EXISTS `login`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `login` (
`UserName` varchar(40) NOT NULL,
`Password` varchar(45) NOT NULL,
PRIMARY KEY (`UserName`,`Password`),
UNIQUE KEY `LogIn_UNIQUE` (`UserName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `login`
--

LOCK TABLES `login` WRITE;


/*!40000 ALTER TABLE `login` DISABLE KEYS */;
INSERT INTO `login` VALUES ('Alex','kamatayan');
/*!40000 ALTER TABLE `login` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `nike`
--

DROP TABLE IF EXISTS `nike`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `nike` (
`item_code` int NOT NULL,
`item_name` varchar(45) NOT NULL,
`product_line` varchar(45) NOT NULL,
`supplier` varchar(45) NOT NULL,
`manufacturing_date` varchar(45) NOT NULL,
`quantity` int NOT NULL,
`manufacturing_country` varchar(45) NOT NULL,
`item_price` int NOT NULL,
PRIMARY KEY
(`item_code`,`item_name`,`product_line`,`supplier`,`manufacturing_date`,`quantity`,`ma
nufacturing_country`,`item_price`),
UNIQUE KEY `item_code_UNIQUE` (`item_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `nike`
--

LOCK TABLES `nike` WRITE;


/*!40000 ALTER TABLE `nike` DISABLE KEYS */;
INSERT INTO `nike` VALUES
(111111111,'Rosmina','Shoes','Nike','11/23/2023',499,'United
States',5000),(318271826,'Air Jordan','Shoes','Nike','03/23/2021',500,'United
States',7500),(334554643,'LeBron','Shoes','Nike','04/30/2018',69,'Canada',8000),(43258
9657,'Air Max','Shoes','Nike','06/07/2023',300,'Canada',5000),(627162361,'Kyrie
III','Shoes','Nike','03/21/2023',600,'United States',5000),(672817232,'Air Force
1','Shoes','Nike','09/16/2023',400,'United States',6500),(982716271,'Keith
Sakura','Shoes','Nike','02/06/2023',100,'Japan',6250);
/*!40000 ALTER TABLE `nike` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `paymaya_users_list`
--

DROP TABLE IF EXISTS `paymaya_users_list`;


/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paymaya_users_list` (
`number` double NOT NULL,
`balance` double NOT NULL,
PRIMARY KEY (`number`,`balance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `paymaya_users_list`
--

LOCK TABLES `paymaya_users_list` WRITE;


/*!40000 ALTER TABLE `paymaya_users_list` DISABLE KEYS */;
INSERT INTO `paymaya_users_list` VALUES (9392888084,6000);
/*!40000 ALTER TABLE `paymaya_users_list` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;


/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS
*/;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2023-12-12 13:24:19

Screenshot of Project Explorer in Eclipse

● AdminSide_Client- Lets us see the clients information and will help us perform updates
● AdminSide- Is the full Admin side section that shows the logs and applies the full CRUD
method
● ClientInterface- Its where the customer orders their products, having to choose between
the two payment methods
● Gcash- Where it verifies the Gcash section of the payment
● InventoryDisplay- A class that shows the possible products from our inventory
● Login- Where the user of the application access their account
● Logistics- Shows the Tracking order and lets the admin update its status
● Paymaya-Where it verifies the PayMaya section of the payment
● Procurement-Settles the payment section of our two suppliers
● SupplierSide- The class where the supplier enters their section of the products

Members Information
Name (SN, FN, Picture (1x1 Detailed Email Address Phone Number
MI.) Uniform Contributions/A
picture) ssigned Tasks:

Member 1: Coded the java qrahtulagan@tip 09392888084


Robert Tulagan for Procurement .edu.ph
and contributed
in Database.

Member 2: Made the CRUD qaabpanganiban 0987401398


Alexius Arielle B. components of @tip.edu.ph
Panganiban the program and
aswell as the
LogIn system
and Inventory
management.

Member 3: Luis Built the java for qleomana@tip.e 0997 223 9616
Ezekeil Omana Sale du.ph
Management
and contributed
in Database.

Member 4: Built the java for 09770380764


Salta, Myke Logistic and qmacbsalta@tip.
Allan contributed in edu.ph
Christopher B. Database.

Member 5: Ervin Contributed in qekmsayo@tip.e 09950762379


Keith M. Sayo Database and du.ph
Program the
Product
Inventory.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy