コード例 #1
0
ファイル: fonctions_conges.php プロジェクト: TexGG/Libertempo
function affiche_calendrier_saisie_date($user_login, $year, $mois, $type_debut_fin)
{
    $jour_today = date('j');
    $jour_today_name = date('D');
    $first_jour_mois_timestamp = mktime(0, 0, 0, $mois, 1, $year);
    $last_jour_mois_timestamp = mktime(0, 0, 0, $mois + 1, 0, $year);
    $mois_name = date_fr('F', $first_jour_mois_timestamp);
    $first_jour_mois_rang = date('w', $first_jour_mois_timestamp);
    // jour de la semaine en chiffre (0=dim , 6=sam)
    $last_jour_mois_rang = date('w', $last_jour_mois_timestamp);
    // jour de la semaine en chiffre (0=dim , 6=sam)
    $nb_jours_mois = ($last_jour_mois_timestamp - $first_jour_mois_timestamp + 60 * 60 * 12) / (24 * 60 * 60);
    // + 60*60 *12 for f*****g DST
    if ($first_jour_mois_rang == 0) {
        $first_jour_mois_rang = 7;
    }
    // jour de la semaine en chiffre (1=lun , 7=dim)
    if ($last_jour_mois_rang == 0) {
        $last_jour_mois_rang = 7;
    }
    // jour de la semaine en chiffre (1=lun , 7=dim)
    echo '<table class="calendrier_saisie_date_debut" cellpadding="0" cellspacing="0">
        <thead>
        <tr align="center" bgcolor="' . $_SESSION['config']['light_grey_bgcolor'] . '">
        <td colspan=7 class="titre"> ' . $mois_name . ' ' . $year . ' </td>
        </tr>
        <tr bgcolor="' . $_SESSION['config']['light_grey_bgcolor'] . '">
        <td class="cal-saisie2">' . _('lundi_1c') . '</td>
        <td class="cal-saisie2">' . _('mardi_1c') . '</td>
        <td class="cal-saisie2">' . _('mercredi_1c') . '</td>
        <td class="cal-saisie2">' . _('jeudi_1c') . '</td>
        <td class="cal-saisie2">' . _('vendredi_1c') . '</td>
        <td class="cal-saisie2">' . _('samedi_1c') . '</td>
        <td class="cal-saisie2">' . _('dimanche_1c') . '</td>
        </tr>
        </thead>
        <tbody>';
    $start_nb_day_before = $first_jour_mois_rang - 1;
    $stop_nb_day_before = 7 - $last_jour_mois_rang;
    for ($i = -$start_nb_day_before; $i <= $nb_jours_mois + $stop_nb_day_before; $i++) {
        if (($i + $start_nb_day_before) % 7 == 0) {
            echo '<tr>';
        }
        $j_timestamp = mktime(0, 0, 0, $mois, $i + 1, $year);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if ($i < 0 || $i > $nb_jours_mois) {
            echo '<td class="' . $td_second_class . '">-</td>';
        } else {
            affiche_cellule_jour_cal_saisie($user_login, $j_timestamp, $td_second_class, $type_debut_fin);
        }
        if (($i + $start_nb_day_before) % 7 == 6) {
            echo '<tr>';
        }
    }
    echo '</tbody></table>';
}
コード例 #2
0
ファイル: functions.php プロジェクト: kamy333/kamy
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;
}
コード例 #3
0
ファイル: calendrier-pdf.php プロジェクト: VV666/Libertempo
function affiche_cellule_jour_user($sql_login, $j_timestamp, $year_select, $mois_select, $j, $second_class, $printable, $tab_calendrier, $tab_rtt_echange, $tab_rtt_planifiees, $tab_type_absence, $DEBUG = FALSE)
{
    $session = session_id();
    global $content;
    $return = array();
    // info bulle
    $j_date_fr = date_fr("d/m/Y", $j_timestamp);
    $j_num_semaine = date_fr("W", $j_timestamp);
    $info_bulle = " title=\"{$sql_login} - {$j_date_fr}\" ";
    if ($second_class == "weekend") {
        $class = "cal-day_" . $second_class;
        if ($printable != 1) {
            // si version écran :
            $content .= "<td class=\"{$class}\" {$info_bulle}>-</td>";
        } else {
            $content .= "<td class=\"{$class}\">-</td>";
        }
    } else {
        $date_j = date("Y-m-d", $j_timestamp);
        $class_am = "travail_am";
        $class_pm = "travail_pm";
        $text_am = "-";
        $text_pm = "-";
        $val_matin = "";
        $val_aprem = "";
        // recup des infos ARTT ou Temps Partiel :
        // la fonction suivante change les valeurs de $val_matin $val_aprem ....
        recup_infos_artt_du_jour_from_tab($sql_login, $j_timestamp, $val_matin, $val_aprem, $tab_rtt_echange, $tab_rtt_planifiees, $DEBUG = FALSE);
        //## AFICHAGE ##
        if ($val_matin == "Y") {
            $class_am = "rtt_am";
            //		$text_am="a";
        }
        if ($val_aprem == "Y") {
            $class_pm = "rtt_pm";
            //		$text_pm="a";
        }
        $text_bulle_type_abs = "";
        if (!($val_matin == "Y" && $val_aprem == "Y")) {
            // Récupération des conges du user
            if (array_key_exists($date_j, $tab_calendrier)) {
                $tab_day = $tab_calendrier["{$date_j}"];
                // on recup le tableau ($tab_jour) de la date que l'on affiche
                //print_r($tab_day);
                $nb_resultat_periode = count($tab_day);
                //
                if ($nb_resultat_periode > 0) {
                    for ($i = 0; $i < $nb_resultat_periode; $i++) {
                        // on regarde chaque periode l'une après l'autre
                        $tab_per = $tab_day[$i];
                        // on recup le tableau de la periode
                        if (in_array($sql_login, $tab_per)) {
                            //$content .= "tab_per =<br>\n"; print_r($tab_per); $content .= "<br>\n";
                            $sql_p_type = $tab_per["p_type"];
                            $sql_p_etat = $tab_per["p_etat"];
                            $sql_p_date_deb = $tab_per["p_date_deb"];
                            $sql_p_date_fin = $tab_per["p_date_fin"];
                            $sql_p_demi_jour_deb = $tab_per["p_demi_jour_deb"];
                            $sql_p_demi_jour_fin = $tab_per["p_demi_jour_fin"];
                            $sql_p_fermeture_id = $tab_per["p_fermeture_id"];
                            $sql_p_date_deb_fr = substr($sql_p_date_deb, 8, 2) . "/" . substr($sql_p_date_deb, 5, 2) . "/" . substr($sql_p_date_deb, 0, 4);
                            $sql_p_date_fin_fr = substr($sql_p_date_fin, 8, 2) . "/" . substr($sql_p_date_fin, 5, 2) . "/" . substr($sql_p_date_fin, 0, 4);
                            //si on est le premier jour ET le dernier jour de conges
                            if ($sql_p_date_deb == $date_j && $sql_p_date_fin == $date_j) {
                                if ($sql_p_demi_jour_deb == "am") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                                if ($sql_p_demi_jour_fin == "pm") {
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } elseif ($sql_p_date_deb == $date_j) {
                                if ($sql_p_demi_jour_deb == "am") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                                } else {
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } elseif ($sql_p_date_fin == $date_j) {
                                if ($sql_p_demi_jour_fin == "pm") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                                } else {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } else {
                                $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                if ($tab_per['p_commentaire'] == "") {
                                    // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                    $text_bulle_type_abs = $tab_type_absence[$sql_p_type]['libelle'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                } else {
                                    $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br>{$sql_p_date_deb_fr} - {$sql_p_date_fin_fr}";
                                }
                                $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                            }
                        }
                    }
                }
            }
        }
        if ($text_am == "a" && $text_pm == "a") {
            $text_am = "abs";
            $text_pm = "";
        }
        // on affiche qu'un seule fois le texte si c'est le même le matin et l'aprem :
        if ($text_am == $text_pm) {
            $text_pm = "";
        } elseif ($text_am == "-" && $text_pm != "") {
            //on a un "-" le matin et qq chose l'aprem :on affiche que le texte de l'aprem
            $text_am = "";
        } elseif ($text_am != "" && $text_pm == "-") {
            //on a un qq chose le matin et un "-" l'aprem :on affiche que le texte du matin
            $text_pm = "";
        }
        $class = "cal-day_" . $second_class . "_" . $class_am . "_" . $class_pm;
        if ($printable != 1) {
            if ($text_am == "-" && $text_pm == "") {
                $content .= "<td class=\"{$class}\"  {$info_bulle}>";
                $content .= "\t{$text_am} {$text_pm} ";
            } else {
                //$content .= "<td class=\"$class\"  onmousedown=\"javascript:afficher('$sql_login-$j_timestamp');\" onmouseup=\"javascript:cacher('$sql_login-$j_timestamp');\">";
                $content .= "<td class=\"{$class}\"  onmouseover=\"javascript:afficher('{$sql_login}-{$j_timestamp}');\" onmouseout=\"javascript:cacher('{$sql_login}-{$j_timestamp}');\">";
                $content .= "\t{$text_am} {$text_pm} ";
                // affiche l'info-bulle (affichée grace au javascript)
                //$texte_info_bulle=" $j_date_fr / ". _('divers_semaine') ." $j_num_semaine <br>$text_bulle_type_abs<br>periode";
                $texte_info_bulle = " {$j_date_fr} <br>{$text_bulle_type_abs}";
                $content .= "\t<div class=\"cal-bulles\" align=\"center\" id='{$sql_login}-{$j_timestamp}' name='{$sql_login}-{$j_timestamp}' >\n\t\t\t\t\t\t{$sql_login}<br>\n\t\t\t\t\t\t<hr align=\"center\" size=\"1\" width=\"100\" color=\"#6699CC\" />\n\t\t\t\t\t\t{$texte_info_bulle}\n\t\t\t\t\t\t<hr align=\"center\" size=\"1\" width=\"100\" color=\"#6699CC\" />\n\t\t\t\t\t\t</div> ";
            }
        } else {
            $content .= "<td class=\"{$class}\" >";
            $content .= "\t{$text_am} {$text_pm} ";
        }
        $content .= "</td>";
    }
    return $return;
}
コード例 #4
0
 public static function setTags($_expression, &$_scenario = null, $_quote = false, $_nbCall = 0)
 {
     if ($_nbCall > 10) {
         return $_expression;
     }
     $replace1 = array('#seconde#' => (int) date('s'), '#heure#' => (int) date('G'), '#minute#' => (int) date('i'), '#jour#' => (int) date('d'), '#mois#' => (int) date('m'), '#annee#' => (int) date('Y'), '#time#' => date('Gi'), '#timestamp#' => time(), '#seconde#' => (int) date('s'), '#date#' => date('md'), '#semaine#' => date('W'), '#sjour#' => '"' . date_fr(date('l')) . '"', '#smois#' => '"' . date_fr(date('F')) . '"', '#njour#' => (int) date('w'), '#hostname#' => '"' . gethostname() . '"', '#IP#' => '"' . network::getNetworkAccess('internal', 'ip') . '"', '#trigger#' => '');
     if (is_object($_scenario)) {
         $cmd = cmd::byId(str_replace('#', '', $_scenario->getRealTrigger()));
         if (is_object($cmd)) {
             $replace1['#trigger#'] = $cmd->getHumanName();
         } else {
             $replace1['#trigger#'] = $_scenario->getRealTrigger();
         }
     }
     if ($_scenario != null) {
         $replace1 = array_merge($replace1, $_scenario->getTags());
     }
     $replace2 = array();
     preg_match_all("/([a-zA-Z][a-zA-Z_]*?)\\((.*?)\\)/", $_expression, $matches, PREG_SET_ORDER);
     foreach ($matches as $match) {
         $function = $match[1];
         $replace_string = $match[0];
         if (substr_count($match[2], '(') != substr_count($match[2], ')')) {
             $pos = strpos($_expression, $match[2]) + strlen($match[2]);
             while (substr_count($match[2], '(') > substr_count($match[2], ')')) {
                 $match[2] .= $_expression[$pos];
                 $pos++;
                 if ($pos > strlen($_expression)) {
                     break;
                 }
             }
             $arguments = self::setTags($match[2], $_scenario, $_quote, $_nbCall++);
             $result = str_replace($match[2], $arguments, $_expression);
             while (substr_count($result, '(') > substr_count($result, ')')) {
                 $result .= ')';
             }
             $result = self::setTags($result, $_scenario, $_quote, $_nbCall++);
             return cmd::cmdToValue(str_replace(array_keys($replace1), array_values($replace1), $result), $_quote);
         } else {
             $arguments = explode(',', $match[2]);
         }
         if (method_exists(__CLASS__, $function)) {
             if ($function == 'trigger') {
                 if (!isset($arguments[0])) {
                     $arguments[0] = '';
                 }
                 $replace2[$replace_string] = self::trigger($arguments[0], $_scenario, $_quote);
             } else {
                 $replace2[$replace_string] = call_user_func_array(__CLASS__ . "::" . $function, $arguments);
             }
         } else {
             if (function_exists($function)) {
                 foreach ($arguments as &$argument) {
                     $argument = evaluate(self::setTags($argument, $_scenario, $_quote));
                 }
                 $replace2[$replace_string] = call_user_func_array($function, $arguments);
             }
         }
     }
     return cmd::cmdToValue(str_replace(array_keys($replace1), array_values($replace1), str_replace(array_keys($replace2), array_values($replace2), $_expression)), $_quote);
 }
コード例 #5
0
ファイル: fonctionsUtil.php プロジェクト: Ophois/webforce3
<?php

$titrePage = "fonctions";
include "header.php";
//echo get_include_path();
require_once "fonctions.php";
//require parce que bloquant si non trouvé
echo double(5) . "<br/>";
echo triple(5) . "<br/>";
echo $multiplicateur;
echo double(triple(46)) . "<br/>";
// date du jour en format US
$dateJour = date('Y-m-d');
// conversion en date FR
echo date_fr($dateJour) . "<br/>";
echo date_fr('2015-10-05') . "<br/>";
echo date_us('05/10/2015') . "<br/>";
$tableau = array(array('Language' => 'PHP', 'Age' => 20, 'Createur' => 'Rasmus Lerdorf'), array('Language' => 'JAVA', 'Age' => 33, 'Createur' => 'SUN'), array('Language' => 'C#', 'Age' => 14, 'Createur' => 'Microsoft'), array('Language' => 'COBOL', 'Age' => 56, 'Createur' => 'IBM'), array('Language' => 'BASIC', 'Age' => 51, 'Createur' => 'inconnu'), array('Language' => 'C', 'Age' => 45, 'Createur' => 'inconnu'), array('Language' => 'C++', 'Age' => 17, 'Createur' => 'toto'));
echo afficheTableau2D($tableau);
$tNombres = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
echo '<pre>';
// affichage des nombres pairs
print_r(array_filter($tNombres, 'pair'));
// détail de la fonction array_filter
$tResultat = array();
foreach ($tNombres as $cle => $nombre) {
    if (pair($nombre)) {
        $tResultat[$cle] = $nombre;
    }
}
print_r($tResultat);
コード例 #6
0
ファイル: ajout_abs.php プロジェクト: rhertzog/lcs
            $test_dispense = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*) FROM ".$prefix_base."absences_eleves WHERE eleve_absence_eleve='".$id_eleve."' AND type_absence_eleve='D'"),0);
			if ($test_dispense != '0')
			{  ?>
				<div class="tableau_info_compt"><a href="javascript:centrerpopup('../lib/liste_absences.php?id_eleve=<?php echo $id_eleve; ?>&amp;type=D',260,320,'scrollbars=yes,statusbar=no,resizable=yes');" title="voir les dispenses">Dispense détecté</a></div>
                  
			<?php
			} ?>
                
             <div class="tableau_info_compt"><a href="javascript:centrerpopup('../lib/liste_absences.php?id_eleve=<?php echo $id_eleve; ?>&amp;type=<?php echo $type; ?>',260,320,'scrollbars=yes,statusbar=no,resizable=yes');" title="voir les absences">voir absences</a></div>
              </td>     
            
            <td><?php if(($mode === "classe" and $i === '0') or $mode != "classe") { ?>
              du&nbsp;&nbsp;<a href="#calend" onClick="<?php
	//echo $cal_a[$i]->get_strPopup('../../lib/calendrier/pop.calendrier.php', 350, 170);
	echo $cal_a[$i]->get_strPopup('../../lib/calendrier/pop.calendrier_id.php', 350, 170);
?>"><img src="../../lib/calendrier/petit_calendrier.gif" border="0" alt="" /></a><br /><input name="d_date_absence_eleve[<?php echo $i; ?>]" id="d_date_absence_eleve_<?php echo $i; ?>" onfocus="javascript:this.select()" type="text" value="<?php if(empty($d_date_absence_eleve)) { echo $datejour; } else { if($action == "modifier" ) { echo $d_date_absence_eleve[$i]; } else { if(isset($d_date_absence_eleve_erreur[$i])) { echo $d_date_absence_eleve_erreur[$i]; } else { echo date_fr($d_date_absence_eleve); } } } ?>" size="10" maxlength="10" /><br />
              au&nbsp;&nbsp;<a href="#calend" onClick="<?php
	//echo $cal_b[$i]->get_strPopup('../../lib/calendrier/pop.calendrier.php', 350, 170);
	echo $cal_b[$i]->get_strPopup('../../lib/calendrier/pop.calendrier_id.php', 350, 170);
?>"><img src="../../lib/calendrier/petit_calendrier.gif" border="0" alt="" /></a><br /><input name="a_date_absence_eleve[<?php echo $i; ?>]" id="a_date_absence_eleve_<?php echo $i; ?>" onfocus="javascript:this.select()" type="text" value="<?php if(isset($a_date_absence_eleve_erreur[$i])) { echo $a_date_absence_eleve_erreur[$i]; } else { ?>JJ/MM/AAAA<?php } ?>" size="10" maxlength="10" />
           </td><?php } ?>
            <td><?php if(($mode === "classe" and $i === '0') or $mode != "classe") { ?>
              de<br /><input name="d_heure_absence_eleve[<?php echo $i; ?>]" onfocus="javascript:this.select()" type="text" value="<?php if(isset($d_heure_absence_eleve_erreur[$i]) and $dp_absence_eleve == "") { echo $d_heure_absence_eleve_erreur[$i]; } else { ?>00:00<?php } ?>" size="5" maxlength="5" /><br />
              a<br /><input name="a_heure_absence_eleve[<?php echo $i; ?>]" onfocus="javascript:this.select()" type="text" value="<?php if(isset($a_heure_absence_eleve_erreur[$i]) and $dp_absence_eleve == "") { echo $a_heure_absence_eleve_erreur[$i]; } else { ?>00:00<?php } ?>" size="5" maxlength="5" />
            </td><?php } ?>
            <td><?php if(($mode === "classe" and $i === '0') or $mode != "classe") { ?>
              de<br />
              <select name="dp_absence_eleve[<?php echo $i; ?>]">
                <option value="">pas de s&eacute;lection</option>
                   <?php
                      $requete_pe = ('SELECT * FROM '.$prefix_base.'edt_creneaux ORDER BY heuredebut_definie_periode, nom_definie_periode ASC');
コード例 #7
0
                <!-- Date Formating -->
                <?php 
    $jour = date("d", strtotime($article->art_datemodif));
    ?>
                <?php 
    $mois = date("m", strtotime($article->art_datemodif));
    ?>
                <?php 
    $annee = date("Y", strtotime($article->art_datemodif));
    ?>
                <!-- End Date Formating -->
                <?php 
    if ($article->art_datemodif == "0000-00-00 00:00:00" || $article->art_datemodif == NULL) {
        echo "</em></span>";
    } else {
        echo ", mis à jour le " . '<span class="date-article">' . date_fr($jour, $mois, $annee) . "</span></em></span>";
    }
    ?>
                <p>
                    <?php 
    echo $article->art_content;
    ?>
                </p>

                <footer class="row full-width">
                    <p class="small-12 medium-9 large-9 column">Tags : <?php 
    echo $article->art_tags;
    ?>
</p>
                </footer>
コード例 #8
0
ファイル: gestion_absences.php プロジェクト: rhertzog/lcs
			    $date_debut_tableau_jour = my_eregi_replace('^0','',$dateexplode[0]);
			    $date_debut_tableau_mois = my_eregi_replace('^0','',$dateexplode[1]);
			    $date_debut_tableau= $date_debut_tableau_jour.'/'.$date_debut_tableau_mois.'/'.$dateexplode[2];
			    if(empty($tableau_info_donnee[$date_debut_tableau])) { $tableau_info_donnee[$date_debut_tableau]=''; }
			    $tableau_info_donnee[$date_debut_tableau]['absence'] = 'oui';
			    if($date_debut===$date_fin) { $passage='non'; } else { $passage='oui'; }
			    $date_debut = date("d/m/Y", mktime(0, 0, 0, $dateexplode[1], $dateexplode[0]+1,  $dateexplode[2]));
			}
                   }
		 $requete_absences_nr = "SELECT * FROM ".$prefix_base."absences_eleves WHERE eleve_absence_eleve='".$select_fiche_eleve."' AND type_absence_eleve='R' ORDER BY d_date_absence_eleve DESC";
                 $execution_absences_nr = mysqli_query($GLOBALS["mysqli"], $requete_absences_nr) or die('Erreur SQL !'.$requete_absences_nr.'<br />'.mysqli_error($GLOBALS["mysqli"]));
                 while ($data_absences_nr = mysqli_fetch_array($execution_absences_nr))
                   {
			$date_debut = date_fr($data_absences_nr['d_date_absence_eleve']);
			    $date_debut = my_eregi_replace('^0','',$date_debut);
			$date_fin = date_fr($data_absences_nr['a_date_absence_eleve']);
			    $date_fin = my_eregi_replace('^0','',$date_fin);
			if(empty($tableau_info_donnee[$date_debut])) { $tableau_info_donnee[$date_debut]=''; }
			$tableau_info_donnee[$date_debut]['retard'] = 'oui';
			if(empty($tableau_info_donnee[$date_fin])) { $tableau_info_donnee[$date_fin]=''; }
			$tableau_info_donnee[$date_fin]['retard'] = 'oui';
                   }
	?><div style="font-size: 14px; text-align: center; margin: auto;"><strong>Statistique sur une année</strong></div>
	<?php
		$gepiYear = getSettingValue('gepiYear');
		$annee_select = explode('-',$gepiYear);
		if ( empty($annee_select[1]) ) { $annee_select = explode('/',$gepiYear); }
		if ( empty($annee_select[1]) ) { $annee_select = explode(' ',$gepiYear); }
		echo @tableau_annuel($select_fiche_eleve, '8', '12', trim($annee_select[0]), $tableau_info_donnee);
	?>
			</div>
