begin process at 2012 05 28 08:16:45
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive PHP

 > 

Archives

 > 

Débutants

 > 

Affciher les infos du jour...


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Affciher les infos du jour...

samedi 8 octobre 2005 à 16:07:04 | Affciher les infos du jour...

mirtil

Bonjour,

J'aurai voulu savoir comment modifier ce code afin que l'agenda affiche directement les infos du jour lorsque l'on arrive sur l'index...

<?php
/*********************************************************************
*    XLAgenda 3.2.3 par Xavier LE QUERE
*   Contact : xavier@lequere.net
*   Web : http://www.xavier.lequere.net/xlagenda
*   (C) Xavier LE QUERE, 2003-2005
*   Version 3.2.3 - 27/05/05
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*  
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*  
*   You should have received a copy of the GNU General Public License
*   along with this program; if not, write to the Free Software
*   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*********************************************************************/

/*********************************************************************
*    NE PAS EDITER CE FICHIER
*    POUR PERSONNALISER XLAgenda 3.2.2 EDITEZ header.php ET footer.php
*   VOUS POUVEZ AUSSI EDITER LA FEUILLE DE STYLE
*********************************************************************/

//VARIABLES GENERALES
include("data.php");
global $dbserver;
global $dbdb;
global $dbuser;
global $dbpass;
//CONNEXION A LA BASE DE DONNEES
@MYSQL_CONNECT ("$dbserver","$dbuser","$dbpass") or die ("<p>Erreur: impossible de communiquer avec la base de donn&eacute;es.<br>V&eacute;rifiez les donn&eacute;s du fichier <b>data.php</b>.</p>");
mysql_select_db("$dbdb");
//VERIFICATION DE L'EXISTENCE DES TABLES
$query="SELECT id FROM $table_agenda";
$result=mysql_query($query);
if (!$result)
{
die ("<p>XLAgenda n'est pas encore install&eacute;.<br>Vous devez <a href=\"install/index.php\">lancer l'installation automatique</a>.</p>");
}
//INITALISATION DES VARIABLES
$texte="";
$request="";
//RECUPERATION DES DONNEES
$year=(isset($_REQUEST["year"])) ? $_REQUEST["year"] : Null;
$month=(isset($_REQUEST["month"])) ? $_REQUEST["month"] : Null;
$day=(isset($_REQUEST["day"])) ? $_REQUEST["day"] : Null;
$categorie=(isset($_REQUEST["categorie"])) ? $_REQUEST["categorie"] : Null;
$navigation=(isset($_REQUEST["navigation"])) ? $_REQUEST["navigation"] : Null;
$limit=(isset($_REQUEST["limit"])) ? $_REQUEST["limit"] : Null;
//CONTROLE DE LA VALIDITE DES DONNEES
if (($year AND !is_numeric($year)) OR ($month AND !is_numeric($month)) OR ($day AND !is_numeric($day)) OR ($categorie AND !is_numeric($categorie)) OR ($navigation AND !is_numeric($navigation)) OR ($limit AND !is_numeric($limit)))
{
die ("<p>Erreur : une variable poss&egrave;de une valeur interdite.<br />L'ex&eacute;cution est interrompue par mesure de s&eacute;curit&eacute;.</p>");
}

//SI AUCUNE DATE N'A ETE SELECTIONNEE ON SELECTIONNE LA DATE DU JOUR
if (!$month)
{
$month = date("m");
//DANS CE CAS SEULS LES EVENEMENTS POSTERIEURS A LA DATE DU JOUR SERONT AFFICHES
$limit = "1";
}
if (!$year)
{
$year = date("Y");
}

//DETERMINATION DU NOM DU MOIS
if ($month == "1") $nom_mois="janvier";
if ($month == "2") $nom_mois="f&eacute;vrier";
if ($month == "3") $nom_mois="mars";
if ($month == "4") $nom_mois="avril";
if ($month == "5") $nom_mois="mai";
if ($month == "6") $nom_mois="juin";
if ($month == "7") $nom_mois="juillet";
if ($month == "8") $nom_mois="ao&ucirc;t";
if ($month == "9") $nom_mois="septembre";
if ($month == "10") $nom_mois="octobre";
if ($month == "11") $nom_mois="novembre";
if ($month == "12") $nom_mois="d&eacute;cembre";

