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.117.254.202
<?php
function getDegreeDaywise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query = "select distinct ifnull(a.fdegree,'') as fdegree ,ifnull(d.fdescpn,'') as fdescpn
from attend a
inner join degree d on a.fdegree = d.fdegree
where a.fcollcode='{$_SESSION['collcode']}'";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function getExamnoDaywise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$degree = $aobj_context->mobj_data["degree"];
$query = "select distinct ifnull(a.fexamno,'') as fexamno,ifnull(d.fexamname,'') as fexamname from attend a
inner join degree d on a.fexamno = d.fexamno
where a.fdegree = '{$degree}' and a.fcollcode='{$_SESSION['collcode']}'
order by a.fexamno";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function getSubjectDaywise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$degree = $aobj_context->mobj_data["degree"];
$examno = $aobj_context->mobj_data["examno"];
$query = "select distinct ifnull(a.fsubcode,'') as fsubcode,ifnull(s.fsubname,'') as fsubname
from attend a
inner join
subject s on a.fsubcode = s.fcsubcode and a.fexamno = s.fexamno and a.fdegree = s.fdegree
where a.fdegree = '{$degree}' and a.fexamno = '{$examno}' and a.fcollcode='{$_SESSION['collcode']}'";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function viewattendanceentry($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$classname = $aobj_context->mobj_data["classname"];
$fclassid = $aobj_context->mobj_data["fclassid"];
$period = $aobj_context->mobj_data["period"];
$noofclass = $aobj_context->mobj_data["noofclass"];
$date = $aobj_context->mobj_data["date"];
$collcode = $_SESSION['collcode'];
$fsort = $aobj_context->mobj_data["fsort"];
$query = "select * from attclass where fclassid = '{$fclassid}'
and ifnull(fblock,'') = 'T'";
$res1 = $aobj_context->mobj_db->GetRow($query);
if($res1)
{
$data="Attendace Entry Bloked Contact Admin. Reason: ".$res1['fblockremarks'];
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}else
{
}
if($fsort == "fname"){
$cond = "s.fname";
}elseif($fsort == "fregno"){
$cond = "a.fregno";
}
$query = "select ifnull(a.FDEGREE,'') as fdegree,
ifnull(a.FEXAMNO,'') as fexamno,ifnull(a.fregno,'') as fregno,ifnull(s.FNAME,'') as fname, ifnull(ad.FPRESENT,'') as fpresent
from attendsum a inner join student s on s.FREGNO = a.FREGNO
and s.fcollcode = a.fcollcode and s.fdegree = a.fdegree
left join attend_det ad on ad.fregno = a.fregno and ad.FSUBCODE = a.FSUBCODE
and ad.FCLASSID = a.FCLASSID and ad.fdegree = a.fdegree
and ad.fexamno = a.fexamno
and ad.fcollcode = a.fcollcode and ad.FDATE = '{$date}'
and ad.FPERIOD = '{$period}' and ad.FNOCLASS = '{$noofclass}' and ad.FCOLLCODE = '{$collcode}'
where a.fclassid = '{$fclassid}'
group by fregno
order by $cond";
// var_dump($query);die();
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function saveattendanceentry($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
include("error_log.php");
$classname = $aobj_context->mobj_data["classname"];
$fclassid = $aobj_context->mobj_data["fclassid"];
$period = $aobj_context->mobj_data["period"];
$syllabus = $aobj_context->mobj_data["syllabus"];
$noofclass = $aobj_context->mobj_data["noofclass"];
$date = $aobj_context->mobj_data["date"];
$collcode = $_SESSION['collcode'];
$data = $aobj_context->mobj_data["data"];
$array = json_decode($data,true);
// var_dump($array);die();
$univcode = $_SESSION['FUNIVCODE'];
$mob = $_SESSION['FMOBILE'];
$usr = $_SESSION['usr'];
$college_code = $_SESSION['collcode'];
$query = "select fblcok, ifnull(fblockremarks, '')as fremarks from attclass
where fteachcode='{$usr}' and fcollcode='{$collcode}' and fclassid='{$fclassid}'";
$blkres = $aobj_context->mobj_db->GetRow($query);
if($blkres['fblcok']=='T'){
if($blkres['fremarks'] == ''||$blkres['fremarks']=='null'){
$arr['msg'] = "Blocked";
}else{
$arr['msg'] = $blkres['fremarks'];
}
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
foreach($array as $key => $value){
$reg = $value['regno'];
$str = "ATTENDANCE ENTRY DAYWISE: USER : $usr, COLLCODE: $collcode, REGNO : $reg, CLASSID : $fclassid, DATE : $date";
$remark = $str;
$enttype = "ATTCD";
$res = error_logs($aobj_context,$univcode,$remark,$college_code,$enttype,$usr,$mob);
$query = "INSERT INTO attend_det (FCOLLCODE, FDEGREE, FEXAMNO, FSUBCODE, FREGNO, FDATE, FPERIOD, FNOCLASS, FPRESENT,FCLASSID,FUPDUSER,FCREATEDATE,fsyllabus,FTEACHCODE,FSECTION)
select s.fcollcode,s.fdegree,a.fexamno,a.fsubcode,s.fregno,'{$date}','{$period}','{$noofclass}','{$value['present']}','{$fclassid}','{$usr}',NOW(),'{$syllabus}',a.fteachcode,a.FSECTION
from student s
inner join attendsum a on s.fcollcode = a.fcollcode
and s.fdegree = a.fdegree
where a.fclassid = '{$fclassid}'
and a.fclassid = '{$fclassid}'
and s.fregno = '{$value['regno']}'
on DUPLICATE KEY UPDATE FPRESENT = '{$value['present']}', FNOCLASS='{$noofclass}', FUPDDATE = NOW()";
$lobj_get_data = $aobj_context->mobj_db->Execute($query);
}
if($lobj_get_data)
{
$arr['msg'] = "Saved Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr['msg']="Failed to Save";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function viewDeleteAddStudDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$teachfrom = $aobj_context->mobj_data["teachfrom"];
$teachto = $aobj_context->mobj_data["teachto"];
$usertype = $_SESSION['user_type'];
$usr = $_SESSION['usr'];
$college_code = $_SESSION['collcode'];
$cnd = '';
if(strtolower($usertype) == 'user')
{
$cnd = "and at.fteachcode = '{$usr}'";
}
$query = "select concat(at.fteachcode,' - ',m.FTEACHNAME) as fteach,
ifnull(ad.fclassid,'') as fclassid,ifnull(at.fclassname,'') as fclassname,ifnull(at.fteachcode,'') as fteachcode,
ifnull(m.FTEACHNAME,'') as fteachname,
ifnull(ad.fperiod,'') as fperiod,ifnull(ad.fnoclass,'') as fnoclass,date_format(ifnull(fdate,''),'%d/%m/%Y') as fdate,
sum(if(ad.fpresent = 'P','1',0)) as pcnt,sum(if(ad.fpresent = 'A','1',0)) as acnt
from attend_det ad
inner join attclass at on at.fclassid = ad.fclassid
inner join masteach m on m.FTEACHCODE = at.fteachcode
where ad.fcollcode = '{$college_code}'
$cnd
and at.fteachcode between '{$teachfrom}' and '{$teachto}'
group by ad.FDATE,ad.fclassid,ad.FPERIOD,ad.FNOCLASS
order by at.fteachcode,ad.FDATE";
// var_dump($query);
// die();
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function deleteAddstudentry($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fclassid = $aobj_context->mobj_data["fclassid"];
$fperiod = $aobj_context->mobj_data["fperiod"];
$fnoclass = $aobj_context->mobj_data["fnoclass"];
$fdate = $aobj_context->mobj_data["fdate"];
$query = "delete from attend_det
where FPERIOD = '{$fperiod}' and FNOCLASS = '{$fnoclass}'
and FCLASSID = '{$fclassid}' and fdate = date_format(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d')
and fcollcode='{$_SESSION['collcode']}'";
$lobj_get_data = $aobj_context->mobj_db->Execute($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
function modifyAddstudentry($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fteachcode = $aobj_context->mobj_data["fteachcode"];
$fclassid = $aobj_context->mobj_data["fclassid"];
$fperiod = $aobj_context->mobj_data["fperiod"];
$fnoclass = $aobj_context->mobj_data["fnoclass"];
$fdate = $aobj_context->mobj_data["fdate"];
$collcode = $_SESSION['collcode'];
$query = "select ifnull(a.FDEGREE,'') as fdegree,
ifnull(a.FEXAMNO,'') as fexamno,ifnull(a.fregno,'') as fregno,
ifnull(s.FNAME,'') as fname, ifnull(ad.FPRESENT,'') as fpresent,
ifnull(ad.fsyllabus,'') as fsyllabus
from attendsum a inner join student s on s.FREGNO = a.FREGNO
and s.fcollcode = a.fcollcode and s.fdegree = a.fdegree
left join attend_det ad on ad.fregno = a.fregno and ad.FSUBCODE = a.FSUBCODE
and ad.FCLASSID = a.FCLASSID and ad.fdegree = a.fdegree
and ad.fexamno = a.fexamno
and ad.fcollcode = a.fcollcode and ad.FDATE = date_format(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d')
and ad.FPERIOD = '{$fperiod}' and ad.FNOCLASS = '{$fnoclass}' and ad.FCOLLCODE = '{$collcode}'
where a.fclassid = '{$fclassid}'
order by a.fregno,s.fname";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if($lobj_get_data)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success");
return;
}
else
{
$data="not found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
}
?>
|