コード例 #9
0
		<input name="selection[<?php echo $total; ?>]" id="sel<?php echo $total; ?>" type="checkbox" value="1" <?php $varcoche = $varcoche."'sel".$total."',"; ?> <?php /* if((isset($selection[$total]) and $selection[$total] == "1") OR $cocher == 1) { ?>checked="checked"<?php } */ ?> />
		<input name="id_absence_eleve[<?php echo $total; ?>]" type="hidden" value="<?php echo $data_avec_motif['id_absence_eleve']; ?>" />
		<?php

            	$cpt_lettre_absence_recus = lettre_absence_envoye($data_avec_motif['id_absence_eleve']);
            	if ( $cpt_lettre_absence_recus != 0 )
            	{

					$info_sup = 'du '.date_fr($data_avec_motif['d_date_absence_eleve']).' au '.date_fr($data_avec_motif['a_date_absence_eleve']);
					?><a href="#" onClick="alert('Pour le supprimer, supprimez la date d\'envoi du courrier.'); return false;"><img src="../images/icons/delete_imp.png" style="width: 16px; height: 16px;" title="Impossible de supprimer <?php if($data_avec_motif['type_absence_eleve']=="A") { ?>l'absence<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>le retard<?php } if ($data_avec_motif['type_absence_eleve']=="D") { ?>la dispence<?php } if ($data_avec_motif['type_absence_eleve']=="I") { ?>le passage à l'infirmerie<?php } ?> <?php echo $info_sup; ?>" border="0" alt="" /></a><?php

				}
				else
				{

            		?><a href="ajout_<?php if($data_avec_motif['type_absence_eleve']=="A") { ?>abs<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>ret<?php } if ($data_avec_motif['type_absence_eleve']=="D") { ?>dip<?php } if ($data_avec_motif['type_absence_eleve']=="I") { ?>inf<?php } ?>.php?action=supprimer&amp;type=<?php echo $type; ?>&amp;id=<?php echo $data_avec_motif['id_absence_eleve']; ?>&amp;date_ce_jour=<?php echo $date_ce_jour; ?>" <?php $info_sup = 'du '.date_fr($data_avec_motif['d_date_absence_eleve']).' au '.date_fr($data_avec_motif['a_date_absence_eleve']); ?>onClick="return confirm('Etes-vous sur de vouloir le supprimer <?php if($data_avec_motif['type_absence_eleve']=="A") { ?>l\'absence<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>le retard<?php } if ($data_avec_motif['type_absence_eleve']=="D") { ?>la dispence<?php } if ($data_avec_motif['type_absence_eleve']=="I") { ?>le passage à l'infirmerie<?php } ?> <?php echo $info_sup; ?>.')"><img src="../../images/icons/delete.png" style="width: 16px; height: 16px;" title="supprimer <?php if($data_avec_motif['type_absence_eleve']=="A") { ?>l'absence<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>le retard<?php } if ($data_avec_motif['type_absence_eleve']=="D") { ?>la dispence<?php } if ($data_avec_motif['type_absence_eleve']=="I") { ?>le passage à l'infirmerie<?php } ?> <?php echo $info_sup; ?>" border="0" alt="" /></a><?php


				} ?>

		<a href="ajout_<?php if($data_avec_motif['type_absence_eleve']=="A") { ?>abs<?php } if($data_avec_motif['type_absence_eleve']=="D") { ?>dip<?php } if($data_avec_motif['type_absence_eleve']=="I") { ?>inf<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>ret<?php } ?>.php?action=modifier&amp;type=<?php echo $type; ?>&amp;id=<?php echo $data_avec_motif['id_absence_eleve']; ?>&amp;mode=eleve"><img src="../../images/icons/saisie.png" style="width: 16px; height: 16px;" title="modifier <?php if($data_avec_motif['type_absence_eleve']=="A") { ?>l'absence<?php } if ($data_avec_motif['type_absence_eleve']=="R") { ?>le retard<?php } if ($data_avec_motif['type_absence_eleve']=="D") { ?>la dispence<?php } if ($data_avec_motif['type_absence_eleve']=="I") { ?>le passage à l'infirmerie<?php } ?>" border="0" alt="" /></a>
		<a href="gestion_absences.php?select_fiche_eleve=<?php echo $data_avec_motif['login']; ?>" title="consulter la fiche de l'élève"><?php echo "<b>".strtoupper($data_avec_motif['nom'])."</b> ".ucfirst($data_avec_motif['prenom']) . " (" . $data_avec_motif['regime'] . ") (" . classe_de($data_avec_motif['login']) . " )"; ?></a>

		</td>
		<td class="<?php echo $couleur_cellule; ?>">
