<?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('etat_paiements');
	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('#nom_prenom<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#fonction<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#prime<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#n_compte<?php echo $rnd1; ?>').html('&nbsp;');
				$j('#banque<?php echo $rnd1; ?>').html('&nbsp;');
				<?php
				break;
			}
			$res = sql("SELECT `dossier_individuel`.`photo` as 'photo', `dossier_individuel`.`matricule` as 'matricule', `dossier_individuel`.`iddindividuel` as 'iddindividuel', `dossier_individuel`.`nom_prenom` as 'nom_prenom', if(`dossier_individuel`.`date_naissance`,date_format(`dossier_individuel`.`date_naissance`,'%d/%m/%Y'),'') as 'date_naissance', `dossier_individuel`.`matrimoniale` as 'matrimoniale', `dossier_individuel`.`enfants` as 'enfants', `dossier_individuel`.`nni` as 'nni', `dossier_individuel`.`telephone` as 'telephone', `dossier_individuel`.`courriel` as 'courriel', `dossier_individuel`.`postale` as 'postale', if(`dossier_individuel`.`date_recrutement`,date_format(`dossier_individuel`.`date_recrutement`,'%d/%m/%Y'),'') as 'date_recrutement', IF(    CHAR_LENGTH(`fonctions1`.`fonction`), CONCAT_WS('',   `fonctions1`.`fonction`), '') as 'fonction', IF(    CHAR_LENGTH(`directions1`.`direction`), CONCAT_WS('',   `directions1`.`direction`), '') as 'direction', IF(    CHAR_LENGTH(`services1`.`service`), CONCAT_WS('',   `services1`.`service`), '') as 'service', IF(    CHAR_LENGTH(`divisions1`.`division`), CONCAT_WS('',   `divisions1`.`division`), '') as 'division', IF(    CHAR_LENGTH(`categorie_prime1`.`categorie`), CONCAT_WS('',   `categorie_prime1`.`categorie`), '') as 'categorie', IF(    CHAR_LENGTH(`statut1`.`statut`), CONCAT_WS('',   `statut1`.`statut`), '') as 'statut', REPLACE(FORMAT(`dossier_individuel`.`salaire`, 0), ',', ' ') as 'salaire', IF(    CHAR_LENGTH(`categorie_prime1`.`prime`), CONCAT_WS('',   `categorie_prime1`.`prime`), '') as 'prime_ts', `dossier_individuel`.`compte` as 'compte', IF(    CHAR_LENGTH(`les_banques1`.`banque`), CONCAT_WS('',   `les_banques1`.`banque`), '') as 'banque', `dossier_individuel`.`total_income` as 'total_income', `dossier_individuel`.`total_expense` as 'total_expense', `dossier_individuel`.`available_budget` as 'available_budget', `dossier_individuel`.`observation` as 'observation' FROM `dossier_individuel` LEFT JOIN `fonctions` as fonctions1 ON `fonctions1`.`idfonction`=`dossier_individuel`.`fonction` LEFT JOIN `directions` as directions1 ON `directions1`.`iddirection`=`dossier_individuel`.`direction` LEFT JOIN `services` as services1 ON `services1`.`idservice`=`dossier_individuel`.`service` LEFT JOIN `divisions` as divisions1 ON `divisions1`.`iddivision`=`dossier_individuel`.`division` LEFT JOIN `categorie_prime` as categorie_prime1 ON `categorie_prime1`.`id_categorie_prime`=`dossier_individuel`.`categorie` LEFT JOIN `statut` as statut1 ON `statut1`.`idstatut`=`dossier_individuel`.`statut` LEFT JOIN `les_banques` as les_banques1 ON `les_banques1`.`id`=`dossier_individuel`.`banque`  WHERE `dossier_individuel`.`iddindividuel`='{$id}' limit 1", $eo);
			$row = db_fetch_assoc($res);
			?>
			$j('#nom_prenom<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['nom_prenom']))); ?>&nbsp;');
			$j('#fonction<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['fonction']))); ?>&nbsp;');
			$j('#prime<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['prime_ts']))); ?>&nbsp;');
			$j('#n_compte<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['compte']))); ?>&nbsp;');
			$j('#banque<?php echo $rnd1; ?>').html('<?php echo addslashes(str_replace(array("\r", "\n"), '', nl2br($row['banque']))); ?>&nbsp;');
			<?php
			break;


	}

?>