src/hotel/management/system/AddCustomer.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class AddCustomer extends JFrame implements ActionListener {

    JTextField t1, t2, t3, t4, t5;
    JButton b1, b2;
    Choice c1;
    JRadioButton r1, r2;

    AddCustomer() {

        JLabel l1 = new JLabel("New Customer Form");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(100, 20, 300, 30);
        add(l1);

        JLabel l2 = new JLabel("Name");
        l2.setBounds(35, 80, 100, 20);
        add(l2);

        t1 = new JTextField();
        t1.setBounds(150, 80, 150, 25);
        add(t1);

        JLabel l3 = new JLabel("Phone");
        l3.setBounds(35, 120, 100, 20);
        add(l3);

        t2 = new JTextField();
        t2.setBounds(150, 120, 150, 25);
        add(t2);

        JLabel l4 = new JLabel("Gender");
        l4.setBounds(35, 160, 100, 20);
        add(l4);

        r1 = new JRadioButton("Male");
        r1.setBounds(150, 160, 60, 25);
        r1.setBackground(Color.WHITE);
        add(r1);

        r2 = new JRadioButton("Female");
        r2.setBounds(220, 160, 80, 25);
        r2.setBackground(Color.WHITE);
        add(r2);

        JLabel l6 = new JLabel("Country");
        l6.setBounds(35, 200, 100, 20);
        add(l6);

        t3 = new JTextField();
        t3.setBounds(150, 200, 150, 25);
        add(t3);

        JLabel l7 = new JLabel("Allocated Room");
        l7.setBounds(35, 240, 100, 20);
        add(l7);

        c1 = new Choice();
        try {

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "select * from room where available = 'Available'";

            ResultSet rs = c.s.executeQuery(str);

            while (rs.next()) {

                c1.add(rs.getString("room_number"));

            }

        } catch (Exception e) {

        }

        c1.setBounds(150, 240, 150, 25);
        c1.setBackground(Color.WHITE);
        add(c1);

        JLabel l8 = new JLabel("Checked In");
        l8.setBounds(35, 280, 100, 20);
        add(l8);

        t4 = new JTextField();
        t4.setBounds(150, 280, 150, 25);
        add(t4);

        JLabel l9 = new JLabel("Deposit");
        l9.setBounds(35, 320, 100, 20);
        add(l9);

        t5 = new JTextField();
        t5.setBounds(150, 320, 150, 25);
        add(t5);

        b1 = new JButton("Add Customer");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(50, 370, 120, 30);
        add(b1);

        b2 = new JButton("Back");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(200, 370, 120, 30);
        add(b2);
        
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/customer.png"));
        Image i2 = i1.getImage().getScaledInstance(250, 250, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l10 = new JLabel(i3);
        l10.setBounds(400, 20, 300, 400);
        add(l10);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 800, 500);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String name = t1.getText();
            String phone = t2.getText();
            String gender = null;
            
            if (r1.isSelected()) {
                
                gender = "Male";
                
            } else if (r2.isSelected()) {
                
                gender = "Female";
                
            }
            
            String country = t3.getText();
            String room = c1.getSelectedItem();
            int roomInt = Integer.parseInt(room);
            String status = t4.getText();
            String deposit = t5.getText();
            int depositInt = Integer.parseInt(deposit);

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "insert into customer values ('" + name + "','" + phone + "','" + gender + "','" + country + "','" + roomInt + "','" + status + "','" + depositInt + "')";

            String str2 = "update room set available = 'Occupied' where room_number = '" + roomInt + "'";

            try {

                c.s.executeUpdate(str);
                c.s.executeUpdate(str2);

                JOptionPane.showMessageDialog(null, "Customer Added");
                
                t1.setText("");
                t2.setText("");
                t3.setText("");
                t4.setText("");
                t5.setText("");

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        }

    }

    public static void main(String[] args) {
        new AddCustomer().setVisible(true);
    }

}






src/hotel/management/system/AddDriver.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;

public class AddDriver extends JFrame implements ActionListener {

    JTextField t1, t2, t3, t4, t5;
    JComboBox c1, c2;
    JButton b1, b2;

    AddDriver() {

        JLabel name = new JLabel("Name");
        name.setFont(new Font("Tahoma", Font.BOLD, 17));
        name.setBounds(60, 80, 120, 30);
        add(name);

        t1 = new JTextField();
        t1.setBounds(200, 80, 150, 30);
        add(t1);

        JLabel age = new JLabel("Age");
        age.setFont(new Font("Tahoma", Font.BOLD, 17));
        age.setBounds(60, 130, 120, 30);
        add(age);

        t2 = new JTextField();
        t2.setBounds(200, 130, 150, 30);
        add(t2);

        JLabel gender = new JLabel("Gender");
        gender.setFont(new Font("Tahoma", Font.BOLD, 17));
        gender.setBounds(60, 180, 120, 30);
        add(gender);

        c1 = new JComboBox(new String[]{"Male", "Female"});
        c1.setBackground(Color.WHITE);
        c1.setBounds(200, 180, 150, 30);
        add(c1);

        JLabel model = new JLabel("Car Model");
        model.setFont(new Font("Tahoma", Font.BOLD, 17));
        model.setBounds(60, 230, 120, 30);
        add(model);

        t4 = new JTextField();
        t4.setBounds(200, 230, 150, 30);
        add(t4);

        JLabel available = new JLabel("Availability");
        available.setFont(new Font("Tahoma", Font.BOLD, 17));
        available.setBounds(60, 280, 120, 30);
        add(available);

        c2 = new JComboBox(new String[]{"Available", "Busy"});
        c2.setBackground(Color.WHITE);
        c2.setBounds(200, 280, 150, 30);
        add(c2);

        JLabel location = new JLabel("Location");
        location.setFont(new Font("Tahoma", Font.BOLD, 17));
        location.setBounds(60, 330, 120, 30);
        add(location);

        t5 = new JTextField();
        t5.setBounds(200, 330, 150, 30);
        add(t5);

        b1 = new JButton("Add Driver");
        b1.setForeground(Color.WHITE);
        b1.setBackground(Color.BLACK);
        b1.setBounds(130, 410, 100, 30);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Cancel");
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.setBounds(250, 410, 100, 30);
        b2.addActionListener(this);
        add(b2);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/eleven.jpg"));
        Image i2 = i1.getImage().getScaledInstance(500, 400, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l1 = new JLabel(i3);
        l1.setBounds(440, 50, 500, 400);
        add(l1);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 1000, 560);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String name = t1.getText();
            String age = t2.getText();
            int ageInt = Integer.parseInt(age);
            String gender = (String) c1.getSelectedItem();
            String model = t4.getText();
            String available = (String) c2.getSelectedItem();
            String location = t5.getText();

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "insert into driver values('" + name + "','" + ageInt + "','" + gender + "','" + model + "','" + available + "','" + location + "')";

            try {

                c.s.executeUpdate(str);
                JOptionPane.showMessageDialog(null, "Driver Added");

                t1.setText("");
                t2.setText("");
                c1.setSelectedItem(null);
                t4.setText("");
                c2.setSelectedItem(null);
                t5.setText("");

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            this.setVisible(false);

        }

    }

    public static void main(String[] args) {

        new AddDriver().setVisible(true);

    }

}





