Beispiel #1
0
function main()
{
    $serviceUrl = 'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=%s&Datum=%s&dienstleisterlist=%s';
    $officeList = [150230, 122301, 122297, 122294, 122210, 122217, 122219, 122227, 122280, 122282, 122284];
    $date = time();
    // Change accordingly....
    $serviceType = '120686';
    // This one is for Almendung
    // Generate the URL with all the offices we need
    $url = sprintf($serviceUrl, $serviceType, $date, implode(',', $officeList));
    // Fetch the data from our URL
    $data = fetchData($url);
    // Parse received data from berlin.de
    $finalLinks = parseData($data);
    // Render links for booking if found
    renderResults($finalLinks);
}
<?php

require_once 'vendor/autoload.php';
require_once 'output-results.php';
$adapter = (require_once 'adapter.php');
/** @var \Zend\Db\Adapter\Driver\StatementInterface $statement */
$statement = $adapter['sqlite']->createStatement("SELECT c.FirstName, c.LastName, c.Email, c.Country,\n        i.InvoiceId, i.InvoiceDate, i.Total\n    FROM Customer c\n    INNER JOIN Invoice I ON (i.CustomerId = c.CustomerId)\n    WHERE (i.Total BETWEEN 13 AND 22)\n    AND (c.Country = 'USA' OR c.Country = 'Germany')\n    ORDER BY i.Total DESC\n    LIMIT 1, 30");
/** @var \Zend\Db\Adapter\Driver\Pdo\Result $results */
$results = $statement->execute();
renderResults($results, $statement);