//MEMORISATION DE LA DATE DU JOUR
$this_year = date("Y");
$this_month = date("m");
$this_day = date("d");
$this_date = date("Y-m-d");

//AFFICHAGE DE L'ENTETE
include("header.php");

//CODE HTML DE LA PAGE
?>
<table width="100%" border="0" cellspacing="2" cellpadding="5">
  <tr valign="top">
    <td width="25%">
      <?php
      include("cal.php");
      ?>
      <br>

      <table width="100%" border="0" cellspacing="2" cellpadding="5" class="cadre">
        <tr>
  
            </form></td>
        </tr>
      </table> <br>
    

    <td width="75%">
     
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td>
             <?php
            //TITRE DE LA PAGE
            echo "<h1>Calendrier";
            if (!$day)
            {
            if (($month == "4") OR ($month == "8") OR ($month == "10"))
            {
            echo " du mois d'$nom_mois $year";
            }
            else
            {
            echo " du mois de $nom_mois $year";
            }
            }
            if ($day)
            {
            if ($day == "1")
            {
            $day2=array("$day","er");
            $day2=implode("",$day2);
            }
            else
            {
            $day2=$day;
            }
            echo " du $day2 $nom_mois $year";
            }
            echo "</h1>";
            if ($nom_mois AND $categorie)
            {
            echo "<h2>Filtre appliqu&eacute;</h2>";
            }
            ?>
          </td>
          <td valign="baseline"><div align="center">
              <?php
                        //LIEN DE SWITCH VUE DEVELOPPEE / VUE REDUITE
                        if (!$reduit)
                        {
                        echo "<p align=\"right\">Vue d&eacute;taill&eacute;e | <a href=\"$url_page?cookie=1&amp;year=$year&amp;month=$month&amp;day=$day&amp;categorie=$categorie&amp;navigation=$navigation&amp;limit=$limit\">Vue r&eacute;duite</a></p>";
                        }
                        if ($reduit)
                        {
                        echo "<p align=\"right\"><a href=\"$url_page?cookie=2&amp;year=$year&amp;month=$month&amp;day=$day&amp;categorie=$categorie&amp;navigation=$navigation&amp;limit=$limit\">Vue d&eacute;taill&eacute;e</a> | Vue r&eacute;duite</p>";
                        }
                        ?>
            </div></td>
        </tr>
        <tr>
          <td colspan="2">
       <?php
      /***********************************************************************************
      *    AFFICHAGE DU MOIS DEMANDE (LIENS DE NAVIGATION, CALENDRIER, CHARGEMENT DE LA PAGE)
      ************************************************************************************/
      if (!$navigation)
      {
      $date1=array("$year","$month","01");
      $date2=array("$year","$month","31");
      $date1=implode("-",$date1);
      $date2=implode("-",$date2);
      if ($limit)
      //CAS DU CHARGEMENT DE LA PAGE - ON CHERCHE SEULEMENT LES EVENEMENTS POSTERIEURS A LA DATE DU JOUR
      {
      $date1=$this_date;
      }
      if ($day)
      {
      //CAS OU UN JOUR A ETE CHOISI
      $query="SELECT * FROM $table_agenda WHERE (date_debut <= '$year-$month-$day' AND date_fin >= '$year-$month-$day') OR (date_debut='$year-$month-$day') AND actif='1'";
      }
      else
      {
      //CAS OU UN MOIS A ETE CHOISI
      $query="SELECT * FROM $table_agenda WHERE (date_debut <= '$date2' AND date_fin >= '$date1' AND actif = '1') ORDER BY date_debut ASC, nom ASC";
      }
      $result=mysql_query($query);
      if($result)
      {
      $total=mysql_num_rows($result);
      //AFFICHAGE DES RESULTATS
      if ($reduit)
      {
      include("affiche2.php");
      }
      else
      {
      include("affiche.php");
      }
      }
      }
      /***********************************************************************
      *    AFFICHAGE DES EVENEMENTS DEMANDES (FORMULAIRE DE FILTRAGE)
      ************************************************************************/
      if ($navigation)
      {
      $date1=array("$year","$month","01");
      $date2=array("$year","$month","31");
      $date1=implode("-",$date1);
      $date2=implode("-",$date2);
      if ($categorie)
      {
      $request="AND categorie = $categorie";
      }
      $query="SELECT * FROM $table_agenda WHERE (date_debut >= '$date1' AND date_debut <= '$date2' AND actif = '1' $request) OR (date_fin >= '$date2' AND date_debut <= '$date2' AND actif = '1' $request) OR (date_debut <= '$date1' AND date_fin >= '$date1' AND actif = '1' $request) OR (date_debut <= '$date1' AND date_fin >= '$date2' AND actif = '1' $request) ORDER BY date_debut ASC, nom ASC";
      $result=mysql_query($query);
      if($result)
      {
      $num=mysql_num_rows($result);
      if (!$num)
      {
      $texte="Aucun &eacute;v&eacute;nement du mois de $nom_mois $this_year ne correspond &agrave; votre demande.";
      }
      //AFFICHAGE DES RESULTATS
      if ($reduit)
      {
      include("affiche2.php");
      }
      else
      {
      include("affiche.php");
      }
      }
      }
      ?>
          </td>
        </tr>
      </table>
     
    </td>
  </tr>