src/hotel/management/system/AddEmployee.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class AddEmployee extends JFrame implements ActionListener {

    JTextField t1, t2, t3, t4, t5, t6;
    JRadioButton r1, r2;
    JComboBox c1;
    JButton b1, b2;

    AddEmployee() {

        JLabel name = new JLabel("NAME");
        name.setBounds(60, 30, 120, 30);
        name.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(name);

        t1 = new JTextField();
        t1.setBounds(200, 30, 150, 30);
        add(t1);

        JLabel age = new JLabel("AGE");
        age.setBounds(60, 80, 120, 30);
        age.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(age);

        t2 = new JTextField();
        t2.setBounds(200, 80, 150, 30);
        add(t2);

        JLabel gender = new JLabel("GENDER");
        gender.setBounds(60, 130, 120, 30);
        gender.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(gender);

        r1 = new JRadioButton("Male");
        r1.setFont(new Font("Tahoma", Font.PLAIN, 14));
        r1.setBounds(200, 130, 70, 30);
        r1.setBackground(Color.WHITE);
        add(r1);

        r2 = new JRadioButton("Female");
        r2.setFont(new Font("Tahoma", Font.PLAIN, 14));
        r2.setBounds(280, 130, 70, 30);
        r2.setBackground(Color.WHITE);
        add(r2);

        JLabel job = new JLabel("JOB");
        job.setBounds(60, 180, 120, 30);
        job.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(job);

        String str[] = {"Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"};
        c1 = new JComboBox(str);
        c1.setBounds(200, 180, 150, 30);
        c1.setBackground(Color.WHITE);
        add(c1);

        JLabel salary = new JLabel("SALARY");
        salary.setBounds(60, 230, 120, 30);
        salary.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(salary);

        t3 = new JTextField();
        t3.setBounds(200, 230, 150, 30);
        add(t3);

        JLabel phone = new JLabel("PHONE");
        phone.setBounds(60, 280, 120, 30);
        phone.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(phone);

        t4 = new JTextField();
        t4.setBounds(200, 280, 150, 30);
        add(t4);

        JLabel nid = new JLabel("NID");
        nid.setBounds(60, 330, 120, 30);
        nid.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(nid);

        t5 = new JTextField();
        t5.setBounds(200, 330, 150, 30);
        add(t5);

        JLabel email = new JLabel("EMAIL");
        email.setBounds(60, 380, 120, 30);
        email.setFont(new Font("Tahoma", Font.BOLD, 17));
        add(email);

        t6 = new JTextField();
        t6.setBounds(200, 380, 150, 30);
        add(t6);

        b1 = new JButton("Submit");
        b1.setForeground(Color.WHITE);
        b1.setBackground(Color.BLACK);
        b1.setBounds(250, 440, 100, 30);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Back");
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.setBounds(130, 440, 100, 30);
        b2.addActionListener(this);
        add(b2);

        JLabel l1 = new JLabel("ADD EMPLOYEE DETAILS");
        l1.setForeground(Color.darkGray);
        l1.setBounds(420, 50, 400, 30);
        l1.setFont(new Font("Tahoma", Font.BOLD, 28));
        add(l1);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/tenth.jpg"));
        Image i2 = i1.getImage().getScaledInstance(520, 520, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(380, 55, 450, 450);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 900, 580);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String name = t1.getText();
            String age = t2.getText();
            int ageInt = Integer.parseInt(age);
            String salary = t3.getText();
            int salaryInt = Integer.parseInt(salary);
            String phone = t4.getText();
            String nid = t5.getText();
            String email = t6.getText();

            String gender = "null";

            if (r1.isSelected()) {
                
                gender = "Male";
                
            } else if (r2.isSelected()) {
                
                gender = "Female";
                
            }

            String job = (String) c1.getSelectedItem();

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "insert into employee values('" + name + "','" + ageInt + "','" + gender + "','" + job + "','" + salaryInt + "','" + phone + "','" + nid + "','" + email + "')";

            try {

                c.s.executeUpdate(str);
                
                JOptionPane.showMessageDialog(null, "Employee added");

                t1.setText("");
                t2.setText("");
                t3.setText("");
                t4.setText("");
                t5.setText("");
                t6.setText("");
                r1.setSelected(false);
                r2.setSelected(false);
                c1.setSelectedItem(null);

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            this.setVisible(false);

        }

    }

    public static void main(String[] args) {
        new AddEmployee().setVisible(true);
    }

}





src/hotel/management/system/AddRooms.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class AddRooms extends JFrame implements ActionListener {

    JTextField t1, t2;
    JComboBox c1, c2, c3;
    JButton b1, b2;

    AddRooms() {

        JLabel available = new JLabel("Availability");
        available.setFont(new Font("Tahoma", Font.BOLD, 17));
        available.setBounds(60, 130, 140, 30);
        add(available);

        c1 = new JComboBox(new String[]{"Available", "Occupied"});
        c1.setBounds(220, 130, 150, 30);
        c1.setBackground(Color.WHITE);
        add(c1);

        JLabel status = new JLabel("Cleaning Status");
        status.setFont(new Font("Tahoma", Font.BOLD, 17));
        status.setBounds(60, 180, 140, 30);
        add(status);

        c2 = new JComboBox(new String[]{"Cleaned", "Dirty"});
        c2.setBounds(220, 180, 150, 30);
        c2.setBackground(Color.WHITE);
        add(c2);

        JLabel price = new JLabel("Price");
        price.setFont(new Font("Tahoma", Font.BOLD, 17));
        price.setBounds(60, 230, 140, 30);
        add(price);

        t2 = new JTextField();
        t2.setBounds(220, 230, 150, 30);
        add(t2);

        JLabel type = new JLabel("Bed Type");
        type.setFont(new Font("Tahoma", Font.BOLD, 17));
        type.setBounds(60, 280, 140, 30);
        add(type);

        c3 = new JComboBox(new String[]{"Single Bed", "Double Bed"});
        c3.setBounds(220, 280, 150, 30);
        c3.setBackground(Color.WHITE);
        add(c3);

        b1 = new JButton("Add Room");
        b1.setForeground(Color.WHITE);
        b1.setBackground(Color.BLACK);
        b1.setBounds(150, 350, 100, 30);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Cancel");
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.setBounds(270, 350, 100, 30);
        b2.addActionListener(this);
        add(b2);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/twelve.jpg"));
        JLabel l2 = new JLabel(i1);
        l2.setBounds(440, 30, 500, 350);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1000, 470);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String available = (String) c1.getSelectedItem();
            String status = (String) c2.getSelectedItem();
            String price = t2.getText();
            int priceInt = Integer.parseInt(price);
            String type = (String) c3.getSelectedItem();

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "insert into room values('" + available + "','" + status + "','" + priceInt + "','" + type + "')";

            try {

                c.s.executeUpdate(str);

                JOptionPane.showMessageDialog(null, "Room Added");

                t2.setText("");

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            this.setVisible(false);

        }

    }

    public static void main(String[] args) {
        new AddRooms().setVisible(true);
    }

}







src/hotel/management/system/CheckOut.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import java.sql.*;

public class CheckOut extends JFrame implements ActionListener {

    Choice c1;
    JTextField t1;
    JButton b1, b2, b3;

