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


Current Path : /proc/thread-self/root/var/www/html/pgadm2020/pgetadm/
Upload File :
Current File : //proc/thread-self/root/var/www/html/pgadm2020/pgetadm/getSavedData.php

<?php

function getSavedData($aobj_context)
{
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
  session_start();
  
  $fappno = $aobj_context->mobj_data["fappno"];
  $db = $aobj_context->mobj_data["db"];


  

  $query = "select fappno, fmobileno, 
  ifnull(fname,'') as fname, 
  ifnull(fphotopath,'') as fphotopath, ifnull(fgender,'') as fgender, 
  date_format(ifnull(fdob,''), '%d/%m/%Y') as fdob, ifnull(ffatname,'') as ffatname,
  ifnull(ffatocc,'') as ffatocc, ifnull(fmotname, '') as fmotname, 
  ifnull(fmotocc, '') as fmotocc, ifnull(fnational, '') as fnational, 
  ifnull(fcategory,'') as fcategory, 
  ifnull(fpmregno,'') as fpmregno, ifnull(fincome,'') as fincome, 
  ifnull(fbpl,'') as fbpl, ifnull(fkarstudy,'') as fkarstudy, 
  ifnull(faadharno,'') as faadharno, ifnull(fsslcregno,'') as fsslcregno, 
  ifnull(fpermadd1,'') as fpermadd1, ifnull(fpermadd2,'') as fpermadd2, 
  ifnull(fpermadd3,'') as fpermadd3, ifnull(fpermadd4,'') as fpermadd4, 
  ifnull(fpermdist,'') as fpermdist, ifnull(fpermstate,'') as fpermstate, 
  ifnull(fpermpin,'') as fpermpin, ifnull(fcurradd1,'') as fcurradd1, 
  ifnull(fcurradd2,'') as fcurradd2, ifnull(fcurradd3,'') as fcurradd3, 
  ifnull(fcurradd4,'') as fcurradd4, ifnull(fcurrdist,'') as fcurrdist, 
  ifnull(fcurrstate,'') as fcurrstate, ifnull(fcurrpin,'') as fcurrpin, 
  ifnull(femail,'') as femail, ifnull(fkashmir,'') as fkashmir, 
  ifnull(fhk,'') as fhk, ifnull(fjk,'') as fjk, ifnull(frural,'') as frural, 
  ifnull(fkannada,'') as fkannada, ifnull(fbcue,'') as fbcue, 
  ifnull(fbcuetype,'') as fbcuetype, ifnull(fsports,'') as fsports, 
  ifnull(fculture,'') as fculture, ifnull(fncc,'') as fncc, 
  ifnull(fnss,'') as fnss, ifnull(fdefence,'') as fdefence,
  ifnull(fpdp,'') as fpdp,ifnull(fcof,'') as fcof,ifnull(fcoh,'') as fcoh,
  ifnull(fgah,'') as fgah,ifnull(fkanm,'') as fkanm, 
  ifnull(funikar,'') as funikar,
  ifnull(fchilsuid,'') as fchilsuid,
  ifnull(fjks,'') as fjks,
  ifnull(fscouts,'') as fscouts,
  ifnull(fhandicap,'') as fhandicap, ifnull(fqdegree,'') as fqdegree, 
  ifnull(FQCOMBCODE,'') as fcombcode, ifnull(fquniv,'') as fquniv, ifnull(fqyear,'') as fqyear, 
  ifnull(fqmonth,'') as fqmonth, ifnull(fqregno,'') as fqregno, 
  ifnull(fqclass,'') as fqclass, ifnull(fqmaxmarks,'') as fqmaxmarks, 
  ifnull(fqsecmarks,'') as fqsecmarks, ifnull(fqpercentage,'') as fqpercentage, 
  ifnull(flang1,'') as flang1, ifnull(flang1mm,'') as flang1mm, 
  ifnull(flang1ms,'') as flang1ms, ifnull(flang2,'') as flang2, 
  ifnull(flang2mm,'') as flang2mm, ifnull(flang2ms,'') as flang2ms, 
  ifnull(fpgdegree,'') as fpgdegree, ifnull(fpgqdegree,'') as fpgqdegree, 
  ifnull(fpgunivtype,'') as fpgunivtype, ifnull(fpgqclass,'') as fpgqclass, 
  ifnull(fpguniv,'') as fpguniv, ifnull(fpgyear,'') as fpgyear, 
  ifnull(fpgmonth,'') as fpgmonth, ifnull(fpgregno,'') as fpgregno, 
  ifnull(fpgmaxmarks,'') as fpgmaxmarks, ifnull(fpgsecmarks,'') as fpgsecmarks, 
  ifnull(fothexam,'') as fothexam, ifnull(fsponsor,'') as fsponsor, 
  ifnull(fothinfo,'') as fothinfo, ifnull(fdocattest,'') as fdocattest,
  ifnull(fpaystatus,'') as fpaystatus,ifnull(fmngetexam,'') as fmngetexam,
  ifnull(fmngexamname,'') as fmngexamname, ifnull(fmngrank,'') as fmngrank,ifnull(fwrkexp,'') as fwrkexp,
  ifnull(fwrkexppath,'') as fwrkexppath,
  ifnull(FQCOLLEGE,'') as FQCOLLEGE,
  ifnull(FLANMM,'') as FLANMM, ifnull(freligion,'') as freligion, ifnull(fmotherton,'') as fmotherton,
  ifnull(fbloodgrp,'') as fbloodgrp, ifnull(fsubcaste,'') as fsubcaste, ifnull(fincomerdno,'') as fincomerdno,
  ifnull(fcasterdno,'') as fcasterdno, ifnull(fhkrdno,'') as fhkrdno, ifnull(fexservice,'') as fexservice,
  ifnull(foutstud,'') as foutstud, ifnull(fselfsupsch,'') as fselfsupsch,
  ifnull(FLANMO,'') as FLANMO, fappstatus,ifnull(funivstud,'') as funivstud,
  ifnull(fdocvrfloc,'') as fdocvrfloc,
  ifnull(fgardname,'') as fgardname,ifnull(fgardocc,'') as fgardocc,
  ifnull(fgirlchild,'') as fgirlchild,ifnull(fsevenkar,'') as fsevenkar,
  ifnull(fkashmig,'') as fkashmig,ifnull(fjkstud,'') as fjkstud,
  ifnull(fruralten,'') as fruralten,ifnull(fkantem,'') as fkantem,
  ifnull(fsonbcu,'') as fsonbcu,ifnull(fstudbu,'') as fstudbu,
  ifnull(finkar,'') as finkar,ifnull(fkarout,'') as fkarout,
  ifnull(fbuautclg,'') as fbuautclg,ifnull(fbiopuc,'') as fbiopuc,
  ifnull(fmathpuc,'') as fmathpuc,
  ifnull(fsponrcand,'') as fsponrcand,
  ifnull(fhostelfac,'') as fhostelfac,
  ifnull(fdistklr,'') as fdistklr,
  ifnull(fbpl,'') as fbpl,
  ifnull(fbscouts,'') as fbscouts
  from entstudadm where fappno = '{$fappno}'";
  //
  $result1 = $aobj_context->mobj_db->GetRow($query);
  // var_dump($result1);

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

  $query = "";
  if($result1['fpaystatus'] == 'success')
  {
    $query = "select fheadcode,famount as fmaxfee from entfeedetl where fappno = '{$fappno}'
    order by fheadcode";
  }
  else 
  {
    $count = 1;
    
    // $query ="select fheadcode, fmaxfee from admfeestr 
    // where fdegree ='PGET' 
    // and fcatcode = '{$result1['fcategory']}' and fcombcode = 'PGET' and fexamno = 'A'
    // and date_format(now(), '%Y-%m-%d') between fadmfeesdate and fadmfeeedate
    // order by fheadcode";
    if($db == 'bcu')
    {
      $query ="select a.fheadcode,if(ifnull(b.famount,0) = 0,fmaxfee,b.famount) as fmaxfee 
      from admfeestr a left join entfeedetl b on  a.fheadcode = b.fheadcode
      and  fappno = '{$fappno}'
      where fdegree ='CERT' 
      and fcatcode = '{$result1['fcategory']}' 
      and fcombcode = 'PGET' and fexamno = 'A'
      and date_format(now(), '%Y-%m-%d') 
      between fadmfeesdate and fadmfeeedate
      order by fheadcode";
    }else
    {
        $query ="select a.fheadcode,if(ifnull(b.famount,0) = 0,fmaxfee,b.famount) as fmaxfee 
          from admfeestr a left join entfeedetl b on  a.fheadcode = b.fheadcode
          and  fappno = '{$fappno}'
          where fdegree ='PGET' 
          and fcatcode = '{$result1['fcategory']}' 
          and fcombcode = 'PGET' and fexamno = 'A'
          and date_format(now(), '%Y-%m-%d') 
          between fadmfeesdate and fadmfeeedate
          order by fheadcode";
    }
  }
  //var_dump($query);
  $result2 = $aobj_context->mobj_db->GetAll($query);


  $query ="select concat(cd.fsubcode,'-',cd.fsubname) as subname,pm.* from entprevcomb cd
  left join entprevmarks pm
  on cd.fdegree = pm.fdegree
  and cd.fsubcode = pm.fsubcode
  and ifnull(pm.fcombcode,'') NOT IN ('lan', 'TOT')
  where pm.fappno = '{$fappno}'
  group by cd.fdegree, cd.fsubcode";
  $result3 = $aobj_context->mobj_db->GetAll($query);

  $query ="select concat(cd.fsubcode,'-',cd.fsubname) as subname,pm.* from entprevcomb cd
  left join entprevmarks pm
  on cd.fcombcode = pm.fcombcode
  and cd.fsubcode = pm.fsubcode
  and ifnull(pm.fcombcode,'') = 'lan'
  where pm.fappno = '{$fappno}'";
  $reslan = $aobj_context->mobj_db->GetAll($query);

  $query ="select concat(cd.fsubcode,'-',cd.fsubname) as subname,pm.* from entprevcomb cd
  left join entprevmarks pm
  on cd.fcombcode = pm.fcombcode
  and cd.fsubcode = pm.fsubcode
  and ifnull(pm.fcombcode,'') = 'TOT'
  where pm.fappno = '{$fappno}'";
  $restotsem = $aobj_context->mobj_db->GetAll($query);


  // select s.fdoctype,ifnull(s.fpath,'') as fpath from entstuddoc s
  // left join entmasdoc d on s.fdoctype = d.fdoctype
  // where fappno = '{$fappno}'
  // order by d.forder
  $query ="select s.fdoctype,ifnull(s.fdocname,'') as fdocname,ifnull(d.fpath,'') as fpath from entmasdoc s
  left join entstuddoc d on s.fdoctype = d.fdoctype and fappno = '{$fappno}'
  order by s.forder;";
  $result4 = $aobj_context->mobj_db->GetAll($query);
  
  $query ="select fheadcode,famount as fmaxfee 
  from entfeedetl where fappno = '{$fappno}'
  order by fheadcode";
  $result5 = $aobj_context->mobj_db->GetAll($query);

//   $query = "select fdoctype from entmasdoc;";
// $res = $aobj_context->mobj_db->GetAll($query);
// var_dump($res[0]);

// $sql = mysql_query("select fdoctype from entmasdoc");
// var_dump($sql);


  if(count($result1) > 0) {
    $arr['student'] = $result1;
    $arr['feedetl'] = $result2;
    $arr['optsub'] = $result3;
    $arr['reslan'] = $reslan;
    $arr['restotsem'] = $restotsem;
    $arr['studoc'] = $result4;
    $arr['studtotfee'] = $result2;
    $arr['ackvfd'] = $result1['fappstatus'];
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
    return;
  }
  else {
    $arr['msg'] = "No data found";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
    return;
  }

}