protected function DateValidation($year, $month, $day) { if (Day($year, $month, $day) == true && Month($year, $month, $day) == true && (Year($year, $month, $day) >= 1800 && Year($year, $month, $day) <= 2299)) { return true; } else { return false; } }
<?php $fecha = $fec_inicial; do { $fechas = array(); foreach ($fecs as $f) { if (MonthYear($f["fecha"]) == MonthYear($fecha)) { $fechas[intval(Day($f["fecha"]))] = "Servicio"; } } ?> <div class="mesCalendario"> <?php echo $this->calendar->generate(Year($fecha), Month($fecha), $fechas); ?> <p> </p> </div> <?php $fecha = NextMonthYear($fecha) . "-01"; } while (MonthYear($fecha) != NextMonthYear($fec_final));
//echo "<hr>"; echo "<div id='ticket'>"; $subtotal = 0; $imgsrc = Image($_SESSION['cart'][$i]['movie']); echo "<img id='poster' src={$imgsrc} alt='poster'>"; echo "<div class='cDetails'>"; echo $_POST['Name'] . "<br>"; echo $_POST['PhNumber'] . "<br>"; echo $_POST['Email'] . "<br>"; echo "</div>"; echo "<div class='mDetails'>"; echo "SILVERADO CINEMAS"; echo "<p>" . MovieName($_SESSION['cart'][$i]['movie']) . "</p>"; fwrite($Checkout, MovieName($_SESSION['cart'][$i]['movie']) . ", "); echo "<p>" . Day($_SESSION['cart'][$i]['day']); fwrite($Checkout, Day($_SESSION['cart'][$i]['day']) . ", "); echo ", " . $_SESSION['cart'][$i]['time'] . "PM </p>"; fwrite($Checkout, $_SESSION['cart'][$i]['time'] . "PM, "); echo "</div>"; foreach ($_SESSION['cart'][$i]['seats'] as $seatType => $quantity) { fwrite($Checkout, SeatName($seatType) . ", "); $subtotal = $subtotal + TicketCost($seatType, $i) * $quantity; echo "<div class='tDetails'>"; echo "<table>\n <tr>\n <td>" . $quantity . "   x    " . SeatName($seatType) . "</td>"; echo "<td>\$" . TicketCost($seatType, $i) * $quantity . "</td>"; echo "</tr></table>"; echo "</div>"; fwrite($Checkout, TicketCost($seatType, $i) * $quantity . ", "); } //echo "Voucher discount:"; echo "<div class='tTotal'>";
for ($i = 0; $i < sizeof($_SESSION['cart']); $i++) { $subtotal = 0; $totalQuantity = 0; foreach ($_SESSION['cart'][$i]['seats'] as $seatType => $quantity) { $subtotal = $subtotal + TicketCost($seatType, $i) * $quantity; $totalQuantity = $totalQuantity + $quantity; } //printing each ticket for ($j = 1; $j <= $totalQuantity; $j++) { echo "<img id='tktpic' src='tickett.png' height='350px' width='50px'>"; echo "<div id=subticket>"; echo "<div id=tktheading>"; echo "SILVERADO CINEMAS"; echo "</div>"; echo "<p>" . MovieName($_SESSION['cart'][$i]['movie']) . "</p>"; echo "<p>" . Day($_SESSION['cart'][$i]['day']); echo ", " . $_SESSION['cart'][$i]['time'] . "PM </p>"; foreach ($_SESSION['cart'][$i]['seats'] as $seatType => $quantity) { echo "<br><br>"; } echo SeatName($seatType) . "<br>"; echo "Seat " . $j; echo "</div>"; } } ?> </body> <?php session_unset(); ?> </html>