<?php
// This script and data application were generated by AppGini 5.76
// 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('transferts_argent');
	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 'emetteur':
			if(!$id){
				?>
				$j('#nni_emetteur<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#phone_emetteur<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#adresse_emetteur<?php echo $rnd1; ?>').html('&nbsp;');
				<?php
				break;
			}
			$res = sql("SELECT `clients`.`matricule_client` as 'matricule_client', if(`clients`.`date_inscription`,date_format(`clients`.`date_inscription`,'%d/%m/%Y'),'') as 'date_inscription', `clients`.`nom_prenom` as 'nom_prenom', `clients`.`sexe` as 'sexe', if(`clients`.`date_naissance`,date_format(`clients`.`date_naissance`,'%d/%m/%Y'),'') as 'date_naissance', `clients`.`age` as 'age', `clients`.`nni` as 'nni', `clients`.`adresse` as 'adresse', `clients`.`telephone` as 'telephone', `clients`.`email` as 'email', IF(    CHAR_LENGTH(`banques1`.`banque`), CONCAT_WS('',   `banques1`.`banque`), '') as 'banque', `clients`.`compte` as 'compte', `clients`.`photo` as 'photo', `clients`.`signature` as 'signature', IF(    CHAR_LENGTH(`agences1`.`agence`), CONCAT_WS('',   `agences1`.`agence`), '') as 'agence', `clients`.`dossier` as 'dossier', `clients`.`urgence` as 'urgence', `clients`.`observation` as 'observation' FROM `clients` LEFT JOIN `banques` as banques1 ON `banques1`.`idbanque`=`clients`.`banque` LEFT JOIN `agences` as agences1 ON `agences1`.`idagence`=`clients`.`agence`  WHERE `clients`.`matricule_client`='{$id}' limit 1", $eo);
			$row = db_fetch_assoc($res);
			?>
			$j('#nni_emetteur<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['nni']))); ?>&nbsp;');
			$j('#phone_emetteur<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['telephone']))); ?>&nbsp;');
			$j('#adresse_emetteur<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['adresse']))); ?>&nbsp;');
			<?php
			break;


	}

?>