</table>
<p>&nbsp;</p>
<?php
//AFFICHAGE DU PIED DE PAGE
include("footer.php");
?>


HELP

mirtil
dimanche 9 octobre 2005 à 00:30:07 | Re : Affciher les infos du jour...



et pourquoi pas 100 balles et un mars?
dimanche 9 octobre 2005 à 19:14:59 | Re : Affciher les infos du jour...

mirtil



J'imaginais que c'etait pas complexe, et qu'avec un bref regard sur le code, kelk1 pourrait m'aider...

mirtil
lundi 10 octobre 2005 à 23:24:42 | Re : Affciher les infos du jour...

FhX

Vaudrait mieux que tu demandes à l'auteur...
Parce que bon :)

mercredi 12 octobre 2005 à 19:23:26 | Re : Affciher les infos du jour...

mirtil

Bah le problème, c'est que l'auteur ne  fournit aucune aide quant à la personnalisation de cet agenda...
Donc je sais pas par où commencer.

Peut être auriez vous un lien pouvant m'orienter....

mirtil


Cette discussion est classée dans : date, mois, month, eacute, year


Répondre à ce message

Sujets en rapport avec ce message

Empecher un calcul [ par nxtreme ] Bonsoir; j'aimerai pouvoir afficher dans une variable une valeur telle quel:$year = date("Y");$mois = date("m")-1;$day = date("d");$datefinale = $y partie de chaine de caractère en gras [ par brezoneg ] Bonjour,Grçace à votre aide; j'utilise le code suivant pour mettre le mois en cours devant l'enregistrement.( ici $enreg)Comment faire apparaitre ce m Besoin Aide Date MYSQL & PHP [ par Dexterage ] voila g un tit soucis au niveau dune requete sql avec la date! en effet, jai une table mysql avec un champ (date_fin) ds ma page php, jai un formulair calcul de dates (mois) [ par lineb76 ] Bonjour,Je vais encore poster un pb sur les dates mais j'ai trouvé pleins de renseignements sur des calculs de date, mais pas celle que je recherche.E PHP probleme de boucle avec dates [ par infosub ] Bonjour, je suis confronté à un petit problème de boucle pour ajouter plusieurs jour à une date.. le script ci-dessous calcule le nombre de jours entr probleme de date [ par ManuAntibes ] salut Je n'arrive pas à utiliser les dates que je recupere de ma base de donnée.$date = $row_Recordset1['date'];//10/05/2002 $année = date("Y",$date) Date Heure en temps réel + message selon date [ par Anakinele ] Est-ce qu'il est possible de faire la même chose que le script en vert (voir plus bas) (trouvé il y a longtemps) avec date et heure (qui défile en tem Toujours a la recherche d'aide pour les dates !!! [ par nagrom_om ] Bon je rééxplique mon probleme. Je choisi une date de depart et une date d'arrivée (demande de congés) je dois calculer le nombre de jours ouvrables p Tri par date... [ par olerien ] Bonjour,Après m'être pris la tête pour régler un problème de triage par date dans un tableau php d'une base MySQL, tout fonctionnait.Mais un souci est petite erreur dans calendrier dynamique javascript!!! [ par joduak ] Salut à vous, j'ai un gros problème sur mon calendrier. copier coller le dans un fichier php et lancez le, vous verrez qu'il y a 2 ptites erreurs. J'a


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,295 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales