--- uke.php_20130318 2013-03-14 23:41:16.000000000 +0000 +++ uke.php 2013-03-18 13:09:36.000000000 +0000 @@ -206,6 +206,7 @@ (SELECT tu.sym_ul FROM teryt_ulic tu WHERE tu.id = nd.location_street) AS address_symul, (CASE WHEN nd.location_flat IS NULL THEN nd.location_house ELSE " .$DB->Concat('nd.location_house ', "'/'", 'nd.location_flat')." END) AS address_budynek, +(SELECT zip FROM pna WHERE pna.cityid = nd.location_city LIMIT 1) AS zipzip, ports, (CASE WHEN nlsrccable.nlsrccount IS NULL THEN 0 ELSE nlsrccable.nlsrccount END) + (CASE WHEN nldstcable.nldstcount IS NULL THEN 0 ELSE nldstcable.nldstcount END) AS cabledistports, (CASE WHEN nlsrcradio.nlsrccount IS NULL THEN 0 ELSE nlsrcradio.nlsrccount END) + (CASE WHEN nldstradio.nldstcount IS NULL THEN 0 ELSE nldstradio.nldstcount END) AS radiodistports, @@ -274,6 +275,7 @@ $netnodes[$netnodename]['address_ulica'] = $netdevice['address_ulica']; $netnodes[$netnodename]['address_symul'] = sprintf("%05d", $netdevice['address_symul']); $netnodes[$netnodename]['address_budynek'] = $netdevice['address_budynek']; + $netnodes[$netnodename]['zipzip'] = $netdevice['zipzip']; } $netnodes[$netnodename]['ranges'] = array(); $netnodes[$netnodename]['netdevices'] = array(); @@ -339,7 +341,7 @@ .(isset($netnode['area_woj']) ? implode(',', array($netnode['area_woj'], $netnode['area_pow'], $netnode['area_gmi']." (".$netnode['area_rodz_gmi'].")", $netnode['area_terc'], $netnode['area_city'], $netnode['area_simc'], $netnode['address_cecha'], - $netnode['address_ulica'], $netnode['address_symul'], $netnode['address_budynek'], ZIP_CODE)) + $netnode['address_ulica'], $netnode['address_symul'], $netnode['address_budynek'], $netnode['zipzip'])) : "LMS netdevinfo ID's: ".implode(' ', $netnode['netdevices']).",".implode(',', array_fill(0, 10, ''))) .",0,".(isset($netnode['longitude']) ? $netnode['latitude'].",".$netnode['longitude'] : ",") .",Nie,".($netnode['cabledistports'] + $netonode['radiodistports'] + $netnode['fiberdistports'] > 1 @@ -427,10 +429,14 @@ (SELECT tu.cecha FROM teryt_ulic tu WHERE tu.id = ?) AS address_cecha, (SELECT (CASE WHEN ls.name2 IS NOT NULL THEN ".$DB->Concat('ls.name2', "' '", 'ls.name')." ELSE ls.name END) AS name FROM location_streets ls WHERE ls.id = ?) AS address_ulica, - (SELECT tu.sym_ul FROM teryt_ulic tu WHERE tu.id = ?) AS address_symul", - array($range['location_city'], $range['location_city'], $range['location_city'], + (SELECT tu.sym_ul FROM teryt_ulic tu WHERE tu.id = ?) AS address_symul, + (SELECT zip FROM pna WHERE pna.cityid = ? LIMIT 1) AS zipzip", + array($range['location_city'], $range['location_city'], $range['location_city'], $range['location_city'], $range['location_city'], $range['location_city'], - $range['location_street'], $range['location_street'], $range['location_street'])); + $range['location_street'], $range['location_street'], $range['location_street'], $range['location_city'])); + + + list ($area_woj, $area_pow, $area_gmi, $area_rodz) = explode('_', $teryt['area_terc']); $teryt['area_terc'] = sprintf("%02d%02d%02d%s", $area_woj, $area_pow, $area_gmi, $area_rodz); $teryt['area_simc'] = sprintf("%07d", $teryt['area_simc']); @@ -450,7 +456,7 @@ .$DB->GroupConcat("DISTINCT (CASE t.type WHEN ".TARIFF_INTERNET." THEN 'INT' WHEN ".TARIFF_PHONE." THEN 'TEL' WHEN ".TARIFF_TV." THEN 'TV' - ELSE 'INT' END)")." AS servicetypes, SUM(t.downceil) AS downstream, SUM(t.upceil) AS upstream + ELSE 'INT' END)")." AS servicetypes, SUM(t.downceil) AS downstream, SUM(t.upceil) AS upstream FROM nodeassignments na JOIN nodes n ON n.id = na.nodeid JOIN assignments a ON a.id = na.assignmentid @@ -537,7 +543,7 @@ .$borough_types[intval($area_rodz)].")", $teryt['area_terc'], $teryt['area_city'], $teryt['area_simc'], $teryt['address_cecha'], $teryt['address_ulica'], $teryt['address_symul'], - $teryt['address_budynek'], ZIP_CODE)) + $teryt['address_budynek'], $teryt['zipzip'])) .",0,".$linktypes[$range['linktype']]['technologia_dostepu']; $snetranges .= ",Nie,Nie," . (isset($ukeservices['INT']) ? "Tak" : "Nie") . ",Nie,Nie," . (isset($ukeservices['TV']) ? "Tak" : "Nie") . ","