Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.133.147.193
Current Path : /var/www/html/reva/ |
| Current File : /var/www/html/reva/reva_api.php |
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
ini_set('max_execution_time', 300);
ini_set("memory_limit", "500M");
header("Content-Type: text/html");
$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
$username = "admin";
$password = "Logisys2104";
$databse = 'logisys3_reva';
$conn = new mysqli($servername, $username, $password, $databse);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$fregno = $_GET['regno'];
$option = $_GET['option'];
if ($fregno == '') {
echo "Please enter Reg. No.";
return;
die();
}
if ($option == '') {
echo "Please enter Option";
return;
die();
}
$update = "update student set fbatch1 = '{$option}'
where fregno = '{$fregno}'";
$result = $conn->query($update);
if ($option == 1) {
$update = "update canddet set fpresent = 'P'
where fregno = '{$fregno}'
and ifnull(fpassmth,'') = ''
and fpresent = 'X'";
$result1 = $conn->query($update);
} else {
$update = "update canddet set fpresent = 'X'
where fregno = '{$fregno}'
and ifnull(fpassmth,'') = ''
and fpresent = 'P'";
$result1 = $conn->query($update);
}
$query = "SELECT s.fdegree, s.fregno, s.fname, s.fcollcode, s.fbatch1,
(case when c.ftotalfee>'0' then 'Fee Paid' else 'Not Paid' end) as Status FROM student s
inner join candsum c on s.fdegree= c.fdegree and s.fregno =c.fregno
and s.fcollcode = c.fcollcode
where s.fregno = '{$fregno}'";
$result2 = $conn->query($query);
echo '<table border="2" style="background-color: white; color: Green; margin: 0 auto;">
<thead>
<tr>
<th>Degree</th>
<th>Register_No</th>
<th>Student_Name</th>
<th>College Code</th>
<th>Option</th>
<th>Status</th>
</tr>
</thead>
<tbody>';
while ($row = mysqli_fetch_assoc($result2)) {
echo
"<tr>
<td>{$row['fdegree']}</td>
<td>{$row['fregno']}</td>
<td>{$row['fname']}</td>
<td>{$row['fcollcode']}</td>
<td>{$row['fbatch1']}</td>
<td>{$row['Status']}</td>
</tr>\n";
}
?>
</tbody>
</table>
</body>
</html>
|