<?php
require_once("../../base/php/startSession.php");
require_once("../../base/php//classDatabase.php");
require_once( "../../base/php/Functions.php" );

global $database;


$budget_id = @$_POST["budget_id"];
if ($budget_id == "") {
	$budget_id = @$_GET["budget_id"];
}

$database = new Database("iCTI");

//echo $softCode;

$httpString = "";
$httpString = $httpString . "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
$httpString = $httpString . "\n<HTTP_SERVICE>";



	$sqlcmd = "SELECT xmldef 					
			FROM activite.v_budgets_saisis_1
			WHERE budget_id = $budget_id ";
	$result = $database->exec($sqlcmd);
				
	if ($result != false) {
	
		
		// lignes 
		$ok = TRUE;

		while ($ok == TRUE) {
			$ok = FALSE;
		
			$record = $database->nextRecordInto();
										

			if ($record != FALSE) {
				$ok = TRUE;

				$xmldef = trim($record[0]);
				
				
				$httpString = $httpString . "\r\n$xmldef";
					

			}
		}

	
	}
	
	
$httpString = $httpString . "\n</HTTP_SERVICE>";
 

$httpString = compress64($httpString);

echo "<CTICONTENT>$httpString</CTICONTENT>";
	




    
?>