<?php
// This script and data application were generated by AppGini 5.81
// 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('fichiers_partages');
	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 'agent':
			if(!$id) {
				?>
				$j('#agence<?php echo $rnd1; ?>').html('&nbsp;');
				<?php
				break;
			}
			$res = sql("SELECT `gestionnaires`.`matricule_gestionnaire` as 'matricule_gestionnaire', if(`gestionnaires`.`date_recrutement`,date_format(`gestionnaires`.`date_recrutement`,'%d/%m/%Y'),'') as 'date_recrutement', `gestionnaires`.`nom_prenom` as 'nom_prenom', `gestionnaires`.`telephone` as 'telephone', `gestionnaires`.`email` as 'email', `gestionnaires`.`adresse` as 'adresse', IF(    CHAR_LENGTH(`fonctions1`.`fonction`), CONCAT_WS('',   `fonctions1`.`fonction`), '') as 'fonction', IF(    CHAR_LENGTH(`agences1`.`agence`), CONCAT_WS('',   `agences1`.`agence`), '') as 'agence', `gestionnaires`.`photo` as 'photo', `gestionnaires`.`dossier` as 'dossier', `gestionnaires`.`observation` as 'observation' FROM `gestionnaires` LEFT JOIN `fonctions` as fonctions1 ON `fonctions1`.`idfonction`=`gestionnaires`.`fonction` LEFT JOIN `agences` as agences1 ON `agences1`.`idagence`=`gestionnaires`.`agence`  WHERE `gestionnaires`.`matricule_gestionnaire`='{$id}' limit 1", $eo);
			$row = db_fetch_assoc($res);
			?>
			$j('#agence<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['agence']))); ?>&nbsp;');
			<?php
			break;


	}

?>