Skip to content
Merged

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ dist

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
Expand Down
4 changes: 4 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<Files ".env">
Require all denied
</Files>

<Files "adminContactDashboard.php">
Require all denied
</Files>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "moh/bld",
"name": "rod/bld",
"description": "BLD e-Sports Team: A Counter-Strike team management system",
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/admin/adminContactDashboard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
// needed to load the database stuff variables
require_once("../php/../php/connect.php");

$host = $_ENV['DB_HOST'];
$user = $_ENV['DB_USER'];
Expand Down Expand Up @@ -49,6 +51,7 @@
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Phone Number</th>
<th>Subject</th>
<th>Message</th>
<th>Date</th>
Expand All @@ -62,6 +65,7 @@
<td><?php echo htmlspecialchars($contact['firstname']); ?></td>
<td><?php echo htmlspecialchars($contact['lastname']); ?></td>
<td><?php echo htmlspecialchars($contact['email']); ?></td>
<td><?php echo htmlspecialchars($contact['phonenumber']); ?></td>
<td><?php echo htmlspecialchars($contact['subject']); ?></td>
<td><?php echo htmlspecialchars($contact['message']); ?></td>
<td><?php echo htmlspecialchars($contact['date']); ?></td>
Expand Down
7 changes: 4 additions & 3 deletions public/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions public/html/contactus.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
$firstName = htmlspecialchars($_POST['first-name']);
$lastName = htmlspecialchars($_POST['last-name']);
$email = htmlspecialchars($_POST['email']);
$phonenumber = htmlspecialchars($_POST['phonenumber']);
$subject = htmlspecialchars($_POST['subject']);
$message = htmlspecialchars($_POST['message']);

try {
// Prepare SQL statement and execute
$stmt = $conn->prepare("INSERT INTO ContactUS (firstname, lastname, email, subject, message) VALUES (?, ?, ?, ?, ?)");
$stmt->execute([$firstName, $lastName, $email, $subject, $message]);
$stmt = $conn->prepare("INSERT INTO ContactUS (firstname, lastname, email, phonenumber, subject, message) VALUES (?, ?, ?, ?, ?, ?)");
$stmt->execute([$firstName, $lastName, $email, $phonenumber, $subject, $message]);

// Redirect to avoid form re-submission on page reload
header("Location: " . $_SERVER['REQUEST_URI']);
Expand Down Expand Up @@ -56,6 +57,12 @@
<input type="email" id="email" name="email" placeholder="email@gmail.com" required>
</div>

<!-- Phone Section -->
<div>
<label for="phonenumber">Phone Number</label>
<input type="phonenumber" id="phonenumber" name="phonenumber" placeholder="06 12345678" required maxlength="10">
</div>

<!-- Subject Section -->
<div>
<label for="subject">Subject</label>
Expand Down
8 changes: 4 additions & 4 deletions public/html/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@
<div class="main">
<div class="card" id="c1">
<p>BLD named as Esports World Cup Foundation Partner</p>
<a href="index.php?page=news/news-1"><img src="../images/news/worldcuppartner.jpeg" alt="BLD named as Esports World Cup Foundation Partner"></a>
<a href="index.php?page=news/news-1"><img src="../images/news/worldcuppartner.jpg" alt="BLD named as Esports World Cup Foundation Partner"></a>
</div>
<div class="card" id="c2">
<p>BLD announces Cubert Academy, a CS:GO Academy team for the 2025 season</p>
<a href="#c2"><img src="../images/news/cubert-academy.png" alt="Cubert Academy announcement"></a>
<a href="index.php?page=news/news-2"><img src="../images/news/cubert-academy.png" alt="Cubert Academy announcement"></a>
</div>
<div class="card" id="c3">
<p>BLD announces gaming chair sponsorship with Razer</p>
<a href="#c3"><img src="../images/news/BLD-PARTNERSHIP-razer.png" alt="Gaming chair sponsorship"></a>
<a href="index.php?page=news/news-3"><img src="../images/news/BLD-PARTNERSHIP-razer.png" alt="Gaming chair sponsorship"></a>
</div>
<div class="card" id="c4">
<p>BLD victorious at first VCT Americas tournament of 2024, qualifies for VCT Masters Madrid</p>
<a href="#c4"><img src="../images/news/BLD-vct-won.png" alt="VCT win announcement"></a>
<a href="index.php?page=news/news-4"><img src="../images/news/BLD-vct-won.png" alt="VCT win announcement"></a>
</div>
</div>
</section>
Expand Down
6 changes: 4 additions & 2 deletions public/html/news/news-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- News-1 Page -->
<head>
<!-- Custom Fonts for the news text DONT REMOVE -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cal+Sans&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
Expand All @@ -10,8 +11,9 @@

<section class="news-article">
<h2>BLD named as Esports World Cup Foundation Partner</h2>
<?php echo date("Y-m-d"); ?>
<img src="../images/news/cubert-academy.png" alt="BLD named as Esports World Cup Foundation Partner">
<p>Published on: 2023-10-01</p>
<p>Author: BLD e-Sports</p>
<img src="../images/news/worldcuppartner.jpg" alt="BLD named as Esports World Cup Foundation Partner">
<div class="news-card">
<div class="news-card-text">
<h1>Los Angeles, California</h1>
Expand Down
35 changes: 34 additions & 1 deletion public/html/news/news-2.php
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
<?php
<!-- News-1 Page -->
<head>
<!-- Custom Fonts for the news text DONT REMOVE -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cal+Sans&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<title>BLD e-Sports | News</title>
</head>

<section class="news-article ">
<h2>BLD announces Cubert Academy, a Counter-Strike Academy team for the 2025 season</h2>
<p>Published on: 2023-12-15</p>
<p>Author: BLD e-Sports</p>
<img src="../images/news/cubert-academy.png" alt="BLD announces Cubert Academy, a Counter-Strike Academy team for the 2025 season">
<div class="news-card">
<div class="news-card-text">
<h1>Los Angeles, California</h1>
<p>– North American organization **BLD** is thrilled to unveil its **Counter-Strike Academy** roster for the 2025 season. Featuring **Zaki “Reduxx” Dilan** as the first core member, **Cubert Academy** is set to make waves in the competitive **Counter-Strike** scene.</p>

<p>“Our vision is simple but impactful. First, we aim to provide a nurturing environment for up-and-coming talent who aren’t yet eligible for premier **CS:GO** competitions, offering them a platform to evolve. At the same time, we want to create opportunities for seasoned players to showcase their skills, positioning them as strong candidates for joining top-tier **CS:GO** teams in the future, including our own **BLD** roster,” said **Mohamad F**, CEO of **BLD**.</p>

<p>While **Cubert Academy** won’t be competing in the **Pro League** just yet, contracts will be structured to give experienced players the option to transition to any top-tier **CS:GO** organization mid-season. After that point, a predetermined buyout of $10k or less will be available, ensuring they can pursue new opportunities without the usual high buyout hurdles.</p>

<p>This initiative will allow players to gain crucial experience in the **Challengers Circuit** and get scouted by major **CS:GO** teams, including **BLD**, without the usual high buyout hurdles.</p>

<p>**Cubert Academy** will be the only North American **Counter-Strike** academy team with such an arrangement. Fans can keep up to date with all team news and updates by following the official **@CubertAcademy** Twitter account.</p>

<p>Support the team directly by grabbing exclusive **Cubert Collection** merch, available in the **BLD Store**.</p>

<div class="nav-item"><a href="index.php?page=home#c1">Go back</a></div>
</div>
</div>

</section>
33 changes: 32 additions & 1 deletion public/html/news/news-3.php
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
<?php
<!-- News-1 Page -->
<head>
<!-- Custom Fonts for the news text DONT REMOVE -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cal+Sans&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<title>BLD e-Sports | News</title>
</head>

<section class="news-article">
<h2>BLD announces gaming chair sponsorship with Razer</h2>
<p>Published on: 2024-06-12</p>
<p>Author: BLD e-Sports</p>
<img src="../images/news/BLD-PARTNERSHIP-razer.png" alt="BLD announces gaming chair sponsorship with Razer">
<div class="news-card">
<div class="news-card-text">
<h1>Los Angeles, California</h1>
<p>– North American organization **BLD** is proud to announce a year-long partnership with **Razer**, the world’s leading lifestyle brand for gamers. With this partnership, the **Razer Iskur V2** gaming chair becomes the official chair for **BLD** players.</p>

<p>The **Razer Iskur V2** is built for ergonomic comfort, with its 6D Adjustable and Adaptive Lumbar Support System designed to fit the natural curvature of the spine. It also offers a custom-tailored experience with adjustable lumbar protrusion and height, ensuring optimal comfort. The chair also features high-density foam cushions, a reactive seat tilt, and up to 152-degree recline functionality.</p>

<p>Speaking on the partnership, CEO **Mohamad F** said:</p>
<p>“We’re excited to partner with **Razer**, a brand that has been a long-time leader in the esports industry. This partnership ensures that our players will have the most comfortable and innovative gaming chairs, helping them perform at their highest level. With the **Razer Iskur V2**, we’re confident our team will have the perfect equipment to compete in the most intense **Counter-Strike** matches.”</p>

Comment on lines +22 to +24
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace markdown-style emphasis with semantic HTML.
Static HTML won’t parse **bold**—use <strong> or <em> tags for emphasis to improve accessibility and consistency.

Example:

-<p>Speaking on the partnership, CEO **Mohamad F** said:</p>
+<p>Speaking on the partnership, CEO <strong>Mohamad F</strong> said:</p>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<p>Speaking on the partnership, CEO **Mohamad F** said:</p>
<p>“We’re excited to partner with **Razer**, a brand that has been a long-time leader in the esports industry. This partnership ensures that our players will have the most comfortable and innovative gaming chairs, helping them perform at their highest level. With the **Razer Iskur V2**, we’re confident our team will have the perfect equipment to compete in the most intense **Counter-Strike** matches.”</p>
<p>Speaking on the partnership, CEO <strong>Mohamad F</strong> said:</p>
<p>“We’re excited to partner with **Razer**, a brand that has been a long-time leader in the esports industry. This partnership ensures that our players will have the most comfortable and innovative gaming chairs, helping them perform at their highest level. With the **Razer Iskur V2**, we’re confident our team will have the perfect equipment to compete in the most intense **Counter-Strike** matches.”</p>

<p>**BLD** is now officially part of **Team Razer**, alongside some of the world’s best esports athletes. This announcement follows the success of **Zaki “Reduxx” Dilan** in securing victories with the **Razer Viper V3 Pro** wireless esports mouse in **Counter-Strike** tournaments.</p>

<p>Fans can look forward to exclusive **Razer Iskur V2** chairs and other **Razer** products available in the **BLD Store**. With this partnership, **BLD** players will now have top-tier gaming peripherals and ergonomic support to keep them at the top of their game.</p>

<div class="nav-item"><a href="index.php?page=home#c1">Go back</a></div>
</div>
Comment on lines +29 to +30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update back-navigation link for static context.
Linking to index.php?page=home#c1 likely breaks on a static page—point back to your homepage file, e.g., ../home.php#c1.

-<div class="nav-item"><a href="index.php?page=home#c1">Go back</a></div>
+<div class="nav-item"><a href="../home.php#c1">Go back</a></div>

</div>
</section>
35 changes: 34 additions & 1 deletion public/html/news/news-4.php
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
<?php
<!-- News-1 Page -->
<head>
<!-- Custom Fonts for the news text DONT REMOVE -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cal+Sans&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<title>BLD e-Sports | News</title>
</head>

<section class="news-article">
<h2>BLD victorious at first CS:GO Americas tournament of 2024, qualifies for CS:GO Masters Madrid</h2>
<p>Published on: 2024-03-04</p>
<p>Author: BLD e-Sports</p>
<img src="../images/news/BLD-vct-won.png" alt="BLD victorious at first CS:GO Americas tournament of 2024, qualifies for CS:GO Masters Madrid">
<div class="news-card">
<div class="news-card-text">
<h1>Los Angeles, California</h1>
<p>– **BLD**, who won their first official international **Counter-Strike** event in Reykjavik in 2021, have added another trophy to their cabinet with an emphatic victory over 2022 World Champions and 2023 Americas Champions LOUD in the first official **CS:GO** event of 2024.</p>

<p>Following an intense off-season that saw the organization bring home titles in the **BLD Invitational** and the **Afreeca TV League Tournament** where the team defeated the 2023 Pacific Champions Paper Rex, **BLD** went into the tournament with high expectations. After a series of hard-fought wins against top-level opponents such as NRG, Leviatan, and 100 Thieves, **BLD** was crowned the **CS:GO Kick-Off Champions**, earning their spot at **CS:GO Masters Madrid**, the first international tournament of the year.</p>

<p>Speaking on the victory, CEO **Mohamad F** said:</p>
<p>“The team has put in the work over the last six months capturing two titles along the way. We brought in two new players who have helped us culminate our turnaround with in-game leader, Mouhamed “johnqt” Ouarid, and the ultimate flex player Jordan “Zellsis” Montemurro. They have meshed so well with the sole remaining member of our 2021 title-winning team, Tyson “TenZ” Ngo, former World Champion Gustavo “Sacy” Rossi, and budding superstar Zachary “zekken” Patrone. We are incredibly excited about the possibility of going to Madrid and capturing another Masters crown.”</p>

<p>**BLD** superstars Tyson “TenZ” Ngo and Zachary “zekken” Patrone were two of the best performers in the tournament. Zekken was the second joint-highest-rated player of the event, while TenZ was crowned the player of the match in the grand final against LOUD.</p>

<p>The match against LOUD was the highest-watched of the event in any region with 823,008 peak viewers, according to data collected by EsportsCharts. To add to this impressive achievement, the match holds the all-time record for most viewership in any non-international **Counter-Strike** match. Out of the top five matches with the highest viewership figures in this tournament, **BLD** features in three of them.</p>

<p>**BLD** is set to open the event at **CS:GO Masters Madrid** against Europe’s Team Heretics at 11am PST on Friday, March 15. The entire playoff field at **CS:GO Masters Madrid** includes Karmine Corp, Paper Rex, Heretics, Gen.G, Edward Gaming, FPX, and LOUD. The tournament starts on March 14 and concludes with the Grand Finals on March 24.</p>

<div class="nav-item"><a href="index.php?page=home#c1">Go back</a></div>
</div>
</div>
</section>
Binary file removed public/images/news/worldcuppartner.jpeg
Binary file not shown.
Binary file added public/images/news/worldcuppartner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 32 additions & 11 deletions public/php/mysqlTables.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
<?php

// creates necessary tables if they don’t exist
global $conn;
$sql = "CREATE TABLE IF NOT EXISTS ContactUS (
contactus_id INT(6) AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
subject VARCHAR(50),
message TEXT,
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)";