    CheckOut() {

        JLabel l1 = new JLabel("Check Out");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(100, 20, 100, 30);
        add(l1);

        JLabel l2 = new JLabel("Customer Phone No.");
        l2.setBounds(30, 80, 120, 30);
        add(l2);

        c1 = new Choice();

        try {

            ConnectMSSQL c = new ConnectMSSQL();

            ResultSet rs = c.s.executeQuery("select * from customer");

            while (rs.next()) {

                c1.add(rs.getString("phone"));

            }

        } catch (Exception e) {

        }

        c1.setBounds(170, 80, 150, 30);
        add(c1);

        JLabel l3 = new JLabel("Room");
        l3.setBounds(30, 130, 120, 30);
        add(l3);

        t1 = new JTextField();
        t1.setBounds(170, 130, 150, 30);
        add(t1);

        b1 = new JButton("Checkout");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(40, 200, 120, 30);
        add(b1);

        b2 = new JButton("Back");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(180, 200, 120, 30);
        add(b2);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/tick.png"));
        Image i2 = i1.getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        b3 = new JButton(i3);
        b3.setBounds(330, 80, 20, 20);
        b3.addActionListener(this);
        add(b3);

        ImageIcon i4 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/sixth.jpg"));
        Image i5 = i4.getImage().getScaledInstance(400, 210, Image.SCALE_DEFAULT);
        ImageIcon i6 = new ImageIcon(i5);
        JLabel l4 = new JLabel(i6);
        l4.setBounds(370, 10, 400, 250);
        add(l4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 800, 300);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String phone = c1.getSelectedItem();
            String room = t1.getText();

            ConnectMSSQL c = new ConnectMSSQL();

            String str2 = "update room set available = 'Available' where room_number = '" + room + "'";

            try {
                
                c.s.executeUpdate(str2);

                JOptionPane.showMessageDialog(null, "Checkout Done");

            } catch (Exception e) {

                System.out.println(e);

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b3) {

            ConnectMSSQL c = new ConnectMSSQL();

            String s = c1.getSelectedItem();

            try {

                ResultSet rs = c.s.executeQuery("select * from customer where phone = '" + s + "'");

                while (rs.next()) {

                    t1.setText(rs.getString("room"));

                }

            } catch (Exception e) {

            }

        }

    }

    public static void main(String[] args) {

        new CheckOut().setVisible(true);

    }

}






src/hotel/management/system/ConnectMSSQL.java
package hotel.management.system;

import java.sql.*;

public class ConnectMSSQL {

    Connection c;
    Statement s;

    public ConnectMSSQL() {

        try {

            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            c = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=projecthms;selectMethod=cursor", "sa", "123456");
            s = c.createStatement();

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

    }

}







src/hotel/management/system/CustomerInfo.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import net.proteanit.sql.*;

public class CustomerInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2;
    JComboBox c1, c2, c3, c4;

    CustomerInfo() {

        t1 = new JTable();
        t1.setBounds(0, 40, 1000, 300);
        add(t1);

        c1 = new JComboBox(new String[]{"Country Region", "Local", "Foreigner"});
        c1.setBounds(160, 400, 150, 25);
        c1.setBackground(Color.WHITE);
        c1.addActionListener(this);
        add(c1);

        c2 = new JComboBox(new String[]{"Sort By", "Room"});
        c2.setBounds(440, 400, 150, 25);
        c2.setBackground(Color.WHITE);
        c2.addActionListener(this);
        add(c2);

        JLabel l1 = new JLabel("Name");
        l1.setBounds(50, 10, 70, 20);
        add(l1);

        JLabel l2 = new JLabel("Phone");
        l2.setBounds(190, 10, 70, 20);
        add(l2);

        JLabel l3 = new JLabel("Gender");
        l3.setBounds(330, 10, 70, 20);
        add(l3);

        JLabel l4 = new JLabel("Country");
        l4.setBounds(470, 10, 70, 20);
        add(l4);

        JLabel l5 = new JLabel("Room");
        l5.setBounds(620, 10, 70, 20);
        add(l5);

        JLabel l6 = new JLabel("Checked In");
        l6.setBounds(750, 10, 70, 20);
        add(l6);

        JLabel l7 = new JLabel("Deposit");
        l7.setBounds(890, 10, 70, 20);
        add(l7);

        b1 = new JButton("Load Data");
        b1.setBounds(350, 560, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Back");
        b2.setBounds(530, 560, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1000, 650);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();
                String str = "select name, phone, gender, country, room, status, deposit from customer";
                ResultSet rs = c.s.executeQuery(str);

                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == c1) {

            if (c1.getSelectedItem() == "Local") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, phone, gender, country, room, status, deposit from customer where country = 'Bangladesh'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c1.getSelectedItem() == "Foreigner") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, phone, gender, country, room, status, deposit from customer where not country = 'Bangladesh'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == c2) {

            if (c2.getSelectedItem() == "Room") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, phone, gender, country, room, status, deposit from customer order by room + 0";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        }

    }

    public static void main(String[] args) {
        new CustomerInfo().setVisible(true);
    }

}








src/hotel/management/system/Dashboard.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Dashboard extends JFrame implements ActionListener {

    JButton b1, b2, b3, b4;

    Dashboard() {

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/luxury.jpg"));
        Image i2 = i1.getImage().getScaledInstance(1720, 1000, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l1 = new JLabel(i3);
        l1.setBounds(230, 0, 1720, 1000);
        add(l1);

        b1 = new JButton("Admin");
        b1.setFont(new Font("Tahoma", Font.BOLD, 26));
        b1.addActionListener(this);
        b1.setBounds(20, 300, 190, 60);
        add(b1);

        b2 = new JButton("Reception");
        b2.setFont(new Font("Tahoma", Font.BOLD, 26));
        b2.addActionListener(this);
        b2.setBounds(20, 470, 190, 60);
        add(b2);

        b4 = new JButton("Logout");
        b4.setFont(new Font("Tahoma", Font.BOLD, 26));
        b4.addActionListener(this);
        b4.setBounds(20, 640, 190, 60);
        add(b4);

        getContentPane().setBackground(Color.decode("#6e5853"));

        setLayout(null);
        setBounds(0, 0, 1950, 1020);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            new DropDown().setVisible(true);

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);

        } else if (ae.getSource() == b3) {

        } else if (ae.getSource() == b4) {

            new Login().setVisible(true);
            this.setVisible(false);

        }

    }

    public static void main(String[] args) {

        new Dashboard().setVisible(true);

    }

}







src/hotel/management/system/DropDown.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class DropDown extends JFrame implements ActionListener {

    JButton b1, b2, b3;

    DropDown() {

        b1 = new JButton("Add Employee");
        b1.setFont(new Font("Tahoma", Font.BOLD, 16));
        b1.addActionListener(this);
        b1.setBounds(5, 30, 160, 40);
        add(b1);

        b2 = new JButton("Add Room");
        b2.setFont(new Font("Tahoma", Font.BOLD, 16));
        b2.addActionListener(this);
        b2.setBounds(5, 100, 160, 40);
        add(b2);

        b3 = new JButton("Add Driver");
        b3.setFont(new Font("Tahoma", Font.BOLD, 16));
        b3.addActionListener(this);
        b3.setBounds(5, 170, 160, 40);
        add(b3);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(230, 337, 190, 290);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            new AddEmployee().setVisible(true);

        } else if (ae.getSource() == b2) {

            new AddRooms().setVisible(true);

        } else if (ae.getSource() == b3) {

            new AddDriver().setVisible(true);

        }

    }

    public static void main(String[] args) {

        new DropDown().setVisible(true);

    }

}








src/hotel/management/system/EmployeeInfo.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;

import net.proteanit.sql.*;

