<?php
$title = array('Elie Semoun', 'Lady Gaga', 'Beyoncé');
$country = array('FRANCE', 'SUISSE');
$genre = array('humour', 'danse', 'dinerspectacle');
$genreLabel = array('Humour', 'Danse', 'Dîner Spectacle');
$city = array('Cannes', 'Deauville', 'Dinard', 'Enghien-les-Bains', 'LaBaule-Escoublac', 'Lille', 'Marrakech', 'Niederbronn-les-Bains', 'Paris', 'Ribeauvillé', 'Saint-Arnoult', 'Le Touquet');
$items = array();

for ($i = 0; $i < 543; $i++) {

    $dates = array();
    $mt_rand = mt_rand(1, 6);
    for ($iDate = 1; $iDate < mt_rand(2, 3); $iDate++) {
        $mt_rand1 = mt_rand($mt_rand + 1, $mt_rand + 5);
        $timestamp = mktime() + $iDate * (60 * 60 * 24 * $mt_rand1);
        $date = date('r', $timestamp);
        $datelabel = date('l j F', $timestamp);
        array_push($dates, array(
            "date" => $date,
            "label" => $datelabel
        ));
        $mt_rand = $mt_rand1;
    }

    $randomI = mt_rand(0, count($genre) - 1);
    array_push($items, array(
        "id" => "elie-semoun-a-partager$i",
        "type" => array(
            "id" => $genre[$randomI],
            "label" => $genreLabel[$randomI]
        ),
        "master" => true,
        "title" => $title[mt_rand(0, count($title) - 1)],
        "subtitle" => "A partager",
        "dates" => $dates,
        "latitude" => 48.9708759,
        "longitude" => 2.3034849,
        "address" => "3, avenue de Ceinture",
        "postalCode" => "95880",
        "city" => $city[mt_rand(0, count($city) - 1)],
        "country" => $country[mt_rand(0, count($country) - 1)],
        "poster" => "img/layout/spectacle/spectacle-item-sample_desktop.jpg",
        "price" => mt_rand(0, 376),
        "links" => array(
            "show" => "/casinos/fr/enghien-les-bains/show/elie-semoun-a-partager.html"
        )
    ));
}
header('Content-Type: application/json; charset=utf8');

echo json_encode($items)


?>