Respan Dataset Explorer

Select one behavior. Every returned turn has one binary label: Present or Absent. Source: final dense boolean release.

5,167,182physical rows
86shards
0.00%qualified row coverage
0.00%qualified cell coverage
Random row JSON API

turns-00050.parquet:37880

af81f42cca5e935543cfc482
turn 1/1gpt-4o-2024-08-06EnglishSouth Korea552 words
degenerate_repetitionAbsentFinal dense release
USER
User: Task: "Update Todo Item"
    Description: "Generate a Node.js controller function to update a  todo item using the Mongoose Todo model."
    Requirements:
    - Database: mongoose
    - Authentication: user
    - Output needed: Return only the function code.
    - Dependencies: Create a function to update an existing todo item by its ID. Export the function itself. Function mode: exports.functionName = async () => {...}, 
Accept parameters: id (as a URL parameter), title, description, status, priority, dueDate from the request body., 
Validate required field: Ensure id is provided and valid. Use simple logic to validate., 
Use the Todo model to find and update the record in the database using the provided id., 
Respond with the updated todo details and a success message., 
Handle validation errors, such as missing fields or invalid ID, and return appropriate error messages.
    - Previous Code 
const mongoose = require('mongoose');
const { Todo } = require('../models/Todo'); // Assumes Todo model is exported from models/Todo.js
// Export the function as per the specified mode
exports.createTodoItem = async (req, res) => {
  try {
    const { title, description, status, priority, dueDate } = req.body;

    // Validate required fields
    if (!title || !status) {
      return res.status(400).json({ error: 'Title and status are required.' });
    }

    // Create a new Todo item using the Todo model
    const newTodo = new Todo({
      title,
      description,
      status,
      priority,
      dueDate,
    });

    // Save to the database
    const savedTodo = await newTodo.save();

    // Respond with the created todo details and a success message
    return res.status(201).json({
      message: 'Todo item created successfully.',
      todo: savedTodo,
    });
  } catch (error) {
    // Handle any errors
    return res.status(500).json({ error: 'An error occurred while creating the todo item.' });
  }
};

    - Supporting data 
    - Updating File "src/controllers/TodoController.js"
    
    Please generate the code for this task, following the instructions and including comments for clarity.
    While creating router for specifict file your have to read supporing file data and create for that 

    **Output Formats**: 

Return dependencies like this `const bcrypt = require('bcrypt');`  in this formate
```dependencies
const bcrypt = require('bcrypt');
```

Ensure this format is consistently followed in responses.
    
User: 


    
Assistant:
ASSISTANT
```javascript
// Import required dependencies
const mongoose = require('mongoose');
const { Todo } = require('../models/Todo'); // Assumes Todo model is exported from models/Todo.js

// Export the function to update a todo item
exports.updateTodoItem = async (req, res) => {
  try {
    const { id } = req.params; // Get the id from the URL parameters
    const { title, description, status, priority, dueDate } = req.body; // Get the fields from the request body

    // Simple validation to check if id is provided and is a valid MongoDB ObjectId
    if (!id || !mongoose.Types.ObjectId.isValid(id)) {
      return res.status(400).json({ error: 'A valid todo item ID is required.' });
    }

    // Update the Todo item in the database using the provided id
    const updatedTodo = await Todo.findByIdAndUpdate(
      id,
      { title, description, status, priority, dueDate },
      { new: true, runValidators: true } // Return the updated document
    );

    // Check if the todo item was found and updated
    if (!updatedTodo) {
      return res.status(404).json({ error: 'Todo item not found.' });
    }

    // Respond with the updated todo details and a success message
    return res.status(200).json({
      message: 'Todo item updated successfully.',
      todo: updatedTodo,
    });
  } catch (error) {
    // Handle any errors
    return res.status(500).json({ error: 'An error occurred while updating the todo item.' });
  }
};
```

turns-00050.parquet:37881

86d99bd413b83a10d716875a
turn 1/1gpt-4o-2024-08-06Englishunknown country876 words
degenerate_repetitionAbsentFinal dense release
USER
You are a database expert and SQL optimizer. You will be given a SQL query and its rewritten variant. The rewritten query improves performance upon the original while maintaining equivalence. Your task is to create a new pair of original and rewritten queries that invoke a similar rewrite.

[ORIGINAL QUERY]```with ss_items as (select i_item_id item_id ,sum(ss_ext_sales_price) ss_item_rev from store_sales ,item ,date_dim where ss_item_sk = i_item_sk and d_date in (select d_date from date_dim where d_week_seq = (select d_week_seq from date_dim where d_date = '2001-06-16')) and ss_sold_date_sk = d_date_sk group by i_item_id), cs_items as (select i_item_id item_id ,sum(cs_ext_sales_price) cs_item_rev from catalog_sales ,item ,date_dim where cs_item_sk = i_item_sk and d_date in (select d_date from date_dim where d_week_seq = (select d_week_seq from date_dim where d_date = '2001-06-16')) and cs_sold_date_sk = d_date_sk group by i_item_id), ws_items as (select i_item_id item_id ,sum(ws_ext_sales_price) ws_item_rev from web_sales ,item ,date_dim where ws_item_sk = i_item_sk and d_date in (select d_date from date_dim where d_week_seq =(select d_week_seq from date_dim where d_date = '2001-06-16')) and ws_sold_date_sk = d_date_sk group by i_item_id) select ss_items.item_id ,ss_item_rev ,ss_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ss_dev ,cs_item_rev ,cs_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 cs_dev ,ws_item_rev ,ws_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ws_dev ,(ss_item_rev+cs_item_rev+ws_item_rev)/3 average from ss_items,cs_items,ws_items where ss_items.item_id=cs_items.item_id and ss_items.item_id=ws_items.item_id and ss_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev and ss_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev and cs_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev and cs_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev and ws_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev and ws_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev order by item_id ,ss_item_rev limit 100;```

[REWRITTEN QUERY]```with dates as (select d_date from date_dim where d_week_seq = (select d_week_seq from date_dim where d_date = '2001-06-16')), ss_items as (select i_item_id item_id ,sum(ss_ext_sales_price) ss_item_rev from store_sales ,item ,date_dim where ss_item_sk = i_item_sk and d_date in (select d_date from dates) and ss_sold_date_sk = d_date_sk group by i_item_id), cs_items as (select i_item_id item_id ,sum(cs_ext_sales_price) cs_item_rev from catalog_sales ,item ,date_dim where cs_item_sk = i_item_sk and d_date in (select d_date from dates) and cs_sold_date_sk = d_date_sk group by i_item_id), ws_items as (select i_item_id item_id ,sum(ws_ext_sales_price) ws_item_rev from web_sales ,item ,date_dim where ws_item_sk = i_item_sk and d_date in (select d_date from dates) and ws_sold_date_sk = d_date_sk group by i_item_id) select ss_items.item_id ,ss_item_rev ,ss_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ss_dev ,cs_item_rev ,cs_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 cs_dev ,ws_item_rev ,ws_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ws_dev ,(ss_item_rev+cs_item_rev+ws_item_rev)/3 average from ss_items,cs_items,ws_items where ss_items.item_id=cs_items.item_id and ss_items.item_id=ws_items.item_id and ss_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev and ss_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev and cs_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev and cs_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev and ws_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev and ws_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev order by item_id ,ss_item_rev limit 100;```

Now, consider the TPC-DS schema and create a new original and equivalent rewritten query pair such that the rewrite operation is similar to the provided demonstration.Keep the following points in mind while creating the new query pair:
1. The original query must not have any CTEs.
2. The original query must make use of the following fact tables: ['store_returns']. Below is the join graph for these fact tables:
    ['store_returns(sr_addr_sk) references customer_address(ca_address_sk);', 'store_returns(sr_reason_sk) references reason(r_reason_sk);', 'store_returns(sr_returned_date_sk) references date_dim(d_date_sk);']
4. The original query must employ 2 joins.
5. The original query must employ the following operators in its WHERE clause: [].
6. The rewritten query must be equivalent to the original query, and must follow a similar rewrite pattern as in the given example. Enclose the original and rewritten queries within ``` and ```.
ASSISTANT
Certainly! Below is a new pair of original and rewritten SQL queries based on the specifications you've provided, considering the TPC-DS schema and applying a similar optimization pattern as demonstrated:

[ORIGINAL QUERY]
```sql
select sr_customer_sk, 
       count(*) as return_count, 
       sum(sr_return_amt) as total_return_amount
from store_returns, 
     customer_address, 
     reason
where sr_addr_sk = ca_address_sk 
  and sr_reason_sk = r_reason_sk
  and d_date in (select d_date 
                 from date_dim
                 where d_month_seq = (select d_month_seq 
                                      from date_dim 
                                      where d_date = '2001-06-16'))
group by sr_customer_sk
order by total_return_amount desc
limit 100;
```

[REWRITTEN QUERY]
```sql
with dates as (
    select d_date 
    from date_dim
    where d_month_seq = (select d_month_seq 
                         from date_dim 
                         where d_date = '2001-06-16')
)
select sr_customer_sk, 
       count(*) as return_count, 
       sum(sr_return_amt) as total_return_amount
from store_returns, 
     customer_address, 
     reason
where sr_addr_sk = ca_address_sk 
  and sr_reason_sk = r_reason_sk
  and d_date in (select d_date from dates)
group by sr_customer_sk
order by total_return_amount desc
limit 100;
```

