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 : 18.191.116.61
<?php
$servername = "97.74.228.93";
$username = "logisys3_logu";
$password = "Logisys@2106";
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$db = "logisys3_bcu";
$fdeggrp = $_POST['fdeggrp'];
$type = $_POST['type'];
$fexamno = "";
if($type != 'board')
{
$fboard = $_POST['fboard'];
if($_POST['fexamno'] == 'ODD')
$fexamno = "A', 'C', 'E";
else if($_POST['fexamno'] == 'EVEN')
$fexamno = "B', 'D', 'F";
else if($_POST['fexamno'] == 'ALL')
$fexamno = "A', 'B', 'C', 'D', 'E', 'F";
else
$fexamno = $_POST['fexamno'];
}
$numalpha = array("A"=>1, "B"=>2, "C"=> 3, "D"=> 4, "E" => 5, "F" => 6, "G" => 7, "H" => 8, "I" =>9, "J" =>10 );
if($type == 'board')
{
$Query = "select distinct m.fboardcode, m.fboardname FROM {$db}.masboard m
inner join {$db}.submasqp q on
q.fboard = m.fboardcode
where fdeggrp = '{$fdeggrp}'
order by m.fboardcode";
$result = mysqli_query($conn, $Query);
$i=0;
while($row = mysqli_fetch_assoc($result))
{
$row1[$i] = $row;
$i++;
}
echo json_encode($row1);
return;
}
else
{
$Query = "select distinct d.fexamno, fexamname, fqpcode, fsubname, fmaxmarks,
if(ifnull(fdegreerange,'') = '', d.fdegree,fdegreerange) as fdegrees
from {$db}.submasqp s inner join {$db}.degree d on s.fdegree =d.fdegree and s.fexamno = d.fexamno
where fboard = '{$fboard}' and s.fdeggrp = '{$fdeggrp}'
and d.fexamno in ('$fexamno') order by d.fexamno, fqpcode";
// var_dump($Query);
$result = mysqli_query($conn, $Query);
$i = 1;
$html = "<tr class='bg-green'>
<th width='4%'><center>Sl. No.</center></th>
<th width='5%'><center>Sem.</center></th>
<th width='7%'><center>QP Code</center></th>
<th ><center>Subject Name</center></th>
<th width='8%'><center>Max. Marks</center></th>
<th ><center>Degree Range</center></th>";
$html .="</tr>";
while($row = mysqli_fetch_assoc($result))
{
$html .= "<tr>
<td><center>{$i}</center></td>
<td><center>".numberToRoman($numalpha[$row['fexamno']])."</center></td>
<td><center>{$row['fqpcode']}</center></td>
<td>{$row['fsubname']}</td>
<td><center>{$row['fmaxmarks']}</center></td>
<td>{$row['fdegrees']}</td>";
$html .="</tr>";
$i++;
}
echo $html;
}
function numberToRoman($number) {
$map = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
$returnValue = '';
while ($number > 0) {
foreach ($map as $roman => $int) {
if($number >= $int) {
$number -= $int;
$returnValue .= $roman;
break;
}
}
}
return $returnValue;
}
?>
|