Exemple #1
0
        $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'];
        if (is_array($tr)) {
            foreach ($tr as $key => $value) {
                if ($value['user'] == $userConnected && $key != $numero) {
                    unset($tr[$key]);
                }
            }
        }
        if ($dureeR >= DUREE) {
            $tr[$numero]['user'] = $userConnected;
            $tr[$numero]['date_ouverture'] = time();
Exemple #2
0
require_once '../classes/Application.php';
require_once '../classes/Calendrier.php';
$appli = new Application();
$name = isset($_GET['name']) ? $_GET['name'] : '';
$enseigne = isset($_GET['enseigne']) ? $_GET['enseigne'] : '';
$irt = isset($_GET['irt']) ? $_GET['irt'] : '';
$trigramme = isset($_GET['trigramme']) ? $_GET['trigramme'] : '';
if (!$name && !$enseigne && !$irt && !$trigramme) {
    $_SESSION['flash']['danger'] = "Recherche non abouti de l'application. Pas d'information d'application passée!";
    die;
}
$array = array();
$res = $appli->SelectAppliSearch($name, $enseigne, $irt, $trigramme);
$cal = new Calendrier();
//debug($res);
if (count($res)) {
    for ($i = 0; $i < count($res); $i++) {
        $value = $res[$i];
        $cal->selectById($value[0]);
        if ($cal->getId()) {
            $tcal = array('JFO' => $cal->getJourFerierOuvert(), 'JFF' => $cal->getJourFerierFermer(), 'LO' => $cal->getLundiOuvert(), 'LF' => $cal->getLundiFermer(), 'MAO' => $cal->getMardiOuvert(), 'MAF' => $cal->getMardiFermer(), 'MEO' => $cal->getMercrediOuvert(), 'MEF' => $cal->getMercrediFermer(), 'JO' => $cal->getJeudiOuvert(), 'JF' => $cal->getJeudiFermer(), 'VO' => $cal->getVendrediOuvert(), 'VF' => $cal->getVendrediFermer(), 'SO' => $cal->getSamediOuvert(), 'SF' => $cal->getSamediFermer(), 'DO' => $cal->getDimancheOuvert(), 'DF' => $cal->getDimancheFermer());
        } else {
            $tcal = '';
        }
        array_push($array, array("ID" => $value[0], "NAME" => $value[1], "ENSEIGNE" => $value[2], "IRT" => $value[3], "TRIGRAMME" => $value[4], "CAL" => $tcal));
    }
}
$json = json_encode($array);
header('Content-Type: application/json');
echo $json;
//debug($array);