Calendar booking
<p>I use script for booking and is work perfect but i dont know how to make some changes. Booking script have three files:</p>

<p>Over File calendar.php see calendar. I click on the day and I get free time to book. </p>

<p>I made that can be booked at least two slots and up to 4 but can not do to the reserved slots must be next to each other in order to reserve terms of half an hour or an hour continuously.</p>

<p>Example: i want reserved minimal 1 hour and max 2 hour continuously.</p>

<p>Can you help me to resolve this problem?</p>

<p>Second problem is name of day and months:</p>

<p>I tried despite all this change the names of days and months in the Spanish but I never could. Do you have a solution for this?</p>

<p>Now the names of days and months are displayed in English.</p>

<p>Calendar.php script is:</p>

<pre><code>&lt;?php

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

include('php/connect.php'); 
include('classes/class_calendar.php');

$calendar = new booking_diary($link);

if(isset($_GET['month'])) $month = $_GET['month']; else $month = date("m");
if(isset($_GET['year'])) $year = $_GET['year']; else $year = date("Y");
if(isset($_GET['day'])) $day = $_GET['day']; else $day = 0;


// Unix Timestamp of the date a user has clicked on
$selected_date = mktime(0, 0, 0, $month, 01, $year); 

// Unix Timestamp of the previous month which is used to give the back arrow the correct month and year 
$back = strtotime("-1 month", $selected_date); 

// Unix Timestamp of the next month which is used to give the forward arrow the correct month and year 
$forward = strtotime("+1 month", $selected_date);

?&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;

&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;Calendar&lt;/title&gt;
&lt;link href="style.css" rel="stylesheet" type="text/css"&gt;

&lt;link href="http://fonts.googleapis.com/css?family=Droid+Serif" rel="stylesheet" type="text/css"&gt;
&lt;link href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css"&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;

var check_array = [];

$(document).ready(function(){

    $(".fields").click(function(){

        dataval = $(this).data('val');

        // Show the Selected Slots box if someone selects a slot
        if($("#outer_basket").css("display") == 'none') { 
            $("#outer_basket").css("display", "block");
        }

        if(jQuery.inArray(dataval, check_array) == -1) {
            check_array.push(dataval);
        } else {
            // Remove clicked value from the array
            check_array.splice($.inArray(dataval, check_array) ,1); 
        }

        slots=''; hidden=''; basket = 0;

        cost_per_slot = $("#cost_per_slot").val();
        //cost_per_slot = parseFloat(cost_per_slot).toFixed(2)

        for (i=0; i&lt; check_array.length; i++) {
            slots += check_array[i] + '\r\n';
            hidden += check_array[i].substring(0, 8) + '|';
            basket = (basket + parseFloat(cost_per_slot));
        }

        // Populate the Selected Slots section
        $("#selected_slots").html(slots);

        // Update hidden slots_booked form element with booked slots
        $("#slots_booked").val(hidden);     

        // Update basket total box
        basket = basket.toFixed(2);
        $("#total").html(basket);   

        // Hide the basket section if a user un-checks all the slots
        if(check_array.length &lt; 2)
        $("#outer_basket").css("display", "none");
        if(check_array.length &gt; 4)
        $("#outer_basket").css("display", "none");

    });


    $(".classname").click(function(){

        msg = '';

        if($("#name").val() == '')
        msg += 'Please enter a Name\r\n';

        if($("#email").val() == '')
        msg += 'Please enter an Email address\r\n';

        if($("#phone").val() == '')
        msg += 'Please enter a Phone number\r\n';   

        if(msg != '') {
            alert(msg);
            return false;
        }

    });

    // Firefox caches the checkbox state.  This resets all checkboxes on each page load 
    $('input:checkbox').removeAttr('checked');

});




&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;?php     

if($_SERVER['REQUEST_METHOD'] == 'POST') {
    $calendar-&gt;after_post($month, $day, $year);  
}   

// Call calendar function
$calendar-&gt;make_calendar($selected_date, $back, $forward, $day, $month, $year);

?&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Script book_slots.php is:</p>

<pre><code>&lt;?php

include('php/connect.php'); 