<?php
			if ((getSettingValue("active_module_trombinoscopes")=='y') and ($photo=="avec_photo")) {
				$nom_photo = '';
				$nom_photo = nom_photo($data_avec_motif['elenoet'],"eleves",2);
        		$photos = $nom_photo;
				//if ( $nom_photo === '' or !file_exists($photo) ) { $photos = "../../mod_trombinoscopes/images/trombivide.jpg"; }
コード例 #10
0
ファイル: FormValidation.php プロジェクト: kamy333/rajah
 function check_date_vs_now($str_time, $warning_me = false)
 {
     // attention contrairement aux autres validation $warning_me part defaut true
     // pour error  rajouter false en appellant la fonction apres la date
     $this->errors;
     $this->warnings;
     $unix_time_date = strtotime($str_time);
     $unix_time_now = strtotime('now');
     $date_input = strftime("%Y-%m-%d", $unix_time_date);
     $date_now = strftime("%Y-%m-%d", $unix_time_now);
     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($date_input);
     $date_input_fr = $date_fr_short;
     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($date_now);
     $date_now_fr = $date_fr_short;
     $field = "Attention date";
     $msg = "";
     $text_array = "";
     $text_return = "Attention la date est au <strong>{$date_input_fr}</strong> aujourd'hui est <strong>{$date_now_fr}</strong>. Assurez-vous si necessaire de rentrer la bonne date ";
     if ($date_input === $date_now) {
         return null;
     } else {
         if ($warning_me) {
             $this->warnings[$field] = $this->fieldname_as_text($field) . " car elle n'est pas aujourd'hui. Assurez-vous de changer la date si necessaire ";
             return $text_return;
         } else {
             $this->errors[$field] = $this->fieldname_as_text($field) . " car elle n'est pas aujourd'hui. Assurez-vous de changer la date si necessaire ";
             return $text_return;
         }
     }
 }
コード例 #11
0
ファイル: view_content.php プロジェクト: kimoudev/blogigniter
			</div>
			<?php 
}
?>

			<div class="tab-pane" id="comments">
				<?php 
