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


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/dashboard.php

<?php

function getDashboardInfo($aobj_context)
{
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

  $univcode = $aobj_context->mobj_data['univcode'];
  $usertype = $aobj_context->mobj_data['usertype'];

  $user = json_decode($aobj_context->mobj_data['user'], true);

  if ($univcode == '') {
    $arr['msg'] = 'Invalid Params';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 1, "failure");
    return;
  }

  $pget_query = "select college_code, message from message_board 
  where date_format(now(),'%Y-%m-%d') between display_from and display_to";
  $result = $aobj_context->pobj_db->GetAll($pget_query);

  $arr['msgs'] = $result;

  if($univcode == '041' && $usertype == "304") {
    $pget_query = "select count(a.fmobileno) as fregcnt, sum(if(ifnull(fappno,'') <> '',1,0)) as fappcnt ,
    sum(if(ifnull(ffinsub,'') = 'T', 1, 0)) as finalsubcnt,
    sum(if(ifnull(fpaystatus,'') = 'success', 1, 0)) as fpaidcnt 
    from collstud a left join pgstudadm b on a.fmobileno = b.fmobileno
    where a.fdegree = 'PGET' and a.factive = 'T'";
    $result = $aobj_context->pobj_db->GetAll($pget_query);

    if (!$result && gettype($result) == 'boolean') {
      $arr['msg'] = "Error while fetching data";
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "Failure");
      return;
    }

    $arr['pget'] = $result;

    $query = "select fdegree1, fdescpn, sum(fstudcnt) as studcount from
    (select fdegree1, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree1 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree1 
    union
    select fdegree2, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree2 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree2
    union
    select fdegree3, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree3 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree3
    union
    select fdegree4, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree4 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree4
    union
    select fdegree5, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree5 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree5
    union
    select fdegree6, fdescpn, count(*) as fstudcnt from pgstudadm a
    inner join degree d on a.fdegree6 = d.fdegree and d.fexamno = 'A'
    where ifnull(fpaystatus,'') = 'success'
    group by fdegree6) a
    group by fdegree1
    order by fdegree1";
    $result = $aobj_context->pobj_db->GetAll($query);

    $arr['subpget'] = $result;
    

  }
  else {
    $arr['pget'] = [];
    $arr['subpget'] = [];
  } 
  echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
  
}