Gestion simplissime des Todo

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

~~ / ADMIN / backup_do.php
Makefile admin.css admin.js index.php var.js var_get.php var_set.php user.js user_list.php user_info.php user_mod.php user_pwd.php user_del.php base.js base_create.php base_upgrade.php base_function.php backup.js backup_list.php backup_do.php backup_restor.php backup_download.php backup_delete.php sql.js sql.php empty.txt
    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 $ROOT = '../' ;
   25 include( "{$ROOT}LIB/param.php" ) ;
   26 include( "{$ROOT}LIB/util.php" ) ;
   27 include( "{$ROOT}LIB/mysql.php" ) ;
   28 include( "{$ROOT}LOCALE/defaut.php" ) ;
   29 foreach( acceptLang() as $lang => $q )
   30     if ( is_file( "{$ROOT}LOCALE/{$lang}.php" ) )
   31         { include( "{$ROOT}LOCALE/{$lang}.php" ) ; break ; }
   32 
   33 
   34 clearstatcache() ;
   35 if ( !is_dir('BACKUP') ) mkdir( 'BACKUP' ) ;
   36 
   37 $file = $DB_BASE.'_'.$DB_PRFX.'_'.date('YmdHis') ;
   38 ob_start() ;
   39 
   40 $tbl =  array( 'member', 'todo' ) ;
   41 $c = new MYSQL ;
   42 
   43 $cle = substr( md5( uniqid( rand(), true ) ), 0, 8 ) ;
   44 $table_begin = $cle."_TB" ;
   45 $table_end = $cle."_TE" ;
   46 $create_begin = $cle."_CB" ;
   47 $create_end = $cle."_CE" ;
   48 $data_begin = $cle."_DB" ;
   49 $data_end = $cle."_DE" ;
   50 $row_begin = $cle."_RB" ;
   51 $row_end = $cle."_RE" ;
   52 $field_begin = $cle."_FB" ;
   53 $field_end = $cle."_FE" ;
   54 
   55 echo $cle."\n".date( "d/m/Y-H:i:s" )."\n" ;
   56 foreach( $tbl as $t )
   57     {
   58     $t = $DB_PRFX.$t ;
   59     echo "$table_begin $t\n" ;
   60     echo "$create_begin\n" ;
   61     $sql = "SHOW CREATE TABLE $t" ;
   62     $res = $c->query( $sql ) ;
   63     $r = mysql_fetch_array( $res, MYSQL_NUM ) ;
   64     echo $r[1]."\n" ;
   65     echo "$create_end\n" ;
   66     echo "$data_begin\n" ;
   67     $sql = "SELECT * FROM $t" ;
   68     $res = $c->query( $sql ) ;
   69     while( $r = mysql_fetch_array( $res, MYSQL_ASSOC ) )
   70         {
   71         echo "$row_begin\n" ;
   72         foreach( $r as $cle => $val )
   73             {
   74             echo "$field_begin $cle\n" ;
   75             echo "$val\n" ;
   76             echo "$field_end\n" ;
   77             }
   78         echo "$row_end\n" ;
   79         }
   80     echo "$data_end\n" ;
   81     echo "$table_end $t\n" ;
   82     }
   83 $c->close() ;
   84 ( $fd=fopen( "BACKUP/$file.dat", 'w' ) ) || die("ERR<#>{$tr['ADM_BU_EOPEN']}") ;
   85 fwrite( $fd, ob_get_contents() ) || die("ERR<#>{$tr['ADM_BU_EWRITE']}") ;
   86 fclose( $fd ) || die("ERR<#>{$tr['ADM_BU_ECLOSE']}" ) ;
   87 ob_end_clean();
   88 echo "OK<#>$file" ;
   89 ?>
Makefile admin.css admin.js index.php var.js var_get.php var_set.php user.js user_list.php user_info.php user_mod.php user_pwd.php user_del.php base.js base_create.php base_upgrade.php base_function.php backup.js backup_list.php backup_do.php backup_restor.php backup_download.php backup_delete.php sql.js sql.php empty.txt
~~ / ADMIN / backup_do.php

Haut de page

Contacter crabs

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