| Current Path : /var/www/html/venkat/aviral/aviral/ |
| Current File : /var/www/html/venkat/aviral/aviral/register.php |
<?php
include('db1.php');
include('session.php');
include('get_course.php');
?>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<center>
<h2>List of dropped courses</h2>
<?php
$_backButton = '<div class="container"><form action="home.php"><button type="submit">Go Back</button></form></div>';
$id = addslashes($_SESSION['key']);
$q = $conn->prepare("select course_id from aviral_dropped where student_id = :id");
$q->bindValue(":id", $id);
$q->execute();
$res = $q->fetchAll(PDO::FETCH_ASSOC);
echo '<form action="reg_submit.php" method="POST">';
?>
<table>
<tr>
<th>Select</th>
<th>Course Name</th>
<th>Semester</th>
<th>L</th>
<th>T</th>
<th>P</th>
</tr>
<?php
foreach ($res as $courseid) {
$courseid = $courseid['course_id'];
$course = get_course($conn, $courseid);
$course_code = $course['course_code'];
$course_name = $course['course_name'];
$semester = $course['semester'];
$L = $course['L'];
$T = $course['T'];
$P = $course['P'];
echo '<tr>';
echo '<td><input type="checkbox" name="sel[]" id="sel" value=' . $courseid . '></td>';
echo '<td>' . $course_name . '</td><td>' . $semester . '</td><td>' . $L . '</td><td>' . $T . '</td><td>' . $P . '</td>';
echo '</tr>';
} ?>
</table>
<?php
echo '<button type="submit">Register</button>';
echo '</form>';
echo '<h2>Selected courses</h2>';
echo '<form action="rem.php" method="POST">';
$q = $conn->prepare("select course_id from aviral_registered where student_id = :id");
$q->bindValue(":id", $id);
$q->execute();
$res = $q->fetchAll(PDO::FETCH_ASSOC);
?>
<table>
<tr>
<th>Select</th>
<th>Course Name</th>
<th>Semester</th>
<th>L</th>
<th>T</th>
<th>P</th>
</tr>
<?php
foreach ($res as $row) {
$courseid = $row['course_id'];
$course = get_course($conn, $courseid);
$course_code = $course['course_code'];
$course_name = $course['course_name'];
$semester = $course['semester'];
$L = $course['L'];
$T = $course['T'];
$P = $course['P'];
echo '<tr>';
echo '<td><input type="checkbox" name="del[]" id="del" value=' . $courseid . '></td>';
echo '<td>' . $course_name . '</td><td>' . $semester . '</td><td>' . $L . '</td><td>' . $T . '</td><td>' . $P . '</td>';
echo '</tr>';
}
echo '</table>';
echo '<button type="submit">Un-register</button>';
echo '</form>';
echo $_backButton;
?>