public class EmployeeInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2, b3, b4;
    JComboBox c1, c2, c3, c4, c5, c6, c7, c8;

    EmployeeInfo() {

        t1 = new JTable();
        t1.setBounds(0, 40, 1010, 300);
        add(t1);

        c1 = new JComboBox(new String[]{"Sort By", "Name", "Age", "Job"});
        c1.setBounds(10, 400, 100, 25);
        c1.setBackground(Color.WHITE);
        c1.addActionListener(this);
        add(c1);

        c2 = new JComboBox(new String[]{"Salary Range", "1k-20k", "21k-40k", "41k-60k", "60k+"});
        c2.setBounds(140, 400, 100, 25);
        c2.setBackground(Color.WHITE);
        c2.addActionListener(this);
        add(c2);

        c3 = new JComboBox(new String[]{"Job", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c3.setBounds(280, 400, 140, 25);
        c3.setBackground(Color.WHITE);
        c3.addActionListener(this);
        add(c3);

        c4 = new JComboBox(new String[]{"No. of employees according to job", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c4.setBounds(460, 400, 230, 25);
        c4.setBackground(Color.WHITE);
        c4.addActionListener(this);
        add(c4);

        c5 = new JComboBox(new String[]{"Mobile SIM operator", "Grameenphone", "Robi", "Banglalink", "Airtel", "Teletalk"});
        c5.setBounds(730, 400, 160, 25);
        c5.setBackground(Color.WHITE);
        c5.addActionListener(this);
        add(c5);

        c6 = new JComboBox(new String[]{"Average Salary according to job", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c6.setBounds(80, 470, 230, 25);
        c6.setBackground(Color.WHITE);
        c6.addActionListener(this);
        add(c6);

        c7 = new JComboBox(new String[]{"Salary greater than Average Salary", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c7.setBounds(360, 470, 230, 25);
        c7.setBackground(Color.WHITE);
        c7.addActionListener(this);
        add(c7);

        c8 = new JComboBox(new String[]{"Salary less than Average Salary", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Stuff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c8.setBounds(640, 470, 230, 25);
        c8.setBackground(Color.WHITE);
        c8.addActionListener(this);
        add(c8);

        JLabel l1 = new JLabel("Name");
        l1.setBounds(40, 10, 70, 20);
        add(l1);

        JLabel l2 = new JLabel("Age");
        l2.setBounds(170, 10, 70, 20);
        add(l2);

        JLabel l3 = new JLabel("Gender");
        l3.setBounds(290, 10, 70, 20);
        add(l3);

        JLabel l4 = new JLabel("Job");
        l4.setBounds(400, 10, 70, 20);
        add(l4);

        JLabel l5 = new JLabel("Salary");
        l5.setBounds(540, 10, 70, 20);
        add(l5);

        JLabel l6 = new JLabel("Phone");
        l6.setBounds(670, 10, 70, 20);
        add(l6);

        JLabel l7 = new JLabel("NID");
        l7.setBounds(790, 10, 70, 20);
        add(l7);

        JLabel l8 = new JLabel("Email");
        l8.setBounds(910, 10, 70, 20);
        add(l8);

        b1 = new JButton("Load Data");
        b1.setBounds(350, 560, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Back");
        b2.setBounds(530, 560, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        b4 = new JButton("Delete");
        b4.setBounds(680, 560, 120, 30);
        b4.setBackground(Color.BLACK);
        b4.setForeground(Color.WHITE);
        b4.addActionListener(this);
        add(b4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1030, 650);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();
                String str = "select name, age, gender, job, salary, phone, nid, email from employee";
                ResultSet rs = c.s.executeQuery(str);

                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == c1) {

            if (c1.getSelectedItem() == "Name") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();
                    String str = "select name, age, gender, job, salary, phone, nid, email from employee order by name";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c1.getSelectedItem() == "Age") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();
                    String str = "select name, age, gender, job, salary, phone, nid, email from employee order by age + 0";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c1.getSelectedItem() == "Job") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee order by job";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == c2) {

            if (c2.getSelectedItem() == "1k-20k") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary between 1000 and 20000";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c2.getSelectedItem() == "21k-40k") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary between 20001 and 40000";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c2.getSelectedItem() == "41k-60k") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary between 40001 and 60000";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c2.getSelectedItem() == "60k+") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > 60001";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == b4) {

            int row = t1.getSelectedRow();

            String cell = t1.getModel().getValueAt(row, 0).toString();

            System.out.println(cell);

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "delete from employee where name = '" + cell + "'";

                c.s.executeQuery(str);

                JOptionPane.showMessageDialog(null, "Row deleted");

            } catch (Exception e) {

                System.out.println(e);

            }

        } else if (ae.getSource() == c3) {

            if (c3.getSelectedItem() == "Front Desk Clerks") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Front Desk Clerks'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Porters") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Porters'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Housekeeping") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Housekeeping'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Kitchen Stuff") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Kitchen Stuff'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Room Service") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Room Service'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Waiter") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Waiter'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Manager") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Manager'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Accountant") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Accountant'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (c3.getSelectedItem() == "Chef") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Chef'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == c4) {

            if (c4.getSelectedItem() == "Front Desk Clerks") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Front Desk Clerks'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Front Desk Clerks in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Porters") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Porters'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Porters in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Housekeeping") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Housekeeping'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Housekeepers in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Kitchen Stuff") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Kitchen Stuff'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Kitchen Stuffs in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Room Service") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Room Service'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Room Service person in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Waiter") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Waiter'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Waiters in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Manager") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Manager'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Managers in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Accountant") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Accountant'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Accountants in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c4.getSelectedItem() == "Chef") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select count(job) from employee where job = 'Chef'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "There are currently " + String.valueOf(i) + " Chefs in our hotel");

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            }

        } else if (ae.getSource() == c5) {

            if (c5.getSelectedItem() == "Grameenphone") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where ((phone like '017%') or (phone like '013%'))";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c5.getSelectedItem() == "Robi") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where phone like '018%'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c5.getSelectedItem() == "Banglalink") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where ((phone like '019%') or (phone like '014%'))";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c5.getSelectedItem() == "Airtel") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where phone like '016%'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c5.getSelectedItem() == "Teletalk") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where phone like '015%'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            }

        } else if (ae.getSource() == c6) {

            if (c6.getSelectedItem() == "Front Desk Clerks") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Front Desk Clerks';";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Front Desk Clerk is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Porters") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Porters'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Porter is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Housekeeping") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Housekeeping'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Housekeeper is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Kitchen Stuff") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Kitchen Stuff'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Kitchen Stuff is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Room Service") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Room Service'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Room Service is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Waiter") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Waiter'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Waiter is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Manager") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Manager'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Manager is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Accountant") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Accountant'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Accountant is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c6.getSelectedItem() == "Chef") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select AVG(salary) from employee where job = 'Chef'";

                    ResultSet rs = c.s.executeQuery(str);

                    while (rs.next()) {

                        int i = rs.getInt(1);

                        JOptionPane.showMessageDialog(null, "Average salary of Chef is " + String.valueOf(i));

                    }

                } catch (Exception e) {

                    System.out.println(e);

                }

            }

        } else if (ae.getSource() == c7) {

            if (c7.getSelectedItem() == "Front Desk Clerks") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Front Desk Clerks') and job = 'Front Desk Clerks'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Porters") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Porters') and job = 'Porters'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Housekeeping") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Housekeeping') and job = 'Housekeeping'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Kitchen Stuff") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Kitchen Stuff') and job = 'Kitchen Stuff'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Room Service") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Room Service') and job = 'Room Service'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Waiter") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Waiter') and job = 'Waiter'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Manager") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Manager') and job = 'Manager'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Accountant") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Accountant') and job = 'Accountant'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c7.getSelectedItem() == "Chef") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary > (select AVG(salary) from employee where job = 'Chef') and job = 'Chef'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            }

        } else if (ae.getSource() == c8) {

            if (c8.getSelectedItem() == "Front Desk Clerks") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Front Desk Clerks') and job = 'Front Desk Clerks'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Porters") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Porters') and job = 'Porters'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Housekeeping") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Housekeeping') and job = 'Housekeeping'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Kitchen Stuff") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Kitchen Stuff') and job = 'Kitchen Stuff'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Room Service") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Room Service') and job = 'Room Service'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Waiter") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Waiter') and job = 'Waiter'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Manager") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Manager') and job = 'Manager'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Accountant") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Accountant') and job = 'Accountant'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            } else if (c8.getSelectedItem() == "Chef") {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, job, salary, phone, nid, email from employee where salary < (select AVG(salary) from employee where job = 'Chef') and job = 'Chef'";

                    ResultSet rs = c.s.executeQuery(str);

                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                    System.out.println(e);

                }

            }

        }

    }

    public static void main(String[] args) {

        new EmployeeInfo().setVisible(true);

    }

}







