Retour...'; echo '

'; if (isset($_GET['restauration'])) { $jour = date('d-m-Y'); $heure = date("H_i_s"); $infos = $jour.'-'.$heure; $fichier = "backup_user-" .$infos .".txt"; DB_to_file($fichier); echo " Un nouveau point a été crée : " .$fichier; echo '
'; echo '
'; } if (isset($_GET['riri'])) { //$source = '1formatik.zip'; //$destination = 'dossier/copie_1formatik.zip'; //chdir("backup"); //echo " Path " .getcwd(); //echo '

'; // copier un fichier du répertoire backup -> insertion $source = getcwd() .'/backup/' .$_GET['original']; $destination = getcwd() .'/insertion/' .$_GET['riri']; //echo $source . " --- " . $destination; //echo '

'; if (!copy($source, $destination)) { echo "[Erreur] : Fichier non copié !."; echo '

'; } else { echo "Le serveur a fait un copie de la sauvegarde " .$_GET['original'] ." dans le fichier temporaire " .$_GET['riri'] ." qui pourra être modifier."; echo '

'; echo " Ce dernier accessible pour une insertion à partir de la page admin - bouton Import Modification."; echo '

'; } } $path = "backup"; $results = array(); $cpt = 0; chdir($path); array_multisort(array_map('filemtime', ($files = glob("*.*"))), SORT_DESC, $files); foreach($files as $filename) { //echo "
  • ".substr($filename, 0, -4)."
  • "; //echo "
  • " .$filename ."
  • "; if(is_file($filename)) { $results[$cpt][0] = $filename; $results[$cpt][1]= filesize($filename); $results[$cpt][2]= filemtime($filename); $results[$cpt][3]= date("F d Y H:i:s", filemtime($filename)); $cpt = $cpt + 1; } } //$files = array_diff(scandir($path), array('.', '..')); //$results = array(); //$cpt = 0; //foreach($files as $file) //{ // if (!in_array($file,array(".",".."))) // { // $results[$cpt][0] = $file; // $results[$cpt][1]= filesize('backup/'.$file); // $results[$cpt][2]= filemtime('backup/'.$file); // $results[$cpt][3]= date("F d Y H:i:s.", filemtime('backup/'.$file)); // $cpt = $cpt + 1; // } //} //echo "
    ";
    	//print_r($results);
    	//echo "
    "; //$tab = listing_fichier_repertoire('backup'); //for($i=0; $i < count($tab); $i++) //{ // $tab_fichier = $tab[$i][0]; // $tab_ts[] = $tab[$i][1]; //} //$tab_sort = $tab_ts; //sort($tab_sort); //$tab_reverse = array_reverse($tab_sort); //for($i=0; $i < count($tab); $i++) //{ // $element = $tab_reverse[$i]; // $position = array_search($element, $tab_ts); //echo '

    '; // $file = $tab[$position][0]; //echo $position ." " .$tab[$position][0] ." " .filesize($file); // $tab_affiche[$i][0] = $tab[$position][0]; // $tab_affiche[$i][1] = filesize($file); //} // echo 'retour ... ; ?> Confirmation de l\'import ?.'; echo " Créer un point de restauration manuellement:           "; echo ''; echo '

    '; echo "Liste des points de restaurations de la database:"; echo '

    '; echo ""; echo " "; //for($i=0; $i < count($tab_affiche); $i++) for($i=0; $i < $cpt; $i++) { $j = $i + 1; echo ""; //echo ''; echo ''; $b = ''; echo ""; echo ""; $blabla = $tab_affiche[$i][0]; $blabla = $results[$i][0]; echo ""; //echo ""; echo ""; //echo ""; echo ""; echo ''; } echo "
    Id Fichier backup Date Taille en octets Voir Copier Importer
    " .$j ."'; //echo '' .$tab_affiche[$i][0] .''; //'; //echo $tab_affiche[$i][0]; echo $results[$i][0]; //echo ' echo '" .$results[$i][3] ."" .$results[$i][1] .""; //echo ""; //echo ""; echo ""; //echo ""; echo "
    "; ?> "; //print_r($date_pieces); $timestamp = mktime ($heure_tab[0], $heure_tab[1], $heure_tab[2], $mois, $jour, $annee); $ts_difference = $ts_actuel - $timestamp; $ts_7jours = 7 * 24 * 3600; if($ts_difference >= $ts_7jours) { //echo $file ." ---- " .$format ." " .$ts ." trop ancien" ; //chdir("sauvegarde_echec"); //unlink($file); $coco = 5; } $results[$cpt][0] = $file; $results[$cpt][1]= $timestamp; $results[$cpt][2]= filesize($file); $cpt = $cpt + 1; } } chdir("backup"); closedir($handler); return $results; } ?>