diff options
Diffstat (limited to 'view/backup.php')
-rw-r--r-- | view/backup.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/view/backup.php b/view/backup.php index b4339e4..9fce805 100644 --- a/view/backup.php +++ b/view/backup.php | |||
@@ -25,12 +25,13 @@ if(isset($_GET['action']) && $_GET['action'] == 'sauvegarde') | |||
25 | { | 25 | { |
26 | ob_start(); | 26 | ob_start(); |
27 | ?> | 27 | ?> |
28 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un gros fichier que vous pouvez garder si vous le souhaitez sur votre ordinateur.</p> | 28 | <h2>Sauvegarde complète</h2> |
29 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui. Ceci est utile dans le cas d'un changement d'hébergement ou dans le cas d'un problème affectant le serveur.</p> | 29 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un unique fichier que vous pouvez conserver si vous le souhaitez sur votre ordinateur.</p> |
30 | <p>Ce fichier se nomme <i>melaineDATA.zip</i>.</p><br/> | 30 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui ou pour récupérer des fichiers effacés ou perdus. Ceci est utile dans le cas d'un changement d'hébergement, d'un problème affectant le serveur, ou encore d'une mauvaise manipulation.</p> |
31 | <p>Ce fichier se nomme <i><?= $nomFichier ?></i>.</p> | ||
31 | 32 | ||
32 | <p><a href="data/melaineDATA.zip" style="border: 2px black ridge; padding: 2px;" >Cliquez ici pour télécharger</a></p><br/> | 33 | <button class="boutonBackup" ><a href="data/<?= $nomFichier ?>" >Le télécharger</a></button> |
33 | <p><a href="index.php?page=<?= $from ?>" >Retour au site</a></p> | 34 | <button class="boutonBackup" ><a class="boutonBackup" href="index.php?page=<?= $from ?>" >Retour au site</a></button> |
34 | <?php | 35 | <?php |
35 | $content = ob_get_clean(); | 36 | $content = ob_get_clean(); |
36 | 37 | ||
@@ -43,22 +44,26 @@ if(isset($_GET['action']) && $_GET['action'] == 'sauvegarde') | |||
43 | <?php | 44 | <?php |
44 | $erreur = ob_get_clean(); | 45 | $erreur = ob_get_clean(); |
45 | } | 46 | } |
47 | |||
46 | // page restauration | 48 | // page restauration |
49 | // attention à la taille maximale des fichiers téléchargés en fonction de l'hébergeur | ||
50 | // si le fichier est trop gros il faut l'ouvrir en javascript en envoyer les données petit à petit | ||
47 | elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') | 51 | elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') |
48 | { | 52 | { |
49 | ob_start(); | 53 | ob_start(); |
50 | ?> | 54 | ?> |
51 | <p>Restauration des données à partir d'une sauvegarde.</p> | 55 | <h2>Restauration des données à partir d'une sauvegarde.</h2> |
52 | <p>Vous devez avoir créé un fichier nommé <i>melaineDATA.zip</i><br/> | 56 | <p>Vous devez avoir créé précédemment un fichier <i>melaineDATA.zip</i><br/> |
53 | en cliquant sur <i>Extraire les données</i>.</p><br/> | 57 | à la page <i>Sauvegarder les données.</i></p><br/> |
54 | 58 | ||
55 | <form action="index.php?from=<?= $from ?>&action=insertion" method="post" > | 59 | <form method="post" enctype="multipart/form-data" action="index.php?from=<?= $from ?>&action=restauration" > |
56 | <input type="file" accept=".zip" ><br/> | 60 | <input type="file" name="archive" accept=".zip" class="boutonBackup" ><br/> |
57 | 61 | ||
58 | <!-- demande de confirmation en JS au submit --> | 62 | <!-- demande de confirmation en JS au submit --> |
59 | 63 | ||
60 | <input type="submit" value="Injecter les données" ><br/><br/> | 64 | <input type="submit" class="boutonBackup" value="Valider" ><br/><br/> |
61 | <a href="index.php?page=<?= $from ?>" >Retour au site</a> | 65 | <?= $message ?> |
66 | <button class="boutonBackup" ><a href="index.php?page=<?= $from ?>" >Retour au site</a></button> | ||
62 | </form> | 67 | </form> |
63 | <?php | 68 | <?php |
64 | $content = ob_get_clean(); | 69 | $content = ob_get_clean(); |
@@ -69,6 +74,9 @@ elseif(isset($_GET['action']) && $_GET['action'] == 'restauration') | |||
69 | <head> | 74 | <head> |
70 | <meta charset="utf-8" /> | 75 | <meta charset="utf-8" /> |
71 | <title><?= $title ?></title> | 76 | <title><?= $title ?></title> |
77 | <!-- <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> --> | ||
78 | <link rel="icon" type="image/png" href="public/mouette-logo.png" > | ||
79 | <link rel="stylesheet" type="text/css" href="public/css/normalize.css" /> | ||
72 | <link rel="stylesheet" type="text/css" href="public/css/accueil.css" /> | 80 | <link rel="stylesheet" type="text/css" href="public/css/accueil.css" /> |
73 | <?php | 81 | <?php |
74 | if(isset($_GET['action']) && $_GET['action'] == 'restauration') | 82 | if(isset($_GET['action']) && $_GET['action'] == 'restauration') |