/** * VALIDATE FUNCTION */ static function Validate($representative = null, $month = null) { if (Session::IsUserLogged() && Session::Get('accountant')) { $datas = Main::GetData(); if (!isset($representative) && isset($datas['representative_id'])) { $representative = $datas['representative_id']; } if (!isset($month) && isset($datas['report_month'])) { $month = $datas['report_month']; } if (!isset($representative) && isset($month)) { $month = null; } require VIEW . '/v_header.php'; if (!isset($representative) && !isset($month)) { require VIEW . '/www/v_select_validation.php'; } elseif (isset($representative) && !isset($month)) { $last_month = new DateTime('first day of last month'); $report = ExpenseReport::Compile($last_month, $representative); $closure = self::Closure($report, Session::Get('accountant')); if (count($closure) > 2) { require VIEW . '/www/v_report_status_update.php'; } elseif ($closure[0] === 'allowed') { $representative = $closure[1]; require VIEW . '/www/v_validate.php'; } else { $now = new DateTime(); $now = $now->format('d-m-Y'); $forbidden = 'La validation des fiches de frais a lieu ' . 'entre le 10 et le 20 du mois suivant. ' . 'Date du jour : ' . $now; require VIEW . '/www/v_forbidden.php'; } } else { $report = ExpenseReport::Compile($month, $representative); $representative = Representative::GetRepresentative($report); require VIEW . '/www/v_validate.php'; } require VIEW . '/v_footer.php'; } else { header('Location: /home/login'); } }
<table> <thead> <tr> <th>Matricule</th> <th>Prénom</th> <th>Nom de famille</th> <th>Adresse (Voie)</th> <th>Code Postal</th> <th>Ville</th> <th>Date d'embauche</th> <th>Sélection</th> </tr> </thead> <tbody> <?php $representatives = Representative::ListAll(); for ($i = 0; $i < count($representatives); $i++) { ?> <tr> <td><?php echo strtoupper($representatives[$i]->getServiceNumber()); ?> </td> <td><?php echo $representatives[$i]->getFirstName(); ?> </td> <td><?php echo $representatives[$i]->getLastName(); ?> </td>