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

	include_once("$currDir/header.php");

	/* grant access to all users who have access to the facture table */
	$order_from = get_sql_from('demandes_permissions');
	if(!$order_from) exit(error_message('Accès non autorisé!', false));

	/* get invoice */
	$order_id = intval($_REQUEST['iddemande_permission']);
	if(!$order_id) exit(error_message('ID facture invalide!', false));
	
	/* retrieve order info */
	$order_fields = get_sql_fields('demandes_permissions');
	$res = sql("select {$order_fields} from {$order_from} and iddemande_permission={$order_id}", $eo);
	if(!($order = db_fetch_assoc($res))) exit(error_message('Aucune facture disponible', false));
	
	//var_dump($order);
	
	/* retrieve order items */
	$items = array();
	$order_total = 0;
	$item_fields = get_sql_fields('demandes_permissions');
	$item_from = get_sql_from('demandes_permissions');
	$res = sql("select {$item_fields} from {$item_from} and demandes_permissions.matricule={$order_id}", $eo);
	while($row = db_fetch_assoc($res)){
		//$row['LineTotal'] = str_replace('$', '', $row['montant']) * $row['qte'];
		$ordres_demandes_permission[] = $row;
		//$order_total += $row['LineTotal'];
	}
	
	//var_dump(ordres_demandes_permission);
	
	?>
	
	<html>
<head>
	<title>Note de service de demandes_permission</title>
<style type="text/css" media="print">
input.imprimer
{
display:none;
}
</style>
 
</head>
 
<body>

<form method="POST" action="">
 
<input type="button" value="Imprimer" class="imprimer" name="bnom" onClick="javascript:window.print()">
</form>

</body>
 
</html>
	
<h6>Honneur - Fraternité - Justice</h6>
<center>
<h4>Ministère de l'Habitat de l'Urbanisme et de l'Aménagement du territoire</h4>
<p>Direction des Affaires Administratives et Financières</p>
<p>Service du Personnel</p>
</center>
<center><u><h4>DEMANDE DE PERMISSION N° <?php echo $order['iddemande_permission']; ?>/MHUAT/DAAF/SP/<?php echo date('Y');?></h4></u></center>
<br>
	<div class="row">
		<div class="col-sm-6">
			<!-- customer info -->
			<p><u>NOM ET PRENOM</u> : <?php echo $order['nom_prenom']; ?> </p><br>
			<p><u>MATRICULE</u> : <?php echo $order['matricule']; ?> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>DATE RECRUTEMENT :</u> <?php echo $order['date_recrutement']; ?></p>
			<p><u>FONCTION</u> : <?php echo $order['fonction']; ?> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>DIVISION :</u> <?php echo $order['division']; ?></p>
			<p><u>SERVICE</u> : <?php echo $order['service']; ?> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>DIRECTION :</u> <?php echo $order['direction']; ?></p>
			<br><br>
			<center>
				<p><u>DATE DE DEPART SOUHAITE</u> : <?php echo $order['depart']; ?></p>
				<br>
				<p><u>DATE DEPART DERNIERE PERMISSION</u> : <?php echo $order['date_dernier_permission']; ?> </p>
				<p><u>ADRESSE PENDANT VOTRE ABSENCE</u> : <?php echo $order['adresse_permission']; ?> </p>
			</center>
			<br>
			<center>
			<p><u>DATE DEMANDE</u> : <?php echo $order['date_demande_p']; ?> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>SIGNATURE DEMANDEUR</u></p>
			</center>
			<center>
			<br><br>
			<p><u>AVIS CHEF HIERARCHIQE</u> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>AVIS DIRECTION UTILISATRICE</u></p>
			<br><br><br>
			<p><u>OBSERVATION CHEF SERVICE PERSONNEL</u> &emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>AVIS DAAF</u></p>
			</center>
			<br><br>
			<center>
			<p><u>DECISION SECRETAIRE GENERAL</u></p>
			</center>
		</div>
			<center>
			<br><br>
			<h4><u>Cadre réservé au service du personnel</u></h4>
			<p><u>Nombre de jours à déduire</u> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>N° Note de service de</u> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>Observation</u></p>
			<br><br>
						<p><u>Demande reçu le : </u> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<u>Traité le :</p>
			</center>
	</div>

<?php

?>
	
	<?php

	include_once("$currDir/footer.php");

?>
