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


Current Path : /var/www/html/univadmin/src/
Upload File :
Current File : /var/www/html/univadmin/src/approvestudename.php

<?php
function approvestudename($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
  $collfrom=$aobj_context->mobj_data["colfrom"];
  $collto=$aobj_context->mobj_data["colto"];
  $univcode = $aobj_context->mobj_data['univcode'];
  $regnofrom=$aobj_context->mobj_data["regfrom"];
  $regnoto=$aobj_context->mobj_data["regto"];
  $regnoto=$aobj_context->mobj_data["regto"];
  $option=$aobj_context->mobj_data["option"];


  if($option == "all"){
    $cnd="";
  }else{
    $cnd="and fstatus='$option'";
  }
   $query="SELECT stud.fstatus, col.fcollname, col.ftown, col.fcollcode, 
                 stud.fapp, stud.foldname, stud.fnewname, stud.fdoc, stud.fregno 
                 FROM studnamecurr stud INNER JOIN college col ON 
                 col.fcollcode = stud.fcollcode WHERE 
                 stud.fregno BETWEEN '$regnofrom' AND '$regnoto' and 
                 stud.fcollcode between '$collfrom' and '$collto' $cnd";
 
     $result = $aobj_context->pobj_db->GetAll($query);
  
  if($result){
    echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
  }
  else{
    $arr['msg']="No User Type Found";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
  }
}


function saveNameStatus($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
  $regno=$aobj_context->mobj_data["regno"];
  $status=$aobj_context->mobj_data["status"];
  $univcode = $aobj_context->mobj_data['univcode'];
  $updmobile=$aobj_context->mobj_data['updmobile'];

    $query = "update studnamecurr set fstatus='$status', fupddate=now(), fupduser='$updmobile' where fregno='$regno'";
    $result = $aobj_context->pobj_db->Execute($query);


    $query_stud = "select ifnull(fregno,'') as fregno,ifnull(foldname,'') as foldname,ifnull(fnewname,'') as fnewname,
    ifnull(fstatus,'') as fstatus,ifnull(fdoc,'') as fdoc from studnamecurr
    where fregno = '{$regno}' and fstatus = 'approved'";

   $res_query_stud = $aobj_context->pobj_db->GetRow($query_stud);


    if($res_query_stud['fstatus'] == 'approved'){
      
      $qry = "update student set 
      FNAME = '{$res_query_stud['fnewname']}', foldname = '{$res_query_stud['foldname']}',
      fnewname = '{$res_query_stud['fnewname']}',fnamedoc = '{$res_query_stud['fdoc']}',fnamestatus = 'T'
       where faregno='{$regno}'";
      //  var_dump($qry);
      //  die();
      $res = $aobj_context->pobj_db->Execute($qry);
     
    }
  
 
  if($result){
    $arr['msg']="Success...!";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, 0, "success");
  }
  else{
    $arr['msg']="failed";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
  }  
}
?>