if (isset($comments) && $comments->num_rows() > 0) {
    ?>
				<ul class="list-group">
				<?php 
    foreach ($comments->result() as $comment) {
        ?>
					 <li class="list-group-item">
						<span class="badge"><?php 
        echo date_fr(date("d", strtotime($comment->com_date)), date("m", strtotime($comment->com_date)), date("Y", strtotime($comment->com_date)));
        ?>
 à <?php 
        echo date("H", strtotime($comment->com_date));
        ?>
h<?php 
        echo date("m", strtotime($comment->com_date));
        ?>
</span>
						<p>Posté par <em><?php 
        echo $comment->com_nickname;
        ?>
</em>
						<br />
						<br />
						<?php 
コード例 #12
0
ファイル: ajout_ret.php プロジェクト: rhertzog/lcs
}

$i = '0';
if ($action === "modifier")
{
        $requete_modif = "SELECT * FROM absences_eleves WHERE id_absence_eleve ='$id'";
        $resultat_modif = mysqli_query($GLOBALS["mysqli"], $requete_modif) or die('Erreur SQL !'.$requete_modif.'<br />'.mysqli_error($GLOBALS["mysqli"]));
        while ($data_modif = mysqli_fetch_array($resultat_modif))
        {
            $type_absence_eleve[$i] = $data_modif['type_absence_eleve'];
            $eleve_absent[$i] = $data_modif['eleve_absence_eleve'];
            $justify_absence_eleve[$i] = $data_modif['justify_absence_eleve'];
            $info_justify_absence_eleve[$i] = $data_modif['info_justify_absence_eleve'];
            $motif_absence_eleve[$i] = $data_modif['motif_absence_eleve'];
            $d_date_absence_eleve[$i] = date_fr($data_modif['d_date_absence_eleve']);
            $a_date_absence_eleve[$i] = date_fr($data_modif['a_date_absence_eleve']);
            $d_heure_absence_eleve[$i] = $data_modif['d_heure_absence_eleve'];
            //$a_heure_absence_eleve[$i] = $data_modif['a_heure_absence_eleve'];
            $heure_retard_eleve[$i] = $data_modif['d_heure_absence_eleve'];
            $i = $i + 1;
        }
}

// s'il y a eu un problème alors on réaffect le donnée au nom des variables du formulaire
$i = '0';
if(isset($id_absence_eleve_erreur[0]) and !empty($id_absence_eleve_erreur[0]))
{
        while (isset($id_absence_eleve_erreur[$i]))
        {
            $type_absence_eleve[$i] = $type_absence_eleve_erreur[$i];
            $eleve_absent[$i] = $id_absence_eleve_erreur[$i];
コード例 #13
0
 private static function parseXmlWeather($xml)
 {
     $weather = simplexml_load_string($xml);
     $return = array();
     if (is_object($weather)) {
         $channel_yweather = $weather->channel->children("http://xml.weather.yahoo.com/ns/rss/1.0");
         foreach ($channel_yweather as $x => $channel_item) {
             foreach ($channel_item->attributes() as $k => $attr) {
                 $yw_channel[$x][$k] = $attr;
             }
         }
         $item_yweather = $weather->channel->item->children("http://xml.weather.yahoo.com/ns/rss/1.0");
         foreach ($item_yweather as $x => $yw_item) {
             foreach ($yw_item->attributes() as $k => $attr) {
                 if ($k == 'day') {
                     $day = $attr;
                 }
                 if ($x == 'forecast') {
                     $yw_forecast[$x][$day . ''][$k] = $attr;
                 } else {
                     $yw_forecast[$x][$k] = $attr;
                 }
             }
         }
         $return = array();
         $return['condition']['text'] = (string) $yw_forecast['condition']['text'][0];
         $return['condition']['text'] = self::convertCondition($return['condition']['text']);
         $return['condition']['temperature'] = (string) $yw_forecast['condition']['temp'][0];
         $return['location']['city'] = (string) $yw_channel['location']['city'][0];
         $return['atmosphere']['humidity'] = (string) $yw_channel['atmosphere']['humidity'][0];
         $return['atmosphere']['pressure'] = (string) $yw_channel['atmosphere']['pressure'][0];
         $return['wind']['speed'] = (string) $yw_channel['wind']['speed'][0];
         $return['wind']['direction'] = (string) $yw_channel['wind']['direction'][0];
         $return['astronomy']['sunrise'] = (string) $yw_channel['astronomy']['sunrise'][0];
         $return['astronomy']['sunrise'] = date("Gi", strtotime($return['astronomy']['sunrise']));
         $return['astronomy']['sunset'] = (string) $yw_channel['astronomy']['sunset'][0];
         $return['astronomy']['sunset'] = date("Gi", strtotime($return['astronomy']['sunset']));
         $day = 0;
         foreach ($yw_forecast['forecast'] as $forecast) {
             $return['forecast'][$day]['day'] = (string) $forecast['day'][0];
             $return['forecast'][$day]['day'] = date_fr($return['forecast'][$day]['day']);
             $return['forecast'][$day]['condition'] = (string) $forecast['text'][0];
             $return['forecast'][$day]['condition'] = self::convertCondition($return['forecast'][$day]['condition']);
             $return['forecast'][$day]['low_temperature'] = (string) $forecast['low'][0];
             $return['forecast'][$day]['high_temperature'] = (string) $forecast['high'][0];
             $day++;
         }
     }
     return $return;
 }
コード例 #14
0
ファイル: view_listing.php プロジェクト: kimoudev/blogigniter
			<div class="caption">

				<div class="row">
					<span class="col-md-3">
						<i class="glyphicon glyphicon-calendar"></i> 
						<?php 
        $jour = date("d", strtotime($row->c_cdate));
        ?>
						<?php 
        $mois = date("m", strtotime($row->c_cdate));
        ?>
						<?php 
        $annee = date("Y", strtotime($row->c_cdate));
        ?>
						<em><?php 
        echo date_fr($jour, $mois, $annee);
        ?>
</em>
					</span>
					<h2 class="col-md-9" style="margin-top: 0">
						<?php 
        echo content_url($row->r_url_rw, $row->c_url_rw, $row->c_title);
        ?>
					</h2>
				</div><!-- end of .row -->

				<div class="row">
					<div class="col-md-3">
					<?php 
        if ($page !== 'rubric') {
            ?>
コード例 #15
0
ファイル: Fonctions.php プロジェクト: TexGG/Libertempo
 public static function affiche_calendrier_saisie_jour_absence($user_login, $year, $mois)
 {
     $return = '';
     $jour_today = date('j');
     $jour_today_name = date('D');
     $first_jour_mois_timestamp = mktime(0, 0, 0, $mois, 1, $year);
     $last_jour_mois_timestamp = mktime(0, 0, 0, $mois + 1, 0, $year);
     $mois_name = date_fr('F', $first_jour_mois_timestamp);
     $first_jour_mois_rang = date('w', $first_jour_mois_timestamp);
     // jour de la semaine en chiffre (0=dim , 6=sam)
     $last_jour_mois_rang = date('w', $last_jour_mois_timestamp);
     // jour de la semaine en chiffre (0=dim , 6=sam)
     $nb_jours_mois = ($last_jour_mois_timestamp - $first_jour_mois_timestamp + 60 * 60 * 12) / (24 * 60 * 60);
     // + 60*60 *12 for f*****g DST
     if ($first_jour_mois_rang == 0) {
         $first_jour_mois_rang = 7;
     }
     // jour de la semaine en chiffre (1=lun , 7=dim)
     if ($last_jour_mois_rang == 0) {
         $last_jour_mois_rang = 7;
     }
     // jour de la semaine en chiffre (1=lun , 7=dim)
     $return .= '<table class="table calendrier_saisie_date">';
     $return .= '<thead><tr><th colspan="7" class="titre"> ' . $mois_name . ' ' . $year . ' </th></tr><tr><th class="cal-saisie2">' . _('lundi_1c') . '</th><th class="cal-saisie2">' . _('mardi_1c') . '</th><th class="cal-saisie2">' . _('mercredi_1c') . '</th><th class="cal-saisie2">' . _('jeudi_1c') . '</th><th class="cal-saisie2">' . _('vendredi_1c') . '</th><th class="cal-saisie2">' . _('samedi_1c') . '</th><th class="cal-saisie2">' . _('dimanche_1c') . '</th></tr></thead>';
     $return .= '<tbody>';
     $start_nb_day_before = $first_jour_mois_rang - 1;
     $stop_nb_day_before = 7 - $last_jour_mois_rang;
     for ($i = -$start_nb_day_before; $i <= $nb_jours_mois + $stop_nb_day_before; $i++) {
         if (($i + $start_nb_day_before) % 7 == 0) {
             $return .= '<tr>';
         }
         $j_timestamp = mktime(0, 0, 0, $mois, $i + 1, $year);
         $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
         if ($i < 0 || $i > $nb_jours_mois || $td_second_class == 'weekend') {
             $return .= '<td class="' . $td_second_class . '">-</td>';
         } else {
             $val_matin = '';
             $val_aprem = '';
             recup_infos_artt_du_jour($user_login, $j_timestamp, $val_matin, $val_aprem);
             $return .= \utilisateur\Fonctions::affiche_cellule_calendrier_echange_absence_saisie_semaine($val_matin, $val_aprem, $year, $mois, $i + 1);
         }
         if (($i + $start_nb_day_before) % 7 == 6) {
             $return .= '<tr>';
         }
     }
     $return .= '</tbody>';
     $return .= '</table>';
     return $return;
 }
コード例 #16
0
ファイル: alert_suivi.php プロジェクト: rhertzog/lcs
								echo 'Présence';
								break;
							case 'C':
								echo 'Courrier';
								break;
							case 'F':
								echo 'Fiche élève';
								break;
							default:
								echo '';
								break;
						}
					?>
				</td>
				<td style="text-align: center; padding: 2px;"><?php echo $donnee_alert_type['specifisite_alert_type']; ?></td>
				<td style="text-align: center; padding: 2px;"><?php echo date_fr($donnee_alert_type['date_debut_comptage']); ?></td>
				<td style="text-align: center; padding: 2px;"><?php echo $donnee_alert_type['nb_comptage_limit']; ?> fois</td>
			      <?php if ( $editer_ce_groupe != 'non' ) { ?>
			        <td style="text-align: center;"><a href="alert_suivi.php?action_page=<?php echo $action_page; ?>&amp;id_alert_groupe=<?php echo $id_alert_groupe; ?>&amp;action=modifier_alert_type&amp;id_alert_type=<?php echo $donnee_alert_type['id_alert_type']; ?>&amp;uid_post=<?php echo my_ereg_replace(' ','%20',$uid); ?>#eg"><img src="../images/modification.png" width="18" height="22" title="Modifier" border="0" alt="" /></a></td>
			        <td style="text-align: center;"><a href="alert_suivi.php?action_sql=supprimer_alert_type&amp;action_page=<?php echo $action_page; ?>&amp;action=<?php echo $action; ?>&amp;id_alert_groupe=<?php echo $id_alert_groupe; ?>&amp;id_alert_type=<?php echo $donnee_alert_type['id_alert_type']; ?>&amp;uid_post=<?php echo my_ereg_replace(' ','%20',$uid); ?>#eg" onClick="return confirm('Etes-vous sur de vouloire le supprimer...')"><img src="../images/x2.png" width="22" height="22" title="Supprimer" border="0" alt="" /></a></td>
			      <?php } ?>
			  </tr>
		<?php } ?>
		</table>
		</div>
	<?php } ?>

  </div>
<?php } ?>

