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


Current Path : /proc/thread-self/root/var/www/misc/public_html/live100/src/
Upload File :
Current File : //proc/thread-self/root/var/www/misc/public_html/live100/src/tranMaster.php

<?php

function saveTranMaster($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$add_edit = trim($aobj_context->mobj_data["add_edit"]);
	$taxcode = trim($aobj_context->mobj_data["taxcode"]);
	$taxname = trim($aobj_context->mobj_data["taxdesc"]);
	
	if($add_edit == 'Add')
	{
		$save_tax = "insert into mastax(FTAXDESC) values('{$taxname}')";
		$lobj_save_tax = $aobj_context->mobj_db->Execute($save_tax);
		$last_inserted_id = $aobj_context->mobj_db->Insert_ID();
		if($lobj_save_tax)
		{
			$success_msg = 'Updated successfully.'.' '.'Supplier code : '.$last_inserted_id;
			echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success"); 
			return;
		}
		else 
		{
			$error_msg = 'Updation failed';
			echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure"); 
			return;		
		}
	}
	else if($add_edit == 'Edit')
	{
		$update_tax = "update mastax set ftaxdesc = '{$taxname}' where ftaxcode = '{$taxcode}'";
		$lobj_update_tax = $aobj_context->mobj_db->Execute($update_tax);
		
		if($lobj_update_tax)
		{
			$success_msg = 'Updated successfully';
			echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success"); 
			return;
		}
		else 
		{
			$error_msg = 'Updation failed';
			echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"failure"); 
			return;		
		}
	}
}

function viewTranMaster($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	session_start();
	 
		
		include_once($aobj_context->main_src.'/src/display_details_in_grid_custom.php');
		$display_obj=new display_details_in_grid($aobj_context);
		$display_obj->table_cols=array('grid_taxcode','grid_taxdesc');
		$display_obj->display_qry="select ftaxcode as id, ftaxcode as grid_taxcode, ftaxdesc as grid_taxdesc from mastax where ifnull(fdeleted,'') <> 'T'";	
 			
		$display_obj->DisplayDetailsInGrid();
	
}


function gettaxCodeDetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 	
	session_start();   //and FDELETED = 'F'
	$taxcode =$aobj_context->mobj_data["taxcode"];  

	$get_tax_details = "select * from mastax where ftaxcode = '{$taxcode}'";	 
 
	$lobj_get_tax_details = $aobj_context->mobj_db->getRow($get_tax_details);
	
	
	if(lobj_get_tax_details )
	{
		echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_tax_details,0,"success"); 
		return;
	}
	else 
	{
		$error_msg = 'no details found ';
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"Disabled"); 
		return;		
	}
}

?>