src/hotel/management/system/HotelManagementSystem.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class HotelManagementSystem extends JFrame implements ActionListener {

    public HotelManagementSystem() {
        
        setBounds(300, 200, 1366, 565);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/hotel.jpg"));
        JLabel l1 = new JLabel(i1);
        l1.setBounds(0, 0, 1366, 565);
        add(l1);

        JLabel l2 = new JLabel("Hotel Management System");
        l2.setBounds(20, 430, 1000, 90);
        l2.setForeground(Color.WHITE);
        l2.setFont(new Font("serif", Font.PLAIN, 70));
        l1.add(l2);

        JButton b1 = new JButton("Next");
        b1.setBackground(Color.WHITE);
        b1.setForeground(Color.BLACK);
        b1.setBounds(1150, 450, 150, 50);
        b1.addActionListener(this);
        l1.add(b1);

        setLayout(null);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {
        new Login().setVisible(true);
        this.setVisible(false);
    }

    public static void main(String[] args) {
        new HotelManagementSystem().setVisible(true);
    }

}








src/hotel/management/system/Login.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;

public class Login extends JFrame implements ActionListener {

    JLabel l1, l2;
    JTextField t1;
    JPasswordField t2;
    JButton b1, b2;
    JCheckBox check;

    Login() {

        l1 = new JLabel("Username");
        l1.setBounds(40, 50, 100, 30);
        add(l1);

        l2 = new JLabel("Password");
        l2.setBounds(40, 100, 100, 30);
        add(l2);

        t1 = new JTextField();
        t1.setBounds(150, 50, 150, 30);
        add(t1);

        t2 = new JPasswordField();
        t2.setBounds(150, 100, 150, 30);
        add(t2);

        check = new JCheckBox("Show Password");
        check.setBounds(185, 140, 140, 30);
        check.setBackground(Color.WHITE);
        check.addActionListener(this);
        add(check);

        b1 = new JButton("Login");
        b1.setBounds(40, 230, 120, 30);
        b1.setForeground(Color.WHITE);
        b1.setBackground(Color.BLACK);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Cancel");
        b2.setBounds(180, 230, 120, 30);
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.addActionListener(this);
        add(b2);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/second.jpg"));
        Image i2 = i1.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l3 = new JLabel(i3);
        l3.setBounds(350, 10, 200, 200);
        add(l3);

        JMenuItem l4 = new JMenuItem("<HTML><U>Don't have an account? Signup</U></HTML>");
        l4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        l4.setBackground(Color.WHITE);
        l4.setBounds(360, 310, 200, 30);
        l4.addActionListener(this);
        add(l4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(700, 300, 600, 400);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String username = t1.getText();
            String password = t2.getText();

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "select * from login where username = '" + username + "' and password = '" + password + "'";

            try {
                ResultSet rs = c.s.executeQuery(str);

                if (rs.next()) {
                    new Dashboard().setVisible(true);
                    this.setVisible(false);
                } else {
                    JOptionPane.showMessageDialog(null, "Invalid username and password");
                    t1.setText("");
                    t2.setText("");
                }

            } catch (Exception e) {

            }
        } else if (ae.getSource() == b2) {
            this.setVisible(false);
            new HotelManagementSystem().setVisible(true);

        } else if (ae.getActionCommand().equals("<HTML><U>Don't have an account? Signup</U></HTML>")) {

            new SignUp().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == check) {

            if (check.isSelected()) {

                t2.setEchoChar((char) 0);

            } else {

                t2.setEchoChar('*');

            }

        }

    }

    public static void main(String[] args) {
        new Login();
    }

}


















src/hotel/management/system/ManagerInfo.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import net.proteanit.sql.*;

public class ManagerInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2;

    ManagerInfo() {

        t1 = new JTable();
        t1.setBounds(0, 40, 1010, 500);
        add(t1);

        JLabel l1 = new JLabel("Name");
        l1.setBounds(40, 10, 70, 20);
        add(l1);

        JLabel l2 = new JLabel("Age");
        l2.setBounds(170, 10, 70, 20);
        add(l2);

        JLabel l3 = new JLabel("Gender");
        l3.setBounds(290, 10, 70, 20);
        add(l3);

        JLabel l4 = new JLabel("Job");
        l4.setBounds(400, 10, 70, 20);
        add(l4);

        JLabel l5 = new JLabel("Salary");
        l5.setBounds(540, 10, 70, 20);
        add(l5);

        JLabel l6 = new JLabel("Phone");
        l6.setBounds(670, 10, 70, 20);
        add(l6);

        JLabel l7 = new JLabel("NID");
        l7.setBounds(790, 10, 70, 20);
        add(l7);

        JLabel l8 = new JLabel("Email");
        l8.setBounds(910, 10, 70, 20);
        add(l8);

        b1 = new JButton("Load Data");
        b1.setBounds(350, 560, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Back");
        b2.setBounds(530, 560, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1030, 650);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();
                String str = "select name, age, gender, job, salary, phone, nid, email from employee where job = 'Manager';";
                ResultSet rs = c.s.executeQuery(str);

                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        }

    }

    public static void main(String[] args) {
        new ManagerInfo().setVisible(true);
    }

}






src/hotel/management/system/PickUp.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;

public class PickUp extends JFrame implements ActionListener {

    Choice c1;
    JButton b1, b2, b3;
    JTable t1;
    JCheckBox cb1, cb2;

