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 : 52.14.66.242
<?php
include ("/var/www/config.php");
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$db = "logisys3_dud";
$type = $_POST['type'];
if($type == 'loadsub')
{
$degree = $_POST['degree'];
$sem = $_POST['sem'];
if($sem=='All')
{
$cnd = "";
}else
{
$cnd = "and fexamno = '{$sem}'";
}
$Query = "select distinct s.fsubcode, s.fsubname FROM {$db}.subject s
where fintass = 'F' and fdegree = '{$degree}'
$cnd ";
//var_dump($Query);
$result = mysqli_query($conn, $Query);
$i=0;
while($row = mysqli_fetch_assoc($result))
{
$row1[$i] = $row;
$i++;
}
echo json_encode($row1);
return;
} else if($type == 'study')
{
$fdegree = $_POST['fdegree'];
$sem = $_POST['sem'];
$subject = $_POST['subject'];
if($sem == 'All')
{
$cnd = "";
}else
{
$cnd = "and o.fexamno = '{$sem}'";
}
if($subject == 'All')
{
$cnd1 = "";
}else
{
$cnd1 = "and o.fsubcode = '{$subject}'";
}
$Query = "select distinct o.fdegree, d.fdescpn,d.fexamno,o.fsubcode,
o.FUPDTEACH,su.fsubname,o.fchapter,
count(distinct fregno) as viewed,
date_format(o.FCREATEDATE,'%d/%m/%Y %h:%i:%s %p') as upddate,
d.fexamname,o.FUPDDEPT,fpath,ifnull(fapprstatus,'Pending') as fapprstatus
FROM {$db}.degree d inner join {$db}.osmmain o on d.fdegree = o.fdegree
and d.fexamno = o.fexamno
inner join {$db}.subject su on su.fdegree = o.fdegree and su.fexamno = o.fexamno
and su.fsubcode = o.fsubcode and su.fintass = 'F'
left join {$db}.osmdetl od on d.fdegree = od.fdegree
and od.fexamno = o.fexamno
and od.fsubcode = o.fsubcode
where o.fdegree = '{$fdegree}'
{$cnd} {$cnd1}
group by o.fdegree,o.fexamno,o.fsubcode,o.FCHAPTER
order by d.fdescpn,d.fexamno";
//var_dump($Query);
$result = mysqli_query($conn, $Query);
$i=0;
while($row = mysqli_fetch_assoc($result))
{
$row1[$i] = $row;
$i++;
}
if($result)
{
$arr['data'] = $row1;
$arr['error_code'] = 0;
echo json_encode($arr);
return;
}else
{
$arr['data'] = "No Data Found!";
$arr['error_code'] = -1;
echo json_encode($arr);
return;
}
}
?>
|