function http_afficher_rendez_vous($date_heure, $date_fin) { global $spip_lang_rtl; $dirpuce = _DIR_RACINE . 'dist'; if (jour($date_heure) == jour($date_fin) AND mois($date_heure) == mois($date_fin) AND annee($date_heure) == annee($date_fin)) { echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')." ".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b><br />\n<b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>"; echo " <img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> ".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</p>"; } else { echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')."<br />\n".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b>, <b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>"; echo "<br />\n<img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> ".majuscules(nom_jour($date_fin))." ".majuscules(affdate($date_fin)).", <b>".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</b></p>"; } }
function afficher_jour_mois_annee_h_m($date, $heures, $minutes, $suffixe='') { return afficher_jour(jour($date), "name='jour$suffixe' id='jour$suffixe' size='1' class='verdana1'") . afficher_mois(mois($date), "name='mois$suffixe' id='mois$suffixe' size='1' class='verdana1'") . afficher_annee(annee($date), "name='annee$suffixe' id='annee$suffixe' class='verdana1'", date('Y')-1) . " <input type='text' class='verdana1' name='heures$suffixe' id='heures$suffixe' value=\"".$heures."\" size='3'/> ".majuscules(_T('date_mot_heures'))." " . "<input type='text' class='verdana1' name='minutes$suffixe' id='minutes$suffixe' value=\"$minutes\" size='3'/>"; }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Le lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - du 20 fevrier au 30 mars * - du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){ static $trans_tbl=NULL; if ($trans_tbl==NULL){ $trans_tbl = get_html_translation_table (HTML_ENTITIES); $trans_tbl = array_flip ($trans_tbl); } $abbr = ''; if (strpos($forme,'abbr')!==false) $abbr = 'abbr'; $affdate = "affdate_jourcourt"; if (strpos($forme,'annee')!==false) $affdate = 'affdate'; $dtstart = $dtend = $dtabbr = ""; if (strpos($forme,'hcal')!==false) { $dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>"; $dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = $horaire=='oui'; $hd = date("H:i",$date_debut); $hf = date("H:i",$date_fin); $au = " " . strtolower(_T('agenda:evenement_date_au')); $du = _T('agenda:evenement_date_du') . " "; $s = ""; if ($d==$f) { // meme jour $s = ucfirst(nom_jour($d,$abbr))." ".$affdate($d); if ($h) $s .= " $hd"; $s = "$dtstart$s$dtabbr"; if ($h AND $hd!=$hf) $s .= "-$dtend$hf$dtabbr"; } else if ((date("Y-m",$date_debut))==date("Y-m",$date_fin)) { // meme annee et mois, jours differents if ($h){ $s = $du . $dtstart . affdate_jourcourt($d) . " $hd" . $dtabbr; $s .= $au . $dtend . $affdate($f); if ($hd!=$hf) $s .= " $hf"; $s .= $dtabbr; } else { $s = $du . $dtstart . jour($d) . $dtabbr; $s .= $au . $dtend . $affdate($f) . $dtabbr; } } else if ((date("Y",$date_debut))==date("Y",$date_fin)) { // meme annee, mois et jours differents $s = $du . $dtstart . affdate_jourcourt($d); if ($h) $s .= " $hd"; $s .= $dtabbr . $au . $dtend . $affdate($f); if ($h) $s .= " $hf"; $s .= $dtabbr; } else { // tout different $s = $du . $dtstart . affdate($d); if ($h) $s .= " ".date("(H:i)",$date_debut); $s .= $dtabbr . $au . $dtend. affdate($f); if ($h) $s .= " ".date("(H:i)",$date_fin); $s .= $dtabbr; } return unicode2charset(charset2unicode(strtr($s,$trans_tbl),'')); }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - Du 20 fevrier au 30 mars * - Du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' ou true permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir une ou plusieurs valeurs parmi * - abbr (afficher le nom des jours en abbrege) * - hcal (generer une date au format hcal) * - jour (forcer l'affichage des jours) * - annee (forcer l'affichage de l'annee) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '') { $abbr = $jour = ''; $affdate = "affdate_jourcourt"; if (strpos($forme, 'abbr') !== false) { $abbr = 'abbr'; } if (strpos($forme, 'annee') !== false) { $affdate = 'affdate'; } if (strpos($forme, 'jour') !== false) { $jour = 'jour'; } $dtstart = $dtend = $dtabbr = ""; if (strpos($forme, 'hcal') !== false) { $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = ($horaire === 'oui' or $horaire === true); $hd = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_debut), 'm' => date("i", $date_debut))); $hf = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_fin), 'm' => date("i", $date_fin))); if ($d == $f) { // meme jour $nomjour = nom_jour($d, $abbr); $s = $affdate($d); $s = _T('date_fmt_jour', array('nomjour' => $nomjour, 'jour' => $s)); if ($h) { if ($hd == $hf) { // Lundi 20 fevrier a 18h25 $s = spip_ucfirst(_T('date_fmt_jour_heure', array('jour' => $s, 'heure' => $hd))); $s = "{$dtstart}{$s}{$dtabbr}"; } else { // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr> if ($dtabbr && $dtstart && $dtend) { $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin_abbr', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf, 'dtstart' => $dtstart, 'dtend' => $dtend, 'dtabbr' => $dtabbr))); } else { $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf))); } } } else { if ($dtabbr && $dtstart) { $s = $dtstart . spip_ucfirst($s) . $dtabbr; } else { $s = spip_ucfirst($s); } } } else { if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) { // meme annee et mois, jours differents if (!$h) { $date_debut = jour($d); } else { $date_debut = $affdate($d); } $date_fin = $affdate($f); if ($jour) { $nomjour_debut = nom_jour($d, $abbr); $date_debut = _T('date_fmt_jour', array('nomjour' => $nomjour_debut, 'jour' => $date_debut)); $nomjour_fin = nom_jour($f, $abbr); $date_fin = _T('date_fmt_jour', array('nomjour' => $nomjour_fin, 'jour' => $date_fin)); } if ($h) { $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd)); $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf)); } $date_debut = $dtstart . $date_debut . $dtabbr; $date_fin = $dtend . $date_fin . $dtabbr; $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin)); } else { $date_debut = affdate($d); $date_fin = affdate($f); if ($jour) { $nomjour_debut = nom_jour($d, $abbr); $date_debut = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_debut, 'jour' => $date_debut)); $nomjour_fin = nom_jour($f, $abbr); $date_fin = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_fin, 'jour' => $date_fin)); } if ($h) { $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd)); $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf)); } $date_debut = $dtstart . $date_debut . $dtabbr; $date_fin = $dtend . $date_fin . $dtabbr; $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin)); } } return $s; }
/** listedatefin() - voir jour() * */ function listedatefin(&$formtemplate, $tableau_template, $mode, $valeurs_fiche) { return jour($formtemplate, $tableau_template, $mode, $valeurs_fiche); }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Le lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - du 20 fevrier au 30 mars * - du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '') { $abbr = ''; if (strpos($forme, 'abbr') !== false) { $abbr = 'abbr'; } $affdate = "affdate_jourcourt"; if (strpos($forme, 'annee') !== false) { $affdate = 'affdate'; } $dtstart = $dtend = $dtabbr = ""; if (strpos($forme, 'hcal') !== false) { $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = $horaire == 'oui'; $hd = date("H:i", $date_debut); $hf = date("H:i", $date_fin); $au = " " . strtolower(_T('agenda:evenement_date_au')); $du = _T('agenda:evenement_date_du') . " "; $s = ""; if ($d == $f) { // meme jour $s = ucfirst(nom_jour($d, $abbr)) . " " . $affdate($d); if ($h) { $s .= " {$hd}"; } $s = "{$dtstart}{$s}{$dtabbr}"; if ($h and $hd != $hf) { $s .= "-{$dtend}{$hf}{$dtabbr}"; } } else { if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) { // meme annee et mois, jours differents if ($h) { $s = $du . $dtstart . affdate_jourcourt($d) . " {$hd}" . $dtabbr; $s .= $au . $dtend . $affdate($f); if ($hd != $hf) { $s .= " {$hf}"; } $s .= $dtabbr; } else { $s = $du . $dtstart . jour($d) . $dtabbr; $s .= $au . $dtend . $affdate($f) . $dtabbr; } } else { if (date("Y", $date_debut) == date("Y", $date_fin)) { // meme annee, mois et jours differents $s = $du . $dtstart . affdate_jourcourt($d); if ($h) { $s .= " {$hd}"; } $s .= $dtabbr . $au . $dtend . $affdate($f); if ($h) { $s .= " {$hf}"; } $s .= $dtabbr; } else { // tout different $s = $du . $dtstart . affdate($d); if ($h) { $s .= " " . date("(H:i)", $date_debut); } $s .= $dtabbr . $au . $dtend . affdate($f); if ($h) { $s .= " " . date("(H:i)", $date_fin); } $s .= $dtabbr; } } } return unicode2charset(charset2unicode($s, 'AUTO')); }
function date_ical($date_heure, $minutes = 0) { return date("Ymd\\THis", mktime(heures($date_heure), minutes($date_heure) + $minutes, 0, mois($date_heure), jour($date_heure), annee($date_heure))); }
function FormCoti($titre, $champs, $valeur, $champs1, $champs2, $champs3, $valeur1, $annee, $pastous, $droitmin, $lien, $espace) { // Formulaire : cotisation global $cotiadhesions1_liste; global $cotiadhesions2_liste; $verrou = VerifieDroit($droitmin); TRdebut($titre, $espace); Select($champs, $valeur, $cotiadhesions1_liste[$annee], $cotiadhesions2_liste[$annee], 6, $pastous, '', '', $verrou, $espace . ' '); html(' le '); INPUTtexte($champs1, jour($valeur1), 'tel', 1, '', $verrou, $espace . ' '); INPUTtexte($champs2, mois($valeur1), 'tel', 1, '', $verrou, $espace . ' '); INPUTtexte($champs3, annee($valeur1), 'tel', 3, '', $verrou, $espace . ' '); // INPUTtexte($champs1,$valeur1,$style1,$taille1,'',$verrou,$espace.' '); //SELECTdate($jour,$mois,$annee,$date,2000,$verrou,$espace.' '); //SELECTdate($jour,$mois,$annee,$date,$datedebut,$verrou,$espace.' '); //list($avant, $date, $apres) = explode("'", $date); //list($annee1, $mois1, $jour1) = explode("-", $date); //return GereRetours($lien,$lien.'&'.$jour.'='.$jour1.'&'.$mois.'='.$mois1.'&'.$annee.'='.$annee1,$espace); TRfin($espace); return GereRetours($lien, $lien . '&' . $champs . '=' . $valeur, $espace); }
function ageActuel($date1, $date2) { // Calcul d'âge if (mois($date1) == mois($date2) and jour($date2) < jour($date1) or mois($date2) < mois($date1)) { $age = annee($date2) - annee($date1) - 1; } else { $age = annee($date2) - annee($date1); } if ($age > 100) { $age = ''; } // Pour éviter les dates fausses. return $age; }
function lcm_page_start($title = "", $css_files = "", $meta = '', $help_code = '') { global $connect_id_auteur; global $connect_status; global $auth_can_disconnect, $connect_login; global $options; global $lcm_lang, $lcm_lang_rtl, $lcm_lang_left, $lcm_lang_right; global $clean_link; global $prefs; // Clean the global link (i.e. remove actions passed in the URL) $clean_link->delVar('var_lang'); $clean_link->delVar('set_options'); $clean_link->delVar('set_couleur'); $clean_link->delVar('set_disp'); $clean_link->delVar('set_ecran'); lcm_html_start($title, $css_files, $meta); // // Title (mandatory) and description (may be empty) of the site // $site_name = _T(read_meta('site_name')); if (!$site_name) { $site_name = _T('title_software'); } $site_desc = _T(read_meta('site_description')); // // Most of the header/navigation html // echo '<div id="header"> <a href="summary.php" class="balance_link"> </a> <h1 class="lcm_main_head"><a href="summary.php" class="head_ttl_link">' . $site_name . '</a></h1> <div class="lcm_slogan"><a href="summary.php" class="head_subttl_link">' . $site_desc . "</a></div>\n\t\t<br />\n\t</div>\n"; echo "<div id='wrapper_" . $prefs['screen'] . "'>\n\t\t<div id=\"container_" . $prefs['screen'] . "\">\n\t\t\t<div id=\"content_" . $prefs['screen'] . "\">\n\t\t\t<!-- This is the navigation column, usually used for menus and brief information -->\n\t\t\t\t<div id=\"navigation_menu_column\">\n\t\t\t\t<!-- Start of navigation_menu_column content -->\n\t\t\t\t\t<div class=\"nav_menu_box\">\n\t\t\t\t\t\t<div class=\"nav_column_menu_head\"><div class=\"mm_main_menu\">" . _T('menu_main') . "</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ul class=\"nav_menu_list\">"; echo show_navmenu_item("listcases.php", 'main_cases'); // Require to be explicitly off in order to hide the menu item (avoid config errors) if (read_meta('client_hide_all') != 'yes') { echo show_navmenu_item("listclients.php", 'main_clients'); } if (read_meta('org_hide_all') != 'yes') { echo show_navmenu_item("listorgs.php", 'main_orgs'); } if (read_meta('expenses_hide_all') != 'yes') { echo show_navmenu_item("listexps.php", "main_expenses"); } echo show_navmenu_item("listauthors.php", 'main_authors'); echo "</ul>\n"; echo "</div>\n"; if ($connect_status == 'admin') { echo "<div class=\"nav_menu_box\">\n"; echo "<div class=\"nav_column_menu_head\"><div class=\"mm_admin\">" . _T('menu_admin') . "</div></div>\n"; echo "<ul class=\"nav_menu_list\">"; show_navmenu_item("config_site.php", "admin_siteconf"); show_navmenu_item("archive.php", "admin_archives"); show_navmenu_item("listreps.php", "admin_reports"); show_navmenu_item("keywords.php", "admin_keywords"); echo "</ul>\n"; echo "</div>\n"; } // Show today's date if ($title != _T('title_upgrade_database')) { echo "<div class=\"nav_menu_box\">\n"; echo "<div class=\"nav_column_menu_head\">\n"; echo "<div class=\"mm_calendar\">" . _T('menu_calendar') . "</div>\n"; echo "</div>\n"; // Show calendar include_lcm('inc_calendar'); $now = date('Y-m-d'); echo "<table border='0' align='center'><tr><td>\n"; // Temporary? [ML] echo http_calendrier_agenda(mois($now), annee($now), jour($now), mois($now), annee($now), false, 'calendar.php'); echo "</td></tr></table>\n"; echo "</div>\n"; // Start agenda box echo '<div class="nav_menu_box">' . "\n"; echo '<div class="nav_column_menu_head">'; echo '<div class="mm_agenda">' . _T('menu_agenda') . "</div>\n"; echo "</div>\n"; $events = false; // Show appointments for today $q = "SELECT app.id_app, start_time, type, title\n\t\t\tFROM lcm_app as app, lcm_author_app as aut\n\t\t\tWHERE aut.id_author=" . $GLOBALS['author_session']['id_author'] . "\n\t\t\tAND app.id_app = aut.id_app\n\t\t\tAND " . lcm_query_trunc_field('app.start_time', 'day') . "\n\t\t\t= " . lcm_query_trunc_field('NOW()', 'day') . "\n\t\t\tORDER BY app.reminder ASC"; $result = lcm_query($q); if (lcm_num_rows($result) > 0) { $events = true; $today = getdate(time()); echo "<p class=\"nav_column_text\">\n" . '<strong><a class="content_link" href="calendar.php?type=jour' . "&jour=" . $today['mday'] . "&mois=" . $today['mon'] . "&annee=" . $today['year'] . '">' . _Th('calendar_button_now') . "</a></strong><br />\n"; echo "</p>\n"; echo "<ul class=\"small_agenda\">\n"; while ($row = lcm_fetch_array($result)) { echo "<li><a href=\"app_det.php?app=" . $row['id_app'] . "\">" . heures($row['start_time']) . ':' . minutes($row['start_time']) . " - " . $row['title'] . "</a></li>\n"; } echo "</ul>\n"; echo "<hr class=\"hair_line\" />\n"; } // Show next appointments $q = "SELECT a.id_app, a.start_time, a.type, a.title\n\t\t\tFROM lcm_app as a, lcm_author_app as aa\n\t\t\tWHERE (aa.id_author = " . $GLOBALS['author_session']['id_author'] . "\n\t\t\t\t\tAND a.id_app = aa.id_app\n\t\t\t\t\tAND a.start_time >= '" . date('Y-m-d H:i:s', (int) ceil(time() / 86400) * 86400) . "')\n\t\t\tORDER BY a.reminder ASC\n\t\t\tLIMIT 5"; $result = lcm_query($q); if (lcm_num_rows($result) > 0) { $events = true; echo "<p class=\"nav_column_text\">\n"; echo "<strong>" . _T('calendar_button_nextapps') . "</strong><br />\n"; echo "</p>\n"; echo "<ul class=\"small_agenda\">\n"; while ($row = lcm_fetch_array($result)) { echo "<li><a href=\"app_det.php?app=" . $row['id_app'] . "\">" . format_date($row['start_time'], 'short') . " - " . $row['title'] . "</a></li>\n"; } echo "</ul>\n"; } if (!$events) { echo '<p class="nav_column_text">' . _T('calendar_info_noacts') . "</p>\n"; } // my appointments echo ' <a href="author_det.php?tab=appointments&author=' . $GLOBALS['author_session']['id_author'] . '" title="' . _T('title_agenda_list') . '">' . '<img src="images/jimmac/stock_show-form-dialog.png" border="0" width="16" height="16" alt="" /></a>'; // new appointment echo ' <a href="edit_app.php?app=0" title="' . _T('app_button_new') . '">' . '<img src="images/jimmac/stock_new-16.png" border="0" width="16" height="16" alt="" /></a>'; // End of nav_menu_box for Agenda echo "</div>\n"; } // End of "navigation_menu_column" content echo "</div>\n\n\t\t\t\t<!-- The main content will be here - all the data, html forms, search results etc. -->\n\t\t\t\t<div id=\"main_column\">\n\t\t\t\t\n\t\t\t\t\t<!-- Start of 'main_column' content -->\n\t\t\t\t\t<h3 class=\"content_head\">"; if ($help_code) { echo '<span class="help_icon">' . lcm_help($help_code) . "</span> "; } echo $title; echo "</h3>\n\t\t\t\t\t<!-- [KM] Just a small experiment how the future breadcrumb will look like -->\n\t\t\t\t\t<!-- div id=\"breadcrumb\"><a href=\"#\" title=\"Test link\">Home</a> > <a href=\"#\" title=\"Test link\">Page1</a> > <a href=\"#\" title=\"Test link\">Subpage1</a> > Subsubpage1</div -->\n\t"; }