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


Current Path : /proc/thread-self/root/var/www/html/pgadm/admin-src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/pgadm/admin-src/applicationview.php

<?php
function loadRange($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	
	
	
	
	$query1 = "select * from entdeg";
  $result1 = $aobj_context->mobj_db->GetAll($query1);
  // var_dump($result1);
	if($result1)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success"); 
	}	
	else
	{	
		$arr = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}
}

function loadAppDetailsView($aobj_context){
  
	$json = new Services_JSON();
	$fdept = stripslashes($aobj_context->mobj_data["fdept"]);
	$afrom = stripslashes($aobj_context->mobj_data["afrom"]);
	$ato = stripslashes($aobj_context->mobj_data["ato"]);
    //var_dump($_SESSION['fusertype']);
  	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	if($fdept != 'All'){
		$cond = "and d.fdegree = '{$fdept}'";
	}

  	$query1 = "select s.fappno, s.fname, date_format(s.fcreatedate, '%d/%m/%Y') as fappdate, s.fgender, s.ftotfee, 
	  s.fcategory, s.fhk,ifnull(s.fappstatus,'Pending') as fappstatus,
	  '{$_SESSION['fusertype']}' as usertype from entstudadm s 
      inner join entoptdeg d on s.fappno = d.fappno
      where s.fappno between '{$afrom}' and '{$ato}'
      {$cond}
      and ifnull(FPAYSTATUS,'') = 'success'
      group by s.fappno";
  	$result1 = $aobj_context->mobj_db->GetAll($query1);
  // var_dump($result1);
	if($result1)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($result1,0,"success"); 
	}	
	else
	{	
		$arr['msg'] = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}


}

function loadstuddocDetails($aobj_context)
{

	$json = new Services_JSON();
	$fappno = stripslashes($aobj_context->mobj_data["fappno"]);
	// var_dump($fappno);
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	

	
	$query1 = "select fappno,fdoctype,fpath,fdeleted,ifnull(fstatus, '') as fstatus,ifnull(fremarks, '') as fremarks from entstuddoc where fappno='{$fappno}'";
	// var_dump($query1);
  $result1 = $aobj_context->mobj_db->GetAll($query1);
  // var_dump($result1);
	$query2 = "select FAPPNO, ifnull(FAPPRSTATUS, '') as FAPPRSTATUS, ifnull(FAPPRDATE, '') as FAPPRDATE ,  ifnull(FAPPRUSERID, '') as FAPPRUSERID , ifnull(FAPPREMARKS, '') as FAPPREMARKS from entstudadm where fappno='{$fappno}'";
  $result2 = $aobj_context->mobj_db->GetAll($query2);
  // var_dump($result1);
	if($result1)
	{	
    $res['app'] = $result1;
    $res['stuadm'] = $result2;
		echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"); 
	}	
	else
	{	
		$arr = "Some Failure as occured";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"error"); 
	}
}


function DocStatusAndRemarks($aobj_context){
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	$fappno = stripslashes($aobj_context->mobj_data["fappno"]);
	$studstatus = stripslashes($aobj_context->mobj_data["studstatus"]);
	$textarea = stripslashes($aobj_context->mobj_data["textarea"]);
	$statusandremarks = stripslashes($aobj_context->mobj_data["statusandremarks"]);
	$obj = json_decode($statusandremarks,true);
  $val_str = array();
  $i= 0;
  foreach($obj as $key=>$value)
  {
      $val_str[$i] = "('".$value['fappno']."','".$value['fdoctype']."','".$value['fstatus']."','".$value['fremarks']."')";
      $i++;
  }
	$str =  implode(",",$val_str);
	trim($str, '"');

  $query1 = "INSERT INTO `entstuddoc` (`fappno`,`fdoctype`, `fstatus`, `fremarks`)
  VALUES
    $str
    on duplicate key update 
		fappno = fappno,fdoctype = fdoctype, fstatus = VALUES(fstatus), fremarks = VALUES(fremarks)";
		
		$rst1 = $aobj_context->mobj_db->Execute($query1);


	$query2 = "update entstudadm set fapprstatus = '{$studstatus}',fappremarks = '{$textarea}',
	FAPPRDATE = now(),
	FAPPRUSERID ='{$_SESSION['USERNAME']}'
	where fappno = '{$fappno}'";
	// var_dump($query2);
	$rst2 = $aobj_context->mobj_db->Execute($query2);
	// var_dump($_SESSION['USERNAME']);


  
 if($rst1 && $rst2)
 {	
	 $success_msg= "Updated Successfully";
	 echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success"); 
 }	
 else
 {	
	 $error_msg = "Some Failure as occured";
	 echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"error"); 
 }


}