Viewing file: registraion.php (7.77 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html> <html lang="en">
<?php include 'head.php';?>
<body>
<!-- ======= Header ======= --> <?php include 'menubar.php';?>
<?php include 'sidebar.php';?>
<main id="main" class="main">
<!DOCTYPE html> <html> <head> <title>Student Registration Form</title> <link rel="stylesheet" type="text/css" href="styles.css"> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background-color: #f7f7f7; }
h1 { text-align: center; margin-bottom: 30px; }
form { max-width: 1000px; margin: 0 auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-full { grid-column: span 2; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input[type="text"], input[type="date"], input[type="tel"], input[type="number"], input[type="file"], textarea, select { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; }
input[type="submit"] { background-color: #4CAF50; color: white; padding: 12px 24px; border: none; border-radius: 4px; cursor: pointer; margin-top: 20px; float: right; }
input[type="submit"]:hover { background-color: #45a049; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } } </style> </head> <body>
<?php include 'connect.php'; $sql = "SELECT * FROM admission ORDER BY enrollment ASC"; if ($result = mysqli_query($link, $sql)) { $studentid = 10001; while ($row = mysqli_fetch_array($result)) { $studentid = is_numeric($row['enrollment']) ? (int)$row['enrollment'] : $studentid; } mysqli_free_result($result); } else { echo "ERROR: Could not execute $sql. " . mysqli_error($link); } $studentid = $studentid + 1; mysqli_close($link); ?>
<h1>Student Registration Form</h1> <form action="submit.php" method="post" enctype="multipart/form-data">
<div class="form-row"> <div> <label>Refer ID:</label> <input type="text" name="referno" required> </div> <div> <label>Name:</label> <input type="text" name="name" required> </div> </div>
<div class="form-row"> <div> <label>Father's Name:</label> <input type="text" name="father" required> </div> <div> <label>Mother's Name:</label> <input type="text" name="mother" required> </div> </div>
<div class="form-row"> <div> <label>Date of Birth:</label> <input type="date" name="dob" required> </div> <div> <label>Mobile Number:</label> <input type="text" name="mobile" required> </div> </div>
<div class="form-row"> <div> <label>Alternate Mobile Number:</label> <input type="text" name="mobile2"> </div> <div> <label>Aadhar Number:</label> <input type="text" name="aadhar"> </div> </div>
<div class="form-row form-row-full"> <label>Address:</label> <textarea name="address" rows="3" required></textarea> </div>
<div class="form-row"> <div> <label>Registration Date:</label> <input type="text" name="reg_date" value="<?php echo date('d/m/Y') ?>" required> </div> <div> <label>Registration Month:</label> <input type="text" name="reg_month" value="<?php echo date('m') ?>" required> </div> </div>
<div class="form-row"> <div> <label>Registration Year:</label> <input type="text" name="reg_year" value="<?php echo date('Y') ?>" required> </div> <div> <label>Fees Amount:</label> <input type="number" name="fees_amount" required> </div> </div>
<div class="form-row"> <div> <label>Username:</label> <input type="text" name="username" value="<?php echo $studentid ?>" required> </div> <div> <label>Password:</label> <input type="text" name="password" required> </div> </div>
<div class="form-row"> <div> <label>Fees Deposit Date:</label> <div style="display: flex; gap: 5px;"> <select name="day"> <?php $today = date('j'); for ($i = 1; $i <= 31; $i++) { echo "<option value=\"$i\"" . ($i == $today ? " selected" : "") . ">$i</option>"; } ?> </select> <select name="month"> <?php $month = date('n'); for ($i = 1; $i <= 12; $i++) { echo "<option value=\"$i\"" . ($i == $month ? " selected" : "") . ">$i</option>"; } ?> </select> <select name="year"> <?php $year = date('Y'); echo "<option value=\"$year\">$year</option>"; ?> </select> </div> </div> <div> <label>Courses:</label> <select name="course" required> <?php include 'connect.php'; $sql = "SELECT ID, course_name FROM courses"; $result = $conn->query($sql); if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo '<option value="' . $row["ID"] . '">' . htmlspecialchars($row["course_name"]) . '</option>'; } } else { echo '<option value="">No courses found</option>'; } $conn->close(); ?> </select> </div> </div>
<div class="form-row"> <div> <label>Student ID:</label> <input type="text" name="student_id" value="<?php echo $studentid ?>" required> </div> <div> <label>Batch Time:</label> <select name="batch_time"> <?php include 'connect.php'; $sql = "SELECT batch_time FROM batch"; $result = $conn->query($sql); if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo '<option value="' . $row["batch_time"] . '">' . $row["batch_time"] . '</option>'; } } else { echo '<option>No batch found</option>'; } $conn->close(); ?> </select> </div> </div>
<div class="form-row form-row-full"> <label>Upload Photo:</label> <input type="file" name="photo" accept="image/*" required> </div>
<div class="form-row form-row-full"> <input type="submit" value="Submit"> </div> </form> </body> </html>
</body> </html>
</main><!-- End #main -->
<?php include 'footer.php';?>
</body>
</html>
|