<input type="hidden" name="consultant" value="<?php echo $row["consultant"]; ?>" />
<input type="hidden" name="consultant[]" value="<?php echo $row["consultant"]; ?>" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="http://www.stp-tool.be/wp-content/pages/includes/style.css" /> </head> <?php header('Content-type: text/html; charset=utf-8'); include('/var/www/stp_tool/wp-content/pages/includes/fonctions.php'); connexionbdd(); global $current_user; get_currentuserinfo(); // on crée la requête SQL $sql_consultants = "SELECT * FROM wp_consultants ORDER BY consultant ASC"; // on envoie la requête AM $req_consultants = mysql_query($sql_consultants) or die('Erreur SQL !<br>'.$sql_consultants.'<br>'.mysql_error()); //on obtient le resultat AM $res_consultants = mysql_num_rows($req_consultants); $prepa_date_rechercher= date("d-m-Y"); $date_rechercher = date("Y-m-d", strtotime(str_replace('/', '-', $prepa_date_rechercher))); ?> <form method="post" action="" enctype="multipart/form-data"> <center><u>Absences du matin le <?php echo $prepa_date_rechercher; ?> ?</u></center> <table id="Table" class="tablecenter"> <tr> <td> <center>Consultant :</center> </td> <td> <center>Malade ?</center> </td> <td> <center>VA ?</center> </td> <td> <center>ADV ?</center> </td> <td> <center>Petit chomage ?</center> </td> </tr> <br /><br /> <?php while($row = mysql_fetch_array($req_consultants)) { ?> <tr> <td> <center><?php echo $row["consultant"]; ?></center> <input type="hidden" name="consultant" value="<?php echo $row["consultant"]; ?>" /> </td> <td> <center><input type="checkbox" id="malade_am" name="malade_am[]" /></center> </td> <td> <center><input type="checkbox" id="va_am" name="va_am[]" /></center> </td> <td> <center><input type="checkbox" id="adv_am" name="adv_am[]" /></center> </td> <td> <center><input type="checkbox" id="petit_chomage_am" name="petit_chomage_am[]" /></center> </td> </tr> <?php $date_planning=$date_rechercher; $auteur=$current_user->display_name; $consultant=$row["consultant"]; } ?> </table> <br /><br /> <center><p><input type="submit" name="etape1" value="Passer à l'étape suivante" /></p></center> </form> <?php if (isset($_POST['etape1'])){ // if send form update data into database foreach ($_POST['malade_am'] as $malade_am) { $absences_malade_am = mysql_real_escape_string($malade_am); mysql_query("UPDATE wp_planning_taches SET malade_am = '$malade_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['va_am'] as $va_am) { $absences_va_am = mysql_real_escape_string($va_am); mysql_query("UPDATE wp_planning_taches SET va_am = '$va_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['adv_am'] as $adv_am) { $absences_adv_am = mysql_real_escape_string($adv_am); mysql_query("UPDATE wp_planning_taches SET adv_am = '$adv_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['petit_chomage_am'] as $petit_chomage_am) { $absences_petit_chomage_am = mysql_real_escape_string($petit_chomage_am); mysql_query("UPDATE wp_planning_taches SET petit_chomage_am = '$petit_chomage_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } echo "<center>On passe aux absences de l'après-midi.</center>"; header('Refresh: 10; url=creer_etape2.php'); } ?>
-- phpMyAdmin SQL Dump -- version 3.4.10.1deb1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le : Jeu 14 Septembre 2017 à 00:29 -- Version du serveur: 5.5.54 -- Version de PHP: 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `stp_tool` -- -- -------------------------------------------------------- -- -- Structure de la table `wp_planning_taches` -- CREATE TABLE IF NOT EXISTS `wp_planning_taches` ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `id_planning` bigint(20) NOT NULL, `date_planning` date NOT NULL, `auteur` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `consultant` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `inbound_am` text COLLATE utf8mb4_unicode_ci, `blancos_am` text COLLATE utf8mb4_unicode_ci, `callpicking1_am` text COLLATE utf8mb4_unicode_ci, `callpicking2_am` text COLLATE utf8mb4_unicode_ci, `contactmailbox_am` text COLLATE utf8mb4_unicode_ci, `quality_am` text COLLATE utf8mb4_unicode_ci, `sicknessfullfilment_am` text COLLATE utf8mb4_unicode_ci, `socdoc_am` text COLLATE utf8mb4_unicode_ci, `teleportel_am` text COLLATE utf8mb4_unicode_ci, `malade_am` text COLLATE utf8mb4_unicode_ci, `va_am` text COLLATE utf8mb4_unicode_ci, `adv_am` text COLLATE utf8mb4_unicode_ci, `petit_chomage_am` text COLLATE utf8mb4_unicode_ci, `inbound_pm` text COLLATE utf8mb4_unicode_ci, `blancos_pm` text COLLATE utf8mb4_unicode_ci, `callpicking1_pm` text COLLATE utf8mb4_unicode_ci, `callpicking2_pm` text COLLATE utf8mb4_unicode_ci, `contactmailbox_pm` text COLLATE utf8mb4_unicode_ci, `quality_pm` text COLLATE utf8mb4_unicode_ci, `sicknessfullfilment_pm` text COLLATE utf8mb4_unicode_ci, `socdoc_pm` text COLLATE utf8mb4_unicode_ci, `teleportel_pm` text COLLATE utf8mb4_unicode_ci, `malade_pm` text COLLATE utf8mb4_unicode_ci, `va_pm` text COLLATE utf8mb4_unicode_ci, `adv_pm` text COLLATE utf8mb4_unicode_ci, `petit_chomage_pm` text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=466 ; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<input type="hidden" name="consultant[]" value="<?php echo $row["consultant"]; ?>"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="http://www.stp-tool.be/wp-content/pages/includes/style.css" /> </head> <?php header('Content-type: text/html; charset=utf-8'); include('/var/www/stp_tool/wp-content/pages/includes/fonctions.php'); connexionbdd(); global $current_user; get_currentuserinfo(); // on crée la requête SQL $sql_consultants = "SELECT * FROM wp_consultants ORDER BY consultant ASC"; // on envoie la requête AM $req_consultants = mysql_query($sql_consultants) or die('Erreur SQL !<br>'.$sql_consultants.'<br>'.mysql_error()); //on obtient le resultat AM $res_consultants = mysql_num_rows($req_consultants); $prepa_date_rechercher= date("d-m-Y"); $date_rechercher = date("Y-m-d", strtotime(str_replace('/', '-', $prepa_date_rechercher))); ?> <form method="post" action="" enctype="multipart/form-data"> <center><u>Absences du matin le <?php echo $prepa_date_rechercher; ?> ?</u></center> <table id="Table" class="tablecenter"> <tr> <td> <center>Consultant :</center> </td> <td> <center>Malade ?</center> </td> <td> <center>VA ?</center> </td> <td> <center>ADV ?</center> </td> <td> <center>Petit chomage ?</center> </td> </tr> <br /><br /> <?php while($row = mysql_fetch_array($req_consultants)) { ?> <tr> <td> <center><?php echo $row["consultant"]; ?></center> <input type="hidden" name="consultant[]" value="<?php echo $row["consultant"]; ?>" /> </td> <td> <center><input type="checkbox" id="malade_am" name="malade_am[]" /></center> </td> <td> <center><input type="checkbox" id="va_am" name="va_am[]" /></center> </td> <td> <center><input type="checkbox" id="adv_am" name="adv_am[]" /></center> </td> <td> <center><input type="checkbox" id="petit_chomage_am" name="petit_chomage_am[]" /></center> </td> </tr> <?php $date_planning=$date_rechercher; $auteur=$current_user->display_name; $consultant=$row["consultant"]; } ?> </table> <br /><br /> <center><p><input type="submit" name="etape1" value="Passer à l'étape suivante" /></p></center> </form> <?php if (isset($_POST['etape1'])){ // if send form update data into database foreach ($_POST['malade_am'] as $malade_am) { $absences_malade_am = mysql_real_escape_string($malade_am); mysql_query("UPDATE wp_planning_taches SET malade_am = '$malade_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['va_am'] as $va_am) { $absences_va_am = mysql_real_escape_string($va_am); mysql_query("UPDATE wp_planning_taches SET va_am = '$va_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['adv_am'] as $adv_am) { $absences_adv_am = mysql_real_escape_string($adv_am); mysql_query("UPDATE wp_planning_taches SET adv_am = '$adv_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } foreach ($_POST['petit_chomage_am'] as $petit_chomage_am) { $absences_petit_chomage_am = mysql_real_escape_string($petit_chomage_am); mysql_query("UPDATE wp_planning_taches SET petit_chomage_am = '$petit_chomage_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'") or die(mysql_error()); } echo "<center>On passe aux absences de l'après-midi.</center>"; header('Refresh: 10; url=creer_etape2.php'); } ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="http://www.stp-tool.be/wp-content/pages/includes/style.css" /> </head> <?php header('Content-type: text/html; charset=utf-8'); date_default_timezone_set("Europe/Paris"); include('/var/www/stp_tool/wp-content/pages/includes/fonctions.php'); connexionbdd(); global $current_user; get_currentuserinfo(); // on crée la requête SQL $sql_consultants = "SELECT * FROM wp_consultants ORDER BY consultant ASC"; // on envoie la requête AM $req_consultants = mysql_query($sql_consultants) or die('Erreur SQL !<br>'.$sql_consultants.'<br>'.mysql_error()); //on obtient le resultat AM $res_consultants = mysql_num_rows($req_consultants); $id_consultant_max = mysql_result(mysql_query("SELECT MAX(ID) FROM wp_consultants"), 0); $prepa_date_rechercher= date("d-m-Y"); $date_rechercher = date("Y-m-d", strtotime(str_replace('/', '-', $prepa_date_rechercher))); $date_planning=$date_rechercher; $auteur=$current_user->display_name; $consultant=$row["consultant"]; $id_consultant=$row["ID"]; if (isset($_POST['etape1'])){ // if send form update data into database foreach ($_POST['malade_am'] as $i=>$malade_am) { $malade_am = mysql_real_escape_string($_POST['malade_am'][$i]); $va_am = mysql_real_escape_string($_POST['va_am'][$i]); $adv_am = mysql_real_escape_string($_POST['adv_am'][$i]); $consultant = mysql_real_escape_string($_POST['consultant'][$i]); $petit_chomage_am = mysql_real_escape_string($_POST['petit_chomage_am'][$i]); mysql_query("UPDATE wp_planning_taches SET malade_am = '$malade_am', va_am = '$va_am', adv_am = '$adv_am', consultant = '$consultant', petit_chomage_am = '$petit_chomage_am' WHERE consultant = '$consultant' AND date_planning = '$date_planning'"); } echo "<center>On passe aux absences de l'après-midi.</center>"; header('Refresh: 10; url=creer_etape2.php'); } ?> <form method="post" action=""> <center><u>Absences du matin le <?php echo $prepa_date_rechercher; ?> ?</u></center> <table id="Table" class="tablecenter"> <tr> <td> <center>Consultant :</center> </td> <td> <center>Malade ?</center> </td> <td> <center>VA ?</center> </td> <td> <center>ADV ?</center> </td> <td> <center>Petit chomage ?</center> </td> </tr> <br /><br /> <?php while($row = mysql_fetch_array($req_consultants)) { ?> <tr> <td> <center><?php echo $row["consultant"]; ?></center> <input type="hidden" name="id_consultant[<?php echo $row["id_consultant"]; ?>]" value="<?php echo $row["id_consultant"]; ?>" /> <input type="hidden" name="consultant[<?php echo $row["id_consultant"]; ?>]" value="<?php echo $row["consultant"]; ?>" /> </td> <td> <center><input type="checkbox" id="malade_am" name="malade_am[<?php echo $row["id_consultant"]; ?>]" /></center> </td> <td> <center><input type="checkbox" id="va_am" name="va_am[<?php echo $row["id_consultant"]; ?>]" /></center> </td> <td> <center><input type="checkbox" id="adv_am" name="adv_am[<?php echo $row["id_consultant"]; ?>]" /></center> </td> <td> <center><input type="checkbox" id="petit_chomage_am" name="petit_chomage_am[<?php echo $row["id_consultant"]; ?>]" /></center> </td> </tr> <?php } ?> </table> <br /><br /> <center><p><input type="submit" name="etape1" value="Passer à l'étape suivante" /></p></center> </form>