1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
<link rel="stylesheet" href="style.css" media="screen">
</head>
<body>
<div id="agendalong">
<!-- DEBUT DU PHP ***********-->
<?php
$artout="jdw";
/** Charger la bibliothèque **/
set_include_path(get_include_path() . PATH_SEPARATOR . './Classes/');
include 'PHPExcel/IOFactory.php';
/** définir le fichier à examiner*/
$inputFileName = './dates.xlsx';
/** On "charge le fichier excel*/
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
/** On dit que c'est la feuille 0 du fichier excell qu'on va utiliser*/
$worksheet=$objPHPExcel->getSheet(0);
/** je met à zero la variable qui va compter les lignes*/
$i=1;
/** On boucle pour passer les lignes en revue*/
foreach ($worksheet->getRowIterator() as $row) {
$i = $row->getrowindex();
/** Ici je met dans les différentes variables le contenu de la cellule concernée pour la ligne en cours*/
$affiche =$worksheet->getCellByColumnAndRow('0',$i)->getCalculatedValue();
$lieu =$worksheet->getCellByColumnAndRow('1',$i)->getCalculatedValue();
$datu =$worksheet->getCellByColumnAndRow('2',$i)->getCalculatedValue();
$heure =$worksheet->getCellByColumnAndRow('3',$i)->getCalculatedValue();
$site =$worksheet->getCellByColumnAndRow('4',$i)->getCalculatedValue();
$mail =$worksheet->getCellByColumnAndRow('5',$i)->getCalculatedValue();
$telephone =$worksheet->getCellByColumnAndRow('6',$i)->getCalculatedValue();
$reserve =$worksheet->getCellByColumnAndRow('7',$i)->getCalculatedValue();
$coment =$worksheet->getCellByColumnAndRow('8',$i)->getCalculatedValue();
$artiste =$worksheet->getCellByColumnAndRow('9',$i)->getCalculatedValue();
$spectacle =$worksheet->getCellByColumnAndRow('10',$i)->getCalculatedValue();
$dati = PHPExcel_Shared_Date::ExcelToPHP($datu);
$dati =date('d-m-Y',$dati);
$dato =date('d-m-Y');
if ($artiste=="all")
{
$artiste=$artout;
}
if ((strtotime($dati)>=strtotime($dato) && $artout==$artiste) or (strtotime($dati)>=strtotime($dato) && $artout=="all")) /** on regarde si la date de la ligne Excell est dans le passé, si pas on affiche le contenu des variables */
{
echo /** On envoi du HTML pour exploiter le contenu des différentes variables et que ça s'affiche bien*/
<<<HTML
<table width="100%" border="1"><tr>
<td width="15%"><img src="$affiche" width="134" height="179" /></td>
<td width="85%">
<span style='font-family:Comic Sans MS; text-align:left; font-size:20px; line-height:25px;'>{$lieu}</span>
<BR>
<table width="100%" border="0"><tr>
<td width="80%">
<span style='font-family:Arial; text-align:left; font-size:12px; line-height:22px;'>{$spectacle}</span>
<BR>
<span style='font-family:Arial; text-align:left; font-size:12px; line-height:22px;'>Le {$dati} à {$heure}</span>
<BR>
<span style='font-family:Arial; text-align:left; font-size:14px; line-height:22px;'>Réservation : <a href="{$site}" target="_blank">Site internet - </a> <a href="mailto:{$mail}">Par e-mail </a>
</span>
<BR>
<span style='font-family:Arial; text-align:left; font-size:14px; line-height:22px;'>Numéro de téléphone : {$telephone}</span>
<BR>
<BR>
<span style='font-family:Arial; text-align:left; font-size:18px; line-height:22px;'>{$coment}</span>
</td>
<td width="20%">
<a href="$reserve" target="_blank">
<img src="./images/bouton.png" width="134" height="134" class=""></a>
</td>
</tr>
</td>
</table>
</tr>
</table>
</html>
HTML;
}
}
$closeFileName = './dates.xlsx';
?>
</div>
</body>
</html> |
Partager