Browse Source

c'est la bonne j'espere !

Baptiste 1 year ago
parent
commit
05ff9140d5
3 changed files with 32 additions and 1 deletions
  1. 10
    0
      README.md
  2. 4
    1
      assets/scripts/php2ics.php
  3. 18
    0
      assets/scripts/planning_tmp.php

+ 10
- 0
README.md View File

@@ -97,6 +97,16 @@ il n'y a globalement pas grand chose à comprendre à part qu'ici la taille (len
97 97
 Tout est modifiable via le panel admin (voir la section "admin" plus bas dans ce readme).
98 98
 
99 99
 
100
+### planning_tmp_dl
101
+
102
+| Nom          | Type         | AUTO_INCREMENT  | NULL  |
103
+| :----------- |:------------:|:---------------:|:-----:|
104
+| planning     | text         |                 |       |
105
+
106
+permet d'enregistrer l'ics pour le téléchargement voir la section "planning" à propos du script php2ics.
107
+
108
+Par défaut il faut avoir une seule ligne vide, le script se chargera de la modifier à chaque fois.
109
+
100 110
 ### scores
101 111
 
102 112
 | Nom          | Type         | AUTO_INCREMENT  | NULL  |

+ 4
- 1
assets/scripts/php2ics.php View File

@@ -143,7 +143,10 @@ if(isset($_POST['download_planning'])) {
143 143
 
144 144
     $cal->End();
145 145
   
146
-   	$cal->DownloadICS("planning_SA_INSA");
146
+	$req = $db->prepare('UPDATE planning_tmp_dl set planning = ?');
147
+    $req->execute(array($cal->GetICS()));
148
+
149
+   	header('Location: assets/scripts/planning_tmp.php');
147 150
 
148 151
 }
149 152
 

+ 18
- 0
assets/scripts/planning_tmp.php View File

@@ -0,0 +1,18 @@
1
+
2
+<?php
3
+include '../../script/db.php';
4
+
5
+$req = $db->query('SELECT planning FROM planning_tmp_dl');
6
+$r = $req -> fetchAll(PDO::FETCH_ASSOC);
7
+
8
+header('Content-Type: text/ics');
9
+header('Content-Transfer-Encoding: Binary');
10
+header('Content-Disposition:attachment; filename=planning_semaine_accueil.ics');
11
+
12
+echo $r[0]['planning'];
13
+
14
+exit();
15
+
16
+header('Location: ../../index.php');
17
+
18
+?>

Loading…
Cancel
Save