    PickUp() {

        JLabel l1 = new JLabel("PickUp Service");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(400, 30, 200, 30);
        add(l1);

        JLabel l2 = new JLabel("Type of Car");
        l2.setBounds(50, 100, 100, 20);
        add(l2);

        c1 = new Choice();

        try {

            ConnectMSSQL c = new ConnectMSSQL();

            ResultSet rs = c.s.executeQuery("select distinct model from driver");

            while (rs.next()) {

                c1.addItem(rs.getString("model"));

            }

        } catch (Exception e) {

        }

        c1.setBounds(150, 100, 200, 25);
        add(c1);

        cb1 = new JCheckBox("Available Drivers (At Hotel)");
        cb1.setBackground(Color.WHITE);
        cb1.addActionListener(this);
        cb1.setBounds(650, 100, 200, 25);
        add(cb1);

        cb2 = new JCheckBox("Experienced Drivers");
        cb2.setBackground(Color.WHITE);
        cb2.addActionListener(this);
        cb2.setBounds(400, 100, 200, 25);
        add(cb2);

        JLabel l3 = new JLabel("Name");
        l3.setBounds(50, 170, 100, 20);
        add(l3);

        JLabel l4 = new JLabel("Age");
        l4.setBounds(200, 170, 100, 20);
        add(l4);

        JLabel l5 = new JLabel("Gender");
        l5.setBounds(340, 170, 100, 20);
        add(l5);

        JLabel l7 = new JLabel("Model");
        l7.setBounds(620, 170, 100, 20);
        add(l7);

        JLabel l8 = new JLabel("Availability");
        l8.setBounds(750, 170, 100, 20);
        add(l8);

        JLabel l9 = new JLabel("Location");
        l9.setBounds(890, 170, 100, 20);
        add(l9);

        t1 = new JTable();
        t1.setBounds(0, 200, 1000, 300);
        add(t1);

        b1 = new JButton("Search");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(200, 520, 120, 30);
        add(b1);

        b3 = new JButton("Load Data");
        b3.setBackground(Color.BLACK);
        b3.setForeground(Color.WHITE);
        b3.addActionListener(this);
        b3.setBounds(360, 520, 120, 30);
        add(b3);

        b2 = new JButton("Back");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(520, 520, 120, 30);
        add(b2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 1000, 650);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "select name, age, gender, model, available, location from driver where model = '" + c1.getSelectedItem() + "'";

                ResultSet rs = c.s.executeQuery(str);
                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == cb1) {

            if (cb1.isSelected()) {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, model, available, location from driver where location = 'At Hotel'";

                    ResultSet rs = c.s.executeQuery(str);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (!cb1.isSelected()) {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, model, available, location from driver";

                    ResultSet rs = c.s.executeQuery(str);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == cb2) {

            if (cb2.isSelected()) {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, model, available, location from driver where age >= 35";

                    ResultSet rs = c.s.executeQuery(str);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            } else if (!cb2.isSelected()) {

                try {

                    ConnectMSSQL c = new ConnectMSSQL();

                    String str = "select name, age, gender, model, available, location from driver";

                    ResultSet rs = c.s.executeQuery(str);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } catch (Exception e) {

                }

            }

        } else if (ae.getSource() == b3) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "select name, age, gender, model, available, location from driver";

                ResultSet rs = c.s.executeQuery(str);
                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        }

    }

    public static void main(String[] args) {

        new PickUp().setVisible(true);

    }

}








src/hotel/management/system/Reception.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Reception extends JFrame implements ActionListener {

    JButton b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12;

    Reception() {

        b1 = new JButton("New Customer Form");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.setBounds(10, 30, 200, 30);
        b1.addActionListener(this);
        add(b1);
        
        b4 = new JButton("All Employee Info");
        b4.setBackground(Color.BLACK);
        b4.setForeground(Color.WHITE);
        b4.setBounds(10, 110, 200, 30);
        b4.addActionListener(this);
        add(b4);

        b5 = new JButton("Customer Info");
        b5.setBackground(Color.BLACK);
        b5.setForeground(Color.WHITE);
        b5.setBounds(10, 150, 200, 30);
        b5.addActionListener(this);
        add(b5);

        b6 = new JButton("Manager Info");
        b6.setBackground(Color.BLACK);
        b6.setForeground(Color.WHITE);
        b6.setBounds(10, 190, 200, 30);
        b6.addActionListener(this);
        add(b6);

        b7 = new JButton("Check Out");
        b7.setBackground(Color.BLACK);
        b7.setForeground(Color.WHITE);
        b7.setBounds(10, 230, 200, 30);
        b7.addActionListener(this);
        add(b7);

        b8 = new JButton("Update Check Status");
        b8.setBackground(Color.BLACK);
        b8.setForeground(Color.WHITE);
        b8.setBounds(10, 270, 200, 30);
        b8.addActionListener(this);
        add(b8);

        b9 = new JButton("Update Room Status");
        b9.setBackground(Color.BLACK);
        b9.setForeground(Color.WHITE);
        b9.setBounds(10, 310, 200, 30);
        b9.addActionListener(this);
        add(b9);

        b10 = new JButton("Pick up Service");
        b10.setBackground(Color.BLACK);
        b10.setForeground(Color.WHITE);
        b10.setBounds(10, 350, 200, 30);
        b10.addActionListener(this);
        add(b10);

        b11 = new JButton("Search Room");
        b11.setBackground(Color.BLACK);
        b11.setForeground(Color.WHITE);
        b11.setBounds(10, 390, 200, 30);
        b11.addActionListener(this);
        add(b11);

        b12 = new JButton("Back");
        b12.setBackground(Color.BLACK);
        b12.setForeground(Color.WHITE);
        b12.setBounds(10, 430, 200, 30);
        b12.addActionListener(this);
        add(b12);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/fourth.jpg"));
        JLabel l1 = new JLabel(i1);
        l1.setBounds(250, 30, 530, 430);
        add(l1);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(550, 200, 800, 530);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            new AddCustomer().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b4) {

            new EmployeeInfo().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b5) {

            new CustomerInfo().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b6) {

            new ManagerInfo().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b7) {

            new CheckOut().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b8) {

            new UpdateStatus().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b9) {

            new UpdateRoom().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b10) {

            new PickUp().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b11) {

            new SearchRoom().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == b12) {
            
            this.setVisible(false);
            
        }

    }

    public static void main(String[] args) {
        new Reception().setVisible(true);
    }

}









src/hotel/management/system/SearchRoom.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;

public class SearchRoom extends JFrame implements ActionListener {

    JComboBox c1;
    JCheckBox c2;
    JButton b1, b2, b3, b4;
    JTable t1;
    JTextField t2, t3;

    SearchRoom() {

        JLabel l1 = new JLabel("Search For Room");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(400, 30, 200, 30);
        add(l1);

        JLabel l2 = new JLabel("Room Bed Type");
        l2.setBounds(50, 100, 100, 20);
        add(l2);

        c1 = new JComboBox(new String[]{"Single Bed", "Double Bed"});
        c1.setBounds(150, 100, 150, 25);
        c1.setBackground(Color.WHITE);
        add(c1);

        JLabel l8 = new JLabel("Room Price");
        l8.setBounds(450, 80, 120, 20);
        add(l8);

        t2 = new JTextField();
        t2.addActionListener(this);
        t2.setBounds(360, 120, 100, 25);
        add(t2);

        t3 = new JTextField();
        t3.addActionListener(this);
        t3.setBounds(480, 120, 100, 25);
        add(t3);

        c2 = new JCheckBox("Only Display Available");
        c2.setBackground(Color.WHITE);
        c2.setBounds(650, 100, 150, 25);
        add(c2);

        JLabel l3 = new JLabel("Room");
        l3.setBounds(90, 170, 100, 20);
        add(l3);

        JLabel l4 = new JLabel("Availability");
        l4.setBounds(270, 170, 100, 20);
        add(l4);

        JLabel l5 = new JLabel("Cleaning Status");
        l5.setBounds(450, 170, 100, 20);
        add(l5);

        JLabel l6 = new JLabel("Price");
        l6.setBounds(680, 170, 100, 20);
        add(l6);

        JLabel l7 = new JLabel("Bed Type");
        l7.setBounds(850, 170, 100, 20);
        add(l7);

        t1 = new JTable();
        t1.setBounds(0, 200, 1000, 380);
        add(t1);

        b1 = new JButton("Search");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(250, 610, 120, 30);
        add(b1);

        b4 = new JButton("Load Data");
        b4.setBackground(Color.BLACK);
        b4.setForeground(Color.WHITE);
        b4.addActionListener(this);
        b4.setBounds(430, 610, 120, 30);
        add(b4);

        b2 = new JButton("Back");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(610, 610, 120, 30);
        add(b2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 150, 1000, 720);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "select * from room where bed_type = '" + c1.getSelectedItem() + "' AND price between " + t2.getText() + " and " + t3.getText() + "";

                String str2 = "select * from room where available = 'Available' AND bed_type = '" + c1.getSelectedItem() + "'  and price between " + t2.getText() + " AND " + t3.getText() + "";

                ResultSet rs;

                if (c2.isSelected()) {

                    rs = c.s.executeQuery(str2);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                } else {

                    rs = c.s.executeQuery(str);
                    t1.setModel(DbUtils.resultSetToTableModel(rs));

                }

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            new Reception().setVisible(true);
            this.setVisible(false);

        } /*else if (ae.getSource() == b3) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "select * from room where price between " + t2.getText() + " and " + t3.getText() + "";

                ResultSet rs = c.s.executeQuery(str);
                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

                System.out.println(e);

            }

        }*/ else if (ae.getSource() == b4) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String str = "select * from room";

