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


Current Path : /var/www/html/phdadm/pgetadm/
Upload File :
Current File : /var/www/html/phdadm/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(fcovid,'') as fcovid,
  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(fstudtype,'') as fstudtype
  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";
  }
  //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);

  $query ="select fdoctype,ifnull(fpath,'') as fpath from entstuddoc where fappno = '{$fappno}'";
  $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);

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

    if($fappno != "") {

      $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(fcovid,'') as fcovid,
        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
        from entstudadm_bkp_07122020 where fappno = '{$fappno}'";
        //
        $result1 = $aobj_context->mobj_db->GetRow($query);
        $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";

        $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);

        $query ="select fdoctype,ifnull(fpath,'') as fpath from entstuddoc where fappno = '{$fappno}'";
        $result4 = $aobj_context->mobj_db->GetAll($query);
        if(count($result1) > 0) {
          $arr['student'] = $result1;
          $arr['feedetl'] = $result2;
          $arr['optsub'] = $result3;
          $arr['reslan'] = $reslan;
          $arr['db'] = $db;
          $arr['restotsem'] = $restotsem;
          $arr['studoc'] = $result4;
          $arr['ackvfd'] = $result1['fappstatus'];

          echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
          return;
        }
    }

    $arr['msg'] = "No data found";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"); 
    return;
  }

}