Je vois que tu es hyper pointu sur le sujet !.. Effectivement, la rue du Cinéma n'existe pas à Chatou.
Sinon, la modification du LAST-MODIFIED ne change rien. 2 jours que j'y suis, je n'ai plus de cheveux, j'attaque les ongles.
pour info, voici mon code :
Code : Tout sélectionner
<?php
session_start();
include('verifSession.php');
// chaine aléatoire
function str_rand(int $length = 32){ // 64 = 32
$length = ($length < 4) ? 4 : $length;
return bin2hex(random_bytes(($length-($length%2))/2));
}
// fin chaine aléatoire
$eol = "\r";
$d = '@cnotes.fr';
$dtStamp = date('Ymd') . 'T' . date('His') . 'Z';
$reqResa = $bdd->prepare("SELECT * from reservations WHERE employe=:employe;");
$reqResa->execute(array(':employe'=>$_SESSION['employeAdmin']));
$ics = "BEGIN:VCALENDAR" . $eol;
$ics .= "VERSION:2.0" . $eol;
$ics .= "PRODID:-//CNotes.fr//CNOTESCAL v1.0//EN" . $eol;
$ics .= "CALSCALE:GREGORIAN" . $eol;
while($rowResa = $reqResa -> fetch()){
$uid = str_rand() . $d;
$idClient = $rowResa['client'];
$typeInter = $rowResa['typeIntervention'];
$adr = $rowResa['adrPresta'] . ' ' . $rowResa['cpPresta'] . ' - ' . $rowResa['villePresta'];
$reqClient = $bdd->prepare("SELECT * from clients WHERE id_client=?;");
$reqClient->execute(array($idClient));
$rowClient = $reqClient -> fetch();
if($rowClient['particulier'] == -1){$nomClient = $rowClient['prenom'] . ' ' . $rowClient['nom'];} else {$nomClient = $rowClient['societe'];}
$reqTypeInter = $bdd->prepare("SELECT * from type_intervention WHERE id_typeIntervention=?;");
$reqTypeInter->execute(array($typeInter));
$rowTypeInter = $reqTypeInter -> fetch();
$typeInter = $rowTypeInter['comment'];
$dte = date('Ymd', strtotime($rowResa['dteReservation']));
$deb = date('His', strtotime($rowResa['heureDebut']));
$fin = date('His', strtotime($rowResa['heureFin']));
$date_debut = $dte;
$date_fin = $dte;
$objet = $nomClient;
$lieu = $adr;
$details = $typeInter . ' - ' . $rowResa['observations'];
//Evenèment au format ICS
$ics .= "BEGIN:VEVENT" . $eol;
$ics .= "UID:" . $uid . $eol;
$ics .= "DTSTART:". $date_debut."T".$deb."Z" . $eol;
$ics .= "DTEND:".$date_fin."T".$fin."Z" . $eol;
$ics .= "DTSTAMP:".$dtStamp . $eol;
$ics .= "SUMMARY:".$objet."" . $eol;
$ics .= "LOCATION:".$lieu."" . $eol;
$ics .= "DESCRIPTION:".$details."" . $eol;
$ics .= "END:VEVENT" . $eol;
}
//Création du fichier
$ics .= "END:VCALENDAR" . $eol;
$fichier = 'public/'.$_SESSION['repertoire'].'/'.$_SESSION['prenomNom'].'Ical.ics';
$f = fopen($fichier, 'w+');
fputs($f, $ics);
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Document sans titre</title>
</head>
<body>
<p><?php echo('<a href="https://cnotes.pc-info-services.fr/' . $fichier . '" target="_blank">https://cnotes.pc-info-services.fr/' . $fichier . '</a>');?>
</p>
<p><?php echo($ics);?> </p>
</body>
</html>
Et voici le fichier ics obtenu :
Code : Tout sélectionner
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CNotes.fr//CNOTESCAL v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:[email protected]
DTSTART:20210130T090000Z
DTEND:20210130T110000Z
DTSTAMP:20210318T095511Z
SUMMARY:Menthe à l'eau
LOCATION:45 impasse du Cudsac 54600 - Villers-lès-Nancy
DESCRIPTION:Maintenance 2h -
END:VEVENT
BEGIN:VEVENT
UID:[email protected]
DTSTART:20210318T100000Z
DTEND:20210318T120000Z
DTSTAMP:20210318T095511Z
SUMMARY:CATOU
LOCATION:14 rue du cinéma 78400 - Chatou
DESCRIPTION: - tralala
END:VEVENT
BEGIN:VEVENT
UID:[email protected]
DTSTART:20210319T110000Z
DTEND:20210319T130000Z
DTSTAMP:20210318T095511Z
SUMMARY:Albert Baleine
LOCATION:Av. de la mer 234 12909 - Genève
DESCRIPTION: - Intervention 2
END:VEVENT
END:VCALENDAR
Je vois que tu es hyper pointu sur le sujet !.. Effectivement, la rue du Cinéma n'existe pas à Chatou.
Sinon, la modification du LAST-MODIFIED ne change rien. 2 jours que j'y suis, je n'ai plus de cheveux, j'attaque les ongles.
pour info, voici mon code :
[code]<?php
session_start();
include('verifSession.php');
// chaine aléatoire
function str_rand(int $length = 32){ // 64 = 32
$length = ($length < 4) ? 4 : $length;
return bin2hex(random_bytes(($length-($length%2))/2));
}
// fin chaine aléatoire
$eol = "\r";
$d = '@cnotes.fr';
$dtStamp = date('Ymd') . 'T' . date('His') . 'Z';
$reqResa = $bdd->prepare("SELECT * from reservations WHERE employe=:employe;");
$reqResa->execute(array(':employe'=>$_SESSION['employeAdmin']));
$ics = "BEGIN:VCALENDAR" . $eol;
$ics .= "VERSION:2.0" . $eol;
$ics .= "PRODID:-//CNotes.fr//CNOTESCAL v1.0//EN" . $eol;
$ics .= "CALSCALE:GREGORIAN" . $eol;
while($rowResa = $reqResa -> fetch()){
$uid = str_rand() . $d;
$idClient = $rowResa['client'];
$typeInter = $rowResa['typeIntervention'];
$adr = $rowResa['adrPresta'] . ' ' . $rowResa['cpPresta'] . ' - ' . $rowResa['villePresta'];
$reqClient = $bdd->prepare("SELECT * from clients WHERE id_client=?;");
$reqClient->execute(array($idClient));
$rowClient = $reqClient -> fetch();
if($rowClient['particulier'] == -1){$nomClient = $rowClient['prenom'] . ' ' . $rowClient['nom'];} else {$nomClient = $rowClient['societe'];}
$reqTypeInter = $bdd->prepare("SELECT * from type_intervention WHERE id_typeIntervention=?;");
$reqTypeInter->execute(array($typeInter));
$rowTypeInter = $reqTypeInter -> fetch();
$typeInter = $rowTypeInter['comment'];
$dte = date('Ymd', strtotime($rowResa['dteReservation']));
$deb = date('His', strtotime($rowResa['heureDebut']));
$fin = date('His', strtotime($rowResa['heureFin']));
$date_debut = $dte;
$date_fin = $dte;
$objet = $nomClient;
$lieu = $adr;
$details = $typeInter . ' - ' . $rowResa['observations'];
//Evenèment au format ICS
$ics .= "BEGIN:VEVENT" . $eol;
$ics .= "UID:" . $uid . $eol;
$ics .= "DTSTART:". $date_debut."T".$deb."Z" . $eol;
$ics .= "DTEND:".$date_fin."T".$fin."Z" . $eol;
$ics .= "DTSTAMP:".$dtStamp . $eol;
$ics .= "SUMMARY:".$objet."" . $eol;
$ics .= "LOCATION:".$lieu."" . $eol;
$ics .= "DESCRIPTION:".$details."" . $eol;
$ics .= "END:VEVENT" . $eol;
}
//Création du fichier
$ics .= "END:VCALENDAR" . $eol;
$fichier = 'public/'.$_SESSION['repertoire'].'/'.$_SESSION['prenomNom'].'Ical.ics';
$f = fopen($fichier, 'w+');
fputs($f, $ics);
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Document sans titre</title>
</head>
<body>
<p><?php echo('<a href="https://cnotes.pc-info-services.fr/' . $fichier . '" target="_blank">https://cnotes.pc-info-services.fr/' . $fichier . '</a>');?>
</p>
<p><?php echo($ics);?> </p>
</body>
</html>[/code]
Et voici le fichier ics obtenu :
[code]
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CNotes.fr//CNOTESCAL v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:
[email protected]DTSTART:20210130T090000Z
DTEND:20210130T110000Z
DTSTAMP:20210318T095511Z
SUMMARY:Menthe à l'eau
LOCATION:45 impasse du Cudsac 54600 - Villers-lès-Nancy
DESCRIPTION:Maintenance 2h -
END:VEVENT
BEGIN:VEVENT
UID:
[email protected]DTSTART:20210318T100000Z
DTEND:20210318T120000Z
DTSTAMP:20210318T095511Z
SUMMARY:CATOU
LOCATION:14 rue du cinéma 78400 - Chatou
DESCRIPTION: - tralala
END:VEVENT
BEGIN:VEVENT
UID:
[email protected]DTSTART:20210319T110000Z
DTEND:20210319T130000Z
DTSTAMP:20210318T095511Z
SUMMARY:Albert Baleine
LOCATION:Av. de la mer 234 12909 - Genève
DESCRIPTION: - Intervention 2
END:VEVENT
END:VCALENDAR[/code]