Beispiel #1
0
    else { if (isset($_GET['init_motif_absence'])) {$init_motif_absence=$_GET['init_motif_absence'];} if (isset($_POST['init_motif_absence'])) {$init_motif_absence=$_POST['init_motif_absence'];} }
if (empty($_GET['def_motif_absence']) and empty($_POST['def_motif_absence'])) { $def_motif_absence="";}
    else { if (isset($_GET['def_motif_absence'])) {$def_motif_absence=$_GET['def_motif_absence'];} if (isset($_POST['def_motif_absence'])) {$def_motif_absence=$_POST['def_motif_absence'];} }

$total = 0;
$verification[0] = 1;
$erreur = 0;
$remarque = 0;

if ($action_sql == "ajouter" or $action_sql == "modifier")
{
   while ($total < $nb_ajout)
      {
            // Vérifcation des variable
              $init_motif_absence_ins = $_POST['init_motif_absence'][$total];
              $def_motif_absence_ins = securite_texte($_POST['def_motif_absence'][$total]);

              if ($action_sql == "modifier") { $id_motif_absence_ins = $_POST['id_motif'][$total]; }

            // Vérification des champs nom et prenom (si il ne sont pas vides ?)
            if($init_motif_absence_ins != "" && $def_motif_absence_ins != "")
            {
                 if($action_sql == "ajouter") { $test = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*) FROM absences_motifs WHERE init_motif_absence = '".$init_motif_absence_ins."'"),0); }
                 if($action_sql == "modifier") { $test = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*) FROM absences_motifs WHERE id_motif_absence != '".$id_motif_absence_ins."' AND init_motif_absence = '".$init_motif_absence_ins."'"),0); }
                 if ($test == "0")
                  {
                     if($action_sql == "ajouter")
                      {
                            // Requete d'insertion MYSQL
                             $requete = "INSERT INTO absences_motifs (init_motif_absence,def_motif_absence) VALUES ('$init_motif_absence_ins','$def_motif_absence_ins')";
                      }
    else { if (isset($_GET['init_absence_action'])) {$init_absence_action=$_GET['init_absence_action'];} if (isset($_POST['init_absence_action'])) {$init_absence_action=$_POST['init_absence_action'];} }
if (empty($_GET['def_absence_action']) and empty($_POST['def_absence_action'])) { $def_absence_action="";}
    else { if (isset($_GET['def_absence_action'])) {$def_absence_action=$_GET['def_absence_action'];} if (isset($_POST['def_absence_action'])) {$def_absence_action=$_POST['def_absence_action'];} }

$total = 0;
$verification[0] = 1;
$erreur = 0;
$remarque = 0;

if ($action_sql == "ajouter" or $action_sql == "modifier")
{
   while ($total < $nb_ajout)
      {
            // Vérifcation des variable
              $init_absence_action_ins = $_POST['init_absence_action'][$total];
              $def_absence_action_ins = securite_texte($_POST['def_absence_action'][$total]);

              if ($action_sql == "modifier") { $id_absence_action_ins = $_POST['id_motif'][$total]; }

            // Vérification des champs nom et prenom (si il ne sont pas vides ?)
            if($init_absence_action_ins != "" && $def_absence_action_ins != "")
            {
                 if($action_sql == "ajouter") { $test = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*) FROM absences_actions WHERE init_absence_action = '".$init_absence_action_ins."'"),0); }
                 if($action_sql == "modifier") { $test = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*) FROM absences_actions WHERE id_absence_action != '".$id_absence_action_ins."' AND init_absence_action = '".$init_absence_action_ins."'"),0); }
                 if ($test == "0")
                  {
                     if($action_sql == "ajouter")
                      {
                            // Requete d'insertion MYSQL
                             $requete = "INSERT INTO absences_actions (init_absence_action,def_absence_action) VALUES ('$init_absence_action_ins','$def_absence_action_ins')";
                      }