0xV3NOMx
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 : 52.14.204.52


Current Path : /proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src/principalfreezingsubject.php

<?php
function semesterfreeze($aobj_context){
    $deg = $aobj_context->mobj_data["degcode"];
    $sem = $aobj_context->mobj_data["sem"];

    $query="select distinct a.fsubcode, s.fsubname, ifnull(fiateachfreez, '')as fiateachfreez,
      ifnull(fiapricfreez, '')as fiapricfreez,
      count(distinct a.fteachcode) as totalcount,
      count(distinct c.fteachcode) as freezcnt,
      group_concat(distinct if(ifnull(c.fteachcode,'') = '',a.fteachcode,'')  Separator '|')as fteachcode from attendsum a 
      left join subject s on a.fsubcode = s.fcsubcode
      and a.fdegree = s.fdegree and a.fexamno = s.fexamno
      left join classfreez c on c.fclassid = a.fclassid and c.fteachcode = a.fteachcode
	  and ifnull(fiateachfreez,'') = 'T'
      where a.fdegree='{$deg}' and a.fexamno='{$sem}' 
      group by a.fsubcode;";
    $result = $aobj_context->mobj_db->GetAll($query);
    
    if ($result) {
        $data['data'] = $result;
        echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success"); 
     
    } else {
        $data['data'] = "Failed";
        echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail");
   
    }
   
}

function savesterfreeze($aobj_context){
 $freezearray=json_decode($aobj_context->mobj_data["data"],true);

 foreach($freezearray as $data){
   
    // if($data['fiateachfreez']=='T'){
 
        $query="UPDATE classfreez
        SET fiateachfreez='{$data['fiateachfreez']}', fiapricfreez='{$data['fiapricfreez']}'
        WHERE left(fsubcode,4)=left('{$data['fsubcode']}',4)";

        // var_dump($query);
      $result =$aobj_context->mobj_db->Execute($query);
  
    // }
   
 }
//  die();
 if ($result) {
    $data['data'] = $result;
    echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success"); 
 
} else {
    $data['data'] = "Failed";
    echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail");

}
}