if(isset($_POST['slots_booked'])) $slots_booked = mysqli_real_escape_string($link, $_POST['slots_booked']);
if(isset($_POST['name'])) $name = mysqli_real_escape_string($link, $_POST['name']);
if(isset($_POST['email'])) $email = mysqli_real_escape_string($link, $_POST['email']);
if(isset($_POST['phone'])) $phone = mysqli_real_escape_string($link, $_POST['phone']);
if(isset($_POST['booking_date'])) $booking_date = mysqli_real_escape_string($link, $_POST['booking_date']);
if(isset($_POST['cost_per_slot'])) $cost_per_slot = mysqli_real_escape_string($link, $_POST['cost_per_slot']);


$booking_array = array(
    "slots_booked" =&gt; $slots_booked,    
    "booking_date" =&gt; $booking_date,
    "cost_per_slot" =&gt; number_format($cost_per_slot, 2),
    "name" =&gt; $name,
    "email" =&gt; $email,
    "phone" =&gt; $phone
);

$explode = explode('|', $slots_booked);

foreach($explode as $slot) {

    if(strlen($slot) &gt; 0) {

        $stmt = $link-&gt;prepare("INSERT INTO bookings (date, start, name, email, phone) VALUES (?, ?, ?, ?, ?)"); 
        $stmt-&gt;bind_param('sssss', $booking_date, $slot, $name, $email, $phone);
        $stmt-&gt;execute();

    } // Close if

} // Close foreach

print_r('&lt;pre&gt;');
print_r($booking_array);
print_r('&lt;/pre&gt;');

?&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;

&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;Booking Confirmed&lt;/title&gt;
&lt;link href="style.css" rel="stylesheet" type="text/css"&gt;

&lt;link href="http://fonts.googleapis.com/css?family=Droid+Serif" rel="stylesheet" type="text/css"&gt;
&lt;link href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css"&gt;
&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;div class='success'&gt;The booking has been made into the database.&lt;/div&gt;

&lt;p style='font-family:courier; font-size:13px; margin-top:25px'&gt;
The booking has been inserted into the database.&lt;br&gt;
The array above shows you details of the $_POST.&lt;br&gt;
&lt;/p&gt;

&lt;p style='font-family:courier; font-size:13px; margin-top:25px'&gt;
You might want to use this page to: 
&lt;/p&gt;

&lt;ul style='font-family:courier; font-size:13px'&gt;
    &lt;li&gt;Redirect the user to a payment gateway (Paypal)&lt;/li&gt;
    &lt;li&gt;Simply show a confirmation page&lt;/li&gt;
    &lt;li&gt;Integrate with your basket&lt;/li&gt;
&lt;/ul&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>And class_calendar.php is:</p>

<pre><code>&lt;?php


