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.129.211.190
<?php
function prbupdate($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query = "select distinct fcollcode from marks_pr
where fdegree like 'bed%'
order by fcollcode";
$deg = $aobj_context->mobj_db->GetAll($query);
for($i = 0;$i<count($deg);$i++){
$fcollcode = $deg[$i]['fcollcode'];
$query = "select distinct * from marks_pr
where fdegree like 'bed%'
and fcollcode = '{$fcollcode}'
and fsubcode = 'D080'
and ifnull(FBATCH,'') =''
order by rand(fregno) ";
$res = $aobj_context->mobj_db->GetAll($query);
$batch = 1;
$j = 1;
foreach($res as $value)
{
$regno = $value['FREGNO'];
$query = "update marks_pr set FBATCH = '{$batch}'
where fcollcode = '{$fcollcode}'
and ifnull(FBATCH,'') =''
and fregno = '{$regno}' and fsubcode = 'D080'";
$res1 = $aobj_context->mobj_db->Execute($query);
if($j % 6 == 0)
{
$batch++;
}
$j++;
}
}
for($i = 0;$i<count($deg);$i++){
$fcollcode = $deg[$i]['fcollcode'];
$query = "select distinct * from marks_pr
where fdegree like 'bed%'
and fcollcode = '{$fcollcode}'
and fsubcode = 'D090'
and ifnull(FBATCH,'') =''
order by rand(fregno) ";
$res = $aobj_context->mobj_db->GetAll($query);
$batch = 1;
$j = 1;
foreach($res as $value)
{
$regno = $value['FREGNO'];
$query = "update marks_pr set FBATCH = '{$batch}'
where fcollcode = '{$fcollcode}'
and ifnull(FBATCH,'') =''
and fregno = '{$regno}' and fsubcode = 'D090'";
$res1 = $aobj_context->mobj_db->Execute($query);
if($j % 6 == 0)
{
$batch++;
}
$j++;
}
}
echo "Completed";
}
?>
|