<?php
// This script and data application were generated by AppGini 5.71
// Download AppGini for free from https://bigprof.com/appgini/download/

	$currDir = dirname(__FILE__);
	include("$currDir/defaultLang.php");
	include("$currDir/language.php");
	include("$currDir/lib.php");

	handle_maintenance();

	header('Content-type: text/javascript; charset=' . datalist_db_encoding);

	$table_perms = getTablePermissions('soldes');
	if(!$table_perms[0]){ die('// Access denied!'); }

	$mfk = $_GET['mfk'];
	$id = makeSafe($_GET['id']);
	$rnd1 = intval($_GET['rnd1']); if(!$rnd1) $rnd1 = '';

	if(!$mfk){
		die('// No js code available!');
	}

	switch($mfk){

		case 'matricule':
			if(!$id){
				?>
				$j('#client<?php echo $rnd1; ?>').html('&nbsp;');
				<?php
				break;
			}
			$res = sql("SELECT `clients`.`idclient` as 'idclient', `clients`.`matricule` as 'matricule', `clients`.`responsable_administratif` as 'responsable_administratif', `clients`.`adresse` as 'adresse', IF(    CHAR_LENGTH(`villes1`.`ville`), CONCAT_WS('',   `villes1`.`ville`), '') as 'ville', `clients`.`pays` as 'pays', `clients`.`telephone` as 'telephone', `clients`.`email` as 'email', `clients`.`forme_juridique` as 'forme_juridique', `clients`.`autre` as 'autre', CONCAT('$', FORMAT(`clients`.`tdepot`, 2)) as 'tdepot', CONCAT('$', FORMAT(`clients`.`tretrait`, 2)) as 'tretrait', CONCAT('$', FORMAT(`clients`.`sold`, 2)) as 'sold', `clients`.`observations` as 'observations' FROM `clients` LEFT JOIN `villes` as villes1 ON `villes1`.`id`=`clients`.`ville`  WHERE `clients`.`idclient`='{$id}' limit 1", $eo);
			$row = db_fetch_assoc($res);
			?>
			$j('#client<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['responsable_administratif']))); ?>&nbsp;');
			<?php
			break;


	}

?>