This repository contains a simple web-based client management system built with HTML, CSS, and PHP. The application allows users to add new clients and view existing client records stored in a MySQL database. The project includes a user-friendly interface with a dark theme and a navigation menu for easy access to different functionalities.
This file contains the HTML form for adding a new client. The form includes fields for the client's name, phone number, email, and registration date.
This file displays a list of all clients stored in the MySQL database. It fetches the client data using PHP and displays it in an HTML table.
This file handles the form submission from index.html
and inserts the new client data into the MySQL database. It uses PHP to process the form data and execute the SQL insert query.
- Global Styles: All elements are styled with
margin: 0
,padding: 0
, andbox-sizing: border-box
for consistent layout. - Body: The body is styled to use the Arial font, have a dark background color, and center its content both vertically and horizontally.
- Container: A container class is used to style the main content area with a gradient background, blur effect, rounded corners, and a drop shadow.
- The navigation bar is fixed at the top, with a dark background and shadow for depth.
- It contains links to view client records and add a new client.
- Links change color and background on hover for a visual effect.
- Labels: Styled with a light gray color and a neon text-shadow effect.
- Inputs and Buttons: Styled with padding, margin, border, rounded corners, and a dark background to match the overall theme.
- Table: The table for displaying client records is styled to be fully responsive and visually appealing with alternating row colors and hover effects.
- Table Headers: Styled with a semi-transparent background and bold text.
- Table Data: Styled with a lighter background and rounded corners for the first and last rows.
- Displays a form for adding new clients.
- The form method is POST and submits data to
insert_data.php
.
- Connects to the MySQL database using PDO.
- Fetches all client records and displays them in an HTML table.
- Handles database connection errors by displaying an error message.
- Processes the form data from
index.html
. - Connects to the MySQL database using PDO.
- Prepares and executes an SQL insert statement to add the new client data.
- Displays a success message if the data is inserted successfully or an error message if an exception occurs.
- Host:
localhost
- Username:
root
- Password:
Boketto@2811
- Database Name:
hair_salon
- Table:
clients
- Columns:
name
(VARCHAR)phone_number
(VARCHAR)email
(VARCHAR)registration_date
(DATE)
-
Setup Database:
- Create a MySQL database named
hair_salon
. - Create a table named
clients
with columns forname
,phone_number
,email
, andregistration_date
.
- Create a MySQL database named
-
Configure Connection:
- Update the database connection details in
database.php
andinsert_data.php
if necessary.
- Update the database connection details in
-
Run the Application:
- Open
index.html
in a web browser to add a new client. - Open
database.php
to view the list of clients.
- Open
- A web server with PHP support (e.g., Apache, Nginx).
- MySQL database server.
- PHP PDO extension for database connection.