Ejemplo n.º 1
0
function agenda_mini($i) {
  $args = func_get_args();
  $une_date = array_shift($args); // une date comme balise
  $sinon = array_shift($args);
  if (!$une_date) return $sinon;
  $type = 'mini';
  $agenda = Agenda_memo_full(0);
  $evt = array();
  foreach (($args ? $args : array_keys($agenda)) as $k) {  
      if (is_array($agenda[$k]))
		foreach($agenda[$k] as $d => $v) { 
		  $evt[$d] = $evt[$d] ? (array_merge($evt[$d], $v)) : $v;
		}
    }
	$la_date = mktime(0, 0, 0, mois($une_date), 1, annee($une_date));
    include_spip('inc/agenda');
    return http_calendrier_init($la_date, $type, '', '', '', array('', $evt));
}
Ejemplo n.º 2
0
function change_date_message($id_message, $heures,$minutes,$mois, $jour, $annee, $heures_fin,$minutes_fin,$mois_fin, $jour_fin, $annee_fin)
{
	$date = date("Y-m-d H:i:s", mktime($heures,$minutes,0,$mois, $jour, $annee));
	
	$jour = journum($date);
	$mois = mois($date);
	$annee = annee($date);
	$heures = heures($date);
	$minutes = minutes($date);
	
	// Verifier que la date de fin est bien posterieure au debut
	$unix_debut = date("U", mktime($heures,$minutes,0,$mois, $jour, $annee));
	$unix_fin = date("U", mktime($heures_fin,$minutes_fin,0,$mois_fin, $jour_fin, $annee_fin));
	if ($unix_fin <= $unix_debut) {
		$jour_fin = $jour;
		$mois_fin = $mois;
		$annee_fin = $annee;
		$heures_fin = $heures + 1;
		$minutes_fin = $minutes;
	}		

	$date_fin = date("Y-m-d H:i:s", mktime($heures_fin,$minutes_fin,0,$mois_fin, $jour_fin, $annee_fin));
	
	$jour_fin = journum($date_fin);
	$mois_fin = mois($date_fin);
	$annee_fin = annee($date_fin);
	$heures_fin = heures($date_fin);
	$minutes_fin = minutes($date_fin);

	sql_updateq('spip_messages', array('date_heure'=>"$annee-$mois-$jour $heures:$minutes:00",  'date_fin'=>"$annee_fin-$mois_fin-$jour_fin $heures_fin:$minutes_fin:00"), "id_message=$id_message");
}
Ejemplo n.º 3
0
function quete_calendrier_agenda ($annee, $mois) {
	global $connect_id_auteur;

	$rv = array();
	if (!$connect_id_auteur) return $rv;
	$date = date("Y-m-d", mktime(0,0,0,$mois, 1, $annee));
	$mois = mois($date);
	$annee = annee($date);

	// rendez-vous personnels dans le mois
	$result_messages = sql_select("M.titre AS summary, M.texte AS description, M.id_message AS uid, M.date_heure", "spip_messages AS M, spip_auteurs_messages AS L", "((L.id_auteur=$connect_id_auteur AND L.id_message=M.id_message) OR M.type='affich') AND M.rv='oui' AND M.date_heure >='$annee-$mois-1' AND date_heure < DATE_ADD('$annee-$mois-1', INTERVAL 1 MONTH) AND M.statut='publie'");
	while($row=sql_fetch($result_messages)) {
		$rv[journum($row['date_heure'])] = $row;
	}
	return $rv;
}
Ejemplo n.º 4
0
    // Remise à zéro de $selected
    $selected = '';
}
echo '</select>', "\n";
?>
                                </div>
                            </div>
                            <div class='row'>
                                <div class="span2">
                                <label for="mois_conges" > Mois :</label> 
                                </div>
                                <div class="span2">
                                    
                                <?php 
// Affichage de la liste déroulante du mois via la fonction mois()
echo mois();
echo "\n                                <script type=text/javascript>\n                                \$('#" . date('n') . "').attr('selected', 'true');\n                                </script>";
?>
                                </div>
                                
                                <div class='offset2 span8 '>
                                <button class="btn btn-primary" type="submit">Continuer <i class="icon-ok"></i> </button>
                                <button class='btn btn-primary' type='button' onClick="javascript:window.location.replace('accueil.php');"> Quitter <i class='icon-home'></i> </button>
                                </div>
                            </div>
                        </fieldset> 
                    </form>
                </div>
            </div>
        </div>
    </body>
