public static function listaPaczkomatów($miejscowość = "", $tylkoPobraniowe = false) { $res = inpost_get_machine_list($miejscowość, $tylkoPobraniowe ? "t" : null); if (is_array($res) && count($res) > 0) { return array("result" => "ok", "list" => $res); } else { return array("result" => "error", "message" => "Zapytanie do serwera Inpost nie zwróciło żadnego paczkomatu"); } }
function inpost_get_towns() { $machines = inpost_get_machine_list(); if (isset($machines) and count($machines)) { foreach ($machines as $machine) { $towns[] = $machine['town']; } $towns = array_unique($towns); sort($towns); return $towns; } return 0; }