                ResultSet rs = c.s.executeQuery(str);

                t1.setModel(DbUtils.resultSetToTableModel(rs));

            } catch (Exception e) {

            }

        }

    }

    public static void main(String[] args) {

        new SearchRoom().setVisible(true);

    }

}














src/hotel/management/system/SignUp.java
package hotel.management.system;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;

public class SignUp extends JFrame implements ActionListener {

    JLabel l1, l2;
    JTextField t1;
    JPasswordField t2;
    JButton b1, b2;
    JCheckBox check;

    SignUp() {

        l1 = new JLabel("Username");
        l1.setBounds(40, 50, 100, 30);
        add(l1);

        l2 = new JLabel("Password");
        l2.setBounds(40, 100, 100, 30);
        add(l2);

        t1 = new JTextField();
        t1.setBounds(150, 50, 150, 30);
        add(t1);

        t2 = new JPasswordField();
        t2.setBounds(150, 100, 150, 30);
        add(t2);

        check = new JCheckBox("Show Password");
        check.setBounds(185, 140, 140, 30);
        check.setBackground(Color.WHITE);
        check.addActionListener(this);
        add(check);

        b1 = new JButton("Signup");
        b1.setBounds(40, 230, 120, 30);
        b1.setForeground(Color.WHITE);
        b1.setBackground(Color.BLACK);
        b1.addActionListener(this);
        add(b1);

        b2 = new JButton("Cancel");
        b2.setBounds(180, 230, 120, 30);
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.addActionListener(this);
        add(b2);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/second.jpg"));
        Image i2 = i1.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l3 = new JLabel(i3);
        l3.setBounds(350, 10, 200, 200);
        add(l3);

        JMenuItem l4 = new JMenuItem("<HTML><U>Already have an account? Login</U></HTML>");
        l4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        l4.setBackground(Color.WHITE);
        l4.setBounds(360, 310, 200, 30);
        l4.addActionListener(this);
        add(l4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(700, 300, 600, 400);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String username = t1.getText();
            String password = t2.getText();

            ConnectMSSQL c = new ConnectMSSQL();

            String str = "insert into login values('" + username + "','" + password + "')";

            try {

                c.s.executeUpdate(str);
                JOptionPane.showMessageDialog(null, "Account Created");

                new Login().setVisible(true);

            } catch (Exception e) {

            }
        } else if (ae.getSource() == b2) {
            this.setVisible(false);
            new HotelManagementSystem().setVisible(true);

        } else if (ae.getActionCommand().equals("<HTML><U>Already have an account? Login</U></HTML>")) {

            new Login().setVisible(true);
            this.setVisible(false);

        } else if (ae.getSource() == check) {

            if (check.isSelected()) {

                t2.setEchoChar((char) 0);

            } else {

                t2.setEchoChar('*');

            }

        }

    }

    public static void main(String[] args) {
        new SignUp().setVisible(true);
    }

}








src/hotel/management/system/UpdateRoom.java
package hotel.management.system;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class UpdateRoom extends JFrame implements ActionListener {

    Choice c1;
    JTextField t1, t2, t3;
    JButton b1, b2, b3;

    UpdateRoom() {

        JLabel l1 = new JLabel("Update Room Status");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 25));
        l1.setForeground(Color.BLUE);
        l1.setBounds(30, 20, 250, 30);
        add(l1);

        JLabel l2 = new JLabel("Customer Phone No.");
        l2.setBounds(30, 80, 120, 20);
        add(l2);

        c1 = new Choice();

        try {

            ConnectMSSQL c = new ConnectMSSQL();

            ResultSet rs = c.s.executeQuery("select * from customer");

            while (rs.next()) {

                c1.add(rs.getString("phone"));

            }

        } catch (Exception e) {

        }

        c1.setBounds(160, 80, 150, 25);
        add(c1);

        JLabel l3 = new JLabel("Room");
        l3.setBounds(30, 130, 120, 20);
        add(l3);

        t1 = new JTextField();
        t1.setBounds(160, 130, 150, 25);
        add(t1);

        JLabel l4 = new JLabel("Availability");
        l4.setBounds(30, 180, 120, 20);
        add(l4);

        t2 = new JTextField();
        t2.setBounds(160, 180, 150, 25);
        add(t2);

        JLabel l5 = new JLabel("Cleaning Status");
        l5.setBounds(30, 230, 120, 20);
        add(l5);

        t3 = new JTextField();
        t3.setBounds(160, 230, 150, 25);
        add(t3);

        b1 = new JButton("Check");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(30, 300, 100, 30);
        add(b1);

        b2 = new JButton("Update");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(140, 300, 100, 30);
        add(b2);

        b3 = new JButton("Back");
        b3.setBackground(Color.BLACK);
        b3.setForeground(Color.WHITE);
        b3.addActionListener(this);
        b3.setBounds(250, 300, 100, 30);
        add(b3);
        
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/seventh.jpg"));
        Image i2 = i1.getImage().getScaledInstance(500, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel icon = new JLabel(i3);
        icon.setBounds(400, 0, 500, 400);
        add(icon);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 970, 430);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            String room = null;
            String s1 = c1.getSelectedItem();

            ConnectMSSQL c = new ConnectMSSQL();

            try {

                ResultSet rs = c.s.executeQuery("select * from customer where phone = '" + s1 + "'");

                while (rs.next()) {

                    t1.setText(rs.getString("room"));
                    room = rs.getString("room");

                }

                ResultSet rs2 = c.s.executeQuery("select * from room where room_number = '" + room + "'");

                while (rs2.next()) {

                    t2.setText(rs2.getString("available"));
                    t3.setText(rs2.getString("status"));

                }

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String room = t1.getText();
                String available = t2.getText();
                String status = t3.getText();

                String str = "update room set available = '" + available + "', status = '" + status + "' where room_number = '" + room + "'";
                
                c.s.executeUpdate(str);
                
                JOptionPane.showMessageDialog(null, "Room Updated Successfully");

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b3) {

            new Reception().setVisible(true);
            this.setVisible(false);

        }

    }

    public static void main(String[] args) {

        new UpdateRoom().setVisible(true);

    }

}














src/hotel/management/system/UpdateStatus.java
package hotel.management.system;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;

public class UpdateStatus extends JFrame implements ActionListener {

    JButton b1, b2, b3;
    Choice c1;
    JTextField t1, t2, t3, t4, t5;

