Compare commits

...

2 commits

Author SHA1 Message Date
Baptiste
9ea0e46285 ics 2022-10-15 17:19:33 +02:00
Baptiste
e010316809 ICS 2022-10-15 17:18:01 +02:00
3 changed files with 4 additions and 27 deletions

View file

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

View file

@ -143,10 +143,14 @@ if(isset($_POST['download_planning'])) {
$cal->End();
<<<<<<< HEAD
$cal->DownloadICS("planning_SA_INSA");
=======
$req = $db->prepare('UPDATE planning_tmp_dl set planning = ?');
$req->execute(array($cal->GetICS()));
header('Location: assets/scripts/planning_tmp.php');
>>>>>>> 2ca75a7bb394da5df40132b30b562ab0bdd8552e
}
?>

View file

@ -1,17 +0,0 @@
<?php
include '../../script/db.php';
$req = $db->query('SELECT planning FROM planning_tmp_dl');
$r = $req -> fetchAll(PDO::FETCH_ASSOC);
header('Content-Type: text/ics');
header('Content-Transfer-Encoding: Binary');
header('Content-Disposition:attachment; filename=planning_semaine_accueil.ics');
echo $r[0]['planning'];
exit();
header('Location: ../../index.php');
?>