$queries = [
// ContactUS table
"CREATE TABLE IF NOT EXISTS ContactUS (
contactus_id INT(6) AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
phonenumber INT(10),
Copy link

@coderabbitai coderabbitai bot May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use VARCHAR instead of INT for phone numbers.

Phone numbers should be stored as VARCHAR instead of INT because:

  1. Phone numbers may start with zero (which would be lost in an INT)
  2. They might include country codes, spaces, or hyphens
  3. Phone numbers aren't used for mathematical operations
        lastname VARCHAR(30) NOT NULL,
        email VARCHAR(50),
-        phonenumber INT(10),
+        phonenumber VARCHAR(20),
        subject VARCHAR(50),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
phonenumber INT(10),
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
phonenumber VARCHAR(20),
subject VARCHAR(50),

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a limiter to only 10 on html input and it only takes int's

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@5RoD I understand you've implemented proper validation on the HTML side with a 10-digit integer limit, which aligns with your INT(10) database field choice. That's a reasonable approach for your current requirements.

Just a quick note for future consideration: if you ever need to support international numbers with country codes or phone numbers with leading zeros, you might revisit this decision. But for your current use case with fixed-length 10-digit integers, your implementation is consistent across both the database and UI.


🏁 Script executed:

#!/bin/bash
# Check the contactus.php implementation to see how the phone number field is implemented
cat public/html/contactus.php | grep -A 10 -B 10 "phonenumber"

Length of output: 2058


@5RoD I see now what you're describing. I noticed your HTML input has a maxlength="10" limit as mentioned.

One thing to consider: your placeholder shows "06 12345678" (with a space and leading zero), but storing as INT(10) will drop leading zeros and would reject spaces. The HTML input type="phonenumber" isn't standard (browsers might default to text), so you may want to add pattern validation or use type="tel" with a numeric pattern if strict integer validation is important.

That said, if your application only needs to handle numeric phone numbers without special formatting or international considerations, your current approach works for your needs. Just be aware of the potential placeholder/storage mismatch.


✏️ Learnings added
Learnt from: 5RoD
PR: 5RoD/BLD#13
File: public/php/mysqlTables.php:12-12
Timestamp: 2025-05-05T21:19:05.594Z
Learning: For the BLD project, phone numbers are stored as INT(10) in the database with corresponding HTML input validation that limits input to 10 digits and only accepts integers.

Learnt from: 5RoD
PR: 5RoD/BLD#13
File: public/php/mysqlTables.php:12-12
Timestamp: 2025-05-05T21:19:05.594Z
Learning: For the BLD project, phone numbers are stored as INT(10) in the database with HTML input constrained by maxlength="10". The form uses a non-standard input type="phonenumber" with placeholder "06 12345678".

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

subject VARCHAR(50),
message TEXT,
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)",

// MatchResults table
"CREATE TABLE IF NOT EXISTS MatchResults (
result_id INT AUTO_INCREMENT PRIMARY KEY,
game_title VARCHAR(50) NOT NULL,
our_team_name VARCHAR(50) NOT NULL,
enemy_team_name VARCHAR(50) NOT NULL,
our_score INT NOT NULL,
enemy_score INT NOT NULL,
match_type VARCHAR(50) NOT NULL,
match_result VARCHAR(50) NOT NULL,
match_date DATE NOT NULL,
result_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)"
];

try {
$conn->exec($sql);
foreach ($queries as $sql) {
$conn->exec($sql);
}
} catch (PDOException $e) {
error_log("Table creation error: " . $e->getMessage());
die("Internal error creating tables.");
Expand Down