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 : 52.14.26.141


Current Path : /var/www/oasis/src_old/
Upload File :
Current File : /var/www/oasis/src_old/bundle_dispatch.php

<?php
function defaultBundleDetails( $aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	session_start();	
    include_once("/JSON.php"); 
	$json = new Services_JSON();
	
	$College_Code = $_SESSION['collcode'];
	$qpcode =  $aobj_context->mobj_data['qpcode'];
	$qpdate =  $aobj_context->mobj_data['qpdate']; 
	$qpsession = $aobj_context->mobj_data['qpsession'];
	
	$select_qry = "select * from colldesp where fqpcode = '{$qpcode}' 
	              and fcollcode ='{$College_Code}' order by FBUNO asc";
				//var_dump($select_qry);
	$lobj_rs = $aobj_context->mobj_db->getAll($select_qry);
	$arr['bundle_details']=$lobj_rs;
	if($lobj_rs)
	{
		
		print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"));
		return;
	 }
	else
	{
		
		print_r($aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure"));      
	 }
}

function saveBundleDetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	session_start();	
    include_once("/JSON.php"); 
	$json = new Services_JSON();
	
	$College_Code = $_SESSION['collcode'];
	$qpcode =  $aobj_context->mobj_data['qpcode'];
	$qpdate =  $aobj_context->mobj_data['qpdate']; 
	$qpsession = $aobj_context->mobj_data['qpsession'];
	
	if($College_Code == '')
	{
		$rdata = "Login and Try again";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
		return $rdata;
	}	

	$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
	$mobj_jsondata = $json->decode($lstr_param);
	$Bundisp_details = get_object_vars($mobj_jsondata);	

	foreach($Bundisp_details as $ak=>$av)
	{
	
		if($av->d != 0)
		{
			$update="update colldesp set
			FTOTSCRIPT='{$av->c}'
			where fcollcode='{$College_Code}' and fqpcode = '{$qpcode}' and fbuno='{$av->d}'";
			//var_dump($update);
			$lobj_insert_qry = $aobj_context->mobj_db->Execute($update);

		}
		else
		{	
			$insert="insert into colldesp(FCOLLCODE,FDOE,FSESSION,FQPCODE,FTOTSCRIPT)
			values('{$College_Code}','{$qpdate}','{$qpsession}','{$qpcode}','{$av->c}')";
			$lobj_insert_qry = $aobj_context->mobj_db->Execute($insert);
			//var_dump($insert);
		}
	}
	
		if($lobj_insert_qry)
		{
			$rdata = "Updated Successfully.";
			print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
			return $rdata;
		 }
		else
		{
			$rdata = "No Updation / Add..!";
			print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
			return $rdata;			
		}			
	 	
 

}


function deleteBundleDetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	session_start();	
	$bundleId=  $aobj_context->mobj_data['bunid'];
	$College_Code = $_SESSION['collcode'];
	
	$delete="delete from colldesp where fcollcode='{$College_Code}' and fbuno='{$bundleId}'";
		var_dump($delete);	
	$lobj_delete_qry = $aobj_context->mobj_db->Execute($delete);
	
	if($lobj_delete_qry)
	{
		$rdata = "Updated Successfully.";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
		return $rdata;
	 }
	else
	{
		$rdata = "Update Failed..";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
		return $rdata;			
	}			
	

}

?>