90 lines
2.6 KiB
PHP
90 lines
2.6 KiB
PHP
<?php
|
|
// ****************************************'
|
|
// Le CASTEL-BTS SIO/ PROJET SDIS29 '
|
|
// Programme: c_interventions.php '
|
|
// Objet : gestion des interventions '
|
|
// Client : Bts SIO2 '
|
|
// Version : 1.0 '
|
|
// Date : 23/05/2019 à 12h00 '
|
|
// Auteur : pascal-blain@wanadoo.fr '
|
|
//*****************************************'
|
|
$action = $_REQUEST['action'];
|
|
switch ($action) {
|
|
case 'voir': {
|
|
include("vues/v_entete.php");
|
|
|
|
if (!isset($_REQUEST['zSemaine'])) {
|
|
$_REQUEST['zSemaine'] = date('W');
|
|
}
|
|
$semaine = $_REQUEST['zSemaine'];
|
|
|
|
if (!isset($_REQUEST['zAnnee'])) {
|
|
$_REQUEST['zAnnee'] = date('Y');
|
|
}
|
|
$annee = $_REQUEST['zAnnee'];
|
|
$premierJour = strtotime("+$semaine weeks", mktime(0, 0, 0, 1, 1, $annee));
|
|
|
|
if (date('w', $premierJour) != 1) {
|
|
$premierJour = strtotime("last monday", $premierJour);
|
|
}
|
|
$lesTranches = $pdo->getParametre("tranche");
|
|
$lesTypesDispos = $pdo->getParametre("dispo");
|
|
$titre = "CIS"; //Centre d'incendie et de secours :";
|
|
//include("vues/v_choixCaserne.php");
|
|
//$lesPompiers = $pdo->getLesPompiers($choix);
|
|
//$lesInterventions = $pdo->getLesInterventions($choix);
|
|
//$intervention = 1;
|
|
//$lesParticipants = $pdo->getLesParticipants($choix, $intervention);
|
|
include("vues/v_Intervention.php");
|
|
break;
|
|
}
|
|
case 'nouvelle': {
|
|
include("vues/v_entete.php");
|
|
$lesCasernes = $pdo->getLesCasernes($_SESSION["adr1"]);
|
|
$lesMotifs = $pdo->motifIntervention();
|
|
$lesPompiers = $pdo->getPompiersDispo('2023-09-23', 2, 2924);
|
|
|
|
include("vues/v_nouvelleIntervention.php");
|
|
|
|
break;
|
|
}
|
|
case 'listePompier':
|
|
require_once ("../include/class.pdo.php");
|
|
|
|
$pdo = PdoBD::getPdoBD();
|
|
|
|
$lesPompiers = $pdo->getPompiersDispo('2023-09-23', 2, $_GET['cis']);
|
|
|
|
echo(json_encode($lesPompiers));
|
|
|
|
break;
|
|
//-----------------------------------------
|
|
case 'majGarde': {
|
|
$pdo->majGarde($_REQUEST["ztLaDate"], $_REQUEST["ztLaTranche"], $_REQUEST["ztExGarde"], $_REQUEST["ztPompier"]);
|
|
header('location: index.php?choixTraitement=gardes&action=voir&zSemaine=' . $_REQUEST["zSemaine"] . '&zAnnee=' . $_REQUEST["zAnnee"]);
|
|
break;
|
|
}
|
|
|
|
//-----------------------------------------
|
|
default: {
|
|
echo 'erreur d\'aiguillage !' . $action;
|
|
break;
|
|
}
|
|
}
|
|
/*
|
|
table equipe:
|
|
eCis smallint(6)
|
|
ePompier smallint(6)
|
|
eIntervention smallint(6)
|
|
|
|
table intervention :
|
|
iCis smallint(6)
|
|
iId smallint(6)
|
|
iLieu varchar(50)
|
|
iDescription varchar(255)
|
|
iDate datetime
|
|
iTranche tinyint(3)
|
|
iHeureDebut datetime
|
|
iHeureFin datetime
|
|
*/
|
|
?>
|