### Database Guide: Understanding How Our Website Works
#### (this is More or less Chat GPT Generated)
**Table of Contents:**
- **How To:**(this is line no. to skip)
- (20) Guide to Import Provided SQL on Your Laptop (Essential)
- (38) How to Run PHP Files in a Browser (Essential)
- (54) Changing Timezone (Essential)
- (66) How to Access `[Link]`
- (82) Setting Up a Server for Local Web Access
- (109) Changing MySQL Port
- **Information:**
- (125) Admin Account Passwords and Email
---
### Guide to Setting Up the Provided Database (SQL File) on Your Laptop
*Assuming you have XAMPP installed and functioning correctly.*
*(Skip this section if you already know how to import an SQL file.)*
1. Extract the provided ZIP file to `C:/xampp/htdocs/` and place it in your desired
folder.
2. Open XAMPP.
3. Start both Apache (not essential at this moment but recommended) and MySQL.
4. Click on "Admin" in the MySQL row. This will redirect you to phpMyAdmin in your
default browser.
5. In phpMyAdmin, create a new database by clicking "New" in the left column.
6. Name the database `seat_sample` and click "Create."
7. Click "Import" on the top navigation bar.
8. Click "Choose File" and select the file `seat_samples.sql` from your extracted
files (e.g., `/Txt files/seat_samples.sql`).
9. Scroll down and click "Go" to complete the import process. You should see
several tables such as `user`, `bus_seats`, etc., if the import was successful.
---
### How to Run PHP Files in a Browser
**Things to Know:**
- Your MySQL port can be found in the "PORT(s)" column in XAMPP. To change it,
refer to the section on changing MySQL port.
- Ensure your files are located in the `xampp/htdocs/` directory where you
extracted the provided ZIP file.
**Steps:**
1. Open the `[Link]` file in your extracted folder. Change the localhost
reference from `[Link]:3307` to `[Link]:(your MySQL port)`.
2. Open your browser and navigate to `localhost/(your file path)/[Link]`.
*You can now interact with the website and report any errors.*
---
### Changing Timezone to Asia/Yangon
It is essential to set the correct timezone for our bus system.
**Steps:**
1. Navigate to `C:/xampp/php/[Link]`.
2. Search for `[Link]` (use Ctrl+F to find it quickly).
3. Change the timezone from `Europe/YourCity` to `Asia/Yangon`.
---
### How to Access `[Link]`
To use the admin functionalities:
1. Navigate to `[Link]`.
2. You will need the admin account email and password (provided in the Information
section).
3. Click on the logo in `[Link]` to be redirected to `[Link]`.
*In the admin page, you can perform actions such as delete or insert records.
Remember to know the column names of the tables you are working with.*
*The admin page automatically deletes `bus_seats` data before the current date and
creates new data for the next week. The system handles a total of 1680 seats daily.
If seats are purchased, they will be reflected accordingly.*
*Note: Direct access to `[Link]` without admin login is restricted.*
---
### Setting Up a Server for Local Web Access
**Things to Know:**
- Ensure that both the server laptop and client devices are connected to the same
Wi-Fi network.
- To prevent unauthorized access, be cautious about sharing admin credentials.
**Server Side:**
1. Open Command Prompt and type `ipconfig`. Note the IPv4 address (e.g.,
`[Link]`).
2. Open XAMPP and click "Config" in the Apache row.
3. Click on "[Link]" and search for `Listen 80`. Change it to `Listen 8080`.
4. Search for `ServerName localhost:80` and change it to `ServerName (your IP
address):8080` (e.g., `[Link]:8080`).
5. Save and exit. Return to the XAMPP Config menu and select the third option,
"[Link]."
6. Search for `Require all denied` and change it to `Require all granted`.
**Client Side:**
1. Ensure the client device is connected to the same Wi-Fi network as the server.
2. Open a browser and navigate to `(server IP address):8080/` (e.g.,
`[Link]:8080/`).
3. Wait for the page to load (it should take no more than a minute). If there are
errors, revisit the previous steps.
4. If successful, you should see the welcome page.
5. Now if you want to go to real pages, delete daashboard in url if there is and in
that place change the url to (orginal url)/[Link] OR you can signin so. go to
[Link].
---
Note..there is a picture included in Txt File about how the database table work.
### Changing MySQL Port
**To change the MySQL port in XAMPP:**
1. **Open XAMPP Control Panel.**
2. Click on the **"Config"** button next to MySQL.
3. Select **"[Link]"** from the dropdown menu. This will open the MySQL
configuration file in a text editor.
4. Look for the line that starts with **`port=`**. It is usually located under the
`[mysqld]` section.
5. Change the port number to your desired port (e.g., `3308` instead of `3306`).
6. Save the file and close the text editor.
7. Restart MySQL through the XAMPP Control Panel to apply the changes.
**Note:** Make sure that the new port is not being used by another application and
update your connection settings in your `[Link]` file to reflect this new
port.
### Information
**Admin Account Information:**
- Username: admin
- Email: admin@[Link]
- Password: adminAccId10
### Troubleshooting Errors and Providing Feedback
**Possible Errors And Providing Feedback:**
If you encounter any issues or if the website is not functioning as expected,
please give feedbacks. Your feedback is invaluable in helping us improve our web
system.