class booking_diary {


// Mysqli connection
function __construct($link) {
    $this-&gt;link = $link;    
}

// Settings you can change:


// Time Related Variables
public $booking_start_time          = "09:30";          // The time of the first slot in 24 hour H:M format  
public $booking_end_time            = "19:00";          // The time of the last slot in 24 hour H:M format  
public $booking_frequency           = 30;               // The slot frequency per hour, expressed in minutes.   

// Day Related Variables

public $day_format                  = 1;                // Day format of the table header.  Possible values (1, 2, 3)   
                                                            // 1 = Show First digit, eg: "M"
                                                            // 2 = Show First 3 letters, eg: "Mon"
                                                            // 3 = Full Day, eg: "Monday"

public $day_closed                  = array("Saturday", "Sunday");  // If you don't want any 'closed' days, remove the day so it becomes: = array();

public $day_closed_text             = "CLOSED";         // If you don't want any any 'closed' remove the text so it becomes: = "";

// Cost Related Variables
public $cost_per_slot               = 20.50;            // The cost per slot
public $cost_currency_tag           = "&amp;pound;";        // The currency tag in HTML such as &amp;euro; &amp;pound; &amp;yen;


//  DO NOT EDIT BELOW THIS LINE

public $day_order                   = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");



public $day, $month, $year, $selected_date, $back, $back_month, $back_year, $forward, $forward_month, $forward_year, $bookings, $count, $days, $is_slot_booked_today;


/*========================================================================================================================================================*/


function make_calendar($selected_date, $back, $forward, $day, $month, $year) {

    // $day, $month and $year are the $_GET variables in the URL
    $this-&gt;day = $day;    
    $this-&gt;month = $month;
    $this-&gt;year = $year;

    // $back and $forward are Unix Timestamps of the previous / next month, used to give the back arrow the correct month and year 
    $this-&gt;selected_date = $selected_date;       
    $this-&gt;back = $back;
    $this-&gt;back_month = date("m", $back);
    $this-&gt;back_year = date("Y", $back); // Minus one month back arrow

    $this-&gt;forward = $forward;
    $this-&gt;forward_month = date("m", $forward);
    $this-&gt;forward_year = date("Y", $forward); // Add one month forward arrow    

    // Make the booking array
    $this-&gt;make_booking_array($year, $month);

}


function make_booking_array($year, $month, $j = 0) { 

    $stmt = $this-&gt;link-&gt;prepare("SELECT name, date, start FROM bookings WHERE date LIKE  CONCAT(?, '-', ?, '%')"); 
    $this-&gt;is_slot_booked_today = 0; // Defaults to 0

    $stmt-&gt;bind_param('ss', $year, $month); 
    $stmt-&gt;bind_result($name, $date, $start);   
    $stmt-&gt;execute();
    $stmt-&gt;store_result();

    while($stmt-&gt;fetch()) {    

        $this-&gt;bookings_per_day[$date][] = $start;

        $this-&gt;bookings[] = array(
            "name" =&gt; $name, 
            "date" =&gt; $date, 
            "start" =&gt; $start        
        ); 

        // Used by the 'booking_form' function later to check whether there are any booked slots on the selected day        
        if($date == $this-&gt;year . '-' . $this-&gt;month . '-' . $this-&gt;day) {
            $this-&gt;is_slot_booked_today = 1;
        } 

    }

    // Calculate how many slots there are per day
    $this-&gt;slots_per_day = 0;   
    for($i = strtotime($this-&gt;booking_start_time); $i&lt;= strtotime($this-&gt;booking_end_time); $i = $i + $this-&gt;booking_frequency * 60) {
        $this-&gt;slots_per_day ++;
    }   

    $stmt-&gt;close();     
    $this-&gt;make_days_array($year, $month);    

} // Close function


function make_days_array($year, $month) { 

    // Calculate the number of days in the selected month                 
    $num_days_month = cal_days_in_month(CAL_GREGORIAN, $month, $year); 

    // Make $this-&gt;days array containing the Day Number and Day Number in the selected month       

    for ($i = 1; $i &lt;= $num_days_month; $i++) { 

        // Work out the Day Name ( Monday, Tuesday... ) from the $month and $year variables
        $d = mktime(0, 0, 0, $month, $i, $year); 

        // Create the array

        $this-&gt;days[] = array("daynumber" =&gt; $i, "dayname" =&gt; date("l", $d)); 

        //$this-&gt;days[0] = array("daynumber" =&gt; 0, "dayname" =&gt; ("Ponedeljak"));
        //$this-&gt;days[1] = array("daynumber" =&gt; 1, "dayname" =&gt; ("Utorak"));
        //$this-&gt;days[2] = array("daynumber" =&gt; 2, "dayname" =&gt; ("Sreda"));
        //$this-&gt;days[3] = array("daynumber" =&gt; 3, "dayname" =&gt; ("Cetvrtak"));
        //$this-&gt;days[4] = array("daynumber" =&gt; 4, "dayname" =&gt; ("Petak"));
        //$this-&gt;days[5] = array("daynumber" =&gt; 5, "dayname" =&gt; ("Subota"));
        //$this-&gt;days[6] = array("daynumber" =&gt; 6, "dayname" =&gt; ("Nedelja")); 



    //$this-&gt;days array:

    //[0] =&gt; Array
    //    (
    //        [daynumber] =&gt; 1
   //         [dayname] =&gt; Monday
    //    )

    //[1] =&gt; Array
     //   (
     //       [daynumber] =&gt; 2
     //       [dayname] =&gt; Tuesday
     //   )

    } 
    $this-&gt;make_blank_start($year, $month);
    $this-&gt;make_blank_end($year, $month);   

} // Close function


function make_blank_start($year, $month) {

    /*
    Calendar months start on different days
    Therefore there are often blank 'unavailable' days at the beginning of the month which are showed as a grey block
    The code below creates the blank days at the beginning of the month
    */  

    // Get first record of the days array which will be the First Day in the month ( eg Wednesday )
    $first_day = $this-&gt;days[0]['dayname']; $s = 0;

        // Loop through $day_order array ( Monday, Tuesday ... )
        foreach($this-&gt;day_order as $i =&gt; $r) {

            // Compare the $first_day to the Day Order
            if($first_day == $r &amp;&amp; $s == 0) {

                $s = 1;  // Set flag to 1 stop further processing

            } elseif($s == 0) {

                $blank = array(
                    "daynumber" =&gt; 'blank',
                    "dayname" =&gt; 'blank'
                );

                // Prepend elements to the beginning of the $day array
                array_unshift($this-&gt;days, $blank);
            }

    } // Close foreach  

} // Close function


function make_blank_end($year, $month) {

    /*
    Calendar months start on different days
    Therefore there are often blank 'unavailable' days at the end of the month which are showed as a grey block
    The code below creates the blank days at the end of the month
    */

    // Add blank elements to end of array if required.
    $pad_end = 7 - (count($this-&gt;days) % 7);

    if ($pad_end &lt; 7) {

        $blank = array(
            "daynumber" =&gt; 'blank',
            "dayname" =&gt; 'blank'
        );

        for ($i = 1; $i &lt;= $pad_end; $i++) {                            
            array_push($this-&gt;days, $blank);
        }

    } // Close if

    $this-&gt;calendar_top(); 

} // Close function


function calendar_top() {

    // This function creates the top of the table containg the date and the forward and back arrows 

    echo "
    &lt;div id='lhs'&gt;&lt;div id='outer_calendar'&gt;

    &lt;table border='0' cellpadding='0' cellspacing='0' id='calendar'&gt;
        &lt;tr id='week'&gt;
        &lt;td align='left'&gt;&lt;a href='?month=" . date("m", $this-&gt;back) . "&amp;amp;year=" . date("Y", $this-&gt;back) . "'&gt;&amp;laquo;&lt;/a&gt;&lt;/td&gt;
        &lt;td colspan='5' id='center_date'&gt;" . date("F, Y", $this-&gt;selected_date) . "&lt;/td&gt;    
        &lt;td align='right'&gt;&lt;a href='?month=" . date("m", $this-&gt;forward) . "&amp;amp;year=" . date("Y", $this-&gt;forward) . "'&gt;&amp;raquo;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;";

    /*
    Make the table header with the appropriate day of the week using the $day_format variable as user defined above
    Definition:

        1: Show First digit, eg: "M"
        2: Show First 3 letters, eg: "Mon"
        3: Full Day, eg: "Monday"       

    */

    foreach($this-&gt;day_order as $r) {


        switch($this-&gt;day_format) {

            case(1):    
                echo "&lt;th&gt;" . substr($r, 0, 1) . "&lt;/th&gt;";                   
            break;

            case(2):
                echo "&lt;th&gt;" . substr($r, 0, 3) . "&lt;/th&gt;";           
            break;

            case(3):    
                echo "&lt;th&gt;" . $r . "&lt;/th&gt;";
            break;

        } 
           // Close switch

    } // Close foreach


    echo "&lt;/tr&gt;";   

    $this-&gt;make_cells();

} // Close function


function make_cells($table = '') {

    echo "&lt;tr&gt;";

    foreach($this-&gt;days as $i =&gt; $r) { // Loop through the date array

        $j = $i + 1; $tag = 0;          

        // If the the current day is found in the day_closed array, bookings are not allowed on this day  
        if(in_array($r['dayname'], $this-&gt;day_closed)) {            
            echo "\r\n&lt;td width='21' valign='top' class='closed'&gt;" . $this-&gt;day_closed_text . "&lt;/td&gt;";      
            $tag = 1;
        }


        // Past days are greyed out
        if (mktime(0, 0, 0, $this-&gt;month, sprintf("%02s", $r['daynumber']) + 1, $this-&gt;year) &lt; strtotime("now") &amp;&amp; $tag != 1) {     

            echo "\r\n&lt;td width='21' valign='top' class='past'&gt;";           
                // Output day number 
                if($r['daynumber'] != 'blank') echo $r['daynumber']; 

            echo "&lt;/td&gt;";       
            $tag = 1;
        }


        // If the element is set as 'blank', insert blank day
        if($r['dayname'] == 'blank' &amp;&amp; $tag != 1) {     
            echo "\r\n&lt;td width='21' valign='top' class='unavailable'&gt;&lt;/td&gt;";   
            $tag = 1;
        }


        // Now check the booking array $this-&gt;booking to see whether we have a booking on this day              
        $current_day = $this-&gt;year . '-' . $this-&gt;month . '-' . sprintf("%02s", $r['daynumber']);

        if(isset($this-&gt;bookings_per_day[$current_day]) &amp;&amp; $tag == 0) {

            $current_day_slots_booked = count($this-&gt;bookings_per_day[$current_day]);

                if($current_day_slots_booked &lt; $this-&gt;slots_per_day) {

                    echo "\r\n&lt;td width='21' valign='top'&gt;
                    &lt;a href='calendar.php?month=" .  $this-&gt;month . "&amp;amp;year=" .  $this-&gt;year . "&amp;amp;day=" . sprintf("%02s", $r['daynumber']) . "' class='part_booked' title='This day is part booked'&gt;" . 
                    $r['daynumber'] . "&lt;/a&gt;&lt;/td&gt;"; 
                    $tag = 1;

                } else {

                    echo "\r\n&lt;td width='21' valign='top'&gt;
                    &lt;a href='calendar.php?month=" .  $this-&gt;month . "&amp;amp;year=" .  $this-&gt;year . "&amp;amp;day=" . sprintf("%02s", $r['daynumber']) . "' class='fully_booked' title='This day is fully booked'&gt;" . 
                    $r['daynumber'] . "&lt;/a&gt;&lt;/td&gt;"; 
                    $tag = 1;           

                } // Close else 

        } // Close if


        if($tag == 0) {

            echo "\r\n&lt;td width='21' valign='top'&gt;
            &lt;a href='calendar.php?month=" .  $this-&gt;month . "&amp;amp;year=" .  $this-&gt;year . "&amp;amp;day=" . sprintf("%02s", $r['daynumber']) . "' class='green' title='Please click to view bookings'&gt;" . 
            $r['daynumber'] . "&lt;/a&gt;&lt;/td&gt;";          

        }

        // The modulus function below ($j % 7 == 0) adds a &lt;tr&gt; tag to every seventh cell + 1;
            if($j % 7 == 0 &amp;&amp; $i &gt;1) {
            echo "\r\n&lt;/tr&gt;\r\n&lt;tr&gt;"; // Use modulus to give us a &lt;tr&gt; after every seven &lt;td&gt; cells
        }       

    }       

    echo "&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;!-- Close outer_calendar DIV --&gt;";

    if(isset($_GET['year']))
    $this-&gt;basket();

    echo "&lt;/div&gt;&lt;!-- Close LHS DIV --&gt;";

    // Check booked slots for selected date and only show the booking form if there are available slots 
    $current_day = $this-&gt;year . '-' . $this-&gt;month . '-' . $this-&gt;day; 
    $slots_selected_day = 0;

    if(isset($this-&gt;bookings_per_day[$current_day]))
    $slots_selected_day = count($this-&gt;bookings_per_day[$current_day]);

    if($this-&gt;day != 0 &amp;&amp; $slots_selected_day &lt; $this-&gt;slots_per_day) { 
        $this-&gt;booking_form();
    }


} // Close function


function booking_form() {

    echo "
    &lt;div id='outer_booking'&gt;&lt;h2&gt;Available Slots&lt;/h2&gt;

    &lt;p&gt;
    The following slots are available on &lt;span&gt; " . $this-&gt;day . "." . $this-&gt;month . "." . $this-&gt;year . "&lt;/span&gt;
    &lt;/p&gt;

    &lt;table width='400' border='0' cellpadding='2' cellspacing='0' id='booking'&gt;
        &lt;tr&gt;
            &lt;th width='150' align='left'&gt;Start&lt;/th&gt;
            &lt;th width='150' align='left'&gt;End&lt;/th&gt;
            &lt;th width='150' align='left'&gt;Price&lt;/th&gt;
            &lt;th width='20' align='left'&gt;Book&lt;/th&gt;           
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;";


        // Create $slots array of the booking times
        for($i = strtotime($this-&gt;booking_start_time); $i&lt;= strtotime($this-&gt;booking_end_time); $i = $i + $this-&gt;booking_frequency * 60) {
            $slots[] = date("H:i:s", $i);  
        }           


        // Loop through $this-&gt;bookings array and remove any previously booked slots

        if($this-&gt;is_slot_booked_today == 1) { // $this-&gt;is_slot_booked_today created in function 'make_booking_array'

            foreach($this-&gt;bookings as $i =&gt; $b) { 

                if($b['date'] == $this-&gt;year . '-' . $this-&gt;month . '-' . $this-&gt;day) {

                    // Remove any booked slots from the $slots array
                    $slots = array_diff($slots, array($b['start']));

                } // Close if

            } // Close foreach

        } // Close if



        // Loop through the $slots array and create the booking table

        foreach($slots as $i =&gt; $start) {           

            // Calculate finish time
            $finish_time = strtotime($start) + $this-&gt;booking_frequency * 60; 

            echo "
            &lt;tr&gt;\r\n
                &lt;td&gt;" . $start . "&lt;/td&gt;\r\n
                &lt;td&gt;" . date("H:i:s", $finish_time) . "&lt;/td&gt;\r\n
                &lt;td&gt;" . $this-&gt;cost_currency_tag . number_format($this-&gt;cost_per_slot, 2) . "&lt;/td&gt;\r\n
                &lt;td width='110'&gt;&lt;input data-val='" . $start . " - " . date("H:i:s", $finish_time) . "' class='fields' type='checkbox'&gt;&lt;/td&gt;
            &lt;/tr&gt;";

        } // Close foreach          

        echo "&lt;/table&gt;&lt;/div&gt;&lt;!-- Close outer_booking DIV --&gt;";


} // Close function


function basket($selected_day = '') {

    if(!isset($_GET['day']))
    $day = '01';
    else
    $day = $_GET['day'];    

    // Validate GET date values
    if(checkdate($_GET['month'], $day, $_GET['year']) !== false) {
        $selected_day = $_GET['year'] . '-' . $_GET['month'] . '-' . $day;  
    } else { 
        echo 'Invalid date!';
        exit();
    }

    echo "&lt;div id='outer_basket'&gt;

    &lt;h2&gt;Rezervi&amp;#353;i termin za " . $this-&gt;day . "." . $this-&gt;month . "." . $this-&gt;year . "&lt;/h2&gt;

        &lt;div id='selected_slots'&gt;&lt;/div&gt;     

            &lt;div id='basket_details'&gt;

                &lt;form method='post' action='book_slots.php'&gt;

                    &lt;label&gt;Name&lt;/label&gt;
                    &lt;input name='name' id='name' type='text' class='text_box'&gt;

                    &lt;label&gt;Email&lt;/label&gt;
                    &lt;input name='email' id='email' type='text' class='text_box'&gt;    

                    &lt;label&gt;Phone&lt;/label&gt;
                    &lt;input name='phone' id='phone' type='text' class='text_box'&gt;    

                        &lt;div id='outer_price'&gt;
                            &lt;div id='currency'&gt;" . $this-&gt;cost_currency_tag . "&lt;/div&gt;
                            &lt;div id='total'&gt;&lt;/div&gt;
                        &lt;/div&gt;                                  

                    &lt;input type='hidden' name='slots_booked' id='slots_booked'&gt;
                    &lt;input type='hidden' name='cost_per_slot' id='cost_per_slot' value='" . $this-&gt;cost_per_slot . "'&gt;
                    &lt;input type='hidden' name='booking_date' value='" . $day . '.' . $_GET['month'] . '.' . $_GET['year'] . "'&gt;

                    &lt;input type='submit' class='classname' value='Make Booking'&gt;

                &lt;/form&gt;

            &lt;/div&gt;&lt;!-- Close basket_details DIV --&gt;

    &lt;/div&gt;&lt;!-- Close outer_basket DIV --&gt;";

} // Close function


} // Close Class

?&gt;
</code></pre>