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


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

<?php

function savesspdetails($aobj_context)
{

    

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];   
    $college_code = $_SESSION['collcode'];
    $regno = $aobj_context->mobj_data["regno"];   
    $degree = $aobj_context->mobj_data["degree"];  
    $aadharno = $aobj_context->mobj_data["aadharno"]; 
    $gender = $aobj_context->mobj_data["gender"];    
    $studname = $aobj_context->mobj_data["studname"];   
    $sslcregno = $aobj_context->mobj_data["sslcregno"];   
    $sslcboard = $aobj_context->mobj_data["sslcboard"];   
    $pucregno = $aobj_context->mobj_data["pucregno"];   
    $pucboard = $aobj_context->mobj_data["pucboard"];   
    $fatheraadharno = $aobj_context->mobj_data["fatheraadharno"];   
    $fathername = $aobj_context->mobj_data["fathername"];   
    $motheraadharno = $aobj_context->mobj_data["motheraadharno"];   
    $mothername = $aobj_context->mobj_data["mothername"];   
    $income = $aobj_context->mobj_data["income"];   
    $caste = $aobj_context->mobj_data["caste"]; 
    $pucpass = $aobj_context->mobj_data["pucpass"];   
    $sslcpass = $aobj_context->mobj_data["sslcpass"];   
    $sslcotherboard = $aobj_context->mobj_data["sslcotherboard"];   
    $pucotherboard = $aobj_context->mobj_data["pucotherboard"]; 
    $sspstudid = $aobj_context->mobj_data["sspstudid"];   
    $satsid = $aobj_context->mobj_data["satsid"]; 
    $save = $aobj_context->mobj_data["save"]; 
    $fdegree = $aobj_context->mobj_data["fdegree"]; 
    $fdescpn = $aobj_context->mobj_data["fdescpn"]; 



    
 
        
    $query ="INSERT INTO `sspstud` (`FCOLLCODE`,`FREGNO`, `FDEGREE`,`FDESCPN`, `FSTUDAADHARNO`, `FSTUDNAME`,`FGENDER`, `FSSLCREGNO`, `FSSLCBOARDCODE`,`FSSLCBOARDNAME`, `FSSLCPASSYEAR`, 
    `FPUCREGNO`, `FPUCBOARDCODE`, `FPUCBOARDNAME`, `FPUCPASSYEAR`, `FSATSID`, `FSSPSTUDID`, `FFATHERAADHAR`, `FFATHERNAME`,
     `FMOTHERAADHAR`, `FMOTHERNAME`, `FINCOMERDNO`, `FCASTERDNO`,`FUPDATEDBY`,`FCREATEDATE`,`FUPDATED`) 
    VALUES('{$college_code}','{$regno}','{$fdegree}','{$fdescpn}','{$aadharno}','{$studname}','{$gender}','{$sslcregno}','{$sslcboard}','{$sslcotherboard}'
    ,'{$sslcpass}','{$pucregno}','{$pucboard}','{$pucotherboard}','{$pucpass}','{$satsid}','{$sspstudid}',
    '{$fatheraadharno}','{$fathername}','{$motheraadharno}','{$mothername}','{$income}','{$caste}','College', now(), 'T') ON DUPLICATE KEY UPDATE 
    FCOLLCODE = '{$college_code}', FREGNO = '{$regno}',FDEGREE = '{$fdegree}',FDESCPN = '{$fdescpn}', FSTUDAADHARNO = '{$aadharno}', FSTUDNAME = '{$studname}', FGENDER = '{$gender}',
    FSSLCREGNO = '{$sslcregno}', FSSLCBOARDCODE = '{$sslcboard}', FSSLCBOARDNAME = '{$sslcotherboard}', FSSLCPASSYEAR =  '{$sslcpass}',
    FPUCREGNO = '{$pucregno}', FPUCBOARDCODE = '{$pucboard}', FPUCBOARDNAME = '{$pucotherboard}', FPUCPASSYEAR = '{$pucpass}',
    FSATSID = '{$satsid}', FSSPSTUDID = '{$sspstudid}', FFATHERAADHAR = '{$fatheraadharno}', FFATHERNAME = '{$fathername}',
    FMOTHERAADHAR = '{$motheraadharno}', FMOTHERNAME = '{$mothername}', FINCOMERDNO = '{$income}', FCASTERDNO = '{$caste}',FMODIFYDATE = now(),FUPDATED = 'T'";
$result=$aobj_context->mobj_db->Execute($query);

if($result){
    $arr['msg'] = 'Details Saved Successfully...!!';
    $arr['deg'] = $fdegree;
  echo $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
}
else{
  $arr['msg']="Please try later";
  echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
// }else{

//   $query = "update sspstud 
//     SET FCOLLCODE = '{$college_code}', FREGNO = '{$regno}',FDEGREE = '{$fdegree}',FDESCPN = '{$fdescpn}', FSTUDAADHARNO = '{$aadharno}', FSTUDNAME = '{$studname}', FGENDER = '{$gender}',
//     FSSLCREGNO = '{$sslcregno}', FSSLCBOARDCODE = '{$sslcboard}', FSSLCBOARDNAME = '{$sslcotherboard}', FSSLCPASSYEAR =  '{$sslcpass}',
//     FPUCREGNO = '{$pucregno}', FPUCBOARDCODE = '{$pucboard}', FPUCBOARDNAME = '{$pucotherboard}', FPUCPASSYEAR = '{$pucpass}',
//     FSATSID = '{$satsid}', FSSPSTUDID = '{$sspstudid}', FFATHERAADHAR = '{$fatheraadharno}', FFATHERNAME = '{$fathername}',
//     FMOTHERAADHAR = '{$motheraadharno}', FMOTHERNAME = '{$mothername}', FINCOMERDNO = '{$income}', FCASTERDNO = '{$caste}'
//     where FREGNO = '{$regno}'";

 
//    $result=$aobj_context->mobj_db->Execute($query);

//    if($result){
//     $arr['msg'] = 'Updated Successfully...!!';
//   echo $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
// }

// else{
//   $arr['msg']="Please try later";
//   echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
// }
}

//  var_dump($query);
  
 


function loaddegreessp($aobj_context)
{

  
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];   
   $regno = $aobj_context->mobj_data["regno"];    
   $college_code = $_SESSION['collcode'];
    $query ="SELECT s.fdegree,d.fdescpn 
    FROM student s 
    INNER JOIN degree d ON s.fdegree = d.fdegree
    WHERE s.fregno = '{$regno}'
    and fcollcode = '{$college_code}'";
    //  var_dump($query);
    //  die();
 
  $result=$aobj_context->mobj_db->GetRow($query);

  

  if(count($result) > 0){
    echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
  }
  else{
    $arr['msg']="Invalid Reg No.";
    echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
  }
  
}



// function viewsspdetails($aobj_context)
// {

//     $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
//     $univcode = $aobj_context->mobj_data["univcode"];   
//    $regno = $aobj_context->mobj_data["regno"];    
//    $degree = $aobj_context->mobj_data["degree"];    
 
  
 
        
//     $query ="SELECT * FROM sspstud
//     where fregno = '{$regno}' ";
//     //  var_dump($query);
//     //  die();
 
//   $result=$aobj_context->mobj_db->GetRow($query);

// //   var_dump($result);
// //   die();

//   if(count($result) > 0){
//     echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
//   }
//   else{
//     $arr['msg']="No details found for this Reg No.";
//     echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
//   }
  
// }


function loadallsspdeg($aobj_context)
{

    
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];   
   $regno = $aobj_context->mobj_data["regno"];    
   $degree = $aobj_context->mobj_data["degree"];    
   $college_code = $_SESSION['collcode']; 
  
 
        
    $query ="SELECT s.fdegree,concat(s.fdegree,' - ',d.fdescpn) as fdescpn FROM student s 
    inner join degree d on s.fdegree = d.fdegree
    and d.fexamno = 'A'
    where s.fcollcode = '{$college_code}'
    group by s.fdegree";
    //  var_dump($query);
    //  die();
 
  $result=$aobj_context->mobj_db->GetAll($query);

//   var_dump($result);
//   die();

  if(count($result) > 0){
    echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
  }
  else{
    $arr['msg']="No degree found";
    echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
  }
  
}




function getsspdetails($aobj_context)
{

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $regfrom = $aobj_context->mobj_data["regfrom"];
    $regto = $aobj_context->mobj_data["regto"];   
       
   $sppdegree = $aobj_context->mobj_data["sspdegree"];  
   $college_code = $_SESSION['collcode'];  

    $query ="SELECT if(ifnull(sp.FREGNO,'') = '', s.fregno,sp.FREGNO) as FREGNO,
    if(ifnull(sp.FSTUDNAME,'') = '', s.fname,sp.FSTUDNAME) as FSTUDNAME, 
    if(ifnull(sp.FSTUDAADHARNO,'') = '', ifnull(s.FAADHARNO,''),ifnull(sp.FSTUDAADHARNO,'')) as FSTUDAADHARNO, 
    if(ifnull(sp.FFATHERNAME,'') = '', s.ffatname,sp.FFATHERNAME) as FFATHERNAME
    FROM student s left join sspstud sp on s.fregno = sp.fregno and s.fcollcode = sp.fcollcode
    where s.fdegree = '{$sppdegree}' 
    and s.fregno between '{$regfrom}' and '{$regto}'
    and s.fcollcode = '{$college_code}'
    and ifnull(s.fsspstudid,'') = ''";
  
 
  $result=$aobj_context->mobj_db->GetAll($query);

    

  if(count($result) > 0){
    echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
  }
  else{
    $arr['msg']="Details not found";
    echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
  }
  
}

function editsspdetails($aobj_context)
{

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];   
   $regno = $aobj_context->mobj_data["regno"];    
   $sspdegree = $aobj_context->mobj_data["sspdegree"];    
 

   $query = "SELECT if(ifnull(sp.FREGNO,'') = '', s.fregno,sp.FREGNO) as FREGNO,
    if(ifnull(sp.FSTUDNAME,'') = '', s.fname,sp.FSTUDNAME) as FSTUDNAME, 
    if(ifnull(sp.FSTUDAADHARNO,'') = '', s.FAADHARNO,sp.FSTUDAADHARNO) as FSTUDAADHARNO, 
    if(ifnull(sp.FFATHERNAME,'') = '', s.ffatname,sp.FFATHERNAME) as FFATHERNAME,
    if(ifnull(sp.FMOTHERNAME,'') = '', s.fmotname,sp.FMOTHERNAME) as FMOTHERNAME,
    if(ifnull(sp.FGENDER,'') = '', s.FGENDER,sp.FGENDER) as FGENDER,
    s.FCOLLCODE, s.FDEGREE,d.FDESCPN, 
     sp.FSSLCREGNO, FSSLCBOARDCODE,FSSLCBOARDNAME, FSSLCPASSYEAR, 
     sp.FPUCREGNO, FPUCBOARDCODE, FPUCBOARDNAME, FPUCPASSYEAR, FSATSID,  sp.FSSPSTUDID, FFATHERAADHAR,
     FMOTHERAADHAR,  FINCOMERDNO, FCASTERDNO
    FROM student s left join sspstud sp on s.fregno = sp.fregno and s.fcollcode = sp.fcollcode
    inner join degree d on s.fdegree = d.fdegree and d.fexamno = 'A'
    where s.fregno = '{$regno}'";

  $result=$aobj_context->mobj_db->GetRow($query);

  //var_dump($query);
  //die();

  if(count($result) > 0){
    echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
  }
  else{
    $arr['msg']="Failed to Load";
    echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
  }
  
}



?>