sdis29-1/controleurs/c_interventions.php
pierre renaudot 7d09299dcb test
2023-11-30 14:03:21 +01:00

95 lines
2.3 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");
include("vues/v_Intervention.php");
break;
}
case 'nouvelle': {
include("vues/v_entete.php");
$lesCasernes = $pdo->getLesCasernes($_SESSION["adr1"]);
$lesMotifs = $pdo->motifIntervention();
$tranche = $pdo->getCurrentTranche();
$date = date('Y-m-d');
$lesPompiers = $pdo->getPompiersDispo($date, $tranche, 2904);
include("vues/v_nouvelleIntervention.php");
break;
}
case 'listePompier':
require_once ("../include/class.pdo.php");
$pdo = PdoBD::getPdoBD();
$tranche = $pdo->getCurrentTranche();
$date = date('Y-m-d');
$lesPompiers = $pdo->getPompiersDispo($date, $tranche, $_GET['cis']);
echo(json_encode($lesPompiers));
break;
case 'nouvelleInter':
require_once ("../include/class.pdo.php");
$pdo = PdoBD::getPdoBD();
//var_dump($_REQUEST);
$listePompier = $_POST['listePompier'];
$data = $_POST['dataForm'];
$pdo->newIntervention(
intval($data['motif']),
intval($data['caserne']),
$data['adresse'],
$data['commentaire'],
$listePompier
);
//var_dump($listePompier);
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
*/
?>