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.119.132.80
<?php
function getAllCollDetial($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$fcollcode = $aobj_context->mobj_data["fcollcode"];
$usertype = $aobj_context->mobj_data["usertype"];
$date = date("Y/m/d");
$con = "";
// var_dump(strpos(" ".$usertype, "308"));die();
if($univcode == '021' && $usertype !== "308"){
if($fcollcode != ""){
$con = "and fcollcode = '{$fcollcode}'";
$con1 = "and std.fcollcode = '{$fcollcode}'";
$con2 = "and cs.fcollcode = '{$fcollcode}'";
$con3 = "and m.fcollcode = '{$fcollcode}'";
}
}
$query = "select count(distinct d.fdegree) as degree from degree d
left join student std on d.fdegree = std.fdegree
where ifnull(d.fdeleted,'') <> 'T' $con1";
$result = $aobj_context->pobj_db->GetRow($query);
$query1 = "select count(distinct fcollcode) as coll from college
where ifnull(fdeleted,'') <> 'T' $con";
$result1 = $aobj_context->pobj_db->GetRow($query1);
$query2 = "select count(distinct fteachcode) as teach from masteach
where ifnull(fdeleted,'') <> 'T' $con";
//var_dump($query2);die();
$result2 = $aobj_context->pobj_db->GetRow($query2);
$query3 = "select count(s.fregno) as std from student s, degree d
where s.fdegree = d.fdegree and trim(s.ftotpass) <> trim(d.fleastexam)
and ifnull(d.fleastexam,'') <> '' and ifnull(d.fnextexam,'') = ''
and ifnull(s.fpdcnumber,'') = '' and ifnull(s.fdcnumber,'') = ''
and ifnull(s.fdeleted,'') <> 'T' $con";
$result3 = $aobj_context->pobj_db->GetRow($query3);
if($univcode === "021"){
$cond = "count(distinct fsubname)as subj";
}else{
$cond = "count(distinct fsubcode) as subj";
}
$query4 = "select {$cond} from subject s
left join student std on s.fdegree = std.fdegree
where ifnull (s.fdeleted,'') <> 'T' $con1";
$result4 = $aobj_context->pobj_db->GetRow($query4);
$query5 = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate, count(cs.fregno) as stdtotal,
sum(if(ifnull(frecptdate,'') = '',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp and d.fexamno = 'A'
inner join candsum cs on dg.fyear =cs.fyear and dg.fexamtype = cs.fexamtype
and d.fdegree = cs.fdegree
where ifnull(cs.fdeleted,'') <> 'T' $con2 group by dg.fdeggrp";
$result5 = $aobj_context->pobj_db->GetAll($query5);
$query6 = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate,
count(m.fregno) as stdtotal,
sum(if(ifnull(fmarks,'-1') = '-1',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp
inner join marks m on dg.fyear =m.fyear and dg.fexamtype = m.fexamtype
and d.fdegree = m.fdegree and m.fexamno = d.fexamno
and m.fyear = dg.fyear and m.fexamtype = dg.fexamtype
where ifnull(m.fdeleted,'') <> 'T' $con3
group by dg.fdeggrp";
$result6 = $aobj_context->pobj_db->GetAll($query6);
$query7 = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate,
count(m.fregno) as stdtotal,
sum(if(ifnull(fmarks11,'-1') = '-1',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp
inner join marks_pr m on dg.fyear =m.fyear and dg.fexamtype = m.fexamtype
and d.fdegree = m.fdegree and m.fexamno = d.fexamno
and m.fyear = dg.fyear and m.fexamtype = dg.fexamtype
where ifnull(m.fdeleted,'') <> 'T' $con3
group by dg.fdeggrp";
$result7 = $aobj_context->pobj_db->GetAll($query7);
$query8 = "select distinct ifnull(cs.FCNTRCODE,'') as fcntrcode,
concat(ifnull(cl.FCOLLNAME,''),', ',cl.ftown) as fcollname,
date_format(ifnull(s.fdoe,''),'%d/%m/%Y') as fdoe,r.FDESCPN,
count(cd.fregno) as cnt
from canddet cd
inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode
inner join candsum cs on cs.fdegree = cd.fdegree
and cd.fcollcode = cs.fcollcode
and cd.fregno = cs.fregno
inner join college cl on cl.FCOLLCODE = cs.FCNTRCODE
inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
inner join deggrp dg on d.fdeggrp = dg.fdeggrp
inner join reason r on s.fsession = r.FREASONCD
where cd.fpresent = 'P'
and s.fdoe = '{$date}'
and ifnull(cs.frecptdate,'') <> '' $con2
group by cs.FCNTRCODE,s.fsession
order by cs.FCNTRCODE,s.fsession";
// and cd.fyear = dg.fyear
// and cd.fexamtype = dg.fexamtype
// and cs.fyear = dg.fyear
// and cs.fexamtype = dg.fexamtype
$result8 = $aobj_context->pobj_db->GetAll($query8);
$query9 = "select distinct ifnull(s.fqpcode,'') as fqpcode,ifnull(s.fsubname,'') as fsubname,
date_format(ifnull(s.fdoe,''),'%d/%m/%Y') as fdoe,r.FDESCPN,
count(cd.fregno) as cnt
from canddet cd
inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode
inner join candsum cs on cs.fdegree = cd.fdegree
and cd.fcollcode = cs.fcollcode
and cd.fregno = cs.fregno
inner join college cl on cl.FCOLLCODE = cs.FCNTRCODE
inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
inner join deggrp dg on d.fdeggrp = dg.fdeggrp
inner join reason r on s.fsession = r.FREASONCD
where cd.fpresent = 'P'
and s.fdoe = '{$date}'
and ifnull(cs.frecptdate,'') <> '' $con2
group by s.fqpcode,s.fsession
order by s.fqpcode,s.fsession";
// var_dump($query9);die();
// and cd.fyear = dg.fyear
// and cd.fexamtype = dg.fexamtype
// and cs.fyear = dg.fyear
// and cs.fexamtype = dg.fexamtype
$result9 = $aobj_context->pobj_db->GetAll($query9);
if(count($result) > 0)
{
$arr['alldeg'] = $result;
$arr['allcoll'] = $result1;
$arr['alltech'] = $result2;
$arr['stdcount'] = $result3;
$arr['subjcount'] = $result4;
$arr['examapp'] = $result5;
$arr['iamarks'] = $result6;
$arr['pramarks'] = $result7;
$arr['exmxentwise'] = $result8;
$arr['qpcodewise'] = $result9;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getAllDegree($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select count(distinct fdegree) as degree from degree
where ifnull(fdeleted,'') <> 'T'";
$result = $aobj_context->pobj_db->GetRow($query);
// var_dump($result);
// die();
if(count($result) > 0)
{
// $arr['states'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getAllDegreeDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$degree = $aobj_context->mobj_data["degree"];
if($degree == 'All'){
$query = "SELECT fdegree, fdescpn, GROUP_CONCAT(ifnull(fexamno,''),' - ' ,ifnull(fexamname,''),'- ',ifnull(ftotsub,'')) as fexamsub ,fexamdate, fdeggrp, ffaculty
FROM degree WHERE IFNULL(fdeleted,'') <> 'T'
group by fdegree";
}else{
$query = "SELECT fdegree, fdescpn, GROUP_CONCAT(ifnull(fexamno,''),' - ' ,ifnull(fexamname,''),'- ',ifnull(ftotsub,'')) as fexamsub ,fexamdate, fdeggrp, ffaculty
FROM degree where fdegree = '{$degree}' and IFNULL(fdeleted,'') <> 'T'
group by fdegree ";
}
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getAllCollCount($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select count(distinct fcollcode) as coll from college
where ifnull(fdeleted,'') <> 'T' and ifnull(fupdated,'F') = 'T'";
$result = $aobj_context->pobj_db->GetRow($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getAllCollDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select ifnull(fcollcode,'') as fcode, ifnull(fcollname,'') as fcoll,
ifnull(ftown,'')as town from college order by fcode";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getDegreeNam($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select fdegree, fdescpn,fexamno, fexamname, ftotsub from degree ";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
// $arr['states'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getSelDegrSem($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$degree = $aobj_context->mobj_data["degr"];
$query = "select fexamno,fexamname from degree where fdegree = '{$degree}'";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getSubj($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
if($univcode === "021"){
$cond = "count(distinct fsubname)as subj";
}else{
$cond = "count(distinct fsubcode) as subj";
}
$query = "select {$cond} from subject
where ifnull(fdeleted,'') <> 'T'";
$result = $aobj_context->pobj_db->GetRow($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getTeachCount($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select count(distinct fteachcode) as teach from masteach
where ifnull(fdeleted,'') <> 'T'";
$result = $aobj_context->pobj_db->GetRow($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getStdCount($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select count(distinct s.fregno) as std
from student s
inner join degree d on s.fdegree = d.fdegree and d.fexamno = 'A'
inner join college c on c.fcollcode = s.fcollcode
left join logisys3_comexam.masuser m on s.fregno = m.fregno
and m.funivcode = '{$univcode}' and m.factive = 'T'
where ifnull(s.fdeleted,'') <> 'T';";
$result = $aobj_context->pobj_db->GetRow($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No States Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getSelSem($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$degree = $aobj_context->mobj_data["degree"];
$sem = $aobj_context->mobj_data["sem"];
$query = "select fsubcode, fsubname, fvalmax, ifnull(fqpcode,'') as qpcode
from subject where fdegree = '{$degree}' and
fexamno = '{$sem}' group by fsubcode";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function viewStdDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$regno = $aobj_context->mobj_data["regno"];
$query = "select s.fdegree,s.fname, s.fcollcode, c.fcollname,c.ftown, d.fdescpn from student s
inner join college c on s.fcollcode = c.fcollcode inner join degree d on s.fdegree = d.fdegree
where s.fregno ='{$regno}' group by s.fdegree,s.fcollcode,s.fregno";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getComStdDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$regno = $aobj_context->mobj_data["regno"];
$query = "select s.fdegree,s.fname, s.fcollcode, c.fcollname,c.ftown, d.fdescpn, fstudid, ifnull(fmarksa,'') as fst,
ifnull(fmarksb,'') as sec,ifnull(fmarksc,'') as third,ifnull(fmarksd,'') as four, ifnull(fmarkse,'') as five,
ifnull(fmarksf,'') as six, ifnull(fmarksg,'') as sevn,ifnull(fmarksh,'') as eigh,ifnull(fmarksi,'') as nine,ifnull(fmarksj,'') as ten,
ifnull(fmaxmarksa,'') as mfst,
ifnull(fmaxmarksb,'') as msec,ifnull(fmaxmarksc,'') as mthird,ifnull(fmaxmarksd,'') as mfour, ifnull(fmaxmarkse,'') as mfive,
ifnull(fmaxmarksf,'') as msix, ifnull(fmaxmarksg,'') as msevn,ifnull(fmaxmarksh,'') as meigh,ifnull(fmaxmarksi,'') as mnine,
ifnull(fmaxmarksj,'') as mten,
ifnull(ffexama,'') as efst,
ifnull(ffexamb,'') as esec,ifnull(ffexamc,'') as ethird,ifnull(ffexamd,'') as efour, ifnull(ffexame,'') as efive,
ifnull(ffexamf,'') as esix, ifnull(ffexamg,'') as esevn,ifnull(ffexamh,'') as eeigh,ifnull(ffexami,'') as enine,
ifnull(ffexamj,'') as eten,
ifnull(fcra,'') as cfst,
ifnull(fcrb,'') as csec,ifnull(fcrc,'') as cthird,ifnull(fcrd,'') as cfour, ifnull(fcre,'') as cfive,
ifnull(fcrf,'') as csix, ifnull(fcrg,'') as csevn,ifnull(fcrh,'') as ceigh,ifnull(fcri,'') as cnine,
ifnull(fcrj,'') as cten,
ifnull(fsgpaa,'') as sfst,
ifnull(fsgpab,'') as ssec,ifnull(fsgpac,'') as sthird,ifnull(fsgpad,'') as sfour, ifnull(fsgpae,'') as sfive,
ifnull(fsgpaf,'') as ssix, ifnull(fsgpae,'') as ssevn,ifnull(fsgpah,'') as seigh,ifnull(fsgpai,'') as snine,
ifnull(fsgpaj,'') as sten,
ifnull(fgpa,'') as gfst,
ifnull(fgpb,'') as gsec,ifnull(fgpc,'') as gthird,ifnull(fgpd,'') as gfour, ifnull(fgpe,'') as gfive,
ifnull(fgpf,'') as gsix, ifnull(fgpe,'') as gsevn,ifnull(fgph,'') as geigh,ifnull(fgpi,'') as gnine,
ifnull(fgpj,'') as gten,ftotpass
from student s
inner join college c on s.fcollcode = c.fcollcode inner join degree d on s.fdegree = d.fdegree
where fregno ='{$regno}' group by fregno";
$result = $aobj_context->pobj_db->GetRow($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function examAppl($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate, count(c.fregno) as stdtotal,
sum(if(ifnull(frecptdate,'') = '',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp and d.fexamno = 'A'
inner join candsum c on dg.fyear =c.fyear and dg.fexamtype = c.fexamtype
and d.fdegree = c.fdegree
where ifnull(c.fdeleted,'') <> 'T' group by dg.fdeggrp";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function iaMarks($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate,
count(m.fregno) as stdtotal,
sum(if(ifnull(fmarks,'-1') = '-1',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp
inner join marks m on dg.fyear =m.fyear and dg.fexamtype = m.fexamtype
and d.fdegree = m.fdegree and m.fexamno = d.fexamno
and m.fyear = dg.fyear and m.fexamtype = dg.fexamtype
where ifnull(m.fdeleted,'') <> 'T'
group by dg.fdeggrp";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function praMarks($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select distinct dg.fdeggrp,dg.fdescpn,dg.fexamdate,
count(m.fregno) as stdtotal,
sum(if(ifnull(fmarks11,'-1') = '-1',0,1)) as total
from deggrp dg
inner join degree d on dg.fdeggrp = d.fdeggrp
inner join marks_pr m on dg.fyear =m.fyear and dg.fexamtype = m.fexamtype
and d.fdegree = m.fdegree and m.fexamno = d.fexamno
and m.fyear = dg.fyear and m.fexamtype = dg.fexamtype
where ifnull(m.fdeleted,'') <> 'T'
group by dg.fdeggrp";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function currActive($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$fcollcode = $aobj_context->mobj_data["fcollcode"];
$arr = [];
$loopdata = ["concat('IA Marks Enabled. Last Date: ',c.fiato)", "concat('PR Marks Enabled. Last Date: ',c.fprto)","concat('Admission Enabled. Last Date: ',c.fadmto)","concat('Hall Ticket Enabled. Last Date: ',c.fhtto)","concat('Attendance Enabled. Last Date: ',c.fattto)","concat('Subject Enabled. Last Date: ',c.fsubcrto)","concat('Room Alert Enabled. Last Date: ',c.frato)"];
$con = ["fiafrom and fiato", "fprfrom and fprto","fadmfrom and fadmto","fhtfrom and fhtto","fattfrom and fattto","fsubcrfrom and fsubcrto","frafrom and frato"];
$cond = "";
if($fcollcode != null){
$cond = "and c.fcollcode = '{$fcollcode}'";
}
for($i=0; $i<count($loopdata); $i++){
$query = "select dg.fdeggrp,dg.fdescpn,{$loopdata[$i]} as IA
from collexam c inner join degree d on c.fdegree = d.fdegree and c.fexamno = d.fexamno
inner join deggrp dg on d.fdeggrp = dg.fdeggrp
where date_format(now(),'%Y-%m-%d') between {$con[$i]} $cond
group by dg.fdeggrp";
$result = $aobj_context->pobj_db->GetAll($query);
foreach($result as $value){
array_push($arr,$value);
}
}
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No Activity';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function examCentreWise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$date = date("Y/m/d");
$query = "select distinct ifnull(cs.FCNTRCODE,'') as fcntrcode,
concat(ifnull(cl.FCOLLNAME,''),', ',cl.ftown) as fcollname,
date_format(ifnull(s.fdoe,''),'%d/%m/%Y') as fdoe,r.FDESCPN,
count(cd.fregno) as cnt
from canddet cd
inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode
inner join candsum cs on cs.fdegree = cd.fdegree
and cd.fcollcode = cs.fcollcode
and cd.fregno = cs.fregno
inner join college cl on cl.FCOLLCODE = cs.FCNTRCODE
inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
inner join deggrp dg on d.fdeggrp = dg.fdeggrp
inner join reason r on s.fsession = r.FREASONCD
where cd.fpresent = 'P'
and s.fdoe = '{$date}'
and ifnull(cs.frecptdate,'') <> ''
group by cs.FCNTRCODE,s.fsession
order by cs.FCNTRCODE,s.fsession";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Activity';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function qpCodeWise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$date = date("Y/m/d");
$query = "select distinct ifnull(s.fqpcode,'') as fqpcode,ifnull(s.fsubname,'') as fsubname,
date_format(ifnull(s.fdoe,''),'%d/%m/%Y') as fdoe,r.FDESCPN,
count(cd.fregno) as cnt
from canddet cd
inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode
inner join candsum cs on cs.fdegree = cd.fdegree
and cd.fcollcode = cs.fcollcode
and cd.fregno = cs.fregno
inner join college cl on cl.FCOLLCODE = cs.FCNTRCODE
inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
inner join deggrp dg on d.fdeggrp = dg.fdeggrp
inner join reason r on s.fsession = r.FREASONCD
where cd.fpresent = 'P'
and s.fdoe = '{$date}'
and ifnull(cs.frecptdate,'') <> ''
group by s.fqpcode,s.fsession
order by s.fqpcode,s.fsession";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}
else
{
$arr['msg'] = 'No Activity';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getStudHistory($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$fcollcode = $aobj_context->mobj_data["fcollcode"];
$usertype = $aobj_context->mobj_data["usertype"];
$con = "";
if($univcode == '021' && $usertype !== "308"){
if($fcollcode != ""){
$con = "and fcollcode = '{$fcollcode}'";
}
}
$queryHistory = "select (select count(*) from student where ifnull(fdcnumber,'') <> '') +
(select count(*) from studhist where ifnull(fdcnumber,'') <> '' $con ) as fhistorycount";
$resultHistory = $aobj_context->pobj_db->GetRow($queryHistory);
$queryCourse = "select (select count(s.fregno) as fcnt from student s, degree d
where s.fdegree = d.fdegree and trim(s.ftotpass) = trim(d.fleastexam)
and ifnull(d.fleastexam,'') <> '' and ifnull(d.fnextexam,'') = ''
and ifnull(s.fpdcnumber,'') = '' and ifnull(s.fdcnumber,'') = ''
and ifnull(s.fdeleted,'') <> 'T' $con
and s.fregno not in(select fregno from studhist))
+
(select count(s.fregno) as fcnt from studhist s, degree d
where s.fdegree = d.fdegree and trim(s.ftotpass) = trim(d.fleastexam)
and ifnull(d.fleastexam,'') <> '' and ifnull(d.fnextexam,'') = ''
and ifnull(s.fpdcnumber,'') = '' and ifnull(s.fdcnumber,'') = ''
and ifnull(s.fdeleted,'') <> 'T' $con) as fcccnt ";
$resuCourse = $aobj_context->pobj_db->GetRow($queryCourse);
$queryGrad = "select (select count(s.fregno) as fcnt from student s, degree d
where s.fdegree = d.fdegree and trim(s.ftotpass) = trim(d.fleastexam)
and ifnull(d.fleastexam,'') <> '' and ifnull(d.fnextexam,'') = ''
and ifnull(s.fpdcnumber,'') <> '' and ifnull(s.fdcnumber,'') = ''
and ifnull(s.fdeleted,'') <> 'T' $con
and s.fregno not in(select fregno from studhist))
+
(select count(s.fregno) as fcnt from studhist s, degree d
where s.fdegree = d.fdegree and trim(s.ftotpass) = trim(d.fleastexam)
and ifnull(d.fleastexam,'') <> '' and ifnull(d.fnextexam,'') = ''
and ifnull(s.fpdcnumber,'') <> '' and ifnull(s.fdcnumber,'') = ''
and ifnull(s.fdeleted,'') <> 'T' $con) as fcccnt";
$resuGrad = $aobj_context->pobj_db->GetRow($queryGrad);
if(true)
{
// $arr['deleted'] = $resultDelted;
$arr['history'] = $resultHistory;
$arr['intern'] = $resuCourse;
$arr['graduands'] = $resuGrad;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function getStudDelHistory($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$fcollcode = $aobj_context->mobj_data["fcollcode"];
$usertype = $aobj_context->mobj_data["usertype"];
$con = "";
if($univcode == '021' && $usertype !== "308"){
if($fcollcode != ""){
$con = "and fcollcode = '{$fcollcode}'";
}
}
$queryDeleted = "select (select count(*)as fdeletedcount from student where fdeleted = 'T' $con)
+ (select count(*)as fdeletedcount from studhist where fdeleted = 'T' $con) as fdeletedcount";
$resultDelted = $aobj_context->pobj_db->GetRow($queryDeleted);
if(true)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($resultDelted,0,"success");
}
else
{
$arr['msg'] = 'No Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|