if ($liste_choix[$_POST['choix']]['choix'] == 0) { $temps2 = mktime() + $liste_choix[$choix]['temps'] * 60; // penser à FROM_UNIXTIME } else { $temps2 = mktime() + $liste_choix[$choix]['temps'] * 60; } $save_ecran_def = requetemysql::save_ecran_def(array('temps2' => $temps2, 'texte' => $liste_choix[$choix]['nom'], 'choix' => $liste_choix[$choix]['choix'], 'permission' => $_SESSION['login'])); echo $save_ecran_def; } elseif ($_GET['action'] == 'save_tel_client') { $save_tel_client = requetemysql::save_tel_client(array('numero' => $_POST['numero'], 'id_client' => $_POST['id_client'])); if (empty($save_tel_client)) { throw new Exception("erreur : sauvegarde du numero client"); } echo $save_tel_client; } elseif ($_GET['action'] == 'save_list_tel_part') { $save_list_tel_part = requetemysql::save_list_tel_part(array('numero' => $_POST['numero'], 'description' => $_POST['description'])); if (empty($save_list_tel_part)) { throw new Exception("erreur : sauvegarde du numero particulier"); } echo $save_list_tel_part; } elseif ($_GET['action'] == 'changement') { $st = $db->prepare("DELETE FROM `aerogard2`.`tourdegarde` where date=FROM_UNIXTIME('" . $_POST['ma_date'] . "'/1000,'%Y/%m/%d') and tour='" . $_SESSION['tour'] . "' and nature='" . $_POST['valeur'] . "'"); $st->execute(); $st->closeCursor(); $sql = "INSERT INTO `aerogard2`.`tourdegarde` (`id`, `login`, `from`, `date`, `nature`, `tour`) VALUES ('', :login, :from, FROM_UNIXTIME(:date/1000,'%Y/%m/%d'), :nature, :tour )"; $sth = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)); $sth->execute(array(':login' => $_POST['veto'], ':from' => $_SESSION['login2'], ':date' => $_POST['ma_date'], ':nature' => $_POST['valeur'], ':tour' => $_SESSION['tour'])); $st->closeCursor(); echo json_encode("ok"); } elseif ($_GET['action'] == 'deplacement') { $date_debut = mktime(0, 0, 0, date("m", $_POST['ma_date'] / 1000), 1, date("Y", $_POST['ma_date'] / 1000));