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 : 3.140.188.195


Current Path : /proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/resultStats.php

<?php

function getResStats($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  $univcode = $aobj_context->mobj_data['univcode'];
  $fcollcode = $aobj_context->mobj_data['fcollcode'];
//if fcollcode is given then ResStats for particular college else for all colleges-based on university
  $fcollcode != '' ? $colQry = "and s.fcollcode='{$fcollcode}' " : $colQry="";

  $query="select distinct count(r.fregno) as ttlStud,
  sum(if(fclass = 'WITHHELD' and fmcnumber not like '%MAL-PRACTICE%',1,0)) as fwh,
  sum(if(fclass = 'WITHHELD' and fmcnumber like '%MAL-PRACTICE%',1,0)) as fmp,
  count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0)) as fdeclared,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) as fpass,
  sum(if(fclass like '%FAIL%',1,0)) as ffail,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) * 100 /(count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0))) as passperct 
  from resmarks r
  inner join student s on s.fregno= r.fregno and r.fdegree=s.fdegree
  {$colQry}
  group by s.fcollcode";


  $result =  $aobj_context->pobj_db->getAll($query);
  // var_dump($query,$result);
  if($result && $result != boolean){
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
  }else{
    $arr = 'Data not Found';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
  }
}

function getDegwiseResStats($aobj_context){

  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  $univcode = $aobj_context->mobj_data['univcode'];
  $fcollcode = $aobj_context->mobj_data['fcollcode'];

  $fcollcode != '' ? $colQry = "and s.fcollcode='{$fcollcode}' " : $colQry="";

  $query="select distinct count(r.fregno) as ttlStud,r.fdegree,
  sum(if(fclass = 'WITHHELD' and fmcnumber not like '%MAL-PRACTICE%',1,0)) as fwh,
  sum(if(fclass = 'WITHHELD' and fmcnumber like '%MAL-PRACTICE%',1,0)) as fmp,
  count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0)) as fdeclared,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) as fpass,
  sum(if(fclass like '%FAIL%',1,0)) as ffail,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) * 100 /(count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0))) as passperct 
  from resmarks r
  inner join student s on s.fregno= r.fregno and r.fdegree=s.fdegree
  {$colQry}  
  group by r.fdegree";

  $result =  $aobj_context->pobj_db->getAll($query);
  // var_dump($query,$result);
  if($result && $result != boolean){
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
  }else{
    $arr = 'Data not Found';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
  }
}

function getAllColgDegwiseResStats($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  $univcode = $aobj_context->mobj_data['univcode'];
  $fcollcode = $aobj_context->mobj_data['fcollcode'];

  $query = "select distinct count(r.fregno) as total,s.fcollcode,s.fdegree,
  sum(if(fclass = 'WITHHELD' and fmcnumber not like '%MAL-PRACTICE%',1,0)) as fwh,
  sum(if(fclass = 'WITHHELD' and fmcnumber like '%MAL-PRACTICE%',1,0)) as fmp,
  count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0)) as fdeclared,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) as fpass,
  sum(if(fclass like '%FAIL%',1,0)) as ffail,
  sum(if(fclass not like '%FAIL%' and fclass not like '%WITHHELD%',1,0)) * 100 /(count(r.fregno) - sum(if(fclass = 'WITHHELD',1,0))) as passperct 
  from resmarks r
  inner join student s on s.fregno= r.fregno and r.fdegree=s.fdegree
  group by s.fcollcode, s.fdegree
  order by s.fcollcode, s.fdegree";
  $result =  $aobj_context->pobj_db->getAll($query);

  if($result && $result != boolean){
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
  }else{
    $arr = 'Data not Found';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
  }
}

function getFCCount($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  $univcode = $aobj_context->mobj_data['univcode'];
  $fcollcode = $aobj_context->mobj_data['fcollcode'];

  $query = "select distinct count(r.fregno) as ttlStud,
  sum(if(fclass like '%first%' or fclass= 'outstanding',1,0)) as FC,
  sum(if(fclass like '%second%',1,0)) as SC,
  sum(if(fclass like '%fail%',1,0)) as fail,
  sum(if(fclass like '%withheld%',1,0)) as wh
  from resmarks r
  inner join student s on s.fregno= r.fregno and r.fdegree=s.fdegree
  where s.fcollcode='{$fcollcode}'";

  $result = $aobj_context->pobj_db->getRow($query);
  
  if($result && $result != boolean){
    echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
  }else{
    $arr = 'Data not Found';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
  }
}
?>