<?php
require_once(__DIR__."/MyOpticianWsdlService.php");

global $selected_shop;

class GlobalLoader {

    private $opticianService;

    public function __construct($optician_id)
    {
        global $service_url;
        $this->opticianService = new MyOpticianWsdlService($service_url, $optician_id);
    }

    public function loadGlobalSelectedShop($siteId, $password, $siteInfo = null ){
        global $selected_shop;
        $shop_name = $_POST['hidden_shop_name'];
        $shops = $this->opticianService->getShops($siteId, $password, $siteInfo);
        foreach($shops AS $shop){
            if($shop->getName() == $shop_name){
                $selected_shop = $shop;
                break;
            }
        }
    }

}

?>