Ejemplo n.º 5
0
function quete_calendrier_agenda($annee, $mois)
{
    include_spip('inc/session');
    $connect_id_auteur = session_get('id_auteur');
    $rv = array();
    if (!$connect_id_auteur) {
        return $rv;
    }
    $date = date("Y-m-d", mktime(0, 0, 0, $mois, 1, $annee));
    $mois = mois($date);
    $annee = annee($date);
    // rendez-vous personnels dans le mois
    $result_messages = sql_select("M.titre AS summary, M.texte AS description, M.id_message AS uid, M.date_heure", "spip_messages AS M, spip_auteurs_liens AS L", "((L.id_auteur={$connect_id_auteur} AND L.id_objet=M.id_message AND L.objet='message') OR M.type='affich') AND M.rv='oui' AND M.date_heure >='{$annee}-{$mois}-1' AND date_heure < DATE_ADD('{$annee}-{$mois}-1', INTERVAL 1 MONTH) AND M.statut='publie'");
    while ($row = sql_fetch($result_messages)) {
        $rv[journum($row['date_heure'])] = $row;
    }
    return $rv;
}
Ejemplo n.º 6
0
function exec_affiche_message_dist($id_message, $cherche_auteur, $forcer_dest)
{
  $row = sql_fetsel("*", "spip_messages", "id_message=$id_message");
  if ($row) {
	$id_message = $row['id_message'];
	$date_heure = $row["date_heure"];
	$date_fin = $row["date_fin"];
	$titre = typo($row["titre"]);
	$texte = propre($row["texte"]);
	$type = $row["type"];
	$statut = $row["statut"];
	$rv = $row["rv"];
	$expediteur = $row['id_auteur'];

	$lejour=journum($row['date_heure']);
	$lemois = mois($row['date_heure']);		
	$lannee = annee($row['date_heure']);		

	$commencer_page = charger_fonction('commencer_page', 'inc');
	echo $commencer_page($titre, "accueil", "messagerie");

	echo debut_gauche('', true);
	
	if ($rv != 'non')
	  echo http_calendrier_agenda ($lannee, $lemois, $lejour, $lemois, $lannee,false, generer_url_ecrire('calendrier'));
	
	echo "<br />";
	echo  http_calendrier_rv(quete_calendrier_taches_annonces(),"annonces");
	echo  http_calendrier_rv(quete_calendrier_taches_pb(),"pb");
	echo  http_calendrier_rv(quete_calendrier_taches_rv(), "rv");

	if ($rv != "non") {
		list ($sh, $ah) = quete_calendrier_interval(quete_calendrier_jour($lannee,$lemois, $lejour));
		foreach ($ah as $k => $v)
		  {
		    foreach ($v as $l => $e)
		      {
			if (preg_match(",=$id_message$,", $e['URL']))
			  {
			    $ah[$k][$l]['CATEGORIES'] = "calendrier-nb";
			    break;
			  }
		      }
		  }
		echo creer_colonne_droite('', true);	

		echo http_calendrier_ics_titre($lannee,$lemois,$lejour,generer_url_ecrire('calendrier'));
		echo http_calendrier_ics($lannee,$lemois, $lejour, '', '', 90, array($sh, $ah),  '', ' calendrier-msg');
	}

	echo debut_droite('', true);

	http_affiche_message($id_message, $expediteur, $statut, $type, $texte, $titre, $rv, $date_heure, $date_fin, $cherche_auteur, $forcer_dest);

	// reponses et bouton poster message

	$discuter = charger_fonction('discuter', 'inc');
	echo $discuter($id_message, 'message', 'id_message', "perso");
  }

  echo fin_gauche(), fin_page();
}
Ejemplo n.º 7
0
function calendrier_jour($jour, $mois, $annee, $large = "large", $le_message = 0)
{
    global $spip_lang_rtl, $spip_lang_right, $spip_lang_left;
    global $connect_id_auteur, $connect_status;
    global $couleur_claire;
    $date = date("Y-m-d", mktime(0, 0, 0, $mois, $jour, $annee));
    $jour = journum($date);
    $mois = mois($date);
    $annee = annee($date);
    if ($large == "large") {
        $largeur = 300;
        $modif_decalage = 40;
        $debut_gauche = 40;
    } else {
        if ($large == "col") {
            $largeur = 120;
            $modif_decalage = 15;
            $debut_gauche = 20;
        } else {
            $largeur = 80;
            $modif_decalage = 5;
            $debut_gauche = 5;
        }
    }
    $bgcolor = "white";
    if ($large == "etroit") {
        $bgcolor = "#eeeeee";
        $today = getdate(time());
        $jour_today = $today["mday"];
        $mois_today = $today["mon"];
        $annee_today = $today["year"];
        if ($jour == $jour_today and $mois == $mois_today and $annee == $annee_today) {
            $bgcolor = "white";
        }
    }
    $nom = mktime(1, 1, 1, $mois, $jour, $annee);
    $jour_semaine = date("w", $nom);
    if ($jour_semaine == 0) {
        $bgcolor = "#e0e0e0";
    }
    if ($large == "col") {
        echo "<div align='center' style='padding: 5px;'><b class='verdana1'><a href='calendrier_jour.php3?jour={$jour}&mois={$mois}&annee={$annee}' style='color:black;'>" . affdate_jourcourt("{$annee}-{$mois}-{$jour}") . "</a></b></div>";
    } else {
        if ($large == "large") {
            echo "<div align='center' style='padding: 5px;'>";
            echo " <a href='message_edit.php3?rv={$annee}-{$mois}-{$jour}&new=oui&type=pb' class='arial1' style='color: blue;'><IMG SRC='img_pack/m_envoi_bleu{$spip_lang_rtl}.gif' WIDTH='14' HEIGHT='7' BORDER='0' alt='' /> " . _T("lien_nouvea_pense_bete") . "</a>";
            echo " &nbsp; <a href='message_edit.php3?rv={$annee}-{$mois}-{$jour}&new=oui&type=normal' class='arial1' style='color: green;'><IMG SRC='img_pack/m_envoi{$spip_lang_rtl}.gif' WIDTH='14' HEIGHT='7' BORDER='0' alt='' /> " . _T("lien_nouveau_message") . "</a>";
            if ($connect_status == "admin") {
                echo " &nbsp; <a href='message_edit.php3?rv={$annee}-{$mois}-{$jour}&new=oui&type=affich' class='arial1' style='color: #ff9900;'><IMG SRC='img_pack/m_envoi_jaune{$spip_lang_rtl}.gif' WIDTH='14' HEIGHT='7' BORDER='0' alt='' /> " . _T("lien_nouvelle_annonce") . "</a>\n";
            }
            echo "</div>";
        }
    }
    if ($large != "etroit") {
        echo "<div style='background-color: {$bgcolor}; border-left: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa;'>";
    } else {
        echo "<div style='background-color: {$bgcolor};'>";
    }
    // bordure
    echo "<div style='position: relative; width: 100%; height: 450px; background: url(img_pack/fond-calendrier.gif);'>";
    echo "<div style='position: absolute; {$spip_lang_left}: 2px; top: 2px; color: #666666;' class='arial0'><b class='arial0'>0:00<br />7:00</b></div>";
    for ($i = 7; $i < 20; $i++) {
        echo "<div style='position: absolute; {$spip_lang_left}: 2px; top: " . (($i - 6) * 30 + 2) . "px; color: #666666;' class='arial0'><b class='arial0'>{$i}:00</b></div>";
    }
    echo "<div style='position: absolute; {$spip_lang_left}: 2px; top: 422px; color: #666666;' class='arial0'><b class='arial0'>20:00<br />23:59</b></div>";
    // articles du jour
    $query = "SELECT * FROM spip_articles WHERE statut='publie' AND date >='{$annee}-{$mois}-{$jour}' AND date < DATE_ADD('{$annee}-{$mois}-{$jour}', INTERVAL 1 DAY) ORDER BY date";
    $result = spip_query($query);
    while ($row = spip_fetch_array($result)) {
        $id_article = $row['id_article'];
        $titre = typo($row['titre']);
        $lejour = journum($row['date']);
        $lemois = mois($row['date']);
        $les_articles .= "<div><a href='articles.php3?id_article={$id_article}' class='arial1'><img src='img_pack/puce-verte-breve.gif' width='8' height='9' border='0'> {$titre}</a></div>";
    }
    // breves du jour
    $query = "SELECT * FROM spip_breves WHERE statut='publie' AND date_heure >='{$annee}-{$mois}-{$jour}' AND date_heure < DATE_ADD('{$annee}-{$mois}-{$jour}', INTERVAL 1 DAY) ORDER BY date_heure";
    $result = spip_query($query);
    while ($row = spip_fetch_array($result)) {
        $id_breve = $row['id_breve'];
        $titre = typo($row['titre']);
        $lejour = journum($row['date_heure']);
        $lemois = mois($row['date_heure']);
        $les_breves .= "<div><a href='breves_voir.php3?id_breve={$id_breve}' class='arial1'><img src='img_pack/puce-blanche-breve.gif' width='8' height='9' border='0'> {$titre}</a></div>";
    }
    if ($large == "large") {
        if ($les_articles or $les_breves) {
            if ($les_articles) {
                $les_articles = "<div><b class='verdana1'>" . _T('info_articles') . "</b></div>" . $les_articles;
            }
            if ($les_breves) {
                $les_breves = "<div><b class='verdana1'>" . _T('info_breves_02') . "</b></div>" . $les_breves;
            }
            echo "<div style='position: absolute; {$spip_lang_left}: 355px; top: 32px; width: 140px;'>";
            echo $les_articles;
            echo $les_breves;
            echo "</div>";
        }
    }
    // rendez-vous personnels
    $result_messages = spip_query("SELECT messages.* FROM spip_messages AS messages, spip_auteurs_messages AS lien WHERE ((lien.id_auteur='{$connect_id_auteur}' AND lien.id_message=messages.id_message) OR messages.type='affich') AND messages.rv='oui' AND messages.date_heure <='{$annee}-{$mois}-{$jour} 23:59:00' AND messages.date_fin > '{$annee}-{$mois}-{$jour} 00:00:00' AND messages.statut='publie' GROUP BY messages.id_message ORDER BY messages.date_heure");
    // Note: le $date_fin est strictement superieur a minuit
    while ($row = spip_fetch_array($result_messages)) {
        $id_message = $row['id_message'];
        $date_heure = $row["date_heure"];
        $date_fin = $row["date_fin"];
        $titre = propre($row["titre"]);
        $texte = propre($row["texte"]);
        $type = $row["type"];
        $lejour = journum($row['date_heure']);
        if ($type == "normal") {
            $la_couleur = "#02531B";
            $couleur_fond = "#CFFEDE";
        } elseif ($type == "pb") {
            $la_couleur = "#3874B0";
            $couleur_fond = "#EDF3FE";
        } elseif ($type == "affich") {
            $la_couleur = "#ccaa00";
            $couleur_fond = "#ffffee";
        } else {
            $la_couleur = "black";
            $couleur_fond = "#aaaaaa";
        }
        $heure_debut = heures($date_heure);
        $minutes_debut = minutes($date_heure);
        $jour_debut = journum($date_heure);
        $mois_debut = mois($date_heure);
        $annee_debut = annee($date_heure);
        // Verifier si debut est jour precedent
        $unix_debut = date("U", mktime($heures_debut, $minutes_debut, 0, $mois_debut, $jour_debut, $annee_debut));
        $unix_debut_today = date("U", mktime(0, 0, 0, $mois, $jour, $annee));
        if ($unix_debut < $unix_debut_today) {
            $heure_debut = 0;
            $minutes_debut = 0;
        }
        // Verifier si fin est jour suivant
        $heure_fin = heures($date_fin);
        $minutes_fin = minutes($date_fin);
        $jour_fin = journum($date_fin);
        $mois_fin = mois($date_fin);
        $annee_fin = annee($date_fin);
        $unix_fin = date("U", mktime($heures_fin, $minutes_fin, 0, $mois_fin, $jour_fin, $annee_fin));
        $unix_fin_today = date("U", mktime(23, 59, 0, $mois, $jour, $annee));
        if ($unix_fin > $unix_fin_today) {
            $heure_fin = 23;
            $minutes_fin = 59;
        }
        // Corriger pour l'affichage dans le tableau (debut et fin de tableau sont reduits)
        if ($heure_debut < 6) {
            $heure_debut = 6;
            $minutes_debut = 0;
        }
        if ($heure_fin < 7) {
            $heure_fin = 7;
            $minutes_fin = 00;
        }
        if ($heure_debut > 20) {
            $heure_debut = 20;
            $minutes_debut = 0;
        }
        if ($heure_fin > 20) {
            $heure_fin = 21;
            $minutes_fin = 00;
        }
        $haut = floor((($heure_debut - 6) * 60 + $minutes_debut) / 2);
        $bas = floor((($heure_fin - 6) * 60 + $minutes_fin) / 2);
        $hauteur = $bas - $haut - 7;
        if ($hauteur < 23) {
            $hauteur = 23;
        }
        if ($bas_prec > $haut) {
            $decalage = $decalage + $modif_decalage;
        } else {
            $decalage = $debut_gauche;
        }
        if ($bas > $bas_prec) {
            $bas_prec = $bas;
        }
        if ($le_message == $id_message) {
            $couleur_cadre = "black";
        } else {
            $couleur_cadre = "{$la_couleur}";
        }
        echo "<div class='dessous'  style='position: absolute; {$spip_lang_left}: " . $decalage . "px; top: " . $haut . "px; height: " . ($hauteur + 8) . "px; width: " . ($largeur + 8) . "px; ' onClick=\"document.location='message.php3?id_message={$id_message}'\" onMouseOver=\"changeclass(this, 'dessus');\" onMouseOut=\"changeclass(this, 'dessous');\">";
        echo "<div style='position: absolute;  height: " . $hauteur . "px; width: " . $largeur . "px;  border: 1px solid {$la_couleur}; padding: 3px; background-color: {$couleur_fond}; -moz-border-radius: 5px;'>";
        echo "</div>";
        echo "<div style='position: absolute; overflow: hidden; height: " . $hauteur . "px; width: " . $largeur . "px;  border: 1px solid {$couleur_cadre}; padding: 3px; -moz-border-radius: 5px;'>";
        echo "<div><b><a href='message.php3?id_message={$id_message}' class='verdana1' style='color: {$la_couleur};'>{$titre}</a></b></div>";
        if ($type == "normal") {
            $result_auteurs = spip_query("SELECT auteurs.* FROM spip_auteurs AS auteurs, spip_auteurs_messages AS lien WHERE (lien.id_message='{$id_message}' AND (auteurs.id_auteur!='{$connect_id_auteur}' AND lien.id_auteur=auteurs.id_auteur))");
            while ($row_auteur = spip_fetch_array($result_auteurs)) {
                $id_auteur = $row_auteur['id_auteur'];
                $nom_auteur = $row_auteur['nom'];
                $les_auteurs[$id_message][] = $nom_auteur;
            }
            if (count($les_auteurs[$id_message]) > 0) {
                echo "<div><font class='verdana1'>" . join($les_auteurs[$id_message], ", ") . "</font></div>";
            }
        }
        if ($large) {
            echo "<div><a href='message.php3?id_message={$id_message}' class='arial1' style='color: #333333; text-decoration: none;'>{$texte}</a></div>";
        }
        echo "</div>";
        echo "</div>";
    }
    echo "</div>";
    echo "</div>";
    if ($large != "large") {
        if ($les_articles or $les_breves) {
            if ($les_articles) {
                $les_articles = "<div><b class='verdana1'>" . _T('info_articles') . "</b></div>" . $les_articles;
            }
            if ($les_breves) {
                $les_breves = "<div><b class='verdana1'>" . _T('info_breves_02') . "</b></div>" . $les_breves;
            }
            echo "<div style='padding: 5px;'>";
            echo $les_articles;
            echo $les_breves;
            echo "</div>";
        }
    }
}
Ejemplo n.º 8
0
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">&nbsp;</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' . "&amp;jour=" . $today['mday'] . "&amp;mois=" . $today['mon'] . "&amp;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 '&nbsp;<a href="author_det.php?tab=appointments&amp;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 '&nbsp;<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> &gt; <a href=\"#\" title=\"Test link\">Page1</a> &gt; <a href=\"#\" title=\"Test link\">Subpage1</a> &gt; Subsubpage1</div -->\n\t";
}
Ejemplo n.º 9
0
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);
}
Ejemplo n.º 10
0
/**
 * Afficher la periode de l'agenda :
 * Le nom du mois si nb_mois = 1
 * L'annee si nb_mois=12 et debut du mois = janvier
 * sinon : mois annee - mois annee (xxx 12 - yyy 13)
 * si le debut de la periode est fixe (debut d'un mois donnee), on precede de
 * "Annee" ou "Saison" la periode
 *
 * @param string $date
 * @param int $nb_mois
 * @param string $affichage_debut
 * @return string
 */
