Crabs Contents Management System

crabs_cms-1.0.4 ©2006-2008 - Christophe Cazajus (crabs-mettre_le_signe_at-crabs-world.com)

~~ / ADMIN / cal_ajouter.php
Makefile admin.xsl admin.js index.php vars_done.php db_create.php users.php user_addmod.php user_info.php user_passwd.php cal_ajouter.php svg.php svg_do.php mysql_create_user.php mysql_create_dossier.php mysql_insert_dossier.php mysql_create_article.php mysql_create_pha.php mysql_insert_pha.php mysql_create_phf.php mysql_create_news.php mysql_create_cal.php mysql_create_calcl.php mysql_insert_calcl.php mysql_create_ff.php mysql_create_fq.php mysql_create_fr.php mysql_create_fu.php mysql_create_fi.php
    1 <?php
    2 //
    3 // =============================================================================
    4 //  crabs_cms-1.0.4 : Crabs Contents Management System
    5 //  Copyright (C) 2006-2008 : Christophe Cazajus (crabs-mettre_le_signe_at-crabs-world.com)
    6 //
    7 //  Ce source fait partie d'un projet logiciel libre. Vous pouvez le distribuer
    8 //  et/ou le modifier en respectant les termes de la GNU General Public License
    9 //  version 2 ou (suite a votre propre choix) une version ulterieure.
   10 //
   11 //  Ce programme est distribue dans l'espoir qu'il puisse etre utile, mais
   12 //  sans aucune garantie, meme si il est associe a un produit qui vous en
   13 //  propose une. Conformez-vous a la GNU General Public License pour avoir
   14 //  plus de precisions.
   15 //
   16 //  L'auteur ne peut etre tenu responsable de l'utilisation faite des
   17 //  composantes associees a ce projet (en partie ou dans leur totalite).
   18 //
   19 //  Une copie du fichier de la GNU GPL est fournie dans le repertoire DOC
   20 //  de ce projet sous le nom gnu_gpl.txt
   21 //
   22 // =============================================================================
   23 //
   24 $RACINE='..' ;
   25 
   26 include( $RACINE.'/pinfo.php' ) ;
   27 include( $RACINE.'/LIB/param.php' ) ;
   28 include( $RACINE.'/LIB/util.php' ) ;
   29 include( $RACINE.'/LIB/xml.php' ) ;
   30 include( $RACINE.'/LIB/mysql.php' ) ;
   31 
   32 $c = new MYSQL ;
   33 
   34 if ( array_key_exists( 'an', $_POST ) )
   35     {
   36     $saison = fromPOST( 'an' ) ; $mois = (int)$CAL_DEB ;
   37     $td = mktime( 12, 0, 0, $mois, 1, $saison ) ;
   38     $tf = mktime( 10, 0, 0, $mois, 1, $saison+1 ) ;
   39     $sql = "INSERT INTO ${DB_PRFX}cal VALUES" ; $sep="\n" ;
   40     for( $i=0 ; $i<365; $i++ )
   41         {
   42         $t = $td + $i* 24*3600 ;
   43         if ( $t >= $tf ) break ;
   44         $a = date( 'Y', $t ) ;
   45         $m = date( 'm', $t ) ;
   46         $j = date( 'd', $t ) ;
   47         $js = date( 'w', $t ) ;
   48         $classe = 'normal' ;
   49         if ( $js == 0 ) $classe='dim' ;
   50         if ( $js == 6 ) $classe='sam' ;
   51         $sql.=$sep."('','$saison','$a', '$m', '$j','$js','$classe', '' )" ;
   52         $sep=",\n" ;
   53         }
   54     $c->query( $sql ) ;
   55     }
   56 $xml = new XML ;
   57 $xml->xsl = relative2absolute( 'admin.xsl' ) ;
   58 $xml->attributs = array( 'menu'=>'cal' ) ;
   59 $xml->addElementText( 'titre', 'Administration du site : '.toXML($SITE_NOM) ) ;
   60 $xml->addElementText( 'site', toXML($SITE_NOM) ) ;
   61 $xml_cal = &$xml->addElement( 'cal' ) ;
   62 
   63 $sql = <<<SQL
   64     SELECT annee
   65     FROM ${DB_PRFX}cal
   66     WHERE mois='$CAL_DEB' AND jour='1'
   67     ORDER BY annee
   68 SQL;
   69 $res = $c->query( $sql ) ;
   70 while ( $r = mysql_fetch_assoc( $res ) )
   71     {
   72     $attr = array() ;
   73     foreach( $r as $var => $val ) $attr[$var] = toXML( fromMySQL( $val ) ) ;
   74     $xml_cal->addElementSimple( 'saison', $attr ) ;
   75     }
   76 $attr = array(
   77     'nom'=>$P_PRODUIT,
   78     'version'=>$P_VERSION,
   79     'php'=>phpversion()
   80     ) ;
   81 $xml->addElementSimple( "produit", $attr ) ;
   82 $xml->affiche() ;
   83 ?>
Makefile admin.xsl admin.js index.php vars_done.php db_create.php users.php user_addmod.php user_info.php user_passwd.php cal_ajouter.php svg.php svg_do.php mysql_create_user.php mysql_create_dossier.php mysql_insert_dossier.php mysql_create_article.php mysql_create_pha.php mysql_insert_pha.php mysql_create_phf.php mysql_create_news.php mysql_create_cal.php mysql_create_calcl.php mysql_insert_calcl.php mysql_create_ff.php mysql_create_fq.php mysql_create_fr.php mysql_create_fu.php mysql_create_fi.php
~~ / ADMIN / cal_ajouter.php

Haut de page

Contacter crabs

Date de génération : 24/10/2008 21:34