### Explanation:
- **Original Query**: The original query selects the customer key (`sr_customer_sk`), count of returns, and the sum of return amounts (`sr_return_amt`) from the `store_returns`, `customer_address`, and `reason` tables, filtering on dates that match specific conditions for a given month sequence. It performs a subquery within the `WHERE` clause to find dates that correspond to "2001-06-16".
  
- **Rewritten Query**: In the rewritten query, I extracted the date determination logic into a common table expression (CTE) named `dates`. This CTE executes prior to the main query, thereby reducing redundant computation in the main query plan by filtering dates in a single execution step rather than multiple identical subquery executions.

This rewrite maintains the query's logic and output equivalence while optimizing the execution by leveraging a CTE. This transformation, much like in the given example, aims to improve performance by simplifying and centralizing potentially costly subquery operations.

turns-00050.parquet:37882

6db41eedd024943f2df26895
turn 1/1o1-mini-2024-09-12EnglishKyrgyzstan7455 words
degenerate_repetitionAbsentFinal dense release
USER
package h;

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

public class AddCustomer extends JFrame implements ActionListener {

    JTextField t1, t2, t3, countryField, checkInField, checkOutField;
    JComboBox<String> c1, c2;
    JButton b1, b2;

    AddCustomer() {

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

        // Full Name
        JLabel name = new JLabel("Full Name");
        name.setBounds(50, 80, 100, 30);
        add(name);

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

        // Phone Number
        JLabel phone = new JLabel("Phone Number");
        phone.setBounds(50, 130, 100, 30);
        add(phone);

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

        // Email
        JLabel email = new JLabel("Email");
        email.setBounds(50, 180, 100, 30);
        add(email);

        t3 = new JTextField();
        t3.setBounds(160, 180, 150, 30);
        add(t3);

        // Gender
        JLabel gender = new JLabel("Gender");
        gender.setBounds(50, 230, 100, 30);
        add(gender);

        String genders[] = {"Male", "Female", "Other"};
        c1 = new JComboBox<>(genders);
        c1.setBounds(160, 230, 150, 30);
        add(c1);

        // Country
        JLabel country = new JLabel("Country");
        country.setBounds(50, 280, 100, 30);
        add(country);

        countryField = new JTextField();
        countryField.setBounds(160, 280, 150, 30);
        add(countryField);

        // Check-in Date
        JLabel checkIn = new JLabel("Check-in Date (YYYY-MM-DD)");
        checkIn.setBounds(50, 330, 200, 30);
        add(checkIn);

        checkInField = new JTextField();
        checkInField.setBounds(250, 330, 150, 30);
        add(checkInField);

        // Check-out Date
        JLabel checkOut = new JLabel("Check-out Date (YYYY-MM-DD)");
        checkOut.setBounds(50, 380, 200, 30);
        add(checkOut);

        checkOutField = new JTextField();
        checkOutField.setBounds(250, 380, 150, 30);
        add(checkOutField);

        // Select Room
        JLabel roomLabel = new JLabel("Select Room");
        roomLabel.setBounds(50, 430, 100, 30);
        add(roomLabel);

        c2 = new JComboBox<>();
        try {
            ConnectMySQL c = new ConnectMySQL();
            String query = "SELECT room_number FROM Rooms WHERE available = TRUE";
            ResultSet rs = c.s.executeQuery(query);
            while (rs.next()) {
                c2.addItem(rs.getString("room_number"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        c2.setBounds(160, 430, 150, 30);
        add(c2);

        // Add Customer Button
        b1 = new JButton("Add Customer");
        b1.setBounds(80, 500, 150, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Back Button
        b2 = new JButton("Back");
        b2.setBounds(250, 500, 150, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/customer.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(400, 80, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 750, 600);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Add Customer Button
            String fullName = t1.getText();
            String phone = t2.getText();
            String email = t3.getText();
            String gender = (String) c1.getSelectedItem();
            String country = countryField.getText();
            String checkIn = checkInField.getText();
            String checkOut = checkOutField.getText();
            String room = (String) c2.getSelectedItem();

            // Input Validation
            if(fullName.isEmpty() || phone.isEmpty() || checkIn.isEmpty() || checkOut.isEmpty() || room == null) {
                JOptionPane.showMessageDialog(null, "Please fill all required fields");
                return;
            }

            ConnectMySQL c = new ConnectMySQL();

            try {
                // Insert into Customers
                String customerQuery = "INSERT INTO Customers (full_name, phone, email, gender, country, created_at, updated_at) "
                        + "VALUES (?, ?, ?, ?, ?, NOW(), NOW())";
                PreparedStatement pstmtCustomer = c.c.prepareStatement(customerQuery, Statement.RETURN_GENERATED_KEYS);
                pstmtCustomer.setString(1, fullName);
                pstmtCustomer.setString(2, phone);
                pstmtCustomer.setString(3, email.isEmpty() ? null : email);
                pstmtCustomer.setString(4, gender);
                pstmtCustomer.setString(5, country.isEmpty() ? null : country);
                pstmtCustomer.executeUpdate();

                ResultSet rs = pstmtCustomer.getGeneratedKeys();
                int customerId = 0;
                if (rs.next()) {
                    customerId = rs.getInt(1);
                }

                // Get room_id and price
                String roomQuery = "SELECT room_id, price FROM Rooms WHERE room_number = ?";
                PreparedStatement pstmtRoom = c.c.prepareStatement(roomQuery);
                pstmtRoom.setInt(1, Integer.parseInt(room));
                ResultSet rsRoom = pstmtRoom.executeQuery();
                int roomId = 0;
                double price = 0.0;
                if (rsRoom.next()) {
                    roomId = rsRoom.getInt("room_id");
                    price = rsRoom.getDouble("price");
                }

                // Calculate deposit (e.g., 20% of total amount)
                double deposit = price * 0.2;

                // Insert into Reservations
                String reservationQuery = "INSERT INTO Reservations (customer_id, room_id, check_in, check_out, status, total_amount, deposit, created_at, updated_at) "
                        + "VALUES (?, ?, ?, ?, 'Booked', ?, ?, NOW(), NOW())";
                PreparedStatement pstmtReservation = c.c.prepareStatement(reservationQuery);
                pstmtReservation.setInt(1, customerId);
                pstmtReservation.setInt(2, roomId);
                pstmtReservation.setDate(3, java.sql.Date.valueOf(checkIn));
                pstmtReservation.setDate(4, java.sql.Date.valueOf(checkOut));
                pstmtReservation.setDouble(5, price);
                pstmtReservation.setDouble(6, deposit);
                pstmtReservation.executeUpdate();

                // Update Room Status
                String updateRoom = "UPDATE Rooms SET available = FALSE, status = 'Occupied' WHERE room_id = ?";
                PreparedStatement pstmtUpdateRoom = c.c.prepareStatement(updateRoom);
                pstmtUpdateRoom.setInt(1, roomId);
                pstmtUpdateRoom.executeUpdate();

                JOptionPane.showMessageDialog(null, "Customer and Reservation Added Successfully");

                // Clear Fields
                t1.setText("");
                t2.setText("");
                t3.setText("");
                c1.setSelectedIndex(0);
                countryField.setText("");
                checkInField.setText("");
                checkOutField.setText("");
                c2.setSelectedIndex(0);

            } catch (SQLIntegrityConstraintViolationException e) {
                JOptionPane.showMessageDialog(null, "Phone number or Email already exists!");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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






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

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;
    JComboBox<String> c1;
    JButton b1, b2;

    AddEmployee() {

        JLabel l1 = new JLabel("Add New Employee");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(150, 20, 300, 30);
        add(l1);

        // Full Name
        JLabel name = new JLabel("Full Name");
        name.setBounds(50, 80, 100, 30);
        add(name);

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

        // Age
        JLabel age = new JLabel("Age");
        age.setBounds(50, 130, 100, 30);
        add(age);

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

        // Gender
        JLabel gender = new JLabel("Gender");
        gender.setBounds(50, 180, 100, 30);
        add(gender);

        String genders[] = {"Male", "Female", "Other"};
        c1 = new JComboBox<>(genders);
        c1.setBounds(160, 180, 150, 30);
        add(c1);

        // Job Title
        JLabel job = new JLabel("Job Title");
        job.setBounds(50, 230, 100, 30);
        add(job);

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

        // Salary
        JLabel salary = new JLabel("Salary");
        salary.setBounds(50, 280, 100, 30);
        add(salary);

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

        // Phone Number
        JLabel phone = new JLabel("Phone Number");
        phone.setBounds(50, 330, 100, 30);
        add(phone);

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

        // National ID
        JLabel nid = new JLabel("National ID");
        nid.setBounds(50, 380, 100, 30);
        add(nid);

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

        // Submit Button
        b1 = new JButton("Add");
        b1.setBounds(80, 450, 100, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Cancel Button
        b2 = new JButton("Cancel");
        b2.setBounds(220, 450, 100, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/addemployee.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(350, 80, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 700, 550);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Add Button
            String fullName = t1.getText();
            String ageStr = t2.getText();
            String gender = (String) c1.getSelectedItem();
            String jobTitle = t3.getText();
            String salaryStr = t4.getText();
            String phone = t5.getText();
            String nid = t6.getText();

            // Input validation can be added here
            try {
                int age = Integer.parseInt(ageStr);
                double salary = Double.parseDouble(salaryStr);

                ConnectMySQL c = new ConnectMySQL();

                String query = "INSERT INTO Employees (full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at) "
                        + "VALUES ('" + fullName + "', " + age + ", '" + gender + "', '" + jobTitle + "', " + salary + ", '" + phone + "', '" + nid + "', '" + phone + "', NOW(), NOW())";

                c.s.executeUpdate(query);
                JOptionPane.showMessageDialog(null, "Employee Added Successfully");

                // Clear Fields
                t1.setText("");
                t2.setText("");
                t3.setText("");
                t4.setText("");
                t5.setText("");
                t6.setText("");

            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(null, "Please enter valid Age and Salary");
            } catch (SQLIntegrityConstraintViolationException e) {
                JOptionPane.showMessageDialog(null, "Phone Number or National ID already exists!");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Cancel Button
            new DropDown().setVisible(true);
            this.setVisible(false);
        }
    }

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












// src/hotel/management/system/AddReceptionist.java
package h;

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

public class AddReceptionist extends JFrame implements ActionListener {

    JTextField t1, t2, t3, t4, t5;
    JPasswordField t6;
    JButton b1, b2;

    AddReceptionist() {

        JLabel l1 = new JLabel("Add Receptionist");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(150, 20, 200, 30);
        add(l1);

        // Full Name
        JLabel name = new JLabel("Full Name");
        name.setBounds(50, 80, 100, 30);
        add(name);

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

        // Phone Number
        JLabel phone = new JLabel("Phone Number");
        phone.setBounds(50, 130, 100, 30);
        add(phone);

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

        // Email
        JLabel email = new JLabel("Email");
        email.setBounds(50, 180, 100, 30);
        add(email);

        t3 = new JTextField();
        t3.setBounds(160, 180, 150, 30);
        add(t3);

        // Login
        JLabel login = new JLabel("Login (Username)");
        login.setBounds(50, 230, 100, 30);
        add(login);

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

        // Password
        JLabel password = new JLabel("Password");
        password.setBounds(50, 280, 100, 30);
        add(password);

        t5 = new JTextField();
        t5.setBounds(160, 280, 150, 30);
        add(t5);

        // Submit Button
        b1 = new JButton("Add");
        b1.setBounds(80, 340, 100, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Cancel Button
        b2 = new JButton("Cancel");
        b2.setBounds(220, 340, 100, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/receptionist.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(350, 50, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 700, 450);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Add Button
            String fullName = t1.getText();
            String phone = t2.getText();
            String email = t3.getText();
            String login = t4.getText();
            String password = t5.getText();

            ConnectMySQL c = new ConnectMySQL();

            String query = "INSERT INTO Receptionists (full_name, phone_number, email, login, password, created_at, updated_at) "
                    + "VALUES ('" + fullName + "', '" + phone + "', '" + email + "', '" + login + "', '" + password + "', NOW(), NOW())";

            try {
                c.s.executeUpdate(query);
                JOptionPane.showMessageDialog(null, "Receptionist Added Successfully");
                new DropDown().setVisible(true);
                this.setVisible(false);
            } catch (SQLIntegrityConstraintViolationException e) {
                JOptionPane.showMessageDialog(null, "Username, Phone Number, or Email already exists!");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Cancel Button
            new DropDown().setVisible(true);
            this.setVisible(false);
        }
    }

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








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

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

public class AddRooms extends JFrame implements ActionListener {

    JTextField t1, t2, t3;
    JComboBox<String> c1, c2, c3;
    JButton b1, b2;

    AddRooms() {

        JLabel l1 = new JLabel("Add New Room");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(150, 20, 200, 30);
        add(l1);

        // Room Number
        JLabel roomNumber = new JLabel("Room Number");
        roomNumber.setBounds(50, 80, 100, 30);
        add(roomNumber);

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

        // Bed Type
        JLabel bedType = new JLabel("Bed Type");
        bedType.setBounds(50, 130, 100, 30);
        add(bedType);

        c1 = new JComboBox<>(new String[]{"Single Bed", "Double Bed", "Queen", "King", "Twin"});
        c1.setBounds(160, 130, 150, 30);
        add(c1);

        // Room Type
        JLabel roomType = new JLabel("Room Type");
        roomType.setBounds(50, 180, 100, 30);
        add(roomType);

        c2 = new JComboBox<>(new String[]{"Standard", "Deluxe", "Suite"});
        c2.setBounds(160, 180, 150, 30);
        add(c2);

        // Price
        JLabel price = new JLabel("Price");
        price.setBounds(50, 230, 100, 30);
        add(price);

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

        // Status
        JLabel status = new JLabel("Status");
        status.setBounds(50, 280, 100, 30);
        add(status);

        c3 = new JComboBox<>(new String[]{"Available", "Occupied", "Maintenance"});
        c3.setBounds(160, 280, 150, 30);
        add(c3);

        // Submit Button
        b1 = new JButton("Add Room");
        b1.setBounds(80, 340, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Cancel Button
        b2 = new JButton("Cancel");
        b2.setBounds(220, 340, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/addroom.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(350, 80, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 700, 450);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Add Room Button
            String roomNumber = t1.getText();
            String bedType = (String) c1.getSelectedItem();
            String roomType = (String) c2.getSelectedItem();
            String priceStr = t2.getText();
            String status = (String) c3.getSelectedItem();

            try {
                int roomNum = Integer.parseInt(roomNumber);
                double price = Double.parseDouble(priceStr);

                ConnectMySQL c = new ConnectMySQL();

                String query = "INSERT INTO Rooms (room_number, bed_type, room_type, price, available, status, created_at, updated_at) "
                        + "VALUES (" + roomNum + ", '" + bedType + "', '" + roomType + "', " + price + ", TRUE, '" + status + "', NOW(), NOW())";

                c.s.executeUpdate(query);
                JOptionPane.showMessageDialog(null, "Room Added Successfully");

                // Clear Fields
                t1.setText("");
                t2.setText("");
                c1.setSelectedIndex(0);
                c2.setSelectedIndex(0);
                c3.setSelectedIndex(0);

            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(null, "Please enter valid Room Number and Price");
            } catch (SQLIntegrityConstraintViolationException e) {
                JOptionPane.showMessageDialog(null, "Room Number already exists!");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Cancel Button
            new DropDown().setVisible(true);
            this.setVisible(false);
        }
    }

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














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

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

public class CheckOut extends JFrame implements ActionListener {

    JComboBox<String> c1;
    JTextField t1;
    JButton b1, b2;

    CheckOut() {

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

        // Номер телефона клиента
        JLabel l2 = new JLabel("Customer Phone No.");
        l2.setBounds(100, 80, 150, 30);
        add(l2);

        c1 = new JComboBox<>();
        try {
            ConnectMySQL c = new ConnectMySQL();
            String query = "SELECT phone FROM Customers";
            ResultSet rs = c.s.executeQuery(query);
            while (rs.next()) {
                c1.addItem(rs.getString("phone"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        c1.setBounds(300, 80, 150, 30);
        add(c1);

        // Номер комнаты
        JLabel l3 = new JLabel("Room Number");
        l3.setBounds(100, 140, 150, 30);
        add(l3);

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

        // Кнопка "Checkout"
        b1 = new JButton("Check Out");
        b1.setBounds(150, 220, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Кнопка "Back"
        b2 = new JButton("Back");
        b2.setBounds(300, 220, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Логотип/изображение
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/tick.png"));
        JLabel l4 = new JLabel(i1);
        l4.setBounds(500, 80, 400, 250);
        add(l4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1000, 300);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Кнопка "Check Out"
            String phone = (String) c1.getSelectedItem();
            String room = t1.getText();

            ConnectMySQL c = new ConnectMySQL();

            try {
                // Обновление статуса бронирования
                String updateReservation = "UPDATE Reservations r "
                        + "JOIN Customers c ON r.customer_id = c.customer_id "
                        + "SET r.status = 'Checked-out' "
                        + "WHERE c.phone = '" + phone + "' AND r.room_id = (SELECT room_id FROM Rooms WHERE room_number = " + room + ") AND r.status = 'Checked-in'";
                c.s.executeUpdate(updateReservation);

                // Обновление доступности комнаты
                String updateRoom = "UPDATE Rooms SET available = TRUE, status = 'Available', updated_at = NOW() WHERE room_number = " + room + "";
                c.s.executeUpdate(updateRoom);

                JOptionPane.showMessageDialog(null, "Check Out Successful");

                // Очистка полей
                t1.setText("");
                c1.setSelectedIndex(0);

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

        } else if (ae.getSource() == b2) { // Кнопка "Back"
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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










package h;


import java.sql.*;

public class ConnectMySQL {
    Connection c;
    Statement s;

    public ConnectMySQL() {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            c = DriverManager.getConnection("jdbc:mysql://localhost:1369/hotellsk", "root", "1369sukAnigghaD1ck");
            s = c.createStatement();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}












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

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

public class CustomerInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2;
    JComboBox<String> c1, c2;

    CustomerInfo() {

        // Table to display customer information
        t1 = new JTable();
        t1.setBounds(0, 40, 1000, 300);
        add(t1);

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

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

        // Column Headers (Optional since JTable can handle headers automatically)
        // You can customize the table model if needed

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

        // Back Button
        b2 = new JButton("Back");
        b2.setBounds(530, 450, 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, 530);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {

        if (ae.getSource() == b1) { // Load Data Button
            try {
                ConnectMySQL c = new ConnectMySQL();
                String query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                        + "FROM Customers c "
                        + "JOIN Reservations r ON c.customer_id = r.customer_id";
                ResultSet rs = c.s.executeQuery(query);
                t1.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == c1) { // Country/Region Filter
            try {
                ConnectMySQL c = new ConnectMySQL();
                String selection = (String) c1.getSelectedItem();
                String query;

                if (selection.equals("Local (Bangladesh)")) {
                    query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                            + "FROM Customers c "
                            + "JOIN Reservations r ON c.customer_id = r.customer_id "
                            + "WHERE c.country = 'Bangladesh'";
                } else if (selection.equals("Foreigner")) {
                    query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                            + "FROM Customers c "
                            + "JOIN Reservations r ON c.customer_id = r.customer_id "
                            + "WHERE c.country != 'Bangladesh'";
                } else {
                    query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                            + "FROM Customers c "
                            + "JOIN Reservations r ON c.customer_id = r.customer_id";
                }

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

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

        } else if (ae.getSource() == c2) { // Sort By Room Number
            try {
                ConnectMySQL c = new ConnectMySQL();
                String selection = (String) c2.getSelectedItem();
                String query;

                if (selection.equals("Room Number")) {
                    query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                            + "FROM Customers c "
                            + "JOIN Reservations r ON c.customer_id = r.customer_id "
                            + "ORDER BY r.room_number ASC";
                } else {
                    query = "SELECT c.full_name, c.phone, c.email, c.gender, c.country, r.room_number, r.check_in, r.check_out, r.status, r.total_amount, r.deposit "
                            + "FROM Customers c "
                            + "JOIN Reservations r ON c.customer_id = r.customer_id";
                }

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

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

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













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

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

public class Dashboard extends JFrame implements ActionListener {

    JButton logoutButton;

    Dashboard() {

        // Background Image
        ImageIcon backgroundIcon = new ImageIcon(ClassLoader.getSystemResource("h/images/luxury.jpg"));
        Image backgroundImage = backgroundIcon.getImage().getScaledInstance(1720, 1000, Image.SCALE_DEFAULT);
        ImageIcon scaledBackground = new ImageIcon(backgroundImage);
        JLabel backgroundLabel = new JLabel(scaledBackground);
        backgroundLabel.setBounds(230, 0, 1720, 1000);
        add(backgroundLabel);

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

        // Additional Admin Features Buttons (Optional)
        // Example: Managing Employees
        // JButton manageEmployees = new JButton("Manage Employees");
        // manageEmployees.setFont(new Font("Tahoma", Font.BOLD, 18));
        // manageEmployees.addActionListener(this);
        // manageEmployees.setBounds(20, 300, 190, 60);
        // backgroundLabel.add(manageEmployees);

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

        setLayout(null);
        setBounds(0, 0, 1950, 1020);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == logoutButton) { // Logout Button
            new Login().setVisible(true);
            this.setVisible(false);
        }

        // Handle additional admin buttons here
        // Example:
        // if (ae.getSource() == manageEmployees) {
        //     new ManageEmployees().setVisible(true);
        //     this.setVisible(false);
        // }
    }

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












// src/hotel/management/system/DropDown.java
package h;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class DropDown extends JFrame implements ActionListener {

    JButton b1, b2, b3, b4;

    DropDown() {

        // Кнопка "Add Employee"
        b1 = new JButton("Add Employee");
        b1.setFont(new Font("Tahoma", Font.BOLD, 16));
        b1.addActionListener(this);
        b1.setBounds(10, 30, 160, 40);
        add(b1);

        // Кнопка "Add Room"
        b2 = new JButton("Add Room");
        b2.setFont(new Font("Tahoma", Font.BOLD, 16));
        b2.addActionListener(this);
        b2.setBounds(10, 100, 160, 40);
        add(b2);

        // Кнопка "Add Receptionist"
        b3 = new JButton("Add Receptionist");
        b3.setFont(new Font("Tahoma", Font.BOLD, 16));
        b3.addActionListener(this);
        b3.setBounds(10, 170, 160, 40);
        add(b3);

        // Кнопка "Back"
        b4 = new JButton("Back");
        b4.setFont(new Font("Tahoma", Font.BOLD, 16));
        b4.addActionListener(this);
        b4.setBounds(10, 240, 160, 40);
        add(b4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(230, 337, 190, 290);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Добавить сотрудника
            new AddEmployee().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == b2) { // Добавить комнату
            new AddRooms().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == b3) { // Добавить приемного
            new AddReceptionist().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == b4) { // Кнопка "Back"
            new Dashboard().setVisible(true);
            this.setVisible(false);
        }
    }

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









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

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

public class EmployeeInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2;
    JComboBox<String> c1, c2;

    EmployeeInfo() {

        JLabel l1 = new JLabel("Employee Information");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(350, 20, 300, 30);
        add(l1);

        // Таблица для отображения информации о сотрудниках
        t1 = new JTable();
        t1.setBounds(0, 70, 1000, 300);
        add(t1);

        // Кнопка "Load Data"
        b1 = new JButton("Load Data");
        b1.setBounds(80, 400, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Фильтр по должности
        c1 = new JComboBox<>(new String[]{"All Jobs", "Front Desk Clerks", "Porters", "Housekeeping", "Kitchen Staff", "Room Service", "Waiter", "Manager", "Accountant", "Chef"});
        c1.setBounds(250, 400, 150, 25);
        c1.setBackground(Color.WHITE);
        c1.addActionListener(this);
        add(c1);

        // Сортировка по зарплате
        c2 = new JComboBox<>(new String[]{"Sort By Salary", "Ascending", "Descending"});
        c2.setBounds(430, 400, 150, 25);
        c2.setBackground(Color.WHITE);
        c2.addActionListener(this);
        add(c2);

        // Кнопка "Back"
        b2 = new JButton("Back");
        b2.setBounds(600, 400, 120, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Логотип/Изображение
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/employeeinfo.png"));
        JLabel l2 = new JLabel(i1);
        l2.setBounds(350, 80, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 150, 1020, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        ConnectMySQL c = new ConnectMySQL();

        if (ae.getSource() == b1) { // Кнопка "Load Data"
            try {
                String query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees";
                ResultSet rs = c.s.executeQuery(query);
                t1.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == c1) { // Фильтр по должности
            try {
                String selection = (String) c1.getSelectedItem();
                String query;

                if (!selection.equals("All Jobs")) {
                    query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees WHERE job_title = '" + selection + "'";
                } else {
                    query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees";
                }

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

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

        } else if (ae.getSource() == c2) { // Сортировка по зарплате
            try {
                String sortOrder = (String) c2.getSelectedItem();
                String query;

                if (sortOrder.equals("Ascending")) {
                    query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees ORDER BY salary ASC";
                } else if (sortOrder.equals("Descending")) {
                    query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees ORDER BY salary DESC";
                } else {
                    query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees";
                }

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

            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (ae.getSource() == b2) { // Кнопка "Back"
            new DropDown().setVisible(true);
            this.setVisible(false);
        }
    }

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











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

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

public class HotelManagementSystem extends JFrame implements ActionListener {

    JButton b1;

    HotelManagementSystem() {

        // Установка размеров и расположения окна
        setExtendedState(JFrame.MAXIMIZED_BOTH);
        setLayout(null);

        // Фоновое изображение
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/hotel.jpg"));
        Image i2 = i1.getImage().getScaledInstance(1366, 768, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l1 = new JLabel(i3);
        l1.setBounds(0, 0, 1366, 768);
        add(l1);

        // Текст "Hotel Management System"
        JLabel l2 = new JLabel("Hotel Management System");
        l2.setForeground(Color.WHITE);
        l2.setFont(new Font("Serif", Font.BOLD, 70));
        l2.setBounds(200, 60, 1000, 90);
        l1.add(l2);

        // Кнопка "Next"
        b1 = new JButton("Next");
        b1.setBounds(1150, 650, 150, 50);
        b1.setBackground(Color.WHITE);
        b1.setForeground(Color.BLACK);
        b1.setFont(new Font("Tahoma", Font.BOLD, 18));
        b1.addActionListener(this);
        l1.add(b1);

        // Настройки окна
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    // Обработка событий кнопок
    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Кнопка "Next"
            new Login().setVisible(true); // Переход на экран входа
            this.setVisible(false); // Скрытие текущего окна
        }
    }

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









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

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() {

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

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

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

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

        // Show Password Checkbox
        check = new JCheckBox("Show Password");
        check.setBounds(150, 140, 150, 25);
        check.setBackground(Color.WHITE);
        check.addActionListener(this);
        add(check);

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

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

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/second.jpg")); // Change image path as needed
        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);

        // Signup Link as a Button
        JButton l4 = new JButton("<HTML><U>Don't have an account? Signup</U></HTML>");
        l4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        l4.setBorderPainted(false);
        l4.setForeground(Color.BLUE.darker());
        l4.setBackground(Color.WHITE);
        l4.setBounds(350, 220, 200, 30);
        l4.setFocusPainted(false);
        l4.setFont(new Font("Tahoma", Font.PLAIN, 12));
        l4.addActionListener(this);
        add(l4);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(700, 300, 600, 400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        // Handle show password checkbox
        if (ae.getSource() == check) {
            if (check.isSelected()) {
                t2.setEchoChar((char) 0);
            } else {
                t2.setEchoChar('*');
            }
        }

        // Handle Login Button
        if (ae.getSource() == b1) {
            String username = t1.getText().trim();
            String password = new String(t2.getPassword()).trim();

            // Basic Validation
            if (username.isEmpty() || password.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Please enter username and password.");
                return;
            }

            ConnectMySQL c = new ConnectMySQL();

            try {
                // Check in Administrators
                String queryAdmin = "SELECT * FROM Administrators WHERE login = ? AND password = ?";
                PreparedStatement pstmtAdmin = c.c.prepareStatement(queryAdmin);
                pstmtAdmin.setString(1, username);
                pstmtAdmin.setString(2, password);
                ResultSet rsAdmin = pstmtAdmin.executeQuery();

                if (rsAdmin.next()) {
                    new Dashboard().setVisible(true);
                    this.setVisible(false);
                    return;
                }

                // Check in Receptionists
                String queryReceptionist = "SELECT * FROM Receptionists WHERE login = ? AND password = ?";
                PreparedStatement pstmtReceptionist = c.c.prepareStatement(queryReceptionist);
                pstmtReceptionist.setString(1, username);
                pstmtReceptionist.setString(2, password);
                ResultSet rsReceptionist = pstmtReceptionist.executeQuery();

                if (rsReceptionist.next()) {
                    new Reception().setVisible(true);
                    this.setVisible(false);
                    return;
                }

                // If not found
                JOptionPane.showMessageDialog(null, "Invalid username or password.");
                t1.setText("");
                t2.setText("");
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        // Handle Cancel Button
        if (ae.getSource() == b2) {
            this.setVisible(false);
            new HotelManagementSystem().setVisible(true);
        }

        // Handle Signup Link
        if (ae.getActionCommand().contains("Don't have an account? Signup")) {
            new SignUp().setVisible(true);
            this.setVisible(false);
        }
    }

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










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

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

public class ManagerInfo extends JFrame implements ActionListener {

    JTable t1;
    JButton b1, b2;

    ManagerInfo() {

        JLabel l1 = new JLabel("Manager Information");
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(350, 20, 300, 30);
        add(l1);

        // Table to display manager information
        t1 = new JTable();
        t1.setBounds(0, 70, 1000, 300);
        add(t1);

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

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

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/manager.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(350, 130, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 1020, 480);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        ConnectMySQL c = new ConnectMySQL();

        if (ae.getSource() == b1) { // Load Data Button
            try {
                String query = "SELECT full_name, age, gender, job_title, salary, phone, national_id, email, created_at, updated_at FROM Employees WHERE job_title = 'Manager'";
                ResultSet rs = c.s.executeQuery(query);
                t1.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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









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

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() {

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

        // Новая форма клиента
        b1 = new JButton("New Customer Form");
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.setBounds(30, 80, 200, 30);
        b1.addActionListener(this);
        add(b1);

        // Информация о клиенте
        b5 = new JButton("Customer Info");
        b5.setBackground(Color.BLACK);
        b5.setForeground(Color.WHITE);
        b5.setBounds(30, 130, 200, 30);
        b5.addActionListener(this);
        add(b5);

        // Выезд клиента
        b7 = new JButton("Check Out");
        b7.setBackground(Color.BLACK);
        b7.setForeground(Color.WHITE);
        b7.setBounds(30, 180, 200, 30);
        b7.addActionListener(this);
        add(b7);

        // Обновление статуса бронирования
        b8 = new JButton("Update Check Status");
        b8.setBackground(Color.BLACK);
        b8.setForeground(Color.WHITE);
        b8.setBounds(30, 230, 200, 30);
        b8.addActionListener(this);
        add(b8);

        // Обновление статуса комнаты
        b9 = new JButton("Update Room Status");
        b9.setBackground(Color.BLACK);
        b9.setForeground(Color.WHITE);
        b9.setBounds(30, 280, 200, 30);
        b9.addActionListener(this);
        add(b9);

        // Поиск комнаты
        b11 = new JButton("Search Room");
        b11.setBackground(Color.BLACK);
        b11.setForeground(Color.WHITE);
        b11.setBounds(30, 330, 200, 30);
        b11.addActionListener(this);
        add(b11);

        // Кнопка "Back"
        b12 = new JButton("Back");
        b12.setBackground(Color.BLACK);
        b12.setForeground(Color.WHITE);
        b12.setBounds(30, 380, 200, 30);
        b12.addActionListener(this);
        add(b12);

        // Логотип/Изображение
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/fourth.jpg"));
        JLabel l2 = new JLabel(i1);
        l2.setBounds(300, 80, 500, 400);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(500, 200, 850, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Новая форма клиента
            new AddCustomer().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == b5) { // Информация о клиенте
            new CustomerInfo().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() == b11) { // Поиск комнаты
            new SearchRoom().setVisible(true);
            this.setVisible(false);
        } else if (ae.getSource() == b12) { // Кнопка "Back"
            new Login().setVisible(true);
            this.setVisible(false);
        }
    }

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








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

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<String> c1, c2, c3;
    JTextField t1, t2;
    JButton b1, b2, b3;
    JTable t3;

    SearchRoom() {

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

        // Bed Type
        JLabel l2 = new JLabel("Bed Type");
        l2.setBounds(50, 80, 100, 30);
        add(l2);

        c1 = new JComboBox<>(new String[]{"Single Bed", "Double Bed", "Queen", "King", "Twin"});
        c1.setBounds(150, 80, 150, 30);
        add(c1);

        // Price Range
        JLabel l3 = new JLabel("Price Range");
        l3.setBounds(50, 130, 100, 30);
        add(l3);

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

        JLabel to = new JLabel("to");
        to.setBounds(230, 130, 20, 30);
        add(to);

        t2 = new JTextField();
        t2.setBounds(250, 130, 70, 30);
        add(t2);

        // Availability
        JLabel l4 = new JLabel("Availability");
        l4.setBounds(50, 180, 100, 30);
        add(l4);

        c2 = new JComboBox<>(new String[]{"All", "Available", "Occupied", "Maintenance"});
        c2.setBounds(150, 180, 150, 30);
        add(c2);

        // Search Button
        b1 = new JButton("Search");
        b1.setBounds(50, 240, 100, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

        // Load All Rooms
        b2 = new JButton("Load All");
        b2.setBounds(170, 240, 100, 30);
        b2.setBackground(Color.BLACK);
        b2.setForeground(Color.WHITE);
        b2.addActionListener(this);
        add(b2);

        // Back Button
        b3 = new JButton("Back");
        b3.setBounds(290, 240, 100, 30);
        b3.setBackground(Color.BLACK);
        b3.setForeground(Color.WHITE);
        b3.addActionListener(this);
        add(b3);

        // Table to display rooms
        t3 = new JTable();
        t3.setBounds(0, 300, 1000, 300);
        add(t3);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 150, 1020, 650);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        ConnectMySQL c = new ConnectMySQL();

        if (ae.getSource() == b1) { // Search Button
            String bedType = (String) c1.getSelectedItem();
            String minPrice = t1.getText();
            String maxPrice = t2.getText();
            String availability = (String) c2.getSelectedItem();

            String query = "SELECT room_number, bed_type, room_type, price, status FROM Rooms WHERE bed_type = '" + bedType + "'";

            if (!minPrice.isEmpty() && !maxPrice.isEmpty()) {
                query += " AND price BETWEEN " + minPrice + " AND " + maxPrice;
            }

            if (!availability.equals("All")) {
                query += " AND status = '" + availability + "'";
            }

            try {
                ResultSet rs = c.s.executeQuery(query);
                t3.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Load All Rooms
            try {
                ResultSet rs = c.s.executeQuery("SELECT room_number, bed_type, room_type, price, status FROM Rooms");
                t3.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b3) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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








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

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

public class SignUp extends JFrame implements ActionListener {

    JLabel l1, l2, l3, l4;
    JTextField t1, t2, t3, t4;
    JPasswordField t5;
    JButton b1, b2;
    JComboBox<String> roleComboBox;
    JCheckBox check;

    // Predefined registration code for administrators
    private static final String ADMIN_REG_CODE = "ADMIN2023"; // Change as needed

    SignUp() {

        // Role Selection
        l3 = new JLabel("Role");
        l3.setBounds(40, 50, 100, 30);
        add(l3);

        roleComboBox = new JComboBox<>(new String[]{"Receptionist", "Administrator"});
        roleComboBox.setBounds(150, 50, 150, 30);
        roleComboBox.addActionListener(this);
        add(roleComboBox);

        // Full Name
        l1 = new JLabel("Full Name");
        l1.setBounds(40, 100, 100, 30);
        add(l1);

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

        // Phone Number
        l2 = new JLabel("Phone Number");
        l2.setBounds(40, 150, 100, 30);
        add(l2);

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

        // Email
        l4 = new JLabel("Email");
        l4.setBounds(40, 200, 100, 30);
        add(l4);

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

        // Password
        JLabel l5 = new JLabel("Password");
        l5.setBounds(40, 250, 100, 30);
        add(l5);

        t5 = new JPasswordField();
        t5.setBounds(150, 250, 150, 30);
        add(t5);

        // Show Password Checkbox
        check = new JCheckBox("Show Password");
        check.setBounds(150, 290, 150, 25);
        check.setBackground(Color.WHITE);
        check.addActionListener(this);
        add(check);

        // Registration Code (only visible for Administrators)
        l4 = new JLabel("Registration Code");
        l4.setBounds(40, 340, 120, 30);
        l4.setVisible(false); // Initially hidden
        add(l4);

        t4 = new JTextField();
        t4.setBounds(170, 340, 150, 30);
        t4.setVisible(false); // Initially hidden
        add(t4);

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

        // Cancel Button
        b2 = new JButton("Cancel");
        b2.setBounds(200, 400, 120, 30);
        b2.setForeground(Color.WHITE);
        b2.setBackground(Color.BLACK);
        b2.addActionListener(this);
        add(b2);

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/second.jpg")); // Change image path as needed
        Image i2 = i1.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l6 = new JLabel(i3);
        l6.setBounds(350, 100, 200, 200);
        add(l6);

        // Login Link as a Button
        JButton l7 = new JButton("<HTML><U>Already have an account? Login</U></HTML>");
        l7.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        l7.setBorderPainted(false);
        l7.setForeground(Color.BLUE.darker());
        l7.setBackground(Color.WHITE);
        l7.setBounds(350, 320, 200, 30);
        l7.setFocusPainted(false);
        l7.setFont(new Font("Tahoma", Font.PLAIN, 12));
        l7.addActionListener(this);
        add(l7);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(700, 300, 600, 500);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);

    }

    public void actionPerformed(ActionEvent ae) {
        // Handle role selection to show/hide registration code field
        if (ae.getSource() == roleComboBox) {
            String selectedRole = (String) roleComboBox.getSelectedItem();
            if (selectedRole.equals("Administrator")) {
                l4.setVisible(true);
                t4.setVisible(true);
            } else {
                l4.setVisible(false);
                t4.setVisible(false);
            }
        }

        // Handle show password checkbox
        if (ae.getSource() == check) {
            if (check.isSelected()) {
                t5.setEchoChar((char) 0);
            } else {
                t5.setEchoChar('*');
            }
        }

        // Handle Signup Button
        if (ae.getSource() == b1) {
            String role = (String) roleComboBox.getSelectedItem();
            String fullName = t1.getText().trim();
            String phone = t2.getText().trim();
            String email = t3.getText().trim();
            String password = new String(t5.getPassword()).trim();

            // Basic Validation
            if (fullName.isEmpty() || phone.isEmpty() || email.isEmpty() || password.isEmpty()) {
                JOptionPane.showMessageDialog(null, "Please fill all required fields.");
                return;
            }

            // Additional Validation for Administrator
            String registrationCode = "";
            if (role.equals("Administrator")) {
                registrationCode = t4.getText().trim();
                if (registrationCode.isEmpty()) {
                    JOptionPane.showMessageDialog(null, "Please enter the registration code for Administrator.");
                    return;
                }
                if (!registrationCode.equals(ADMIN_REG_CODE)) {
                    JOptionPane.showMessageDialog(null, "Invalid Registration Code.");
                    return;
                }
            }

            ConnectMySQL c = new ConnectMySQL();

            String tableName = role.equals("Administrator") ? "Administrators" : "Receptionists";

            // Prepare SQL statement with placeholders to prevent SQL injection
            String query;
            if (role.equals("Administrator")) {
                query = "INSERT INTO Administrators (full_name, phone_number, email, login, password, registration_code, created_at, updated_at) "
                        + "VALUES (?, ?, ?, ?, ?, ?, NOW(), NOW())";
            } else {
                query = "INSERT INTO Receptionists (full_name, phone_number, email, login, password, created_at, updated_at) "
                        + "VALUES (?, ?, ?, ?, ?, NOW(), NOW())";
            }

            try {
                PreparedStatement pstmt = c.c.prepareStatement(query);
                pstmt.setString(1, fullName);
                pstmt.setString(2, phone);
                pstmt.setString(3, email);
                pstmt.setString(4, phone); // Using phone as login; adjust as needed
                pstmt.setString(5, password);
                if (role.equals("Administrator")) {
                    pstmt.setString(6, registrationCode);
                }
                pstmt.executeUpdate();
                JOptionPane.showMessageDialog(null, role + " Account Created Successfully");
                new Login().setVisible(true);
                this.setVisible(false);
            } catch (SQLIntegrityConstraintViolationException e) {
                JOptionPane.showMessageDialog(null, "Username, Phone Number, or Email already exists!");
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        // Handle Cancel Button
        if (ae.getSource() == b2) {
            this.setVisible(false);
            new Login().setVisible(true);
        }

        // Handle Login Link
        if (ae.getActionCommand().contains("Already have an account? Login")) {
            new Login().setVisible(true);
            this.setVisible(false);
        }
    }

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







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

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

public class UpdateRoom extends JFrame implements ActionListener {

    JComboBox<String> c1, c2;
    JTextField t1;
    JButton b1, b2, b3;

    UpdateRoom() {

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

        // Select Room
        JLabel roomSelect = new JLabel("Select Room");
        roomSelect.setBounds(50, 80, 100, 30);
        add(roomSelect);

        c1 = new JComboBox<>();
        try {
            ConnectMySQL c = new ConnectMySQL();
            String query = "SELECT room_number FROM Rooms";
            ResultSet rs = c.s.executeQuery(query);
            while (rs.next()) {
                c1.addItem(rs.getString("room_number"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        c1.setBounds(160, 80, 150, 30);
        add(c1);

        // Availability
        JLabel availability = new JLabel("Availability");
        availability.setBounds(50, 130, 100, 30);
        add(availability);

        c2 = new JComboBox<>(new String[]{"Available", "Occupied", "Maintenance"});
        c2.setBounds(160, 130, 150, 30);
        add(c2);

        // Submit Button
        b1 = new JButton("Update");
        b1.setBounds(80, 200, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

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

        // Logo/Image
        ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("h/images/updateroom.png"));
        Image i2 = i1.getImage().getScaledInstance(300, 300, Image.SCALE_DEFAULT);
        ImageIcon i3 = new ImageIcon(i2);
        JLabel l2 = new JLabel(i3);
        l2.setBounds(350, 80, 300, 300);
        add(l2);

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(400, 200, 700, 400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Update Button
            String roomNumber = (String) c1.getSelectedItem();
            String availability = (String) c2.getSelectedItem();

            ConnectMySQL c = new ConnectMySQL();

            try {
                String query = "UPDATE Rooms SET available = " + (availability.equals("Available") ? "TRUE" : "FALSE") + ", status = '" + availability + "', updated_at = NOW() WHERE room_number = " + roomNumber + "";
                c.s.executeUpdate(query);
                JOptionPane.showMessageDialog(null, "Room Status Updated Successfully");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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










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

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

public class UpdateStatus extends JFrame implements ActionListener {

    JComboBox<String> c1, c2;
    JTextField t1, t2;
    JButton b1, b2;

    UpdateStatus() {

        JLabel l1 = new JLabel("Update Check-in Status");
        l1.setForeground(Color.BLUE);
        l1.setFont(new Font("Tahoma", Font.PLAIN, 20));
        l1.setBounds(150, 20, 300, 30);
        add(l1);

        // Customer Phone Number
        JLabel l2 = new JLabel("Customer Phone No.");
        l2.setBounds(50, 80, 150, 30);
        add(l2);

        c1 = new JComboBox<>();
        try {
            ConnectMySQL c = new ConnectMySQL();
            String query = "SELECT phone FROM Customers";
            ResultSet rs = c.s.executeQuery(query);
            while (rs.next()) {
                c1.addItem(rs.getString("phone"));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        c1.setBounds(200, 80, 150, 30);
        add(c1);

        // Reservation Status
        JLabel l3 = new JLabel("Reservation Status");
        l3.setBounds(50, 130, 150, 30);
        add(l3);

        c2 = new JComboBox<>(new String[]{"Booked", "Checked-in", "Checked-out", "Cancelled"});
        c2.setBounds(200, 130, 150, 30);
        add(c2);

        // Total Amount
        JLabel l4 = new JLabel("Total Amount");
        l4.setBounds(50, 180, 150, 30);
        add(l4);

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

        // Deposit
        JLabel l5 = new JLabel("Deposit");
        l5.setBounds(50, 230, 150, 30);
        add(l5);

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

        // Update Button
        b1 = new JButton("Update");
        b1.setBounds(80, 300, 120, 30);
        b1.setBackground(Color.BLACK);
        b1.setForeground(Color.WHITE);
        b1.addActionListener(this);
        add(b1);

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

        // Auto-fill Total Amount and Deposit based on Reservation
        c1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                String phone = (String) c1.getSelectedItem();
                try {
                    ConnectMySQL c = new ConnectMySQL();
                    String query = "SELECT r.total_amount, r.deposit FROM Reservations r JOIN Customers c ON r.customer_id = c.customer_id WHERE c.phone = '" + phone + "' AND r.status = 'Booked'";
                    ResultSet rs = c.s.executeQuery(query);
                    if (rs.next()) {
                        t1.setText(String.valueOf(rs.getDouble("total_amount")));
                        t2.setText(String.valueOf(rs.getDouble("deposit")));
                    } else {
                        t1.setText("");
                        t2.setText("");
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        });

        getContentPane().setBackground(Color.WHITE);

        setLayout(null);
        setBounds(450, 200, 500, 400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getSource() == b1) { // Update Button
            String phone = (String) c1.getSelectedItem();
            String status = (String) c2.getSelectedItem();
            String totalAmountStr = t1.getText();
            String depositStr = t2.getText();

            double totalAmount = 0.0;
            double deposit = 0.0;

            try {
                totalAmount = Double.parseDouble(totalAmountStr);
                deposit = Double.parseDouble(depositStr);
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(null, "Please enter valid amounts");
                return;
            }

            ConnectMySQL c = new ConnectMySQL();

            try {
                String updateQuery = "UPDATE Reservations r JOIN Customers c ON r.customer_id = c.customer_id "
                        + "SET r.status = '" + status + "', r.total_amount = " + totalAmount + ", r.deposit = " + deposit + ", r.updated_at = NOW() "
                        + "WHERE c.phone = '" + phone + "'";
                c.s.executeUpdate(updateQuery);
                JOptionPane.showMessageDialog(null, "Reservation Status Updated Successfully");
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else if (ae.getSource() == b2) { // Back Button
            new Reception().setVisible(true);
            this.setVisible(false);
        }
    }

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










-- Создание базы данных
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
);

напиши ТЗ так будто у меня еще нет кода 
четко и кртако
ASSISTANT
## Техническое Задание (ТЗ) на Разработку Системы Управления Отелем

### 1. Введение
Настоящее техническое задание описывает требования к разработке Системы Управления Отелем (СУО), предназначенной для автоматизации ключевых процессов гостиничного бизнеса, включая управление клиентами, сотрудниками, комнатами, бронированиями и платежами.

### 2. Цель
Создание эффективной и надежной СУО, позволяющей оптимизировать операционные процессы отеля, улучшить качество обслуживания клиентов и повысить общую эффективность работы гостиницы.

### 3. Функциональные Требования

#### 3.1 Управление Клиентами
- **Добавление Новых Клиентов:** Ввод и хранение информации о клиентах (ФИО, телефон, email, пол, страна, даты заезда и выезда, номер комнаты).
- **Просмотр и Поиск Клиентов:** Просмотр списка клиентов с возможностью фильтрации по различным критериям (страна, статус бронирования и т.д.).
- **Обновление Информации:** Редактирование данных клиента и их бронирований.
- **Удаление Клиентов:** Возможность удаления записи о клиенте.

#### 3.2 Управление Сотрудниками
- **Добавление Сотрудников:** Ввод информации о сотрудниках (ФИО, возраст, пол, должность, зарплата, телефон, национальный ID).
- **Просмотр и Поиск Сотрудников:** Просмотр списка сотрудников с возможностью фильтрации по должности и сортировке по зарплате.
- **Редактирование и Удаление:** Обновление данных сотрудников и удаление записей.

#### 3.3 Управление Комнатами
- **Добавление Комнат:** Ввод информации о комнатах (номер комнаты, тип кровати, тип комнаты, цена, статус доступности).
- **Просмотр и Поиск Комнат:** Просмотр списка комнат с фильтрацией по типу кровати, цене и статусу.
- **Обновление Статуса Комнаты:** Изменение статуса доступности комнаты (доступна, занята, на обслуживании).

#### 3.4 Управление Бронированиями
- **Создание Бронирований:** Связывание клиентов с комнатами, установка дат заезда и выезда, расчет общей суммы и депозита.
- **Просмотр Бронирований:** Просмотр текущих и прошлых бронирований с возможностью фильтрации и сортировки.
- **Обновление Статуса Бронирования:** Изменение статуса бронирования (забронирована, заезжена, выехала, отменена).

#### 3.5 Управление Платежами
- **Регистрация Платежей:** Введение информации о платежах (сумма, дата, метод оплаты).
- **Просмотр Платежей:** История платежей с детализацией по бронированиям.

### 4. Нефункциональные Требования

#### 4.1 Производительность
- Система должна обеспечивать быстрый отклик при обработке запросов до 2 секунд.

#### 4.2 Безопасность
- Защита данных клиентов и сотрудников.
- Аутентификация и авторизация пользователей с разными уровнями доступа.
- Шифрование паролей и конфиденциальной информации.

#### 4.3 Масштабируемость
- Возможность расширения функционала и увеличения объема данных без значительных изменений в архитектуре.

#### 4.4 Удобство Использования
- Интуитивно понятный интерфейс.
- Поддержка нескольких языков (начиная с русского и английского).

### 5. Пользовательские Роли и Права Доступа

- **Администратор:**
  - Полный доступ ко всем функциям системы.
  - Управление пользователями и настройками системы.
  
- **Ресепшионист:**
  - Управление клиентами и бронированиями.
  - Регистрация выездов и платежей.
  
- **Менеджер:**
  - Просмотр и анализ отчетов.
  - Управление сотрудниками и комнатами.

### 6. Требования к Базе Данных
- **СУБД:** MySQL
- **Структура Базы Данных:**
  - Таблицы: Administrators, Receptionists, Employees, Rooms, Room_Images, Customers, Reservations, Payments.
  - Связи между таблицами через внешние ключи (например, Reservations связываются с Customers и Rooms).

### 7. Технологический Стек
- **Язык Программирования:** Java
- **Фреймворки и Библиотеки:**
  - Swing для GUI.
  - JDBC для взаимодействия с базой данных.
  - Библиотека rs2xml (net.proteanit.sql.DbUtils) для работы с JTable.
  
### 8. Требования к Интерфейсу Пользователя
- **Главное Окно:** Dashboard с навигацией по ключевым функциям.
- **Формы:** Интуитивно понятные формы для ввода и редактирования данных.
- **Таблицы:** Удобные таблицы для отображения списков клиентов, сотрудников, комнат и бронирований с возможностью фильтрации и сортировки.
- **Диалоги:** Сообщения об ошибках и подтверждения действий.

### 9. Требования к Безопасности
- Шифрование паролей пользователей.
- Ограничение доступа к функциям в зависимости от роли пользователя.
- Регулярное резервное копирование базы данных.

### 10. Сроки и Этапы Разработки
- **Анализ и Проектирование:** 2 недели
- **Разработка Backend:** 4 недели
- **Разработка Frontend:** 3 недели
- **Тестирование:** 2 недели
- **Внедрение и Обучение:** 1 неделя

### 11. Ожидаемые Результаты
- Полностью функциональная СУО, способная эффективно управлять операциями отеля.
- Увеличение скорости обработки бронирований и улучшение качества обслуживания клиентов.
- Снижение количества ошибок за счет автоматизации процессов.

### 12. Дополнительные Требования
- Возможность интеграции с внешними системами (например, системами онлайн-бронирования).
- Поддержка мобильных устройств (опционально).
- Локализация интерфейса на несколько языков.

---

**Примечание:** Все изменения и дополнения к данному техническому заданию должны быть согласованы с заказчиком и задокументированы соответствующим образом.

turns-00050.parquet:37883

30e337fc74bac5716a7c482f
turn 1/1gpt-4o-2024-08-06EnglishUnited States743 words
degenerate_repetitionAbsentFinal dense release
USER
[
    {
        "category": "girls fact",
        "title": "5 signs a girl has been hurt...",
        "answer1": "1. She avoids intimacy and commitments...",
        "answer2": "2. She may fear getting close to someone and being vulnerable again...",
        "answer3": "3. She may have trust issues...",
        "answer4": "4. She may blame herself for what happened and feel unworthy...",
        "answer5": "5. She may push people away or end relationship before they get serious..."
    },
    {
        "category": "Boys fact",
        "title": "5 situations where boys will feel shy...",
        "answer1": "1. When he meets his crush or his gf after a very long time...",
        "answer2": "2. when they get compliments from others...",
        "answer3": "3. when a group of girls crosses him, he feels shy...",
        "answer4": "4. Accidentally, if a girl tries to speak with him...",
        "answer5": "5. when his friends make fun of him about his crush or gf..."
    },
    {
        "category": "Boys fact",
        "title": "5 secrets to make a boy happy...",
        "answer1": "1. Make him emotionally happy by understanding his mood swings...",
        "answer2": "2. Let him know how much you like him without going overboard...",
        "answer3": "3. Don't be too clingy...",
        "answer4": "4. Learn to compromise when you have disagreement...",
        "answer5": "5. Don't pick fights. if you have an urge to fight, ask yourself why you want to pick a fight and why you're angry."
    },
    {
        "category": "Teenagers fact",
        "title": "5 secrets about teenage girls/boys...",
        "answer1": "1. They do crazy things in front of the mirror...",
        "answer2": "2. If someone wish them on their birthday they keep on see that messages...",
        "answer3": "3. They watch their own status in whatsApp too many times...",
        "answer4": "4. If they get upset they remove their whatsApp profile...",
        "answer5": "5. In exams, they start to write answers in last 5 mins..."
    },
    {
        "category": "Crush fact",
        "title": "5 happiness of having a school crush...",
        "answer1": "1. That one eye to eye contact from your crush gives you the biggest happiness...",
        "answer2": "2. Accidentally when you touch them or talk with them...",
        "answer3": "3. When your friends tease your crush by calling your name...",
        "answer4": "4. After a long leave when you see your crush...",
        "answer5": "5. When our friends say that your crush is watching you... Though you know it's a lie you enjoy that"
    }
]
Above is a json format tiktok script 5 examples, which related to relationship. Now, please based on the json format to output related to nutrition.
    
ASSISTANT
```json
[
    {
        "category": "Nutrition fact",
        "title": "5 signs you're not getting enough nutrients...",
        "answer1": "1. You feel constantly fatigued and low on energy...",
        "answer2": "2. You experience frequent hair loss or brittle nails...",
        "answer3": "3. Your skin has become dull or experiences frequent breakouts...",
        "answer4": "4. You often catch colds or have a weaker immune system...",
        "answer5": "5. You have difficulty concentrating or experience mood swings..."
    },
    {
        "category": "Nutrition fact",
        "title": "5 situations where you need to consider dietary changes...",
        "answer1": "1. When you have sudden weight gain or loss without trying...",
        "answer2": "2. When you notice digestive issues like bloating or irregular bowel movements...",
        "answer3": "3. When you find yourself often feeling hungry or unsatisfied after meals...",
        "answer4": "4. When you are experiencing persistent muscle cramps or weakness...",
        "answer5": "5. When your doctor advises you due to health conditions like diabetes or high blood pressure..."
    },
    {
        "category": "Nutrition fact",
        "title": "5 secrets to maintain a balanced diet...",
        "answer1": "1. Include a variety of colorful fruits and vegetables in your meals...",
        "answer2": "2. Ensure you're consuming enough protein with every meal...",
        "answer3": "3. Limit processed foods and opt for whole grains...",
        "answer4": "4. Stay hydrated by drinking plenty of water throughout the day...",
        "answer5": "5. Plan your meals ahead of time to avoid unhealthy snacking..."
    },
    {
        "category": "Nutrition fact",
        "title": "5 myths about eating habits...",
        "answer1": "1. Skipping meals helps with weight loss...",
        "answer2": "2. All fats are bad for your health...",
        "answer3": "3. Carbs are the enemy in a balanced diet...",
        "answer4": "4. You must eat only low-calorie foods to be healthy...",
        "answer5": "5. Detox diets are necessary to cleanse your body..."
    },
    {
        "category": "Nutrition fact",
        "title": "5 benefits of having a colorful diet...",
        "answer1": "1. A variety of colors means a wider range of nutrients...",
        "answer2": "2. Colorful diets are often rich in antioxidants...",
        "answer3": "3. They support better heart health and lower cholesterol...",
        "answer4": "4. They help in boosting your immune system...",
        "answer5": "5. Colorful foods can improve mental health and mood..."
    }
]
```

turns-00050.parquet:37884

27b198e689d4b2e62262294a
turn 1/9gpt-4o-2024-08-06EnglishSpain106 words
degenerate_repetitionAbsentFinal dense release
USER
analyse cette conversation et repond amicalement merci oiur le retour: Bonjour Mickael, nous devons rediscuter de la proposition avec Sabine
 
problème de cohérence de salaire au sein de l'équipe
 
nous te tenons au courant
 
très bonne journée à toi
 
ASSISTANT
Bien sûr ! Voici une réponse amicale que vous pourriez envoyer :

---

Bonjour [Nom du destinataire],

Merci pour votre retour. Je comprends l'importance de garantir une cohérence salariale au sein de l'équipe. N'hésitez pas à me tenir informé des avancées et à me recontacter lorsque vous serez prêt à en rediscuter avec Sabine.

En attendant, je vous souhaite une excellente journée également !

À bientôt,
Mickael

turns-00050.parquet:37885

4a9aece2cc23f201a559d6df
turn 2/9gpt-4o-2024-08-06EnglishSpain65 words
degenerate_repetitionAbsentFinal dense release
USER
tutoiement
ASSISTANT
Bien sûr, voici une version avec tutoiement :

---

Salut [Nom du destinataire],

Merci pour ton retour. Je comprends l'importance de garantir une cohérence salariale au sein de l'équipe. N'hésite pas à me tenir au courant des avancées et à me recontacter quand vous serez prêts à en rediscuter avec Sabine.

En attendant, je te souhaite une très bonne journée !

À bientôt,
Mickael

turns-00050.parquet:37886

01a374d088ee4f80ae6e2fe4
turn 3/9gpt-4o-2024-08-06EnglishSpain139 words
degenerate_repetitionAbsentFinal dense release
USER
do the same fir this conversation and improve my message

Hey, just checking in did you send that invite 
 
heyyy, I was preparing the doc for tomorrow, the invit' has been sent  Do you have a Thermofisher email ? 
 
Thankyou all received
 
Look forward to catching up
 

my message: Likewise ⁠

Wink

 Do you have a thermofisher email? the accesses? It will help for your understanding ⁠

Wink

 
ASSISTANT
Certainly! Here's a revised and friendlier version of your message:

---

Hey there!

Likewise, I'm really looking forward to catching up! 😉

By the way, do you have a Thermo Fisher email set up yet? Having access will really help with your understanding of everything. Let me know if you need any assistance with that! 😊

Looking forward to seeing you soon!

---

Feel free to adjust it further if needed!

turns-00050.parquet:37887

a96cd26e303dc0094985c6a4
turn 4/9gpt-4o-2024-08-06EnglishSpain193 words
degenerate_repetitionAbsentFinal dense release
USER
rewrite this message casualy but pro, he's a good friend of mine: nope.. I contacted Pauline Storti ( implementation manager in Netherlands and Aurelie Mouelle,  no news from them, I asked my manager AGS about it, she doesn't know how to get me those accesses.. But patience is my knew credo ^^ I remeber you telling me that I need to relax and slowdown my energy regarding feedback and such .. but I have to admit that I feel grateful having you around because people are kind of slow ... 
ASSISTANT
Sure, here's a more casually professional version of your message:

---

Hey!

So, no luck yet—I reached out to Pauline Storti, our implementation manager in the Netherlands, and Aurelie Mouelle, but haven't heard back from them. Even checked in with my manager at AGS, and she's not sure how to get those accesses for me either. But hey, patience is my new mantra! 😄

I remember you telling me to relax and slow down when it comes to feedback and all. I have to say, I'm really grateful to have you around because things can be a bit slow here.

Catch up soon!

turns-00050.parquet:37888

3419513261266b8fa7197b46
turn 5/9gpt-4o-2024-08-06EnglishSpain32 words
degenerate_repetitionAbsentFinal dense release
USER
rewrite friendly : Hi Anna, I forget to mentionned, thnaks for the holidays request ⁠

Wink

 
ASSISTANT
Hey Anna,

Oops, I forgot to mention—thanks for handling the holiday request! 😉

Catch you later!

turns-00050.parquet:37889

141e58382118a24a2bccf9ed
turn 6/9gpt-4o-2024-08-06EnglishSpain309 words
degenerate_repetitionAbsentFinal dense release
USER
Analyse la copnversation et repond a Hadjer que pour le moment je n'ai pas pris contact avec les candidats je voulais son avis, et que Rachel maintenant dans la section Hiring manager review donc tu peux analyser son cv : Bonjour Hadjer,
J'espère que tu vas bien. J'ai pris contact avec M. Angar pour qu'il puisse postuler sur le poste d'aide laboratoire. Pourrais-tu jeter un œil sur les deux autres profils que j'ai dans la section "Hiring Manager Review" : Florian Pausé et Rachel Cazorla
 
Bauman, Mickael
Bonjour Hadjer,  J'espère que tu vas bien. J'ai pris contact avec M. Angar pour qu'il puisse postuler sur le poste d'aide laboratoire. Pourrais-tu jeter un œil sur les deux autres profils que j'ai dans la section "Hiring Manager Review" : Florian Pausé et Rachel Cazorla

Hello Mickael, oui merci et toi tu vas bien? merci pour l'update

 
je regarde et je te dis
 
Super, merci 
Bauman, Mickael
Bonjour Hadjer,  J'espère que tu vas bien. J'ai pris contact avec M. Angar pour qu'il puisse postuler sur le poste d'aide laboratoire. Pourrais-tu jeter un œil sur les deux autres profils que j'ai dans la section "Hiring Manager Review" : Florian Pausé et Rachel Cazorla

Pour florian Pausé, le risque est sa licence mais on peut le recevoir on entretien si t'as deja confirmé avec lui le besoin de rester sur le poste. Et aussi sa localisation il est ou ? 

 
et pour Rachel je ne la vois pas
 
ASSISTANT
Bonjour Hadjer,

J'espère que tu vas bien. Pour le moment, je n'ai pas encore pris contact avec les candidats car je voulais d'abord avoir ton avis. En ce qui concerne Rachel, elle est maintenant dans la section "Hiring Manager Review", donc tu devrais pouvoir analyser son CV.

N'hésite pas à me faire savoir ce que tu en penses. Merci pour ton aide !

À bientôt,
Mickael