current_day; $current_month = $resdate->current_month; $current_month_2 = $resdate->current_month_2; $current_year = $resdate->current_year; $date_MySQL_firstday = "'$year-$current_month_2-01'"; $rqt_date = "select date_format(".$date_MySQL_firstday.", '%w') as first_day_pos, date_format(DATE_SUB(DATE_ADD(".$date_MySQL_firstday.", INTERVAL 1 MONTH),INTERVAL 1 DAY), '%d') as nb_days_month " ; $resultatdate=mysql_query($rqt_date); $resdate=mysql_fetch_object($resultatdate); $first_day_pos = $resdate->first_day_pos; $first_day_pos = ($first_day_pos == 0) ? 7 : $first_day_pos; $nb_days_month = $resdate->nb_days_month ; $current_month_name = $monthes_name[$current_month]; /* Ajout ER : détection si date en cours du calendrier correspond ou pas à la date de l'appelant Sans ce test, le lien sur tous les jours identiques d'un autre mois n'étaient pas affichés, exemple : appelant avec date au 04/10/2003 >> lien du 04/11/2003 absent */ $date_MySQL_caller = "'".substr($date_caller, 0 ,4)."-".substr($date_caller, 4 ,2)."-".substr($date_caller, 6 ,2)."'"; $rqt_date = "select date_format(".$date_MySQL_caller.", '%d') as current_day, date_format(".$date_MySQL_caller.", '%c') as current_month, date_format(".$date_MySQL_caller.", '%Y') as current_year "; $resultatdate=mysql_query($rqt_date); $resdate=mysql_fetch_object($resultatdate); $caller_day = $resdate->current_day; $caller_month = $resdate->current_month; $caller_year = $resdate->current_year; if (($caller_month==$current_month) && ($caller_year==$current_year) && ($caller_day==$current_day)) $same_date=1; else $same_date=0; if (!$style_calendrier) { $style_calendrier = ''; $output = $style_calendrier ; } if ($form_input_par_jour) $output .= $admin_calendrier_form_mois_start ; $output .= ''."\n"; // Displaying the current month/year if ($param['show_month'] == 1) { $output .= ''."\n"; $output .= ' "; $output .= ""."\n"; } if($pmb_first_week_day_format){ $first_day_pos++; if($first_day_pos==8) $first_day_pos=1; } // Building the table row with the days if ($param['show_day'] == 1) { $output .= ''."\n"; if($pmb_first_week_day_format) $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; if(!$pmb_first_week_day_format) $output .= ''."\n"; $output .= ''."\n"; } else { $first_day_pos = 1; } $output .= ''; $int_counter = 0; for ($i = 1; $i < $first_day_pos; $i++) { $output .= ''."\n"; $int_counter++; } // Building the table for ($i = 1; $i <= $nb_days_month; $i++) { $i_2 = ($i < 10) ? '0'.$i : $i; $commentaire=htmlentities($reception[$current_year.'-'.$current_month_2.'-'.$i_2]['commentaire'],ENT_QUOTES, $charset) ; $obj="$current_year-$current_month_2-$i_2"; ### Row start if ((($i + $first_day_pos-1) % $param['calendar_columns']) == 1 && $i != 1) { $output .= ""; $int_counter = 0; } if ($form_input_par_jour) { $input_commentaire = " ".str_replace("!!name!!", "comment_".$i_2, $admin_calendrier_form_mois_commentaire) ; $input_commentaire = " ".str_replace("!!commentaire!!", $commentaire, $input_commentaire) ; } else $input_commentaire = "" ; $serie=0; if($num_abt){// Pour la grille abonnement $type_serie=$type_horsserie=0; $requete = "select type from abts_grille_abt where num_abt='$num_abt' and date_parution ='$obj'"; $resultat=mysql_query($requete); while($r=mysql_fetch_object($resultat)){ $type=$r->type; if ($type==1)$type_serie=1; if ($type==2)$type_horsserie=2; } $serie=$type_serie+$type_horsserie; } else{// Pour la grille modèle $requete = "select type_serie from abts_grille_modele where num_modele='$modele_id' and date_parution ='$obj'"; $resultat=mysql_query($requete); while($r=mysql_fetch_object($resultat)){ $type_serie=$r->type_serie; $serie+=$type_serie; } } // c'est un périodique if ($serie==1) { $class = " class='lien_date' "; } // c'est un hors-série elseif ($serie==2) { $class = " class='lien_date_hs'"; } // c'est un hors-série et un périodique elseif ($serie==3) { $class = " class='lien_date_hs_p'"; } // rien n'est attendu ce jour là else { $class = " "; } $td_link="onClick='ad_date(\"$obj\",event);return false;'"; $output .="\n"; $int_counter++; // Row end if ( (($i+$first_day_pos-1) % $param['calendar_columns']) == 0 ) { $output .= ''."\n"; } } $cell_missing = $param['calendar_columns'] - $int_counter; for ($i = 0; $i < $cell_missing; $i++) { $output .= ''."\n"; } $output .= ''."\n"; $output .= '
'."\n"; $output .= ""; if ($base_url_mois) $output .= ""; if ($param['use_img'] ) $output .= ""; $output .= $current_month_name.' '.$current_year; if ($base_url_mois) $output .= ""; $output .= "
'.$msg[1024].''.$msg[1018].''.$msg[1019].''.$msg[1020].''.$msg[1021].''.$msg[1022].''.$msg[1023].''.$msg[1024].'
 
" . "$i
 
'."\n"; return $output; }