alert(_('Valeurs invalides')); } $choose = "yes"; } /* * Close selected periode */ if (isset($_POST['close_per'])) { if (isset($_POST['sel_per_close'])) { $a_per_to_close = $_POST['sel_per_close']; for ($i = 0; $i < count($a_per_to_close); $i++) { $per = new Periode($cn); $jrn_def_id = isset($_GET['jrn_def_id']) ? $_GET['jrn_def_id'] : 0; $per->jrn_def_id = $jrn_def_id; $per->set_periode($a_per_to_close[$i]); $per->close(); } } $choose = "yes"; } if ($action == "delete_per") { $p_per = $_GET["p_per"]; // Check if the periode is not used if ($cn->count_sql("select * from jrnx where j_tech_per={$p_per}") != 0) { alert(' Désolé mais cette période est utilisée'); } else { $count = $cn->get_value("select count(*) from parm_periode;"); if ($count > 1) { $Res = $cn->exec_sql("delete from parm_periode where p_id={$p_per}"); } else { alert(' Désolé mais vous devez avoir au moins une période');