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.231.160
<?php
function atttechblp($aobj_context){
session_start();
$collcode=$_SESSION['collcode'];
$semarry = ["A","C"];
foreach( $semarry as $val)
{
$query = "select distinct c.fdegree,c.fcollcode,c.fsem,c.fsection,
c.fperiod,c.fnoclass,c.fsubcode,c.fteachcode as cteachcode,
a.fteachcode,a.fclassid,DAYNAME(DATE_SUB(now(), INTERVAL 2 DAY)) as fday,
date_format(DATE_SUB(now(), INTERVAL 2 DAY),'%Y-%m-%d') as fdate
From calsstimetable c left join attend_det a on c.fcollcode = a.fcollcode
and c.fdegree = a.fdegree and c.fsem = a.fexamno
and c.fsection = a.fsection and c.fsubcode = left(a.fsubcode,4)
and a.FDATE = date_format(DATE_SUB(now(), INTERVAL 2 DAY),'%Y-%m-%d')
where fday = DAYNAME(DATE_SUB(now(), INTERVAL 2 DAY))
and fsem = '{$val}'
and c.fcollcode = '1001'
and ifnull(a.fclassid,'') = ''
order by c.fdegree,c.fteachcode";
$result = $aobj_context->mobj_db->GetAll($query);
if($result){
foreach($result as $val)
{
$cteachcode = $val['cteachcode'];
$fdegree = $val['fdegree'];
$fsection = $val['fsection'];
$fsubcode = $val['fsubcode'];
$fday = $val['fday'];
$fdate = $val['fdate'];
$fperiod = $val['fperiod'];
$remarks = "Attendace: $fday $fdate $fperiod Not Entred";
$query = "select distinct fclassid From attendsum
where fteachcode = '{$cteachcode}'
and fdegree = '{$fdegree}'
and left(fsubcode,4) = '{$fsubcode}' and fsection = '{$fsection}'";
//var_dump($query);
$res = $aobj_context->mobj_db->GetRow($query);
$fclassid = $res['fclassid'];
$upd = "update attclass set fblock = 'T', fblockremarks = '{$remarks}'
where fclassid = '{$fclassid}'";
$res1 = $aobj_context->mobj_db->Execute($upd);
}
//echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}else{
//echo $aobj_context->mobj_output->ToJSONEnvelope($result,-1,"failure");
}
}
}
?>
|