} ?> <?php function kinoUser($MiFech) { for ($i = 0; $i <= 10; $i++) { $inicio = strtotime($MiFech); $dias = $i * 86400; $MiFecha = date("Y-m-d", $inicio + $dias); $fecha = substr($MiFecha, 0, 4) . "/" . substr($MiFecha, 5, 2) . "/" . substr($MiFecha, 8, 2); $diaSem = strtotime($MiFecha); $eldiaes = date('N', $diaSem); if ($eldiaes == 3) { return $MiFecha; break; } else { if ($eldiaes == 7) { return $MiFecha; break; } } } } ?> <?php $datei = kino(date("Y-m-d")); echo "Date now \t " . $datei . "</br></br>"; $dateu = kinoUser($_POST['fecha']); echo $dateu;
<header>BITBURG</header> <?php kino('KINO_BITBURG'); ?> </li> <li data-row="1" data-col="5" data-sizex="3" data-sizey="1"> <header>HILLESHEIM</header> <?php kino('KINO_HILLESHEIM'); ?> </li> <li data-row="2" data-col="5" data-sizex="3" data-sizey="3"> <header>TRIER</header> <?php kino('KINO_TRIER'); ?> </li> </ul> <script> $( document ).ready(function() { $('div').each(function(index) { $(this).bind("DOMSubtreeModified", function(event) { var elem = $(event.target); if(elem.data('subtype') == 'KINO' && elem.html().match(/, /)) { elem.html(elem.html().replace(/, /, '<br>')); } }); }); });