示例#1
0
echo $emp_data['emp_name'];
?>
 </h2>
<div id="agenda">
	<!--le lien pour vouloir modifier l'agenda d'un employee-->
	<div><a href="emp_edit.php?<?php 
echo PARAM_EMP_ID . '=' . $emp_id;
?>
">
			<img border="0" alt="edit" src="pictures/edit.png">
		</a></div>
	<table>
		<tr><th>Heure</th><th>Activité</th></tr>

		<?php 
foreach (get_agenda($emp_id) as $key => $value) {
    echo '<tr><th>', $key, '</th><th>', $value, '</th></tr>';
}
// TODO: Afficher l'agenda de l'employé
if (array_key_exists(PARAM_EMP_ID, $_GET)) {
    echo $_GET[PARAM_EMP_ID];
}
?>

	</table>
</div>
<?php 
require_once 'view_bloc/_view_footer.php';
?>
</body>
</html>
示例#2
0
<?php

/* inclure les ficiers _data.php et _proc.php*/
require_once 'data/_data.php';
require_once 'utils/_proc.php';
define('PARAM_SUBMIT', 'submit');
$liste_employes = get_employes();
if (array_key_exists(PARAM_EMP_ID, $_GET)) {
    $emp_id = $_GET[PARAM_EMP_ID];
}
$liste_activites = get_activites();
$agenda = get_agenda($emp_id);
if (array_key_exists(PARAM_SUBMIT, $_POST)) {
    $agenda['08'] = $liste_activites[$_POST['08']];
    $agenda['09'] = $liste_activites[$_POST['09']];
    $agenda['10'] = $liste_activites[$_POST['10']];
    $agenda['11'] = $liste_activites[$_POST['11']];
    $agenda['12'] = $liste_activites[$_POST['12']];
    $agenda['13'] = $liste_activites[$_POST['13']];
    $agenda['14'] = $liste_activites[$_POST['14']];
    $agenda['15'] = $liste_activites[$_POST['15']];
    set_agenda($emp_id, $agenda);
    header('location: index.php?' . PARAM_EMP_ID . '=' . $emp_id);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Modifier l'agenda des l'employes</title>
</head>