Gestion simplissime des Todo

crabs_todo-2.0 ©2008-2011 - Christophe Cazajus (crabs-mettre_le_signe_at-crabs-world.com)

~~ / hr_todo_create.php
Makefile todo.css todo.js onglet.js liste.js detail.js modif.js index.php logout.php todo.php hr_todo_create.php hr_todo_list.php hr_todo_info.php hr_todo_change.php hr_todo_del.php hr_projet_liste.php hr_pseudo_liste.php
    1 <?php
    2 //
    3 // =============================================================================
    4 //  crabs_todo-2.0 : Gestion simplissime des Todo
    5 //  Copyright (C) 2008-2011 : 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 
   25 $ROOT = '' ;
   26 include( "{$ROOT}LIB/param.php" ) ;
   27 include( "{$ROOT}LIB/util.php" ) ;
   28 include( "{$ROOT}LIB/mysql.php" ) ;
   29 include( "{$ROOT}LOCALE/defaut.php" ) ;
   30 foreach( acceptLang() as $lang => $q )
   31     if ( is_file( "{$ROOT}LOCALE/{$lang}.php" ) )
   32         { include( "{$ROOT}LOCALE/{$lang}.php" ) ; break ; }
   33 
   34 if ( !array_key_exists( 'PHPSESSID', $_REQUEST ) )
   35     { header( 'Location: '.$ROOT_URL ) ; exit ; }
   36 session_set_cookie_params(0,relative2absolute('.', true)) ;
   37 session_start() ;
   38 $pseudo = $_SESSION['user']['pseudo'] ;
   39 $can = ( $_SESSION['user']['create_todo'] == 'Y' ) ? 'true' : 'false' ;
   40 
   41 if ( ! $can  ) die( 'permission denied' ) ;
   42 
   43 /* on utilise les filtres comme defaut */
   44 $projet =  toMySQL( fromJS( fromGET( 'projet', '' ) ) ) ;
   45 $filtres = array( 'fw'=>'w', 'fp'=>'p', 'fr'=>'r' ) ;
   46 foreach( $filtres as $get => $var )
   47     $$var = toMySQL( substr( fromGET( $get, '..1' ), 2 ) ) ;
   48 if ( $projet == '0' ) $projet = '' ;
   49 if ( $w + 0 == 0 ) $w = 3 ;
   50 if ( $p + 0 == 0 ) $p = 1 ;
   51 if ( $r + 0 == 0 ) $r = 1 ;
   52 
   53 $sql = <<<SQL
   54     INSERT INTO ${DB_PRFX}todo VALUES(
   55         '', '$w', '$p', '$pseudo', '$r', '$projet', NOW(),
   56         '{$tr['TODO_TASK']}', '{$tr['TODO_NOTE']}', NULL )
   57 
   58 SQL;
   59 
   60 $c = new MYSQL( true, false ) ;
   61 $c->query( $sql ) ;
   62 $id = $c->id() ;
   63 echo "OK<!>$id" ;
   64 ?>
Makefile todo.css todo.js onglet.js liste.js detail.js modif.js index.php logout.php todo.php hr_todo_create.php hr_todo_list.php hr_todo_info.php hr_todo_change.php hr_todo_del.php hr_projet_liste.php hr_pseudo_liste.php
~~ / hr_todo_create.php

Haut de page

Contacter crabs

Date de génération : 22/09/2011 21:49