<?php /* fin du div de centrage du tableau pour ie5 */ ?>
コード例 #17
0
function affiche_calendrier_saisie_jours_chomes($year, $mois, $tab_year, $DEBUG = FALSE)
{
    $jour_today = date("j");
    $jour_today_name = date("D");
    $first_jour_mois_timestamp = mktime(0, 0, 0, $mois, 1, $year);
    $mois_name = date_fr("F", $first_jour_mois_timestamp);
    $first_jour_mois_rang = date("w", $first_jour_mois_timestamp);
    // jour de la semaine en chiffre (0=dim , 6=sam)
    if ($first_jour_mois_rang == 0) {
        $first_jour_mois_rang = 7;
    }
    // jour de la semaine en chiffre (1=lun , 7=dim)
    echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" width=\"250\" bgcolor=" . $_SESSION['config']['semaine_bgcolor'] . ">\n";
    /* affichage  2 premieres lignes */
    echo "\t<tr align=\"center\" bgcolor=\"" . $_SESSION['config']['light_grey_bgcolor'] . "\"><td colspan=7 class=\"titre\"> {$mois_name} {$year} </td></tr>\n";
    echo "\t<tr bgcolor=\"" . $_SESSION['config']['light_grey_bgcolor'] . "\">\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('lundi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('mardi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('mercredi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('jeudi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('vendredi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('samedi_1c') . "</td>\n";
    echo "\t\t<td class=\"cal-saisie2\">" . _('dimanche_1c') . "</td>\n";
    echo "\t</tr>\n";
    /* affichage ligne 1 du mois*/
    echo "<tr>\n";
    // affichage des cellules vides jusqu'au 1 du mois ...
    for ($i = 1; $i < $first_jour_mois_rang; $i++) {
        if ($i == 6 && $_SESSION['config']['samedi_travail'] == FALSE || $i == 7 && $_SESSION['config']['dimanche_travail'] == FALSE) {
            $bgcolor = $_SESSION['config']['week_end_bgcolor'];
        } else {
            $bgcolor = $_SESSION['config']['semaine_bgcolor'];
        }
        echo "<td bgcolor={$bgcolor} class=\"cal-saisie2\">-</td>";
    }
    // affichage des cellules cochables du 1 du mois à la fin de la ligne ...
    for ($i = $first_jour_mois_rang; $i < 8; $i++) {
        $j = $i - $first_jour_mois_rang + 1;
        $j_timestamp = mktime(0, 0, 0, $mois, $j, $year);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    echo "</tr>\n";
    /* affichage ligne 2 du mois*/
    echo "<tr>\n";
    for ($i = 8 - $first_jour_mois_rang + 1; $i < 15 - $first_jour_mois_rang + 1; $i++) {
        $j_timestamp = mktime(0, 0, 0, $mois, $i, $year);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    echo "</tr>\n";
    /* affichage ligne 3 du mois*/
    echo "<tr>\n";
    for ($i = 15 - $first_jour_mois_rang + 1; $i < 22 - $first_jour_mois_rang + 1; $i++) {
        $j_timestamp = mktime(0, 0, 0, $mois, $i, $year);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    echo "</tr>\n";
    /* affichage ligne 4 du mois*/
    echo "<tr>\n";
    for ($i = 22 - $first_jour_mois_rang + 1; $i < 29 - $first_jour_mois_rang + 1; $i++) {
        $j_timestamp = mktime(0, 0, 0, $mois, $i, $year);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    echo "</tr>\n";
    /* affichage ligne 5 du mois (peut etre la derniere ligne) */
    echo "<tr>\n";
    for ($i = 29 - $first_jour_mois_rang + 1; $i < 36 - $first_jour_mois_rang + 1 && checkdate($mois, $i, $year); $i++) {
        $j_timestamp = mktime(0, 0, 0, $mois, $i, $year);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    for ($i; $i < 36 - $first_jour_mois_rang + 1; $i++) {
        if ($i == 35 - $first_jour_mois_rang && $_SESSION['config']['samedi_travail'] == FALSE || $i == 36 - $first_jour_mois_rang && $_SESSION['config']['dimanche_travail'] == FALSE) {
            $bgcolor = $_SESSION['config']['week_end_bgcolor'];
        } else {
            $bgcolor = $_SESSION['config']['semaine_bgcolor'];
        }
        echo "<td bgcolor={$bgcolor} class=\"cal-saisie2\">-</td>";
    }
    echo "</tr>\n";
    /* affichage ligne 6 du mois (derniere ligne)*/
    echo "<tr>\n";
    for ($i = 36 - $first_jour_mois_rang + 1; checkdate($mois, $i, $year); $i++) {
        $j_timestamp = mktime(0, 0, 0, $mois, $i, $year);
        $j_date = date("Y-m-d", $j_timestamp);
        $j_day = date("d", $j_timestamp);
        $td_second_class = get_td_class_of_the_day_in_the_week($j_timestamp);
        if (in_array("{$j_date}", $tab_year)) {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\" checked></td>";
        } else {
            echo "<td  class=\"cal-saisie {$td_second_class}\">{$j_day}<input type=\"checkbox\" name=\"tab_checkbox_j_chome[{$j_date}]\" value=\"Y\"></td>";
        }
    }
    for ($i; $i < 43 - $first_jour_mois_rang + 1; $i++) {
        if ($i == 42 - $first_jour_mois_rang && $_SESSION['config']['samedi_travail'] == FALSE || $i == 43 - $first_jour_mois_rang && $_SESSION['config']['dimanche_travail'] == FALSE) {
            $bgcolor = $_SESSION['config']['week_end_bgcolor'];
        } else {
            $bgcolor = $_SESSION['config']['semaine_bgcolor'];
        }
        echo "<td bgcolor={$bgcolor} class=\"cal-saisie2\">-</td>";
    }
    echo "</tr>\n";
    echo "</table>\n";
}
コード例 #18
0
ファイル: admin_nav.php プロジェクト: kamy333/photo_gallery


                </ul>



                <?php 
?>




                <ul class="nav navbar-nav navbar-right">
                    <?php 
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();
?>

                    <p class="navbar-text " style=""><?php 
echo $date_fr_long_hr;
?>
</p>

                    <?php 
if (isset($_SESSION["user_id"])) {
    ?>

                       <li class="active"><a href="logout.php" data-toggle="dropdown"><span class='glyphicon glyphicon-user' aria-hidden='true'></span><?php 
    echo "&nbsp;&nbsp;";
    echo $user->username . "&nbsp;&nbsp;";
    ?>
コード例 #19
0
ファイル: modele_export.php プロジェクト: kamy333/kamy
        unset($_GET);
        redirect_to("view_program_history.php" . $urlencode);
    } else {
        // Failure
        $_SESSION["message"] = "Program creation failed.";
        unset($_GET);
        redirect_to("view_program_history.php" . $urlencode);
    }
}
if (isset($_GET['modele_date']) && isset($_GET['jour'])) {
    // only visible
    $date = "'" . mysql_prep($_GET['modele_date']) . "'";
    $week_day_rank = mysql_prep($_GET['jour']);
    $urlencode = "?str_time=" . urlencode($_GET['modele_date']);
    //$msg=htmlentities(day_fr( $_GET['jour']),ENT_COMPAT,'utf-8');
    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($_GET['modele_date']);
    $msg = " en date du " . htmlentities($date_fr_short, ENT_COMPAT, 'utf-8');
    // $msg.=" en date du " . htmlentities($_GET['modele_date'],ENT_COMPAT,'utf-8');
    $query = " INSERT INTO programmed_courses ( modele_id , client_id , heure , depart , arrivee , prix_course , chauffeur , course_date, pseudo,type_transport ) SELECT   programmed_courses_modele.id , programmed_courses_modele.client_id , programmed_courses_modele.heure , programmed_courses_modele.depart , programmed_courses_modele.arrivee , if (programmed_courses_modele.prix_course is null , 0 , programmed_courses_modele.prix_course ) , programmed_courses_modele.chauffeur ,{$date} , clients.pseudo, programmed_courses_modele.type_transport FROM programmed_courses_modele INNER JOIN clients ON programmed_courses_modele.client_id = clients.id WHERE programmed_courses_modele.visible = 1 and programmed_courses_modele.week_day_rank = {$week_day_rank}";
    $result = mysqli_query($connection, $query);
    if ($result) {
        // Success
        $_SESSION["message"] = "Modèle successfully exported to program for {$msg}.";
        $_SESSION["OK"] = true;
        unset($_GET);
        redirect_to("view_program_history.php" . $urlencode);
    } else {
        // Failure
        $_SESSION["message"] = "Course creation failed.";
        unset($_GET);
        redirect_to("view_program_history.php" . $urlencode);
コード例 #20
0
ファイル: 10_modele.php プロジェクト: kamy333/kamy
$layout_context = "admin";
$active_menu = "admin";
$stylesheets = "";
$fluid_view = true;
$javascript = "";
$incl_message_error = true;
include "../includes/layouts/header_2.php";
include "../includes/layouts/nav.php";
?>




<?php 
if (isset($_GET["program_id"]) && !isset($_POST["submit"])) {
    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($program["course_date"]);
    // GET request
    $fiedset_msg = " Client " . $program["pseudo"];
    $fiedset_msg .= " en date de " . $date_fr_short;
    $fiedset_msg .= " ID " . $_GET["program_id"];
    // validation warning
    $date_msg = get_warning_error_p(check_date_vs_now($program['course_date']), true);
    list($msg_pseudo_autres, $msg_nom_patient) = validate_pseudo($pseudo, $pseudo_autres, $nom_patient, true);
    $msg_bon_no = validate_pseudo_bon_no($pseudo, $bon_no, true);
    //    echo $msg_pseudo_autres;
    //    echo $msg_nom_patient;
    $msg_pseudo_autres = get_warning_error_p($msg_pseudo_autres, true);
    $msg_nom_patient = get_warning_error_p($msg_nom_patient, true);
    $msg_bon_no = get_warning_error_p($msg_bon_no, true);
    // non post from GET
    $missing = validate_presences_non_post($required_fields, $program, true);
コード例 #21
0
ファイル: graph_camembert.php プロジェクト: rhertzog/lcs
		$x_recharge = $x;
		while ( !empty($x[$i]) )
		{
			$valeur = explode('-',$x_recharge[$i]);
			$x[$i] = convert_num_mois_court($valeur[1]).' '.$valeur[0];
			$valeur = '';
			$i = $i + 1;
		}
	}
// si semaine conversion
	if ( $echelle_x === 'J') {
		$i = 0;
		$x_recharge = $x;
		while ( !empty($x[$i]) )
		{
			$x[$i] = date_fr($x_recharge[$i]);
			$i = $i + 1;
		}
	}



$pie = new Pie(array_values($_SESSION['donnee_e']), Pie::COLORED);

// remarque Pie::COLORED autre variable : COLORED, AQUA, DARK, EARTH

// les étiquettes
	// précision de l'étiquette, nombre de chiffre après la virgule
	$pie->setLabelPrecision(1);
	// position de l'étiquette
	$pie->setLabelPosition(-5);
コード例 #22
0
ファイル: AplDeFonction.php プロジェクト: AntoineSylvain/WF3
<h1>Fonctions</h1>



<?php 
get_include_path();
include "header.php";
include "fonction.php";
echo double(5) . "</br>";
echo triple(3) . "</br>";
echo double(triple(3)) . "</br>";
echo puissance(45, 1) . "</br>";
// date du jour en format US
$dateJour = date('Y-m-d');
// conversion en date FR
echo date_fr($dateJour) . "</br>";
// reconversion au format US
echo date_us(date_fr($dateJour)) . "</br>";
include "footer.php";
コード例 #23
0
ファイル: calendrier-pdf.php プロジェクト: TexGG/Libertempo
function affiche_cellule_jour_user($sql_login, $j_timestamp, $year_select, $mois_select, $j, $second_class, $printable, $tab_calendrier, $tab_rtt_echange, $tab_rtt_planifiees, $tab_type_absence)
{
    $session = session_id();
    global $content;
    $return = array();
    // info bulle
    $j_date_fr = date_fr("d/m/Y", $j_timestamp);
    $j_num_semaine = date_fr("W", $j_timestamp);
    $info_bulle = " title=\"{$sql_login} - {$j_date_fr}\" ";
    if ($second_class == "weekend") {
        $class = "cal-day_" . $second_class;
        if ($printable != 1) {
            // si version écran :
            $content .= "<td class=\"{$class}\" {$info_bulle}>-</td>";
        } else {
            $content .= "<td class=\"{$class}\">-</td>";
        }
    } else {
        $date_j = date("Y-m-d", $j_timestamp);
        $class_am = "travail_am";
        $class_pm = "travail_pm";
        $text_am = "-";
        $text_pm = "-";
        $val_matin = "";
        $val_aprem = "";
        // recup des infos ARTT ou Temps Partiel :
        // la fonction suivante change les valeurs de $val_matin $val_aprem ....
        recup_infos_artt_du_jour_from_tab($sql_login, $j_timestamp, $val_matin, $val_aprem, $tab_rtt_echange, $tab_rtt_planifiees);
        //## AFICHAGE ##
        if ($val_matin == "Y") {
            $class_am = "rtt_am";
        }
        if ($val_aprem == "Y") {
            $class_pm = "rtt_pm";
        }
        $text_bulle_type_abs = "";
        if (!($val_matin == "Y" && $val_aprem == "Y")) {
            // Récupération des conges du user
            if (array_key_exists($date_j, $tab_calendrier)) {
                $tab_day = $tab_calendrier["{$date_j}"];
                // on recup le tableau ($tab_jour) de la date que l'on affiche
                $nb_resultat_periode = count($tab_day);
                if ($nb_resultat_periode > 0) {
                    for ($i = 0; $i < $nb_resultat_periode; $i++) {
                        // on regarde chaque periode l'une après l'autre
                        $tab_per = $tab_day[$i];
                        // on recup le tableau de la periode
                        if (in_array($sql_login, $tab_per)) {
                            $sql_p_type = $tab_per["p_type"];
                            $sql_p_etat = $tab_per["p_etat"];
                            $sql_p_date_deb = $tab_per["p_date_deb"];
                            $sql_p_date_fin = $tab_per["p_date_fin"];
                            $sql_p_demi_jour_deb = $tab_per["p_demi_jour_deb"];
                            $sql_p_demi_jour_fin = $tab_per["p_demi_jour_fin"];
                            $sql_p_fermeture_id = $tab_per["p_fermeture_id"];
                            $sql_p_date_deb_fr = substr($sql_p_date_deb, 8, 2) . "/" . substr($sql_p_date_deb, 5, 2) . "/" . substr($sql_p_date_deb, 0, 4);
                            $sql_p_date_fin_fr = substr($sql_p_date_fin, 8, 2) . "/" . substr($sql_p_date_fin, 5, 2) . "/" . substr($sql_p_date_fin, 0, 4);
                            //si on est le premier jour ET le dernier jour de conges
                            if ($sql_p_date_deb == $date_j && $sql_p_date_fin == $date_j) {
                                if ($sql_p_demi_jour_deb == "am") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                                if ($sql_p_demi_jour_fin == "pm") {
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } elseif ($sql_p_date_deb == $date_j) {
                                if ($sql_p_demi_jour_deb == "am") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                                } else {
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } elseif ($sql_p_date_fin == $date_j) {
                                if ($sql_p_demi_jour_fin == "pm") {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                                } else {
                                    $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                    $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                    if ($tab_per['p_commentaire'] == "") {
                                        // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                        $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    } else {
                                        $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                    }
                                    if (isset($return[$tab_type_absence[$sql_p_type]['libelle']])) {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] += 0.5;
                                    } else {
                                        $return[$tab_type_absence[$sql_p_type]['libelle']] = 0.5;
                                    }
                                }
                            } else {
                                $class_am = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_am";
                                $text_am = $tab_type_absence[$sql_p_type]['short_libelle'];
                                $class_pm = get_class_titre($sql_p_type, $tab_type_absence, $sql_p_etat, $sql_p_fermeture_id) . "_pm";
                                $text_pm = $tab_type_absence[$sql_p_type]['short_libelle'];
                                if ($tab_per['p_commentaire'] == "") {
                                    // *** si le commentaire est renseigné on l'affiche dans l'infobulle, sinon on affiche le type d'absence ***
                                    $text_bulle_type_abs = '<div class="type-abscence">' . $tab_type_absence[$sql_p_type]['libelle'] . "</div>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                } else {
                                    $text_bulle_type_abs = $tab_per['p_commentaire'] . "<br/>{$sql_p_date_deb_fr} <i class=\"fa fa-long-arrow-right\"></i> {$sql_p_date_fin_fr}";
                                }
                                $return[$tab_type_absence[$sql_p_type]['libelle']] = 1;
                            }
                        }
                    }
                }
            }
        }
        if ($text_am == "a" && $text_pm == "a") {
            $text_am = "abs";
            $text_pm = "";
        }
        // on affiche qu'un seule fois le texte si c'est le même le matin et l'aprem :
        if ($text_am == $text_pm) {
            $text_pm = "";
        } elseif ($text_am == "-" && $text_pm != "") {
            //on a un "-" le matin et qq chose l'aprem :on affiche que le texte de l'aprem
            $text_am = "";
        } elseif ($text_am != "" && $text_pm == "-") {
            //on a un qq chose le matin et un "-" l'aprem :on affiche que le texte du matin
            $text_pm = "";
        }
        $class = "cal-day cal-day_" . $second_class . "_" . $class_am . "_" . $class_pm;
        $content .= "<td class=\"{$class}\" >";
        $content .= "\t{$text_am} {$text_pm} ";
        $content .= "</td>";
    }
    return $return;
}
コード例 #24
0
ファイル: blog.php プロジェクト: kimoudev/blogigniter
 public function view($slug_rubric = '', $slug_content = '', $page_number = 0)
 {
     $data['query_all_rubrics'] = $this->all_rubrics;
     $data['all_authors'] = $this->all_authors;
     $data['all_tags'] = $this->all_tags;
     $params = $this->front->about();
     if (!empty($params)) {
         $data['p_title'] = $params->p_title;
         $data['about'] = $params->p_about;
         $data['twitter'] = $params->p_twitter;
         $data['google'] = $params->p_google;
     } else {
         $data['p_title'] = $data['about'] = $data['twitter'] = $data['google'] = '';
     }
     // Rubric case
     if ($this->uri->total_segments() == 1 or $this->uri->total_segments() == 3) {
         $data['all_content'] = $this->front->get_all_content();
         $config = pagination_custom($params->p_nb_listing);
         $total_rows = $this->model_content->get_contents_rubric_listing($slug_rubric, '', '')->num_rows();
         // Config for pagination : base_url, first_url, total_rows, num_link, uri_segment
         $pagination = pagination_links(base_url($slug_rubric . '/page'), base_url($this->uri->segment(1)), $total_rows, round($total_rows / $config['per_page'] + 1), 3);
         $this->pagination->initialize(array_merge($config, $pagination));
         if ($page_number > $pagination['num_links']) {
             redirect(show_404());
         } else {
             $data['query'] = $this->model_content->get_contents_rubric_listing($slug_rubric, $page_number, $config['per_page']);
             if ($data['query']->num_rows == 0) {
                 redirect(show_404());
             }
             $data['pagination'] = $this->pagination->create_links();
         }
         // Nb comments
         foreach ($data['all_content']->result() as $row) {
             $nb_comments[$row->c_id] = $this->front->get_comments($row->c_id)->num_rows();
         }
         $data['nb_comments'] = $nb_comments;
         $row = $data['query']->row();
         $data['page'] = 'rubric';
         $data['title'] = $row->r_title;
         if (!empty($params)) {
             $data['meta_title'] = $row->r_title . ' - ' . $params->p_title;
         } else {
             $data['meta_title'] = $row->r_title;
         }
         if ($this->uri->total_segments() == 3 && $page_number <= 1) {
             redirect(base_url($slug_rubric), 302);
         } elseif ($page_number == 0) {
             $data['breadcrumb'] = $data['title'];
         } else {
             $data['page_number'] = $page_number;
             $data['meta_title'] .= ' - page ' . $page_number;
             $data['breadcrumb'] = '<a href="' . base_url($slug_rubric) . '">' . $data['title'] . '</a> - page ' . $page_number;
         }
         $data['meta_desc'] = $row->r_description;
         //$data['meta_pagination'] = $this->front->get_pagination_seo($pagination['base_url'], $pagination['first_url'], $page_number, $total_rows, $config['per_page'], $type='POST');
         // Article case
     } elseif ($this->uri->total_segments() <= 2) {
         $query_article = $this->model_content->get_content_by_slug($slug_rubric, $slug_content);
         if ($query_article->num_rows() == 1) {
             $data['page'] = 'content';
             $row = $query_article->row();
             $row->c_content = Parsedown::instance()->parse($row->c_content);
             $c_id = $row->c_id;
             $data['title'] = $data['c_title'] = $row->c_title;
             $data['c_content'] = $row->c_content;
             $data['c_image'] = $row->c_image;
             $data['c_pdate'] = $row->c_pdate;
             $data['c_date'] = date_fr(date("d", strtotime($row->c_pdate)), date("m", strtotime($row->c_pdate)), date("Y", strtotime($row->c_pdate)));
             $data['c_udate'] = $row->c_udate;
             $data['udate'] = date_complete_fr(date("d", strtotime($row->c_udate)), date("m", strtotime($row->c_udate)), date("Y", strtotime($row->c_udate)), date("h", strtotime($row->c_udate)), date("i", strtotime($row->c_udate)));
             $data['c_url_rw'] = $row->c_url_rw;
             $data['r_title'] = $row->r_title;
             $data['r_url_rw'] = $row->r_url_rw;
             $data['u_id'] = $row->u_id;
             $data['u_login'] = $row->u_login;
             $data['u_biography'] = $row->u_biography;
             $data['u_twitter'] = $row->u_twitter;
             $data['u_google'] = $row->u_google;
             $data['nb_comments'] = $this->front->get_comments($row->c_id)->num_rows();
             if (!empty($params)) {
                 $data['meta_title'] = $row->c_title . ' - ' . $params->p_title;
             } else {
                 $data['meta_title'] = $row->c_title;
             }
             $data['meta_desc'] = character_limiter(strip_tags($row->c_content), 254);
             $data['breadcrumb'] = $row->c_title;
             if (isset($row->c_tags)) {
                 $data['tags'] = explode(';', $row->c_tags);
             }
             $data['query_same_user'] = $this->model_content->get_content_by_user($data['u_id'], 5, $c_id);
             $data['query_same_rubric'] = $this->model_content->get_contents_same_rubric($slug_rubric, $slug_content);
             $c_tags = array_values(array_filter(explode(';', $row->c_tags)));
             $data['query_same_tag'] = $this->model_content->get_contents_same_tag($slug_rubric, $slug_content, $c_tags);
             $data['all_content'] = $this->model_content->get_contents_others($slug_content);
             $data['comments'] = $this->model_comment->get_comment($c_id);
             $this->form_validation->set_rules('com_nickname', 'Nom', 'trim|required|min_length[2]');
             $this->form_validation->set_rules('com_content', 'Contenu', 'trim|required|min_length[2]');
             $this->form_validation->set_rules('captcha', 'Captcha', 'callback_check_captcha');
             $com_nickname = $this->input->post('com_nickname');
             $com_content = $this->input->post('com_content');
             $captcha = $this->input->post('captcha');
             $this->form_validation->set_message('com_nickname', 'Le pseudo doit faire 2 caractères mininum');
             $this->form_validation->set_message('com_content', 'Le pseudo doit faire 2 caractères mininum');
             $this->load->library('session');
             if ($this->form_validation->run() !== FALSE) {
                 $this->model_comment->create_comment($c_id, $com_nickname, $com_content);
                 $this->session->set_flashdata('success', 'Commentaire ajouté.');
                 redirect(current_url());
             } else {
                 // Génération du captcha
                 $word = substr(sha1(rand()), -5);
                 $path_captcha = 'assets/captcha/';
                 $the_captcha = array('word' => $word, 'img_path' => $path_captcha, 'img_url' => site_url() . $path_captcha, 'img_width' => '150', 'img_height' => 30, 'expiration' => 60);
                 $this->session->set_userdata('captcha', $word);
                 $this->session->set_userdata('image', $the_captcha['img_url']);
                 $data['captcha'] = create_captcha($the_captcha);
                 $data['captcha_image'] = $data['captcha']['image'];
                 //$this->session->unset_userdata('captcha');
             }
         } else {
             redirect(show_404());
         }
     } else {
         redirect(show_404());
     }
     $this->load->view(URL_LAYOUT, $data);
 }
コード例 #25
0
ファイル: sidebar.php プロジェクト: sybix/freeostorrent
?>
                        </select>
                        </div>
                </ul>
</li>

<li>
        <h4><span>Archives</span></h4>
                <ul class="blocklist">
                        <div class="select">
                        <select onchange="document.location.href = this.value">
                        <option>Choisir un mois</option>
                        <?php 
$stmt = $db->query("SELECT Month(postDate) as Month, Year(postDate) as Year FROM blog_posts_seo GROUP BY Month(postDate), Year(postDate) ORDER BY postDate DESC");
while ($row = $stmt->fetch()) {
    $monthName = date_fr("F", mktime(0, 0, 0, $row['Month'], 10));
    $slug = 'a-' . $row['Month'] . '-' . $row['Year'];
    echo "<option value='" . $slug . "'>" . $monthName . "</option>";
}
?>
                        </select>
                        </div>
                </ul>
</li>

<li>
        <h4><span>Menu</span></h4>

                <?php 
if ($user->is_logged_in() && $_SESSION['username'] == 'mumbly') {
    ?>
コード例 #26
0
ファイル: function_abs.php プロジェクト: rhertzog/lcs
function modifier_absences_rb($id,$debut_ts_modif,$fin_ts_modif)
{

	global $prefix_base;

	/*
	$id -> id de la table absences_eleves
	$type -> R ou A
	*/

	if ( $id != '' )
    {

		// on vérifie qu'une absence ne se trouve pas entre le début et la fin de celle saisie
		$cpt_ligne = old_mysql_result(mysqli_query($GLOBALS["mysqli"], "SELECT count(*)
											   FROM " . $prefix_base . "absences_eleves
											   WHERE id_absence_eleve = '" . $id . "'"
											 ),0);

		// s'il y un enregistrement
		if ( $cpt_ligne != 0 )
		{

			// on ne connait pas l'id dans la table absences_rb donc il vas falloir utilise d'autre information avant la supprimession
			$requete = "SELECT *
						FROM " . $prefix_base . "absences_eleves
						WHERE id_absence_eleve = '" . $id . "' ";

	        $resultat = mysqli_query($GLOBALS["mysqli"], $requete) or die('Erreur SQL !'.$requete.'<br />'.mysqli_error($GLOBALS["mysqli"]));
    	    while ( $donnee = mysqli_fetch_array($resultat) )
        	{

	        	$type_absence = $donnee['type_absence_eleve'];
    	        $eleve_absent = $donnee['eleve_absence_eleve'];
        	    $d_date_absence_eleve = $donnee['d_date_absence_eleve'];
            	$a_date_absence_eleve = $donnee['a_date_absence_eleve'];
            	$d_heure_absence_eleve = $donnee['d_heure_absence_eleve'];
            	$a_heure_absence_eleve = $donnee['a_heure_absence_eleve'];

        	}

			if ( $type_absence === 'R' )
			{

				$a_heure_absence_eleve = $d_heure_absence_eleve;

			}

        	$explode_heuredeb = explode(":", $d_heure_absence_eleve);
			$explode_heurefin = explode(":", $a_heure_absence_eleve);
			$explode_date_debut = explode('/', date_fr($d_date_absence_eleve));
			$explode_date_fin = explode('/', date_fr($a_date_absence_eleve));
			$debut_ts = mktime($explode_heuredeb[0], $explode_heuredeb[1], 0, $explode_date_debut[1], $explode_date_debut[0], $explode_date_debut[2]);
			$fin_ts = mktime($explode_heurefin[0], $explode_heurefin[1], 0, $explode_date_fin[1], $explode_date_fin[0], $explode_date_fin[2]);

			if ( $debut_ts != '' and $fin_ts != '' )
			{

				// on cherche l'id de la table absence_rb
				$requete = "SELECT *
							FROM " . $prefix_base . "absences_rb
							WHERE retard_absence = '" . $type_absence . "'
				    		  AND debut_ts >=  '" . $debut_ts . "'
			   		 		  AND fin_ts <= '" . $fin_ts . "'
			   		 		  AND eleve_id = '" . $eleve_absent . "'
			   		 	   ";

	        $resultat = mysqli_query($GLOBALS["mysqli"], $requete) or die('Erreur SQL !'.$requete.'<br />'.mysqli_error($GLOBALS["mysqli"]));
    	    while ( $donnee = mysqli_fetch_array($resultat) )
        	{

        		$id_absences_rb = $donnee['id'];

        						$req_modifier = "UPDATE " . $prefix_base . "absences_rb
								 SET debut_ts = '" . $debut_ts_modif . "',
								     fin_ts = '" . $fin_ts_modif . "'
						   	   	 WHERE id = '" . $id_absences_rb . "'
			  			  	  ";

       			$req_sql = mysqli_query($GLOBALS["mysqli"], $req_modifier);

			}




			}

		}

	}

}
コード例 #27
0
ファイル: functions_programs.php プロジェクト: kamy333/kamy
function get_modal_program($program_id)
{
    // modal
    $program = find_program_by_id($program_id);
    $client = find_client_by_id($program["client_id"]);
    $div_id = "myModalprogram{$program_id}";
    $output = "";
    //   $output .= "";
    if ($program["validated_chauffeur"] == 1) {
        $color = "success";
    } elseif ($program["validated_chauffeur"] == 2) {
        $color = "danger";
    } else {
        $color = "info";
    }
    $output .= "<a class='btn btn-{$color}' style='width:14em;' href='#' data-toggle='modal' data-target='#{$div_id}'>";
    $output .= "" . htmlentities($client['web_view'], ENT_COMPAT, 'utf-8');
    //  $output.="<span class=\"glyphicon glyphicon-info-sign\" style='color: green;' aria-hidden='true'>";
    //  $output.="</span>";
    $output .= "</a>";
    //  $output.= "&nbsp;&nbsp; ";
    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($program["course_date"]);
    // below is modal mode not shown (hidden)
    $output .= "<div class='modal fade' id='{$div_id}' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>";
    $output .= "    <div class='modal-dialog'>";
    $output .= "        <div class='modal-content'>";
    $output .= "            <div class='modal-header'>";
    $output .= "                <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>";
    $output .= "                <h5 class='modal-title' id='myModalLabel'>";
    $output .= "<span style='color: #ff0000;'><strong>" . htmlentities($date_fr_long, ENT_COMPAT, 'utf-8');
    $output .= "</strong></span> &nbsp;&nbsp;- &nbsp;Pseudo :<strong>" . htmlentities($client['pseudo'], ENT_COMPAT, 'utf-8');
    $output .= "</strong><br> Nom: <strong>" . htmlentities($client['web_view'], ENT_COMPAT, 'utf-8');
    $output .= "</strong></h5>";
    $output .= "            </div>";
    $output .= "            <div class='modal-body'>";
    //function of body of modal
    $p_edit = "edit_course_program.php";
    $p_del = "delete_course_program.php";
    $p_new = "new_course_program.php";
    $p_annulation = "edit_annuler_course_program.php";
    $p_validation = "edit_validation_chauffeur_program.php";
    $p_validation_mgr = "edit_validation_mgr_program.php";
    $p_validation_final = "edit_validation_final_program.php";
    $url = "&url=" . urlencode($_SERVER['PHP_SELF']);
    $query_string = "&str_time=" . urlencode($program['course_date']);
    $output .= "<div class='container-fluid text-left'> ";
    $output .= get_modal_body_program($program_id);
    //   $output .= "<div class='container-fluid text-right'> ";
    //   $output .= "                <button type='button' class='btn btn-default' data-dismiss='modal'>&nbsp;Close&nbsp;</button>";
    //  $output .= "</div>";
    $output .= "</div>";
    $output .= "            </div>";
    $enable_accessr = true;
    $enable_access_valider = true;
    $enable_access_valider_mgr = true;
    $enable_access_valider_final = true;
    $enable_access_delete = true;
    $enable_access_annuler = true;
    $enable_access_edit = true;
    settype($p_val_chauf, "integer");
    settype($p_val_mgr, "integer");
    settype($p_val_final, "integer");
    $p_val_chauf = $program["validated_chauffeur"];
    $p_val_mgr = $program["validated_mgr"];
    $p_val_final = $program["validated_final"];
    if (is_chauffeur()) {
        $enable_access_delete = false;
        $enable_access_valider_mgr = false;
        $enable_access_valider_final = false;
    }
    if ($p_val_chauf == 1) {
        $text_validation = "Reactiver";
        $text_validation_annuler = "Annuler";
        $enable_access_annuler = false;
        if (is_chauffeur() && $_SESSION["nom"] !== $program["chauffeur"]) {
            $enable_access_valider = false;
            $enable_access_annuler = false;
            $enable_access_edit = false;
        }
        // course annullé
    } elseif ($p_val_chauf == 2) {
        $text_validation = "Reactiver";
        $text_validation_annuler = "Re-Annuler";
        $enable_access_valider = false;
        if (is_chauffeur() && $_SESSION["nom"] !== $program["chauffeur"]) {
            $enable_access_annuler = false;
            $enable_access_valider = false;
            $enable_access_edit = false;
        }
    } else {
        $text_validation = "Valider";
        $text_validation_annuler = "Annuler";
        $enable_access_valider_mgr = false;
        $enable_access_valider_final = false;
    }
    if ($p_val_mgr == 1) {
        $enable_access_valider = false;
        //    $enable_access_valider_mgr=false;
        //    $enable_access_valider_final=false;
        $enable_access_delete = false;
        $enable_access_annuler = false;
        $enable_access_edit = false;
        $text_validation_mgr = "Re- Mgr";
    } else {
        $text_validation_mgr = "Val Mgr";
    }
    if ($p_val_final == 1) {
        $enable_access_delete = false;
        $enable_access_annuler = false;
        $enable_access_valider = false;
        $enable_access_edit = false;
        $enable_access_valider_mgr = false;
        $text_validation_final = "Re- final";
    } else {
        $text_validation_final = "Val final";
    }
    // for testing re enable all-------------------------
    //    $enable_access_valider=true;
    //    $enable_access_valider_mgr=true;
    //    $enable_access_valider_final=true;
    //    $enable_access_delete=true;
    //    $enable_access_annuler=true;
    //    $enable_access_edit=true;
    //----------------------------------------
    $style_width_button = "style='width: 6em;'";
    $output .= "            <div class='modal-footer'>";
    $output .= "                <div class='btn-group btn-group-justified' role='group' aria-label='...'>";
    if ($enable_access_edit) {
        $output .= "                <p class='btn'  ><a class='btn btn-primary btn-xm'{$style_width_button} href='{$p_edit}?program_id=" . urlencode($program_id) . $query_string . $url . "'>Edit</a></p>";
    }
    if ($enable_access_delete) {
        if (!is_chauffeur()) {
            $output .= "                <p class='btn'><a class='btn btn-danger btn-xm' {$style_width_button} href='{$p_del}?program_id=" . urlencode($program_id) . $query_string . $url . "'>Delete</a></p>";
        }
    }
    if ($enable_access_annuler) {
        $output .= "                <p class='btn'><a class='btn btn-danger btn-xm' {$style_width_button} href='{$p_annulation}?program_id=" . urlencode($program_id) . $query_string . $url . "'>{$text_validation_annuler}</a></p>";
    }
    $output .= "                <p class='btn' ><a class='btn btn-warning btn-xm' {$style_width_button} href='{$p_new}?program_id=" . urlencode($program_id) . $query_string . $url . "'>add</a></p>";
    $output .= "                </div>";
    $output .= "            <div class='modal-footer'>";
    $output .= "                <div class='btn-group btn-group-justified' role='group' aria-label='...'>";
    if ($enable_access_valider) {
        $output .= "                <p class='btn' ><a class='btn btn-success btn-group-sm '{$style_width_button} href='{$p_validation}?program_id=" . urlencode($program_id) . $query_string . $url . "'>{$text_validation}</a></p>";
    }
    if ($enable_access_valider_mgr) {
        if (!is_chauffeur()) {
            $output .= "                <p class='btn'><a class='btn btn-primary btn-xm' {$style_width_button} href='{$p_validation_mgr}?program_id=" . urlencode($program_id) . $query_string . $url . "'>{$text_validation_mgr}</a></p>";
        }
    }
    if ($enable_access_valider_final) {
        if (!is_chauffeur()) {
            $output .= "                <p class='btn'><a class='btn btn-primary btn-xm' {$style_width_button} href='{$p_validation_final}?program_id=" . urlencode($program_id) . $query_string . $url . "'>{$text_validation_final}</a></p>";
        }
    }
    $output .= "                <p class='btn' data-dismiss='modal'><a class=' btn btn-info btn-xm' {$style_width_button}>close</a> </p>";
    $output .= "                </div>";
    $output .= "            </div>";
    $output .= "        </div>";
    $output .= "    </div>";
    $output .= "</div>";
    return $output;
}
コード例 #28
0
ファイル: statistiques.php プロジェクト: rhertzog/lcs
						$entete_tableau_recharge = $entete_tableau;
						$i = 0;
						while ( !empty($entete_tableau_recharge[$i]) )
						{
							$valeur = explode('-',$entete_tableau_recharge[$i]);
							$entete_tableau[$i] = convert_num_mois_court($valeur[1]).' '.$valeur[0];
							$valeur = '';
							$i = $i + 1;
						}
					}
					if ( $echelle_x === 'J') {
						$i = 0;
						$entete_tableau_recharge = $entete_tableau;
						while ( !empty($entete_tableau_recharge[$i]) )
						{
							$entete_tableau[$i] = date_fr($entete_tableau_recharge[$i]);
							$i = $i + 1;
						}
					}

				// valeur du tableau
				$donnee_tableau = array_values($_SESSION['donnee_e']);
					if ( $echelle_y === 'H' ) {
						$donnee_tableau_recharge = $donnee_tableau;
						$i = 0;
						while ( !empty($donnee_tableau_recharge[$i]) )
						{
							$donnee_tableau[$i] = convert_minutes_heures($donnee_tableau_recharge[$i]);
							$i = $i + 1;
						}
					}
コード例 #29
0
function affiche_calendrier_saisie_jours_chomes($year, $mois, $tab_year, $DEBUG = FALSE)
{
    $jour_today = date("j");
    $jour_today_name = date("D");
    $first_jour_mois_timestamp = mktime(0, 0, 0, $mois, 1, $year);
    $mois_name = date_fr("F", $first_jour_mois_timestamp);
    $first_jour_mois_rang = date("w", $first_jour_mois_timestamp);
    // jour de la semaine en chiffre (0=dim , 6=sam)
    if ($first_jour_mois_rang == 0) {
        $first_jour_mois_rang = 7;
    }
    // jour de la semaine en chiffre (1=lun , 7=dim)
    echo "<table>\n";
    /* affichage  2 premieres lignes */
    echo "<thead>\n";
    echo "\t<tr align=\"center\" bgcolor=\"" . $_SESSION['config']['light_grey_bgcolor'] . "\"><th colspan=7 class=\"titre\"> {$mois_name} {$year} </th></tr>\n";
    echo "\t<tr>\n";
    echo "\t\t<th class=\"cal-saisie2\">" . _('lundi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2\">" . _('mardi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2\">" . _('mercredi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2\">" . _('jeudi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2\">" . _('vendredi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2 weekend\">" . _('samedi_1c') . "</th>\n";
    echo "\t\t<th class=\"cal-saisie2 weekend\">" . _('dimanche_1c') . "</th>\n";
    echo "\t</tr>\n";
    echo "</thead>\n";
    /* affichage ligne 1 du mois*/
    echo "<tr>\n";
    // affichage des cellules vides jusqu'au 1 du mois ...
    for ($i = 1; $i < $first_jour_mois_rang; $i++) {
        echo affiche_jour_hors_mois($mois, $i, $year, $tab_year);
    }
    // affichage des cellules cochables du 1 du mois à la fin de la ligne ...
    for ($i = $first_jour_mois_rang; $i < 8; $i++) {
        $j = $i - $first_jour_mois_rang + 1;
        echo affiche_jour_checkbox($mois, $j, $year, $tab_year);
    }
    echo "</tr>\n";
    /* affichage ligne 2 du mois*/
    echo "<tr>\n";
    for ($i = 8 - $first_jour_mois_rang + 1; $i < 15 - $first_jour_mois_rang + 1; $i++) {
        echo affiche_jour_checkbox($mois, $i, $year, $tab_year);
    }
    echo "</tr>\n";
    /* affichage ligne 3 du mois*/
    echo "<tr>\n";
    for ($i = 15 - $first_jour_mois_rang + 1; $i < 22 - $first_jour_mois_rang + 1; $i++) {
        echo affiche_jour_checkbox($mois, $i, $year, $tab_year);
    }
    echo "</tr>\n";
    /* affichage ligne 4 du mois*/
    echo "<tr>\n";
    for ($i = 22 - $first_jour_mois_rang + 1; $i < 29 - $first_jour_mois_rang + 1; $i++) {
        echo affiche_jour_checkbox($mois, $i, $year, $tab_year);
    }
    echo "</tr>\n";
    /* affichage ligne 5 du mois (peut etre la derniere ligne) */
    echo "<tr>\n";
    for ($i = 29 - $first_jour_mois_rang + 1; $i < 36 - $first_jour_mois_rang + 1 && checkdate($mois, $i, $year); $i++) {
        echo affiche_jour_checkbox($mois, $i, $year, $tab_year);
    }
    for ($i; $i < 36 - $first_jour_mois_rang + 1; $i++) {
        echo affiche_jour_hors_mois($mois, $i, $year, $tab_year);
    }
    echo "</tr>\n";
    /* affichage ligne 6 du mois (derniere ligne)*/
    echo "<tr>\n";
    for ($i = 36 - $first_jour_mois_rang + 1; checkdate($mois, $i, $year); $i++) {
        echo affiche_jour_checkbox($mois, $i, $year, $tab_year);
    }
    for ($i; $i < 43 - $first_jour_mois_rang + 1; $i++) {
        echo affiche_jour_hors_mois($mois, $i, $year, $tab_year);
    }
    echo "</tr>\n";
    echo "</table>\n";
}
コード例 #30
0
$nb_eleves = mysqli_num_rows($call_eleve);
$cpt_i = 1;
while ($donner = mysqli_fetch_array($call_eleve)) {
    //AJOUT ERIC
    $eleve_id_classe[$cpt_i] = $donner['id'];
    $ident_eleve[$cpt_i] = $donner['login'];
    $ident_eleve_sel1 = $ident_eleve[$cpt_i];
    $elenoet_eleve[$cpt_i] = $donner['elenoet'];
    $ele_id_eleve[$cpt_i] = $donner['ele_id'];
    $nom_eleve[$cpt_i] = $donner['nom'];
    $prenom_eleve[$cpt_i] = $donner['prenom'];
    $sexe[$cpt_i] = $donner['sexe'];
    if ($sexe[$cpt_i] == "M") {
        $date_naissance[$cpt_i] = 'Né le ' . date_fr($donner['naissance']);
    } else {
        $date_naissance[$cpt_i] = 'Née le ' . date_fr($donner['naissance']);
    }
    $INE_eleve[$cpt_i] = $donner['no_gep'];
    //echo "\$INE_eleve[$cpt_i]=$INE_eleve[$cpt_i]<br />";
    $classe_tableau_id[$cpt_i] = $donner['id'];
    $classe_nomlong[$cpt_i] = $donner['nom_complet'];
    $classe_nomcour[$cpt_i] = $donner['classe'];
    $tmp_photo = nom_photo(my_strtolower($donner['elenoet']));
    //if("$tmp_photo"!=""){
    if ($tmp_photo) {
        $photo[$cpt_i] = $tmp_photo;
    } else {
        $photo[$cpt_i] = "";
    }
    $doublement[$cpt_i] = '';
    if ($donner['doublant'] === 'R') {