function affdate_periode($date, $nb_mois, $affichage_debut = 'date_jour')
{
    $fixe = in_array($affichage_debut, array('debut_mois_1', 'debut_mois_2', 'debut_mois_3', 'debut_mois_4', 'debut_mois_5', 'debut_mois_6', 'debut_mois_7', 'debut_mois_8', 'debut_mois_9', 'debut_mois_10', 'debut_mois_11', 'debut_mois_12'));
    if ($nb_mois == 1) {
        return affdate_mois_annee($date);
    }
    if ($nb_mois == 12 and mois($date) == 1) {
        return ($fixe ? _T('agenda:label_annee') . ' ' : '') . annee($date);
    }
    return ($fixe ? _T('agenda:label_periode_saison') . ' ' : '') . affdate_mois_annee($date) . " - " . affdate_mois_annee(agenda_moisdecal($date, $nb_mois - 1));
}
Ejemplo n.º 11
0
								</td></tr>
							</thead>
							<tbody>

									<?php 
    function mois($i)
    {
        $mois = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
        return $mois[$i];
    }
    for ($i = 0; $i < 12; $i++) {
        ?>

										<tr>
											<td class="col-xs-6"><?php 
        echo mois($i);
        ?>
</td>
											<td class="col-xs-3"><input class="form-control" id="<?php 
        echo 'ca_' . ($i + 1);
        ?>
" type="text" value="" /></td>
											<td class="col-xs-3"><input class="form-control" id="<?php 
        echo 'benef_' . ($i + 1);
        ?>
" type="text" value="" /></td>
										</tr>

									<?php 
    }
    ?>
