Commit 13313c84 authored by suleman.hussain's avatar suleman.hussain

dcfsdf

parent 84dd5b96
<!DOCTYPE html>
<html>
<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
// Connects to database
$conn=mysqli_connect("ysjcs.net","suleman.hussain","WF8L8LE8","sulemanhussain");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql="SELECT * FROM Drivers";
$results = mysqli_query($conn,$sql);
/*
while($row = mysqli_fetch_assoc($results)) {
echo $row["First_Name"];
echo"<br/>";
foreach($row as $row){
echo $row . "|\t|";
}
echo"<br/>";
}
*/
// Table
echo "<table>";
echo "<tr>";
echo "<th>First Name</th>";
echo "<th>Last Name</th>";
echo "<th>DoB</th>";
/*
echo "</tr>";
while($row = mysqli_fetch_assoc($results)){
echo "<tr>";
......@@ -41,29 +27,53 @@ while($row = mysqli_fetch_assoc($results)){
echo "</tr>";
}
echo "</table>";
*/
echo '<form action="submit.php" method="post">';
if(isset($_POST['search'])) {
$search_term = $_POST['search_term'];
echo '<label>Driver ID:</label>';
echo '<input type="text" name="Driver_ID">';
echo '<br>';
echo '<label>First Name:</label>';
echo '<input type="text" name="First_Name">';
echo '<br>';
echo '<label>Last Name:</label>';
echo '<input type="text" name="Last_Name">';
echo '<br>';
echo '<label>Team ID:</label>';
echo '<input type="text" name="Team_ID">';
echo '<br>';
echo '<label>Driver Number:</label>';
echo '<input type="text" name="Driver_Number">';
// Connect to the database
$conn = mysqli_connect("ysjcs.net","suleman.hussain","WF8L8LE8","sulemanhussain");
echo '<button type="submit">Submit</button>';
// Call the stored procedure
$results = mysqli_query($conn, "CALL search_proc('$search_term')");
// Display the results
echo "</tr>";
while($row = mysqli_fetch_assoc($results)){
echo "<tr>";
echo "<td>" . $row["First_Name"]. "</td>";
echo "<td>" . $row["Last_Name"]. "</td>";
echo "<td>" . $row["DoB"]. "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="main.js"></script>
</head>
<h2 id="header"><span class="highlight">Select to view</span></h2>
<button class="Button" onclick="location.href='home.php'">
<span>Home</span></button>
<button class="Button" onclick="location.href='drivers.php'">
<span>Drivers</span></button>
<form method="post" action="">
<input type="text" name="search_term" id="search-bar" placeholder="Search Driver First Name">
<button type="submit" name="search" id="search-btn">
<i class="fa fa-search"></i>
</button>
</form>
?>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html>
<body>
<?php
// Connects to database
$conn=mysqli_connect("ysjcs.net","suleman.hussain","WF8L8LE8","sulemanhussain");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql="SELECT * FROM Drivers";
$results = mysqli_query($conn,$sql);
?>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="main.js"></script>
</head>
<h2 id="header"><span class="highlight">Select to view</span></h2>
<button class="Button" onclick="location.href='home.php'">
<span>Home</span></button>
<button class="Button" onclick="location.href='drivers.php'">
<span>Drivers</span></button>
</body>
</html>
\ No newline at end of file
const h2 = document.getElementById("header");
const h2Text = h2.innerHTML;
const h2Wrapper = document.createElement("span");
h2Wrapper.style.backgroundColor = "#F5A623";
h2Wrapper.style.color = "#fff";
h2Wrapper.style.padding = "0.2em";
h2Wrapper.innerHTML = h2Text;
h2.innerHTML = "";
h2.appendChild(h2Wrapper);
......@@ -20,3 +20,32 @@ form {
transform: translate(-50%,-50%);
}
button {
background-color: blue; /* sets the background color of the button */
color: white; /* sets the text color of the button */
padding: 10px 20px; /* sets the padding around the text inside the button */
border: none; /* removes the border around the button */
border-radius: 5px; /* adds rounded corners to the button */
font-size: 16px; /* sets the font size of the text inside the button */
cursor: pointer; /* changes the cursor to a pointer when hovered over the button */
transition: transform 0.3s ease; /* adds a transition to the transform property */
}
button:hover {
background-color: red; /* changes the background color of the button when hovered over */
transform: scale(1.1); /* scales the button up by 10% when hovered over */
transform: rotate(180deg);
}
.highlight{
background-color: #F5A623;
color: #fff;
padding: 0.2em;
}
#search-form {
display: flex;
justify-content: flex-end;
align-items: center;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment