if (!isset($_GET["modele_id"])) { $_SESSION["message"] = "Fatal error edit modele call administrator modele id"; redirect_to($url); } //if (!isset($_GET["clientid"])) { // $_SESSION["message"] = "Fatal error edit modele call administrator client id"; // redirect_to($url); //} // ?> <?php //we can remove the get variable only $_GET["modeleid"] $modele = find_modele_by_id($_GET["modele_id"]); $client = find_client_by_id($modele["client_id"]); if (!$client || !$modele) { // admin ID was missing or invalid or // admin couldn't be found in database $_SESSION["message"] = "Fatal error edit modele call administrator database client id"; redirect_to($url); } ?> <?php if (isset($_POST['submit'])) { $required_fields = array("week_day_rank", "client_habituel", "heure", "pseudo", "visible"); validate_presences($required_fields); $week_day_rank = mysql_prep($_POST["week_day_rank"]);
function tooltips_modele($modele_id, $text_input = "") { $modele = find_modele_by_id($modele_id); $tooltip_text = ""; foreach ($modele as $key => $val) { $key_clean = ucfirst(str_replace("_", " ", $key)); if ($key == "week_day_rank") { $tooltip_text .= "Jour" . ": " . htmlentities(day_fr($val), ENT_COMPAT, 'utf-8') . "<br>"; } elseif ($key == "client_habituel") { if ($val == 0) { $val_yes_no = "Non"; } else { $val_yes_no = "Oui"; } $tooltip_text .= htmlentities($key_clean, ENT_COMPAT, 'utf-8') . ": " . htmlentities($val_yes_no, ENT_COMPAT, 'utf-8') . "<br>"; } elseif ($key == "client_id") { } elseif ($key == "inverse_addresse") { } elseif ($key == "input_date") { } elseif ($key == "prix_course") { $tooltip_text .= htmlentities($key_clean, ENT_COMPAT, 'utf-8') . ": " . htmlentities($val, ENT_COMPAT, 'utf-8') . " frs<br>"; } else { $tooltip_text .= htmlentities($key_clean, ENT_COMPAT, 'utf-8') . ": " . htmlentities($val, ENT_COMPAT, 'utf-8') . "<br>"; } } $output = ""; $output .= "<a class='' href='#' data-toggle='tooltip' data-html='true' data-placement='top' title='"; $output .= $tooltip_text; $output .= "'>"; $output .= $text_input; $output .= "<span class=\"glyphicon glyphicon-info-sign\" style='color: #000000;' aria-hidden='true'></span>"; $output .= "</a>"; return $output; }