Ejemplo n.º 12
0
echo '<fieldset class="info_box">' . "\n";
echo '<p class="normal_text">' . "\n";
echo _Ti('app_input_title') . $row['title'] . "<br />\n";
echo _Ti('app_input_type') . _Tkw('appointments', $row['type']) . "<br />\n";
if ($row['hidden'] == 'Y') {
    echo '<p class="normal_text"><strong>' . _T('app_info_is_deleted') . "</strong>";
    if ($ac['a']) {
        echo " " . _T('app_info_is_deleted2');
    }
    echo "</p>\n";
}
show_page_subtitle(_T('generic_subtitle_general'), 'tools_agenda');
echo _Ti('app_input_description') . nl2br($row['description']) . "<br />\n";
echo "<br />\n";
echo _Ti('time_input_date_start') . format_date($row['start_time'], 'short');
$year_for_cal = "&annee=" . annee($row['start_time']) . "&mois=" . mois($row['start_time']) . "&jour=" . journum($row['start_time']);
// day
echo ' ' . http_href_img("calendar.php?type=jour" . $year_for_cal, 'cal-today.gif', '', _T('app_info_see_cal_for_day_tooltip'));
echo "<br />\n";
/* [ML] removing: not really useful for now 
	$end_time = vider_date($row['end_time']);
	$reminder = vider_date($row['reminder']);
	if ($prefs['time_intervals'] == 'absolute') {
		echo _Ti('time_input_date_end') . format_date($row['end_time'], 'short') . "<br />\n";
		echo _Ti('app_input_reminder') . format_date($row['reminder'], 'short') . "<br />\n";
	} else {
		$duration = ($end_time ? strtotime($row['end_time']) - strtotime($row['start_time']) : 0);
		echo _Ti('app_input_time_length') . format_time_interval($duration,($prefs['time_intervals_notation'] == 'hours_only')) . "<br />\n";
		$reminder_offset = ($reminder ? strtotime($row['start_time']) - strtotime($row['reminder']) : 0);
		echo _Ti('app_input_reminder')
			. format_time_interval($reminder_offset,($prefs['time_intervals_notation'] == 'hours_only'))
Ejemplo n.º 13
0
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;
}
Ejemplo n.º 14
0
function presenter_message_boucles($row, $afficher_auteurs)
{
	global $connect_id_auteur, $spip_lang_left, $spip_lang_rtl;

	$vals = array();

	$id_message = $row['id_message'];
	$date = $row["date_heure"];
	$date_fin = $row["date_fin"];
	$titre = sinon($row['titre'], _T('ecrire:info_sans_titre'));
	$type = $row["type"];
	$rv = $row["rv"];

			//
			// Titre
			//

	$s = "<a href='" . generer_url_ecrire("message","id_message=$id_message") . "' style='display: block;'>";

	switch ($type) {
	case 'pb' :
				$puce = "m_envoi_bleu$spip_lang_rtl.gif";
				break;
	case 'memo' :
				$puce = "m_envoi_jaune$spip_lang_rtl.gif";
				break;
	case 'affich' :
				$puce = "m_envoi_jaune$spip_lang_rtl.gif";
				break;
	case 'normal':
	default:
				$puce = "m_envoi$spip_lang_rtl.gif";
				break;
	}
				
	$s .= http_img_pack("$puce", "", "width='14' height='7'");
	$s .= "&nbsp;&nbsp;".typo($titre)."</a>";
	$vals[] = $s;

			//
			// Auteurs

	if ($afficher_auteurs) {
		$result_auteurs = sql_select("auteurs.id_auteur, auteurs.nom", "spip_auteurs AS auteurs, spip_auteurs_messages AS lien", "lien.id_message=$id_message AND lien.id_auteur!=$connect_id_auteur AND lien.id_auteur=auteurs.id_auteur");

		$auteurs = '';
		while ($row_auteurs = sql_fetch($result_auteurs)) {
			$id_auteur = $row_auteurs['id_auteur'];
			$auteurs[] = "<a href='" . generer_url_ecrire("auteur_infos","id_auteur=$id_auteur") . "'>".typo($row_auteurs['nom'])."</a>";
		}

		if ($auteurs AND $type == 'normal') {
			$s = "<span class='arial1 spip_x-small'>" . join(', ', $auteurs) . "</span>";
		} else $s = "&nbsp;";
		$vals[] = $s;
	}
			
			//
			// Messages de forums
			
	$total_forum = sql_countsel('spip_forum', "id_message=$id_message");
			
	if ($total_forum > 0) $vals[] = "($total_forum)";
	else $vals[] = "";
			
			//
			// Date
			//
			
	$s = affdate($date);
	if ($rv == 'oui') {
		$jour=journum($date);
		$mois=mois($date);
		$annee=annee($date);
				
		$heure = heures($date).":".minutes($date);
		if (affdate($date) == affdate($date_fin))
			$heure_fin = heures($date_fin).":".minutes($date_fin);
		else 
			$heure_fin = "...";

		$s = "<div " . 
			http_style_background('rv-12.gif', "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px") .
			"><a href='" . generer_url_ecrire("calendrier","type=jour&jour=$jour&mois=$mois&annee=$annee") . "'><b style='color: black;'>$s</b><br />$heure-$heure_fin</a></div>";
	} else {
		$s = "<span style='color: #999999'>$s</span>";
	}
			
	$vals[] = $s;

	return $vals;
}
Ejemplo n.º 15
0
function statistiques_par_mois($entrees, $script){

	$maxgraph = maxgraph(max($entrees));
	$rapport = 200/$maxgraph;
	$largeur = floor(420 / (count($entrees)));
	if ($largeur < 1) $largeur = 1;
	if ($largeur > 50) $largeur = 50;
	$decal = 0;
	$tab_moyenne = array();

	$all = '';

	foreach($entrees as $key=>$value) {
		$key = substr($key,0,4).'-'.substr($key,4,2);
		$mois = affdate_mois_annee($key);
		if ($decal == 30) $decal = 0;
		$decal ++;
		$tab_moyenne[$decal] = $value;
		$moyenne = statistiques_moyenne($tab_moyenne);
		$hauteur_moyenne = round($moyenne * $rapport) - 1;
		$hauteur = round($value * $rapport) - 1;
		$res = '';
		$title= attribut_html(supprimer_tags("$mois | "
			._T('info_total')." ".$value));
		$tagtitle = $script ? '' : $title;
		if ($hauteur > 0){
			if ($hauteur_moyenne > $hauteur) {
				$difference = ($hauteur_moyenne - $hauteur) -1;
				$res .= http_img_rien($largeur, 1, 'trait_moyen');
				$res .= http_img_rien($largeur, $difference, '', $tagtitle);
				$res .= http_img_rien($largeur,1,"trait_haut");
				if (preg_match(",-01,",$key)){ // janvier en couleur foncee
					$res .= http_img_rien($largeur,$hauteur,"couleur_janvier", $tagtitle);
				} else {
					$res .= http_img_rien($largeur,$hauteur,"couleur_mois", $tagtitle);
				}
			}
			else if ($hauteur_moyenne < $hauteur) {
				$difference = ($hauteur - $hauteur_moyenne) -1;
				$res .= http_img_rien($largeur,1,"trait_haut", $tagtitle);
				if (preg_match(",-01,",$key)){ // janvier en couleur foncee
						$couleur =  'couleur_janvier';
				} else {
						$couleur = 'couleur_mois';
				}
				$res .= http_img_rien($largeur,$difference, $couleur, $tagtitle);
				$res .= http_img_rien($largeur,1,'trait_moyen',$tagtitle);
				$res .= http_img_rien($largeur,$hauteur_moyenne, $couleur, $tagtitle);
			} else {
				$res .= http_img_rien($largeur,1,"trait_haut", $tagtitle);
				if (preg_match(",-01,",$key)){ // janvier en couleur foncee
					$res .= http_img_rien($largeur, $hauteur, "couleur_janvier", $tagtitle);
				} else {
					$res .= http_img_rien($largeur,$hauteur, "couleur_mois", $tagtitle);
				}
			}
		}
		$res .= http_img_rien($largeur,1,'trait_bas', $tagtitle);

		if (!$script) {
			$y = annee($key);
			$m = mois($key);
			$href = generer_url_ecrire('calendrier', "type=mois&annee=$y&mois=$m&jour=1");
		} else $href = "$script&amp;date=$key";

		$all .= "\n<td style='width: ${largeur}px'><a href='"
		.  $href
		. '\' title="'
		. $title
		. '">'
		. $res
		. "</a></td>\n";
	}

	return
	  "\n<table cellpadding='0' cellspacing='0' border='0'><tr>"
	.  "\n<td ".http_style_background("fond-stats.gif").">"
	. "\n<table cellpadding='0' cellspacing='0' border='0' class='bottom'><tr>"
	. "\n<td class='trait_bas'>" . http_img_rien(1, 200) ."</td>"
	.  $all
	. "\n<td style='background-color: black'>" . http_img_rien(1, 1)
	. "</td>"
	. "</tr></table></td>"
	. "\n<td ".http_style_background("fond-stats.gif")." valign='bottom'>"
	. http_img_rien(3, 1, 'trait_bas') ."</td>"
	. "\n<td>" . http_img_rien(5, 1) ."</td>"
	. "\n<td valign='top'>"
	. statistiques_echelle($maxgraph)
	. "</td></tr></table>";
 }
Ejemplo n.º 16
0
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)));
}
Ejemplo n.º 17
0
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) .
    "&nbsp;  <input type='text' class='verdana1' name='heures$suffixe' id='heures$suffixe' value=\"".$heures."\" size='3'/>&nbsp;".majuscules(_T('date_mot_heures'))."&nbsp;" .
    "<input type='text' class='verdana1' name='minutes$suffixe' id='minutes$suffixe' value=\"$minutes\" size='3'/>";
}
Ejemplo n.º 18
0
function sql_calendrier_agenda($mois, $annee)
{
    global $connect_id_auteur;
    $rv = array();
    if (!$connect_id_auteur) {
        return $rv;
    }
    $date = date("Y-m-d", mktime(0, 0, 0, $mois, 1, $annee));
    $mois = mois($date);
    $annee = annee($date);
    // The future events involving the author in this month
    $result_messages = lcm_query("SELECT app.start_time\n\t\t\t\t\tFROM lcm_app as app, lcm_author_app as aut\n\t\t\t\t\tWHERE aut.id_author = " . $GLOBALS['author_session']['id_author'] . "\n\t\t\t\t\tAND app.id_app = aut.id_app\n\t\t\t\t\tAND app.hidden != 'Y'\n\t\t\t\t\tAND app.start_time >= '{$annee}-{$mois}-01'\n\t\t\t\t\tAND app.start_time < " . lcm_query_date_add_interval("{$annee}-{$mois}-01", '+', 'month', 1));
    while ($row = lcm_fetch_array($result_messages)) {
        $rv[journum($row['start_time'])] = 1;
    }
    return $rv;
}