$listeCheck = ''; for ($i = 0; $i < count($STATGEOL); $i++) { if (isset($_POST['stat_zonegeo_' . $i])) { $listeCheck .= $i . ','; } } $stat = new Stat(); $stat->SetParam(NULL, $idIncident, $_POST['refchangement'], $_POST['stat_publicationIR'], $_POST['stat_publicationPM'], $_POST['stat_typecause'], $_POST['stat_typecause_second'], $_POST['stat_typologiegts'], $_POST['stat_equipeResp'], $_POST['fournisseurResp'], $_POST['statPowerprod'], $_POST['statLegacy'], $_POST['stat_Composant'], $_POST['Composant_complement'], $listeCheck); $idStat = $stat->Creer(); $_SESSION['flash']['success'] = "Le stat est Bien Ajouté !"; header('Location:modifStat.php?idStat=' . $idStat . '&idIncident=' . $idIncident); } } $incident = new incidents(); $incident->_setUser($userConnected); $incident->chargerIncident($idIncident); $impacte = new Impact(); $impacte->chargerFirstIncident($idIncident); $application = new Application(); $application->SelectAppliById($impacte->getApplicationId()); require_once '../inc/header.inc.php'; ?> <h1>Statistique</h1> <form action="" method="POST"> <div class="bloc"> <?php $link = "Stat"; require_once '../inc/search.inc.php'; ?> <div class="width100 input-group-addon"> <span class="fl-left" style=" line-height:2.5;">Edition de l'incident N° <strong> <?php
<?php foreach ($errors as $error) { echo '<li>' . $error . '</li>'; } ?> </ul> </div> <?php } ?> <form action="" method="POST"> <div class="bloc"> <?php $incident = new incidents(); $incident->chargerIncident($numincident); require_once '../inc/search.inc.php'; ?> <?php $statLink = $incident->getIdStat() ? 'modifStat.php?idIncident=' . $numincident . '&idStat=' . $incident->getIdStat() : 'stat.php?idIncident=' . $numincident; ?> <div class="width100 input-group-addon"> <span class="fl-left" style=" line-height:2.5;"> Ajout pour l'incident N°:<strong><?php echo $incident->getIncident(); ?> </strong> </span> <span class="lib" style="float:left; margin-left:25px; line-height:2.5;"> Titre comm : <strong><?php
require_once '../inc/fonctions.inc.php'; require_once '../classes/Impact.php'; require_once '../classes/Application.php'; require_once '../classes/incidents.php'; require_once '../classes/Calendrier.php'; $incident = new incidents(); $impacte = new Impact(); $appli = new Application(); $calendrier = new Calendrier(); if (isset($_GET['action'])) { $impacte->supprimer($IdImpact); $_SESSION['flash']['erreur'] = "Impacte supprimé!"; header('Location:ListeImpact.php?idIncident=' . $_GET['IdIncident']); } $impacte->chargerImpact($IdImpact); $incident->chargerIncident($impacte->getIncidentId()); $numero = $impacte->getIncidentId(); if (!empty($_POST)) { $errors = array(); $_POST['Incident_risqueAggravation'] = isset($_POST['Incident_risqueAggravation']) ? 1 : 0; $_POST['Incident_dejaApparu'] = isset($_POST['Incident_dejaApparu']) ? 1 : 0; $_POST['Incident_previsible'] = isset($_POST['Incident_previsible']) ? 1 : 0; /* Contrôle des champs obligatoire */ if (empty($_POST['IdAppli'])) { $errors['IdAppli'] = "Vous devez remplir le champ Application!"; } if (!isInteger($_POST['Incident_Impact_jourhommeperdu']) && !empty($_POST['Incident_Impact_jourhommeperdu'])) { $errors['Incident_Impact_jourhommeperdu'] = "Le champ jours homme perdu doit etre numérique !"; }
$res = $SCHEMA->total_record(); if ($res && $_POST['IdIncident'] == $res[0][1]) { $errors['IdIncident'] = "Ce Numéro est déjà utlisé"; } } if (empty($errors)) { //Incident $incident->setIncident($numero, '', $_POST['IdIncident'], $_POST['titreincident'], $_POST['Incident_departement'], $_POST['Incident_statut'], $_POST['Incident_priorite'], $_POST['incidentuserimpacte'], $_POST['debutincident'], $_POST['finincident'], $_POST['Incident_duree'], $_POST['IncImpact_description'], $_POST['Incident_risqueAggravation'], $_POST['Incident_cause'], $_POST['incidentConnex'], $_POST['incidentprobleme'], $_POST['Incident_retablissement'], $_POST['incidentresponsabilite'], $_POST['incidentserviceacteur'], $_POST['Incident_localisation'], $_POST['Incident_useraction'], $_POST['incidentdatecreci'], $_POST['Incident_commentaire'], $_POST['Incident_dejaApparu'], $_POST['Incident_previsible'], $_POST['Incident_suivi'], $_POST['incidentdatedecision'], $_POST['Incident_chronogramme']); $incident->sauvegarder(); // Impacte $impacte->setParam($_POST['IdImpacte'], $numero, $_POST['IdAppli'], $_POST['Incident_Impact_datedebut'], $_POST['Incident_Impact_datefin'], $_POST['Incident_Impact_dureereelle'], $_POST['Incident_Impact_jourhommeperdu'], $_POST['Incident_Impact_impactmetier'], $_POST['Incident_Impact_impact'], $_POST['Incident_Impact_sla'], $_POST['Incident_Impact_criticite'], $_POST['Incident_Impact_description']); $impacte->modifier(); $_SESSION['flash']['success'] = " L'incident est bien modifié."; } } else { $incident->chargerIncident($numero); if (empty($incident->getNumero())) { $_SESSION['flash']['success'] = " Ce Numéro d'incident n'existe pas!"; header('Location:index.php'); } //debug($incident); $impacte->chargerFirstIncident($incident->getNumero()); $appli->SelectAppliById($impacte->getApplicationId()); if ($impacte->getApplicationId()) { $idAppli = $impacte->getApplicationId(); $calendrier->selectById($idAppli); //debug($calendrier); } // Tester l'existance de la fiche if (isset($tr[$numero])) { $dureeR = time() - $tr[$numero]['date_ouverture'];
<?php session_start(); define('TITLE', "Pas d'incidents"); require_once '../inc/config.inc.php'; require_once '../inc/fonctions.inc.php'; require_once '../classes/db.php'; require_once '../classes/incidents.php'; if (isset($_GET['supprimer'])) { $incidents = new incidents(); $incidents->chargerIncident($_GET['id']); $incidents->Supprimer(); $contenu_fichier_json = file_get_contents('../inc/TraceFiche.json'); $tr = json_decode($contenu_fichier_json, true); unset($tr[$_GET['id']]); $json = json_encode($tr); file_put_contents('../inc/TraceFiche.json', $json); $_SESSION['flash']['success'] = "L'incident est bien supprimé!"; } $req = "SELECT ID,INCIDENT FROM " . SCHEMA . ".INCIDENT"; $req .= " ORDER BY ID DESC"; $db = new db(); $db->db_connect(); $db->db_query($req); $res = $db->db_fetch_array(); if (!isset($res[0][0])) { require_once '../inc/header.inc.php'; ?> <h1>Pas d'incidents</h1> <a class="btn btn-success" href="add.php">Ajouter Incident</a> <?php