?> </select> </div></div> <div class="form-group"> <label class="col-sm-3 control-label" for="heure">Heure départ*; </label> <div class="col-sm-9"> <select class="form-control" name="heure" id="heure" required> <option value="<?php echo htmlentities($modele['heure'], ENT_COMPAT, 'utf-8'); ?> "> <?php echo htmlentities(visu_heure($modele['heure']), ENT_COMPAT, 'utf-8'); ?> </option> <?php include "../includes/dataforms/hournew.php"; ?> </select> </div></div> <div class="form-group"> <label class="col-sm-3 control-label" for="depart">Départ</label> <div class="col-sm-9"> <input type="text" class="form-control" name="depart" autocomplete="off" list="liste_address" value="<?php
function output_program_day($string_date = 'now') { $date_unix = strtotime($string_date); $day_no = day_eng_no(strftime("%A", $date_unix)); $date_formatted = strftime("%d %b %Y", $date_unix); $day_name_french = day_fr($day_no); $date_sql = strftime("%Y-%m-%d", $date_unix); $full_date_formatted = $day_name_french . " " . $date_formatted; $output = ""; $program_set = find_program_by_date($date_sql); if (count_prog_by_date($date_sql) == 0) { $output .= "<p class='text-center' style='vertical-align:middle;'>pas de résultat pour le {$full_date_formatted}</p>"; } else { // $output .= Get_badges_program ($string_date); $output .= "<div class='table-responsive'>"; $output .= "<table class='table table-striped table-bordered table-hover table-condensed '>"; $output .= "<tr>"; // $output .= "<td class='text-center alert-danger'>Jour</td>"; //Heure if (isset($_GET["validation_chauffeur"])) { $valid_chauffeur = $_GET["validation_chauffeur"]; if ($valid_chauffeur == 1) { $color = ""; $style = "color: white; background-color:green;"; } elseif ($valid_chauffeur == 2) { $color = ""; $style = "color: white; background-color:palevioletred;"; } elseif ($valid_chauffeur == 0) { $color = ""; $style = "color: white; background-color:lightskyblue;"; } else { $color = ""; $style = ""; } } else { $valid_chauffeur = 3; $color = ""; $style = ""; } $output .= "<th class='text-center {$color}' style='vertical-align:middle; {$style}'> Heure </th>"; $output .= "<th class='text-center {$color}' style='vertical-align:middle;{$style} '>{$full_date_formatted}</th>"; // $output .= "<th class='text-center {$color}' style='vertical-align:middle;{$style} '></th>"; $output .= "</tr>"; while ($program = mysqli_fetch_assoc($program_set)) { $output .= "<tr>"; $client = find_client_by_id($program['client_id']); $heure = htmlentities(visu_heure($program['heure']), ENT_COMPAT, 'utf-8'); $client_web_view = htmlentities($client['web_view'], ENT_COMPAT, 'utf-8'); if ($program["validated_chauffeur"] == 1) { $succes = "success"; $color1 = "success"; } elseif ($program["validated_chauffeur"] == 2) { $succes = ""; $color1 = "danger"; } else { $succes = ""; $color1 = "info"; } // if($program['chauffeur'] && ($program["validated_chauffeur"]==1 || $program["validated_chauffeur"]==2)) { // $chauffeur =find_chauffeur_by_name(trim($program['chauffeur'])); // if ($chauffeur){ // $initial=$chauffeur['initial']; // } else { // $initial=""; // } // // } else { // $initial=""; // } /* if($program["validated_chauffeur"]==1){ $output.= "<td class='text-center {$succes}' style='vertical-align:middle;'>". $heure."</td>"; } else { $output.= "<td class='text-center' style='vertical-align:middle;'>". $heure."</td>"; }*/ $output .= "<td class='text-center {$succes}' style='vertical-align:middle;'>" . $heure . "</td>"; $output .= "<td class='text-center {$succes}'>" . get_modal_program($program['id']) . "</td>"; // $output.= "<td class='text-center {$succes}'><h5><span class='label label-{$color1}' style='width:6em;'>"; // $output.= "".htmlentities($initial,ENT_COMPAT, 'utf-8').""; // $output.= "</h5></span></td>"; $output .= "</tr>"; } $output .= "</table>"; $output .= "</div>"; } mysqli_free_result($program_set); return $output; }
</div> </div> <div class="form-group listheureretour"> <p class="col-sm-offset-3" style="font-size:0.9em;color:#ff0000" id="errorMessageHeure"></p> <label class="col-sm-3 control-label" for="HeureRetour" id="LabelHeureRetour">Heure Retour</label> <div class="col-sm-9"> <select class="form-control" name="HeureRetour" id="HeureRetour" onchange="myheureRetourchange()" > <option value="<?php echo htmlentities($course['heure_retour'], ENT_COMPAT, 'utf-8'); ?> " selected><?php echo htmlentities(visu_heure($course['heure_retour'])); ?> </option> <option value ="" ></option> <option value = 'NA'>NA</option> <?php include "../includes/dataforms/hournew.php"; ?> </select> </div> </div> <div class="form-group">
<div class="form-group"> <?php echo isset($msg_presence_warning_heure) ? $msg_presence_warning_heure : ""; ?> <?php echo isset($msg_presence_error_heure) ? $msg_presence_error_heure : ""; ?> <label class="col-sm-3 control-label" for="heure">Heure départ</label> <div class="col-sm-9"> <select class="form-control" name="heure" id="heure"> <?php if ((isset($_POST['heure']) || $_GET) && isset($heure)) { echo "<option value=" . "'" . htmlentities($heure, ENT_COMPAT, 'utf-8') . "'" . " selected>" . htmlentities(visu_heure($heure), ENT_COMPAT, 'utf-8') . "</option>"; } else { echo "<option value='' disabled selected>Heure départ </option>"; } ?> <?php include "../includes/dataforms/hournew.php"; ?> </select> </div></div> <div class="form-group"> <?php echo isset($msg_pseudo) ? $msg_pseudo : ""; ?>
echo $heure_retour_integer . "<br>"; if ($heure_aller_integer > $heure_retour_integer) { echo "FALSE heure aller superieur heure retour"; } else { echo "OK heure aller inferieur heure retour"; } echo "<hr>"; echo substr($heure_aller, 0, 1) . "<br>"; echo substr($heure_retour, 0, 1) . "<br>"; echo "<hr>"; //format hours for vizualization form function visu_heure($heure) { $first = (int) substr($heure, 0, 1); $len = strlen($heure); $heure = str_replace("h", ":", $heure); $heure_no_0 = substr($heure, 1, $len - 1); if ($first == 0) { return $heure_no_0; } else { return $heure; } } echo "<hr>"; echo $heure = visu_heure($heure_aller) . "<br>"; echo $heure = visu_heure($heure_retour) . "<br>"; ?> </body> </html>
function choisir_distinct_form($column_name, $table_name, $precede_name = "", $date_return = "") { //$column_name //$table_name //$precede_name // $date_return only for date will add the date function // global $connection; //$table_name="clients"; // $column_name='pseudo'; $output = ""; $output_form = ""; // $table_mysql=array('admins','chauffeurs','clients'); $col_date = array('course_date', 'str_time'); $col_heure = array('heure'); $col_day = array('week_day_rank'); $col_monthname = array('monthname'); $col_week = array('week'); $col_year = array('year'); $column_name_display = ""; $col_date_return = array('monthname', 'year', 'day', 'week', 'yearweek', 'dayname'); if ($date_return && in_array($date_return, $col_date_return)) { $format_col_name = "{$date_return}({$column_name}) as {$column_name}"; // var_dump($format_col_name1); // $format_col_name=$column_name; } else { $format_col_name = $column_name; } $array_dec = array('course_date'); $asc_desc = " ASC"; if (isset($array_dec) && in_array($column_name, $array_dec)) { $asc_desc = " DESC"; } $query = "SELECT DISTINCT "; $query .= " {$format_col_name} "; $query .= "FROM {$table_name} "; $query .= "ORDER BY {$column_name} {$asc_desc} "; // var_dump($query); if ($precede_name) { if ($date_return && in_array($date_return, $col_date_return)) { $final_column_name = $precede_name . "_" . $date_return . "_" . $column_name; } else { $final_column_name = $precede_name . "_" . $column_name; } } else { $final_column_name = $column_name; } $return_query_set = mysqli_query($connection, $query); confirm_query($return_query_set); while ($return_query = mysqli_fetch_assoc($return_query_set)) { $data = htmlentities($return_query[$column_name], ENT_COMPAT, 'utf-8'); $output .= "<option value='{$data}'>"; if (in_array($column_name, $col_date)) { list($date_fr, $date_fr_short, $date_fr_long, $date_fr_hr, $date_fr_short_hr, $date_fr_long_hr, $date_fr_full_hr) = date_fr($data); if ($date_return == "monthname") { $output .= htmlentities(mth_fr_name($data), ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Mois", ENT_COMPAT, 'utf-8'); } elseif ($date_return == "year") { $output .= htmlentities($data, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("year", ENT_COMPAT, 'utf-8'); } elseif ($date_return == "week") { $output .= htmlentities($data, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Semaine", ENT_COMPAT, 'utf-8'); } elseif ($date_return == "day") { $output .= htmlentities($data, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Jour No", ENT_COMPAT, 'utf-8'); } elseif ($date_return == "dayname") { $output .= htmlentities(day_fr(day_eng_no($data)), ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Jour semaine", ENT_COMPAT, 'utf-8'); } elseif ($date_return == "yearweek") { $data_out = substr($data, 0, 4) . "-" . substr($data, 4, 2); $output .= htmlentities($data_out, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("An _Semaine", ENT_COMPAT, 'utf-8'); } else { $output .= htmlentities($date_fr_short, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Date", ENT_COMPAT, 'utf-8'); } } elseif (in_array($column_name, $col_heure)) { $output .= htmlentities(visu_heure($data), ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Heure", ENT_COMPAT, 'utf-8'); } elseif (in_array($column_name, $col_day)) { $output .= htmlentities(day_fr($data), ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Jour", ENT_COMPAT, 'utf-8'); } elseif (in_array($column_name, $col_monthname)) { $output .= htmlentities(mth_fr_name($data), ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Mois", ENT_COMPAT, 'utf-8'); } elseif (in_array($column_name, $col_week)) { $output .= htmlentities("Semaine " . $data, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Semaine", ENT_COMPAT, 'utf-8'); } elseif (in_array($column_name, $col_year)) { $output .= htmlentities($data, ENT_COMPAT, 'utf-8'); $column_name_display = htmlentities("Année", ENT_COMPAT, 'utf-8'); } else { $output .= $data; $column_name_display = htmlentities(ucfirst(str_replace('_', ' ', $column_name)), ENT_COMPAT, 'utf-8'); } $output .= "</option>"; } //$style="style='background-color: #2c2fff;width:150px;color: #f3f2ff;text-align: center'"; // $class="pure-input-1-2"; $class = " class=\"form-control\" "; mysqli_free_result($return_query_set); // $output_form.="<div class='col-lg-2 col-md-2'>"; $output_form .= "<div class=\"form-group\" >"; $output_form .= "<label for='{$final_column_name}'></label>"; $output_form .= "<select {$class} name='{$final_column_name}' id='{$final_column_name}' >"; $output_form .= "<option value='' disabled selected>{$column_name_display}</option>"; $output_form .= $output; $output_form .= "</select>"; $output_form .= "</div>"; // $output_form.="</div>"; return $output_form; }
function output_all_modele_pivot_search($time = "tomorrow") { global $visible; $modele_set = find_all_modele_pivot($visible); $page_name = "modele_export.php"; // page which import the day $output = ""; // $now = strtotime("now"); // $now_no = day_eng_no(strftime("%A" ,$now)); // $now_date_formatted = strftime("%d-%m-%Y" ,$now); // $today_day_name_french = day_fr($now_no); $tomorrow = strtotime($time); $tomorrow_no = day_eng_no(strftime("%A", $tomorrow)); $tomorrow_date_formatted = strftime("%d-%m-%Y", $tomorrow); $tomorrow_day_name_french = day_fr($tomorrow_no); $tomorrow_date_sql = strftime("%Y-%m-%d", $tomorrow); // echo "now - <strong>".$now."</strong><br>"; // echo "now_no - <strong>".$now_no."</strong><br>"; // echo "now_date_formatted - <strong>".$now_date_formatted."</strong><br>"; // echo "today_day_name_french - <strong>".$today_day_name_french."</strong><br>"; // // echo "<hr>"; // // echo "tomorrow - <strong>".$tomorrow."</strong><br>"; // echo "tomorrow_no - <strong>".$tomorrow_no."</strong><br>"; // echo "tomorrow_date_formatted - <strong>".$tomorrow_date_formatted."</strong><br>"; // echo "tomorrow_day_name_french - <strong>".$tomorrow_day_name_french."</strong><br>"; $output .= "<div class='table-responsive'>"; $output .= "<table class='table table-striped table-bordered table-hover table-condensed'>"; $output .= "<tr>"; $output .= "<th class='text-center' style='vertical-align:middle;'>Heure</th>"; for ($a = 1; $a <= 7; $a++) { $day = day_fr($a); // func return Lundi, Mardi... if ($a == $tomorrow_no) { $output .= "<td class='text-center alert-danger' style='color: white'><strong>"; $output .= "<a href=\"{$page_name}?jour="; $output .= urlencode($a); $output .= "&"; $output .= "modele_date="; $output .= urldecode($tomorrow_date_sql); $output .= "\" onclick=\"return confirm('Importer {$day}?');"; $output .= "\">"; $output .= $day . " " . $tomorrow_date_formatted; $output .= "   "; $output .= "<span class='glyphicon glyphicon-plus'style='color:green;' aria-hidden='true'></span>"; $output .= "   "; $output .= "</a>"; $output .= "</strong>"; $output .= "</td>"; // $output .= "<td class='text-center' colspan='3'>Actions</td>"; $output .= "</tr>"; $output .= "<tr>"; // $output .= "<td></td>"; } // end if } // end for $old_heure = ""; while ($modele = mysqli_fetch_assoc($modele_set)) { for ($a = 1; $a <= 7; $a++) { $day = day_fr($a); // func return Lundi, Mardi... $modele_id = $modele[$day]; // return value of array if ($a == $tomorrow_no && $modele[$day]) { $output .= "<tr>"; $new_heure = $modele['heure']; if ($new_heure !== $old_heure) { $output .= "<td class='text-center' style='vertical-align:middle;'><strong>" . htmlentities(visu_heure($modele["heure"]), ENT_COMPAT, 'utf-8') . "</strong></td>"; } else { $output .= "<td></td>"; } $old_heure = $modele["heure"]; } } $p_edit = "edit_course_modele.php"; $p_del = "delete_course_modele.php"; $p_new = "new_course_modele.php"; $web_view = htmlentities($modele["web_view"]); $pseudo = htmlentities($modele["pseudo"]); $heure = $modele['heure']; $client_id = $modele['client_id']; if ($web_view) { $client_name = $web_view; } else { $client_name = $pseudo; } for ($a = 1; $a <= 7; $a++) { $day = day_fr($a); // func return Lundi, Mardi... $modele_id = $modele[$day]; // return value of array if ($a == $tomorrow_no && $modele[$day]) { if ($day == $tomorrow_day_name_french) { $output .= "<td class='text-center'>"; } // $output.= tooltips_modele($modele_id,$client_name); $output .= tooltips_modele($modele_id); $output .= "<span class='btn'>"; if ($visible == 1) { $output .= "<a class='btn btn-primary btn-xm' style='width:14em;' "; } else { $output .= "<a class='btn btn-info btn-xm' style='width:14em;' "; } $output .= get_modal_modele($modele_id, $tomorrow_date_sql); $output .= "</a>"; $output .= "</span>"; $output .= "</td>"; // $output .= "<td>"; // $output .= "<a href=\"{$p_edit}?client_id="; // $output .= urlencode($client_id) . "&modele_id=" . urlencode($modele_id) . "&jour_id=" . urlencode($a); // $output .= " \" onclick=\"return confirm('Editer modele {$pseudo} ?');"; // $output .= " \">"; // $output.="   "; // $output .= "<span class='glyphicon glyphicon-pencil'style='color:blue;' aria-hidden='true'></span>"; // $output.="   "; // $output .= "</a>"; // $output .= "</td>"; // // $output .= "<td>"; // $output .= "<a href=\"{$p_new}?client_id="; // $output .= urlencode($client_id) . "&modele_id=" . urlencode($modele_id); // $output .= " \" onclick=\"return confirm('Nouveau modele {$pseudo} ?');"; // $output .= " \">"; // $output.="   "; // $output .= "<span class='glyphicon glyphicon-plus'style='color:green;' aria-hidden='true'></span>"; // $output.="   "; // $output .= "</a>"; // $output .= "</td>"; // // // $output .= "<td>"; // $output .= "<a href=\"{$p_del}?modele_id=" . urlencode($modele_id); // $output .= " \" onclick=\"return confirm('Delete modele {$pseudo} {$day} à {$heure}?');"; // $output .= " \">"; // $output.="   "; // $output .= "<span class='glyphicon glyphicon-remove'style='color:red;' aria-hidden='true'></span>"; // $output.="   "; // $output .= "</a>"; // // $output .= "</td>"; $output .= "</tr>"; } } } // while $output .= "</table>"; mysqli_free_result($modele_set); $output .= "</div>"; return $output; }