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.146.37.242
Current Path : /var/www/oasis/src/ |
| Current File : /var/www/oasis/src/studentfeesandattiashortagedata.php |
<?php
function studentfeesandattiashortagedata($aobj_context){
$collcode=$_SESSION['collcode'];
$degree_code = $aobj_context->mobj_data["deg"];
$exam = $aobj_context->mobj_data["sem"];
$regnos=$aobj_context->mobj_data["regnos"];
if (strpos($regnos, "All") !== false) {
$regno="";
}else{
$regnosArray = explode(',', $regnos);
$quotedRegnosArray = array_map(function($regno) {
return "'" . trim($regno) . "'";
}, $regnosArray);
$quotedRegnos = implode(',', $quotedRegnosArray);
$regno = "AND cs.fregno IN ($quotedRegnos)";
}
if(strtolower($exam) != 'all')
{
$examstr1 = "and fexamno = '{$exam}'";
$examstr2 = "and am.fexamno = '{$exam}'";
$examstr3 = "and a.fexamno = '{$exam}'";
$examstr4 = "and cd.fexamno = '{$exam}'";
}else{
$examstr1="";
$examstr4="";
}
$query = "select distinct fyear, fexamtype from canddet where fdegree = '{$degree_code}' {$examstr1}";
$res1 = $aobj_context->mobj_db->GetRow($query);
$fyear = $res1['fyear'];
$fexamtype = $res1['fexamtype'];
// $query1 = "SELECT ifnull(s.fname,'')as fname, ifnull(cs.fregno,'')as fregno, ifnull(cs.ftotalfee,'')as ftotalfee, IF(att.fremarks='Attendance Shortage','Attendance Shortage', '')AS attshortage,
// IF(att.fremarks='IA Shortage', 'IA Shortage', '')AS iashortage FROM candsum cs
// LEFT JOIN attshort_r att
// ON att.fregno = cs.fregno AND cs.fyear = att.fyear AND cs.fexamtype = att.fexamtype
// INNER JOIN student s ON s.fregno = cs.fregno
// WHERE cs.fdegree='{$degree_code}' AND cs.fyear='{$fyear}' AND cs.fexamtype='{$fexamtype}'";
$query1="SELECT IFNULL(s.fname,'') AS fname, cs.fyear, cs.fexamtype,
IFNULL(cs.fregno,'') AS fregno,
cs.ffreshexam,
IF(IFNULL(cs.frecptdate,'') = '','Not Applied','Applied') AS fstatus,
GROUP_CONCAT(DISTINCT CONCAT(su.fsubshort,' - ',IF(cd.fpresent = 'P','Applied','-')) ORDER BY cd.fexamno,cd.fsubcode
SEPARATOR ' | ' ) AS substatus
FROM candsum cs
INNER JOIN student s ON s.fregno = cs.fregno AND cs.fcollcode = s.fcollcode
INNER JOIN canddet cd ON cs.fregno = cd.fregno AND cs.fcollcode = cd.fcollcode
INNER JOIN (SELECT DISTINCT fsubcode,fdegree,fexamno,fsubshort
FROM subject WHERE fdegree='{$degree_code}' {$examstr1}) su ON su.fdegree = cd.fdegree AND su.fexamno = cd.fexamno
AND su.fsubcode = cd.fsubcode
WHERE cs.fdegree='{$degree_code}'
AND s.fdegree = '{$degree_code}'
AND cs.fcntrcode = '{$collcode}'
{$regno}
{$examstr4}
AND IFNULL(cd.fpassmth,'') = ''
GROUP BY cs.fregno";
$results = $aobj_context->mobj_db->GetAll($query1);
if($results){
$data['data'] = $results;
echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success");
}else{
$data['data'] = "Failed to show";
echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail");
return;
}}
function getCandidateRegNoForHallTicket($aobj_context){
$collcode=$_SESSION['collcode'];
$degree_code = $aobj_context->mobj_data["degree"];
$exam = $aobj_context->mobj_data["exam"];
$query="SELECT IFNULL(cs.fregno,'') AS fregno
FROM candsum cs
WHERE cs.fdegree = '{$degree_code}'
AND cs.fcollcode = '{$collcode}'
GROUP BY cs.fregno";
$results = $aobj_context->mobj_db->GetAll($query);
if($results){
$data['data'] = $results;
echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success");
}else{
$data['data'] = "Failed to show";
echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail");
return;
}}
function hallticketattendenceshortagedata($aobj_context){
$college_code = $_SESSION['collcode'];
$degree_code = $aobj_context->mobj_data["deg"];
$exam = $aobj_context->mobj_data["sem"];
$regnos=$aobj_context->mobj_data["regnos"];
if (strpos($regnos, "All") !== false) {
$regno="";
}else{
$regnosArray = explode(',', $regnos);
$quotedRegnosArray = array_map(function($regno) {
return "'" . trim($regno) . "'";
}, $regnosArray);
$quotedRegnos = implode(',', $quotedRegnosArray);
$regno = "AND att.fregno IN ($quotedRegnos)";
}
if(strtolower($exam) != 'all')
{
$examstr1 = "and fexamno = '{$exam}'";
$examstr2 = "and am.fexamno = '{$exam}'";
$examstr3 = "and a.fexamno = '{$exam}'";
}
$query = "select distinct fyear, fexamtype from canddet where fdegree = '{$degree_code}' {$examstr1}";
$res1 = $aobj_context->mobj_db->GetRow($query);
$fyear = $res1['fyear'];
$fexamtype = $res1['fexamtype'];
$query = "select distinct fdeggrp from degree
where fdegree = '{$degree_code}' {$examstr1}";
$res4 = $aobj_context->mobj_db->GetRow($query);
$fdeggrp = $res4['fdeggrp'];
$delqur = "delete from attshort_r where
fdegree = '{$degree_code}'
and fyear = '{$fyear}' and fexamtype = '{$fexamtype}'
{$examstr1}";
$res2 = $aobj_context->mobj_db->Execute($delqur);
if($fdeggrp == 'UGMD')
{
$qyery = "insert ignore into attshort_r(fcollcode,fdegree,fexamno,fsubcode,fregno,fremarks,ftotval,fsecval,fperval,FUPDDATE,fyear,fexamtype,fshortiaper)
select m.fcollcode,m.fdegree,m.fexamno,m.fsubcode,m.fregno,'IA Shortage', sum(m.fmarks) as secmarks,sum(s.fvalmax) as maxmarks,
((sum(m.fmarks)/sum(s.fvalmax))*100) as perval,now(),m.fyear,m.fexamtype,dg.fshortiaper
from marks m inner join candsum cs on m.fregno = cs.fregno and m.fexamno = cs.ffreshexam
and m.fyear = cs.fyear and m.fexamtype = cs.fexamtype
inner join subject s on m.fdegree = s.fdegree and m.fexamno = s.fexamno and m.fsubcode = s.fcsubcode
inner join degree dg on m.fdegree = dg.fdegree and m.fexamno = dg.fexamno
where m.fdegree ='{$degree_code}'
and m.fcollcode = '{$college_code}'
and ifnull(dg.fshortiaper,'') <> ''
{$examstr2}
group by m.fcollcode,m.fdegree,m.fexamno,s.fsubcode,m.fregno
having (perval< CAST(dg.fshortiaper as unsigned))";
$res4 = $aobj_context->mobj_db->Execute($qyery);
}else
{
$qyery = "insert ignore into attshort_r(fcollcode,fdegree,fexamno,fsubcode,fregno,fremarks,ftotval,fsecval,fperval,FUPDDATE,fyear,fexamtype,fshortiaper)
select m.fcollcode,m.fdegree,m.fexamno,m.fsubcode,m.fregno,'IA Shortage',
sum(fsmaxmarks) as totval,sum(if(ifnull(fmarks,'-1') = '-1',0,fmarks)) as secval,
(sum(if(ifnull(fmarks,'-1') = '-1',0,fmarks))/sum(fvalmax)*100) as perval,now(),m.fyear,m.fexamtype,dg.fshortiaper
from marks m
inner join candsum cs on m.fregno = cs.fregno and m.fexamno = cs.ffreshexam
and m.fyear = cs.fyear and m.fexamtype = cs.fexamtype
inner join subject s on m.fdegree = s.fdegree and m.fexamno = s.fexamno and m.fsubcode = s.fcsubcode
inner join degree dg on m.fdegree = dg.fdegree and m.fexamno = dg.fexamno
where s.fintass = 'T' and m.fdegree like '{$degree_code}'
and ifnull(dg.fshortiaper,'') <> ''
{$examstr2}
and m.fcollcode = '{$college_code}'
and s.fretain = 'T'
group by m.fcollcode,m.fdegree,m.fexamno,m.fsubcode,m.fregno
having (perval< CAST(dg.fshortiaper as unsigned))";
//<ifnull(dg.fshortiaper,'0')
// echo $qyery;
// die();
$res4 = $aobj_context->mobj_db->Execute($qyery);
}
$qyery = "insert ignore into attshort_r(fcollcode,fdegree,fexamno,fsubcode,fregno,fremarks,fperval,FUPDDATE,fyear,fexamtype)
select distinct a.fcollcode,a.fdegree,a.fexamno,s.fcsubcode,a.fregno,'Attendance Shortage',ifnull(a.fper,0) as perval,now(),a.fyear,a.fexamtype
from attend a inner join candsum cs on a.fregno = cs.fregno and a.fexamno = cs.ffreshexam
and a.fyear = cs.fyear and a.fexamtype = cs.fexamtype
inner join degree dg on a.fdegree = dg.fdegree and a.fexamno = dg.fexamno
inner join subject s on a.fdegree = s.fdegree and a.fexamno = s.fexamno
and left(a.fsubcode,4) = s.fsubcode
where ifnull(fper,0) < ifnull(dg.fshortattper,0)
and a.fdegree = '{$degree_code}'
and ifnull(dg.fshortattper,'') <> ''
and s.fretain <> 'T'
{$examstr3}
and a.fcollcode like '{$college_code}'
and ifnull(a.fentdate,'')<>''";
$res5 = $aobj_context->mobj_db->Execute($qyery);
$query="SELECT att.fregno as regno, st.fname as fname,
concat(su.fsubname,' - ',su.fsubshort) as subjectcode,
att.FPERVAL as attper, concat(FSECVAL,'/',FTOTVAL,', Per.: ',att.FPERVAL) as iaper,
FREMARKS
FROM attshort_r att
INNER JOIN student st on att.fregno = st.fregno
AND att.fdegree = st.fdegree
INNER JOIN subject su on att.fdegree = su.fdegree
AND att.FEXAMNO = su.FEXAMNO
AND att.fsubcode = su.fcsubcode
WHERE att.fdegree='{$degree_code}'
and att.fyear = '{$fyear}'
and att.fexamtype = '{$fexamtype}'
{$regno}
order by att.fregno,att.fsubcode";
$results = $aobj_context->mobj_db->GetAll($query);
if($results){
$data['data'] = $results;
echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success");
}else{
$data['data'] = "Failed to show";
echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail");
return;
}
}
?>
|