    UpdateStatus() {

        JLabel l1 = new JLabel("Check-in Details");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setForeground(Color.BLUE);
        l1.setBounds(80, 30, 200, 30);
        add(l1);

        JLabel l2 = new JLabel("Customer Phone No.");
        l2.setBounds(30, 80, 120, 20);
        add(l2);

        c1 = new Choice();

        try {

            ConnectMSSQL c = new ConnectMSSQL();

            ResultSet rs = c.s.executeQuery("select * from customer");

            while (rs.next()) {

                c1.add(rs.getString("phone"));

            }

        } catch (Exception e) {

        }

        c1.setBounds(160, 80, 150, 25);
        add(c1);

        JLabel l3 = new JLabel("Room");
        l3.setBounds(30, 130, 100, 20);
        add(l3);

        t1 = new JTextField();
        t1.setBounds(160, 130, 150, 25);
        add(t1);

        JLabel l4 = new JLabel("Name");
        l4.setBounds(30, 180, 100, 20);
        add(l4);

        t2 = new JTextField();
        t2.setBounds(160, 180, 150, 25);
        add(t2);

        JLabel l5 = new JLabel("Check-in");
        l5.setBounds(30, 230, 100, 20);
        add(l5);

        t3 = new JTextField();
        t3.setBounds(160, 230, 150, 25);
        add(t3);

        JLabel l6 = new JLabel("Amount Paid");
        l6.setBounds(30, 280, 100, 20);
        add(l6);

        t4 = new JTextField();
        t4.setBounds(160, 280, 150, 25);
        add(t4);

        JLabel l7 = new JLabel("Pending Amount");
        l7.setBounds(30, 330, 100, 20);
        add(l7);

        t5 = new JTextField();
        t5.setBounds(160, 330, 150, 25);
        add(t5);

        b1 = new JButton("Check");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        b1.setBounds(30, 390, 100, 30);
        add(b1);

        b2 = new JButton("Update");
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        b2.setBounds(150, 390, 100, 30);
        add(b2);

        b3 = new JButton("Back");
        b3.setBackground(Color.BLACK);
        b3.setForeground(Color.WHITE);
        b3.addActionListener(this);
        b3.setBounds(270, 390, 100, 30);
        add(b3);

        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/images/nine.jpg"));
        JLabel l9 = new JLabel(i1);
        l9.setBounds(400, 50, 500, 300);
        add(l9);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 960, 500);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String room = null;
                
                String deposit = null;
                
                int amountPaid;
                
                String price = null;
                
                String id = c1.getSelectedItem();

                String str = "select * from customer where phone = '" + id + "'";

                ResultSet rs = c.s.executeQuery(str);

                while (rs.next()) {

                    t1.setText(rs.getString("room"));
                    t2.setText(rs.getString("name"));
                    t3.setText(rs.getString("status"));
                    t4.setText(rs.getString("deposit"));

                    room = rs.getString("room");
                    deposit = rs.getString("deposit");

                }

                ResultSet rs2 = c.s.executeQuery("select * from room where room_number = '" + room + "'");

                while (rs2.next()) {

                    price = rs2.getString("price");

                    amountPaid = Integer.parseInt(price) - Integer.parseInt(deposit);

                    t5.setText(Integer.toString(amountPaid));

                }

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b2) {

            try {

                ConnectMSSQL c = new ConnectMSSQL();

                String s1 = c1.getSelectedItem();
                String s2 = t1.getText();
                int s3 = Integer.parseInt(s2);
                String s4 = t2.getText();
                String s5 = t3.getText();
                String s6 = t4.getText();
                int s7 = Integer.parseInt(s6);

                String str = "update customer set room = '" + s3 + "', name = '" + s4 + "', status = '" + s5 + "', deposit = '" + s7 + "' where phone = '" + s1 + "'";

                c.s.executeUpdate(str);

                JOptionPane.showMessageDialog(null, "Data Updated Successfully");

            } catch (Exception e) {

            }

        } else if (ae.getSource() == b3) {

            new Reception().setVisible(true);
            this.setVisible(false);

        }

    }

    public static void main(String[] args) {

        new UpdateStatus().setVisible(true);

    }

}





можно ли переделать полностью этот код под мою базу данных то есть полностью убрать все что не используется и добавить все что не достает 
также учти что я использую mysql а не mssql это тоже надо поменять
напиши полные коды для этого 



-- Создание базы данных
CREATE DATABASE IF NOT EXISTS hotellsk;
USE hotellsk;

-- Таблица Administrators
CREATE TABLE Administrators (
    admin_id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(150) NOT NULL,
    passport_number VARCHAR(20) UNIQUE NOT NULL,
    address TEXT NOT NULL,
    phone_number VARCHAR(15) UNIQUE NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL,
    login VARCHAR(20) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    registration_code VARCHAR(50) UNIQUE NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Таблица Receptionists
CREATE TABLE Receptionists (
    receptionist_id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(150) NOT NULL,
    passport_number VARCHAR(20) UNIQUE NOT NULL,
    address TEXT NOT NULL,
    phone_number VARCHAR(15) UNIQUE NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL,
    login VARCHAR(20) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Таблица Employees (для других сотрудников)
CREATE TABLE Employees (
    employee_id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(100) NOT NULL,
    age INT,
    gender ENUM('Male', 'Female', 'Other'),
    job_title VARCHAR(50) NOT NULL,
    salary DECIMAL(10, 2) NOT NULL,
    phone VARCHAR(15) UNIQUE NOT NULL,
    national_id VARCHAR(20) UNIQUE NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Таблица Rooms
CREATE TABLE Rooms (
    room_id INT AUTO_INCREMENT PRIMARY KEY,
    room_number INT UNIQUE NOT NULL,
    available BOOLEAN DEFAULT TRUE,
    status ENUM('Available', 'Occupied', 'Maintenance') DEFAULT 'Available',
    price DECIMAL(10,2) NOT NULL,
    bed_type ENUM('Single', 'Double', 'Queen', 'King', 'Twin') NOT NULL,
    room_type VARCHAR(50),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Таблица Room_Images
CREATE TABLE Room_Images (
    image_id INT AUTO_INCREMENT PRIMARY KEY,
    room_id INT NOT NULL,
    image_url VARCHAR(255) NOT NULL,
    is_primary BOOLEAN DEFAULT FALSE,
    FOREIGN KEY (room_id) REFERENCES Rooms(room_id) ON DELETE CASCADE
);

-- Таблица Customers
CREATE TABLE Customers (
    customer_id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(100) NOT NULL,
    phone VARCHAR(15) UNIQUE NOT NULL,
    email VARCHAR(100) UNIQUE,
    gender ENUM('Male', 'Female', 'Other'),
    country VARCHAR(50),
    address TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Таблица Reservations
CREATE TABLE Reservations (
    reservation_id INT AUTO_INCREMENT PRIMARY KEY,
    customer_id INT NOT NULL,
    room_id INT NOT NULL,
    check_in DATE NOT NULL,
    check_out DATE NOT NULL,
    status ENUM('Booked', 'Checked-in', 'Checked-out', 'Cancelled') DEFAULT 'Booked',
    total_amount DECIMAL(10,2),
    deposit DECIMAL(10,2),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ON DELETE CASCADE,
    FOREIGN KEY (room_id) REFERENCES Rooms(room_id) ON DELETE CASCADE
);

-- Таблица Payments
CREATE TABLE Payments (
    payment_id INT AUTO_INCREMENT PRIMARY KEY,
    reservation_id INT NOT NULL,
    amount DECIMAL(10, 2) NOT NULL,
    payment_date DATE NOT NULL,
    payment_method ENUM('Cash', 'Credit Card', 'Debit Card', 'Online Transfer') NOT NULL,
    FOREIGN KEY (reservation_id) REFERENCES Reservations(reservation_id) ON DELETE CASCADE
);