<?php
require_once( __DIR__. '/common.php');
require_once(__DIR__."/my-optician-wsdl-service/MyOpticianWsdlService.php");
global $service_url, $optician_id, $shops, $opticianService, $siteInfo, $siteId, $current_step;
$current_step = 1;
if(!isset($_GET['OpticianId'])){
    include_once('error.php');
    die;
}
$optician_id = $_GET['OpticianId'];
$opticianService = new MyOpticianWsdlService($service_url, $optician_id);

$siteInfo = $opticianService->getSiteInfo($optician_id, $password);
$siteId = $siteInfo->getSite();
$password = $siteInfo->getPassword();

$shops = $opticianService->getShops($siteId, $password);

// require_once __DIR__ . "/select-shop.php";

if(count($shops) > 1){
    require_once __DIR__ . "/select-shop.php";
} else {
    $_GET['Shop'] = $shops[0]->getName();
    require_once __DIR__ . "/pre-select-slots.php";
}
?>