<?php
session_start();
if (!isset($_SESSION['AccID'])) {
    header('Location: login.html');
    exit();
}

include("connection.php");
$PlaceNum = $_POST['place'];
$AccID = $_SESSION['AccID'];

// Fetching the user's name
$sql = "SELECT Renter_Name FROM renter WHERE Renter_ID = '$AccID'";
$result = mysqli_query($conn, $sql);
$user = mysqli_fetch_assoc($result);
$userName = $user['Renter_Name'];
?>

<!DOCTYPE html>
<html>
<head>
    <title>Proof | UITM BAZAAR</title>
  <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="style2.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
  <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--bg-color, rgb(15,15,15));
            color: var(--text-color, white);
        }
        
        h2 {
            font-size: 40px;
        }
        h6 {
            font-size: 15px;
        }
        hr {
            border: 1px solid #ccc;
            margin: 20px auto;
            width: 50%;
        }
        strong {
            display: block;
            font-weight: bold;
            margin-top: 20px;
            font-size: 20px;
        }
        p {
            margin-bottom: 20px;
        }
        .button-row {
            display: flex;
            justify-content: space-between;
            margin-top: 20px; /* Adjust as needed */
        }

        .button-row  a {
            margin-left: 50px;
            padding: 10px 20px;
            background-color: var(--main-color, purple);
            color: white;
            border: none;
            border-radius: 5px;
            display: flex;
            justify-content: space-between;
        }
        .button-row  a:hover {
            background-color: #6b1c6e;
        }
        .button-row button {
            margin-right: 50px;
            padding: 10px 20px;
            background-color: var(--main-color, purple);
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
            display: flex;
            justify-content: space-between;
        }
        .button-row button:hover {
            background-color: #6b1c6e;
        }
        footer {
            padding: 20px 0;
            background-color: #333;
            color: white;
        }
        form {
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: black;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        fieldset {
            border: none;
            padding: 0;
            margin: 0;
        }
        table {
            width: 100%;
        }
        td {
          margin-right: 30px;
            padding: 10px;
            font-size: 20px;

        }
        input[type="text"],
        select {
            width: calc(100% - 20px);
            padding: 8px;
            margin: 5px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        input[type="checkbox"] {
            margin-right: 5px;
        }
        label {
            font-size: 20px;
        }
        .hom-img h1{
            font-size: 40px;
            text-align: center;
            margin-right: 10px;
        }
        .hom-img img{
            margin-left: 430px;
            margin-bottom: 30px;
            position: center;
            width: 170px;
        }
        .tapak-message {
          font-size: 30px;
          font-weight: bold;
          text-align: center;
          margin-top: 60px; /* Adjust as needed */
        }
    </style>
</head>
<body>
    <aside class="sidebar">
      <div class="logo">
        <img src="pic/profiles.png" alt="logo">
        <h2><?php echo $userName; ?>'s</h2>
      </div>
      <ul class="links">
        <h4>Main Menu</h4>
        <li>
          <span class="material-symbols-outlined"><img src="pic/home.png"></span>
          <a href="rentermenu.php">Main Menu</a>
        </li>
        <hr>
        <h4>Advanced</h4>
        <li>
          <span class="material-symbols-outlined"><img src="pic/receipt.png"></span>
          <a href="selectReceipt.php">Receipt</a>
        </li>
        <hr>
        <h4>Account</h4>
        <li>
          <span class="material-symbols-outlined"><img src="pic/profile2.png"></span>
          <a href="renterProfile.php">Profile</a>
        </li>
        <hr>
        <h4>Sign Out</h4>
        <li class="logout-link">
          <span class="material-symbols-outlined"><i class="fa-solid fa-right-from-bracket"></i></span>
          <a href="logout.php">Logout</a>
        </li>
      </ul>
    </aside>
<header class = "header">
        <a href= "rentermenu.php" class = "logo">Welcome
        <span><?php echo $userName; ?>'s</span></a>

        <i class="fa-solid fa-bars" id="menu-icon"></i>

        <nav class="navbar">
            <a href="rentPlace.php">Rent Place</a>
            <a href="sawEvents.php">Event</a>
            <a href="payment.php">Payment</a>
            <a href="sentFeedback.php">Sent Feedback</a>
            </nav>      
</header>

<div class="centered">
  <div class="tapak-message">
    <br><br>
     Fill In Your Details <br><br>
</div>
    <form name="borang" method="POST" action="proof2.php">
            <input type="hidden" name="place" value="<?php echo $PlaceNum; ?>">
            <fieldset>
                <table>
                    <tr>
                        <td><label for="ID">Renter ID:</label></td>
                        <td><input type="text" name="ID" id="ID" value="<?php echo $AccID; ?>" readonly></td>
                    </tr>
                    
                    <tr>
                        <td>Category Type :</td>
                        <td>
                            <select name='categoryType' id='categoryType'>
                                <option value='Food'>FOOD & DRINK</option>
                                <option value='Toys'>TOYS</option>
                                <option value='Clothes'>CLOTHES</option>
                            </select>
                        </td>
                    </tr>
                    
                    <tr>
                        <td>Dates :</td>
                        <td><input type="date" name="dates" id="dates" min="<?php echo date('Y-m-d'); ?>" max="<?php echo date('Y-m-d', strtotime('+1 month')); ?>" required></td>
                    </tr>

                    <tr>
                        <td>Peddling License :</td>
                        <td><input type="text" name="Licences" id="Licences" required></td>
                    </tr>
                </table>
            </fieldset>
            <br>
            <div class="button-row">
                    <a href="rentPlace.php" class="button">BACK</a>
                <button type="submit" value="submit" name="submit" class="button">SUBMIT</button>
            </div>

        </form><br>

        <footer class="footer" id="footer" style="margin-top: 100px;">
        <div class="social">
            <a onclick="showPopup()"><i class="fa-solid fa-phone"></i></a>
            <a onclick="showPopup2()"><i class="fa-solid fa-envelope"></i></a>
        </div>
        <div id="popup" class="popup">
                <h2>This is Our No Phone!</h2><br>
                <p>016-430 6562</p>
                <button class = btns onclick="closePopup()">Close</button>
        </div>

        <div id="popup2" class="popup">
                <h2>This is Our Email!</h2><br>
                <p>uitm@student.uitm.edu.my</p>
                <button class = btns onclick="closePopup2()">Close</button>
        </div>
        <ul class="list">
            <li>
                <a href="sentFeedback.php">Rate Us</a>
            </li>

            <li>
                <a href="sawEvents.php">Event</a>
            </li>

            <li>
                <a href="renterProfile.php">Profile</a>
            </li>

            <li>
                <a href="https://bendahari.uitm.edu.my/index.php/component/contact/category/55-cawangan-negeri-perak-kampus-tapah">Website</a>
            </li>
        </ul>
        <p class="copyright">
            © NextGen Techne | All Rights Reserved
        </p>
    </footer>
    <script src="script.js"></script>


</body>
</html>


