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


Current Path : /var/www/oasis/src/
Upload File :
Current File : /var/www/oasis/src/UpdateCollDet.php

<?php

function getCollDet($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
  $fcollas = $_SESSION['fcollas'];

  $query="select fcollcode,fcollname,ftown,fcolladd1,fcolladd2,fcolladd3,fcolladd4,
  fprincipalname,fphone,faltmobile,fmobile,ffax,femail,
  '{$fcollas}' as fcollas
  from college
  where fcollcode='{$_SESSION['collcode']}'";
  $results = $aobj_context->mobj_db->GetRow($query);
  
  if( count($results) != 0)
  echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success");
  else 
   echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
}


function updateCollProfile($aobj_context){
  $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
  $data = $aobj_context->mobj_data['data'];
  $json = json_decode($data,true);

  if($_SESSION['collcode'] == '' || $_SESSION['collcode'] == null){
    $arr['msg']="Session Expired. Login Again";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
  }

  $data = array();
  foreach($json[0] as $k => $v) {
    $data[$k] = $v;
  }
  if($data['fmobile'] == '' || $data['fprincipalname'] == ""){
    $arr['msg']="Invalid Parameters";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
  }
  
  $query = "update college set 
  fcolladd1='{$data['fcolladdr1']}',fcolladd2='{$data['fcolladdr2']}',
  fcolladd3='{$data['fcolladdr3']}',
  fcolladd4='{$data['fcolladdr4']}',fprincipalname='{$data['fprincipalname']}',
  fphone='{$data['fphone']}',faltmobile='{$data['faltmobile']}',fmobile='{$data['fmobile']}',
  ffax='{$data['ffax']}',femail='{$data['femailid']}',fcoordinates='{$data['fcoordinates']}'
  where fcollcode='{$_SESSION['collcode']}'";
  // var_dump($query);
  // return;

  $results = $aobj_context->mobj_db->Execute($query);
  if($results){
    $arr['msg']="Updated successfully!";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
  }
  else
  {
    $arr['msg']="Updation was not successfull, Please try after again!";
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
  }
}

?>