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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
| <?php
/*
Template Name: agendaspecial
*/
?>
<?php
get_header();
?>
<?php
global $post;
/**
* Setup Dynamic Sidebar
*/
list( $has_sidebar, $sidebar_position, $sidebar_area ) = setup_dynamic_sidebar( $post->ID );
$hide_page_title = get_field('hide_page_title', $post->ID);
?>
<!-- container -->
<div class="container">
<?php
if($has_sidebar){
?>
<div class="boxed">
<?php
}
?>
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
?>
<!-- breadcrumbs -->
<?php
if(!is_front_page() && empty($hide_page_title)) {
echo '<span class="heading-t"></span>';
the_title('<h1>','</h1>');
echo '<span class="heading-b"></span>';
}
?>
<?php
if ( $has_sidebar ) :
?>
<div class="content__wrapper<?php if ( 'left' === $sidebar_position ) echo ' content--rev'; ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class('content__main single-post'); ?>>
<?php
else:
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('single-post'); ?>>
<?php
endif;
?>
<?php the_post_thumbnail( array(696, 353), array( 'class' => 'wp-featured-image' ) ); ?>
<div class="entry">
<?php
$artout="jdw";
/** Charger la bibliothèque **/
include($_SERVER['DOCUMENT_ROOT'].'/agendamaster/Classes/PHPExcel/IOFactory.php');
/** définir le fichier à examiner*/
$inputFileName = $_SERVER['DOCUMENT_ROOT'].'/agendamaster/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');
$affiches = 'http://espaceimy.cluster010.ovh.net/agendamaster/'.$affiche;
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="45%" border="1" align="center"><tr>
<td width="15%"><img src="$affiches" 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="http://espaceimy.cluster010.ovh.net/agendamaster/images/bouton2.png" width="110" height="110" class=""></a>
</td>
</tr>
</td>
</table>
</tr>
</table>
</html>
HTML;
}
}
$closeFileName = $_SERVER['DOCUMENT_ROOT'].'/agendamaster/dates.xlsx';
?>
</div>
<?php //get_template_part('parts/share'); ?>
<?php
//comments_template();
if ( $has_sidebar ) :
?>
</article>
<aside id="sidebar" class="content__side widget-area widget-area--<?php echo esc_attr( $sidebar_area ); ?>">
<?php
do_action('before_ironband_sidebar_dynamic_sidebar', 'page.php');
dynamic_sidebar( $sidebar_area );
do_action('after_ironband_sidebar_dynamic_sidebar', 'page.php');
?>
</aside>
</div>
<?php
else:
?>
</article>
<?php
endif;
endwhile;
endif;
?>
<?php
if($has_sidebar){
?>
</div>
<?php
}
?>
</div>
<?php
get_footer(); |
Partager