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.144.1.100
<?php
include("database.php");
include("commandb.php");
//session_start();
$UNIVCODE = $_SESSION['UNIVCODE'];
/*$query = "INSERT INTO menulog(funivcode,fdate,fthtimetable)
VALUES('{$UNIVCODE}',date_format(now(),'%Y-%m-%d'),1)
ON DUPLICATE KEY UPDATE fthtimetable = if(ifnull(fthtimetable,'') = '', 1,fthtimetable+1)";
$results = mysqli_query($conndb,$query);
$strUserLogQuery = "insert into userlog
(funivcode, fregno, fmobileno, fipadd, FREASONCODE, FDESCPN)
values ('{$_SESSION['UNIVCODE']}', '{$_SESSION['REGNO']}',
'{$_SESSION['MOBILE']}', '{$_SERVER['REMOTE_ADDR']}',
'TTMN', 'TTMN - {$_SESSION['REGNO']} Viewed Theory Time Table')";
$result = mysqli_query($conndb,$strUserLogQuery);
*/
$regno = $_SESSION['REGNO'];
$screen = $_POST['screen'];
$query = "select cd.fregno, dg.fexamname, cd.fexamno, st.fname,
concat(cd.fdegree,' - ',dg.fdescpn) as fdegree, cd.fexamtype,
concat(dg.fexamdate, ' Examination') as fexamdate, cd.fyear,
su.fqpcode, su.fsubname, ifnull(an.fansbookno,'') as fansbookno,
concat(date_format(su.fdoe,'%d/%m/%Y'),' [',dayname(su.fdoe),']') as fdoe, re.fdescpn,
concat('[', cs.fcntrcode, '] ', cl.fcollname, ', ' , cl.ftown) as centre
from canddet cd
inner join subject su
on cd.fdegree = su.fdegree
and cd.fexamno = su.fexamno
and cd.fsubcode = su.fsubcode
and ifnull(su.fqpcode,'') <> ''
inner join degree dg on
cd.fdegree = dg.fdegree
and cd.fexamno = dg.fexamno
inner join student st on
cd.fcollcode = st.fcollcode
and cd.fdegree = st.fdegree
and cd.fregno =st.fregno
left join reason re
on su.fsession = re.freasoncd
inner join candsum cs
on cd.fdegree = cs.fdegree
and cd.fcollcode = cs.fcollcode
and cd.fregno = cs.fregno
and cs.fyear = dg.fmeyear
and cs.fexamtype = dg.fmeexamtyp
inner join college cl
on cs.fcntrcode = cl.fcollcode
left join ansstud an on
cd.fdegree = an.fdegree and cd.fregno = an.fregno
and su.fqpcode = an.fqpcode and cd.fyear = an.fyear and cd.fexamtype = an.fexamtype
where cd.fregno = '{$regno}'
and ifnull(cd.fpassmth,'') = ''
and ifnull(cd.fpresent,'') = 'P'
and su.ftheory = 'T'";
//var_dump($query); and ifnull(su.fdoe,'0000-00-00') <> '0000-00-00'
$result = mysqli_query($conn,$query);
//var_dump(count($result));
$count = @mysqli_num_rows($result);
if($count > 0)
{
$i = 0;
while($row = mysqli_fetch_assoc($result))
{
$fname = $row['fname'];
$fdegree = $row['fdegree'];
$fexamdate = $row['fexamdate'];
$fregno = $row['fregno'];
$strCentre = $row['centre'];
$rgExamno[$i] = $row['fexamno'];
$rgExamname[$i] = $row['fexamname'];
$fqpcode[$i] = $row['fqpcode'];
$fansbookno[$i] = $row['fansbookno'];
$fdoe[$i] = $row['fdoe'];
$fdescpn[$i] = $row['fdescpn'];
$fsubname[$i] = $row['fsubname'];
$i++;
}
$app['error_code'] = 1;
$app['fqpcode'] = $fqpcode;
$app['fansbookno'] = $fansbookno;
$app['fsubname'] = $fsubname;
$app['fdescpn'] = $fdescpn;
$app['fdoe'] = $fdoe;
$app['fname'] = $fname;
$app['fdegree'] = $fdegree;
$app['strCentre'] = $strCentre;
$app['fexamname'] = $rgExamname;
$app['rgExamno'] = $rgExamno;
$app['fexamdate'] = $fexamdate;
$app['fregno'] = $fregno;
mysqli_close($conn);
mysqli_close($conndb);
echo json_encode($app);
}else
{
$app['data'] = "Exam Time Table Not Available";
$app['error_code'] = 0;
mysqli_close($conn);
mysqli_close($conndb);
echo json_encode($app);
}
?>
|