diff options
Diffstat (limited to 'controller/ajax.php')
-rw-r--r-- | controller/ajax.php | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/controller/ajax.php b/controller/ajax.php index 26aa9c6..ed840cd 100644 --- a/controller/ajax.php +++ b/controller/ajax.php | |||
@@ -38,48 +38,6 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_ | |||
38 | } | 38 | } |
39 | 39 | ||
40 | 40 | ||
41 | // inversion des positions de deux éléments d'une page | ||
42 | /*if(isset($_GET['action']) && isset($_GET['page']) && ($_GET['action'] == 'monter' || $_GET['action'] == 'descendre') && isset($_GET['file_code']) && !empty($_GET['file_code'])) | ||
43 | { | ||
44 | // sécurité !! | ||
45 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) | ||
46 | { | ||
47 | header('Location: index.php?erreur=interdit'); | ||
48 | } | ||
49 | else | ||
50 | { | ||
51 | require('controller/admin.php'); | ||
52 | require('model/Article.php'); | ||
53 | |||
54 | $pagesArticlesSimples = ['menu', 'melaine', 'musique', 'presse', 'livres', 'jaime', 'peinture', 'archives', 'legal']; | ||
55 | $sens = 0; | ||
56 | |||
57 | if($_GET['action'] == 'monter') | ||
58 | { | ||
59 | $sens = 1; | ||
60 | } | ||
61 | if($_GET['action'] == 'descendre') | ||
62 | { | ||
63 | $sens = 0; | ||
64 | } | ||
65 | |||
66 | if(in_array($_GET['page'], $pagesArticlesSimples)) | ||
67 | { | ||
68 | // 1 pour monter | ||
69 | inversionPositions($_GET['page'], $_GET['file_code'], 'Article', $sens); | ||
70 | } | ||
71 | elseif($_GET['page'] == 'discographie') | ||
72 | { | ||
73 | require('model/Album.php'); | ||
74 | |||
75 | // 1 pour monter | ||
76 | inversionPositions($_GET['page'], $_GET['file_code'], 'Album', $sens); | ||
77 | } | ||
78 | } | ||
79 | exit(); // stop !! | ||
80 | }*/ | ||
81 | |||
82 | |||
83 | // page restauration quand le fichier zip est lourd | 41 | // page restauration quand le fichier zip est lourd |
84 | // -> input file onchange | 42 | // -> input file onchange |
85 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' | 43 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' |
@@ -114,4 +72,17 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration' | |||
114 | echo('file send'); | 72 | echo('file send'); |
115 | exit(); // stop !! | 73 | exit(); // stop !! |
116 | } | 74 | } |
117 | } \ No newline at end of file | 75 | } |
76 | |||
77 | // nettoyage | ||
78 | if(!isset($_GET['action']) || $_GET['action'] != 'restauration') | ||
79 | { | ||
80 | if(isset($_SESSION['fileName'])) | ||
81 | { | ||
82 | unset($_SESSION['fileName']); | ||
83 | } | ||
84 | if(isset($_SESSION['fileSize'])) | ||
85 | { | ||
86 | unset($_SESSION['fileSize']); | ||
87 | } | ||
88 | } | ||