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.142.251.204


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

<?php
  function getAttTeachDegree($aobj_context){
    $collcode = $_SESSION['collcode'];
    
    $query = "select ifnull(c.fdegree, '')as id, concat(ifnull(d.fdescpn, ''), ' ','[',ifnull(c.fdegree, ''),']') as value 
              from attendsum c inner join degree d on d.fdegree= c.fdegree
              where c.fcollcode = '{$collcode}' group by c.fdegree";
    $res = $aobj_context->mobj_db->GetAll($query);

    $query = "select ifnull(d.fexamno, '' ) as id, concat(ifnull(d.fexamname, ''), ' ','[',ifnull(d.fexamno, ''),']') as value
              from attendsum c inner join degree d on d.fdegree= c.fdegree and d.fexamno = c.fexamno
              where c.fcollcode = '{$collcode}' group by c.fexamno";
    $res1 = $aobj_context->mobj_db->GetAll($query);

    $query = "select ifnull(d.fsection, '' )as id, ifnull(d.fsection,'') as value 
              from attendsum c inner join student d on d.fdegree= c.fdegree 
              and d.fcollcode = c.fcollcode
              where c.fcollcode = '{$collcode}' 
              and ifnull(d.fsection,'') <> ''
              group by d.fsection";
    $res2 = $aobj_context->mobj_db->GetAll($query);

    if($res){

      $arr['degcode'] = $res;
      $arr['semcode'] = $res1;
      $arr['sectioncode'] = $res2;
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
      return;
	  } else { 
      $arr['msg'] = 'No degree details found';
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
      return $rdata;			
	  }		
  }

  function viewAttTeachSum($aobj_context){

    $collcode = $_SESSION['collcode'];
    $degree = $aobj_context->mobj_data["degree"];
    $sem = $aobj_context->mobj_data["sem"];
    $section = $aobj_context->mobj_data["section"];
    $fdate = $aobj_context->mobj_data["fdate"];

    $degcnd = "and a.fdegree = '{$degree}'";
    if( strtoupper($degree) == 'ALL' )
    {
      $degcnd = "";
    }

    $semcnd = "and a.fexamno = '{$sem}'";
    if( strtoupper($sem) == 'ALL' )
    {
      $semcnd = "";
    }

    $seccnd = "and ifnull(st.FSECTION,'') = '{$section}'";
    if( strtoupper($section) == 'ALL' )
    {
      $seccnd = "";
    }

    $exam_query = "select distinct a.FDATE,a.fdegree,a.fcollcode,a.fsection,c.fclassname,
    concat(su.fsubshort,' - ',su.fsubname) as fsubname,a.fexamno,
    a.fperiod,a.fnoclass,concat(c.fteachcode, ' - ',m.fteachname) as fteachname,
    a.fclassid,
    count(a.fregno) as ftot,
    sum(if(a.FPRESENT ='P',1,0)) as fpresent,
    sum(if(a.FPRESENT ='A',1,0)) as fabsnet,
    if(ifnull(a.fclassid,'') = '','Not Entered','Entered') as status
    from attend_det a 
    inner join attclass c on a.fclassid = c.fclassid
    inner join masteach m on c.fteachcode = m.fteachcode
    and a.fcollcode = m.fcollcode
    inner join student st on st.fregno = a.fregno and st.fdegree = a.fdegree
    inner join subject su on a.fdegree = su.fdegree and a.fexamno = su.fexamno
    and a.fsubcode = su.fcsubcode    
    where a.FDATE = '{$fdate}'
    and a.fcollcode = '{$collcode}'
    
    {$degcnd}
    {$semcnd}
    {$seccnd}

    group by a.fdate,a.fteachcode,a.fclassid,a.fsubcode,a.fperiod,a.fnoclass
    order by a.fdegree,a.fexamno,a.FPERIOD,c.fclassname,a.fteachcode,a.fclassid,a.FDATE";
    //var_dump($exam_query);
    $exam_result = $aobj_context->mobj_db->GetAll($exam_query);

    if($exam_result){
      echo $aobj_context->mobj_output->ToJSONEnvelope($exam_result, 0, "success");
	  } else { 
      $arr['msg'] = 'No sem details found';
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
      return $rdata;			
	  }		
  }

 
?>