error_reporting(E_ALL);
ini_set('display_errors', 1);
require('api.php');
if ( isset($_GET['lang']) ){
$lang = $_GET['lang'];
} else {
$lang = 'ua';
}
$function = 'Branch000';
$where = "Branchtype = 'ППВ'";
$where = '';
$order = 'RegionDescriptionUA, CityDescriptionUA';
$function = 'Branch1';
$where = 'LimitDelivery = 0 AND LimitJustReceive = 0';
$order = 'RegionDescriptionUA, CityDescriptionUA';
$xml = api($function, $where, $order);
$rosan_av = true;
//print_r($xml);
//die();
$res = '
Телефон гарячої лінії в Україні 0 800 50 50 44, +380322442208 , +380322221608
Відділення(місто) |
Тип |
Адреса |
пн-пт |
сб |
';
$i = 0;
$last_region = '';
foreach ($xml->result_table->items as $row){
$region = (string)$row->RegionDescriptionUA;
$name = (string)$row->DescriptionUA;
$city = (string)$row->CityDescriptionUA;
$street = (string)$row->StreetDescriptionUA;
$house = (string)$row->House;
$flat = trim((string)$row->Flat);
$lim = $row->Limitweight;
$type = $row->Branchtype;
$code = $row->BranchCode;
$arr_shc = explode (';', str_replace(array('Пн ', ' Вт ', ' Ср ', ' Чт ', ' Пт ', ' Сб ', ' Нд ', '--:-- - --:--'), '', (string)$row->WorkingHours));
$only_r = (string)$row->OnlyReceiver;
$lat = $row->Latitude;
$lon = $row->Longitude;
$adr_more = $row->AddressMoreInformation;
if ($city == ''){
continue;
}
if ($only_r == '1'){
$only_r_txt = '*';
} else {
$only_r_txt = '';
}
$adress = $street;
if ($house != ''){
$adress .= ', ' . $house;
}
if ($flat != ''){
$adress .= '/' . $flat;
}
if ($adr_more != ''){
//$adress .= ' (' . $adr_more . ')';
}
$i++;
if ($last_region != $region){
$res .= '
' . $region . ' область |
|
|
|
|
';
$i++;
}
$last_region = $region;
if (($city == 'Київ') and ($rosan_av)){
$res .= '
Київ |
Росан |
вул. Авіаконструктора Антонова, 5, оф. 101 |
09:00-18:30 (обід 13:00-14:00) |
10:00-13:30 |
';
$rosan_av = false;
}
if ($type == 'ОВ') {
$st = 'font-weight: bold;';
} else {
$st = '';
}
$res .= '
' . $city . ' |
' . $type . ' ' . $only_r_txt . ' №' . $code . ' |
' . $adress . ' |
' . $arr_shc[0] . ' |
' . $arr_shc[5] . ' |
';
}
$res .= '
';
echo $res;