Example #1
0
function CableLine_Info($cableLineId)
{
    $wr['id'] = $cableLineId;
    $res = CableLine_SELECT(0, $wr);
    $result['CableLine'] = $res;
    $CableType = $result['CableLine']['rows'][0]['CableType'];
    $wr['id'] = $CableType;
    $res = CableType_SELECT(0, $wr);
    $result['CableLine']['rows'][0]['CableTypeMarking'] = $res['rows'][0]['marking'];
    $result['CableLine']['rows'][0]['CableTypeManufacturer'] = $res['rows'][0]['manufacturer'];
    $result['CableLine']['rows'][0]['CableTypeId'] = $res['rows'][0]['id'];
    $result['CableLinePoints'] = getCableLinePoint_NetworkNodeName($cableLineId);
    return $result;
}
Example #2
0
            $res['rows'][$i]['lon'] = $matches[1];
            $res['rows'][$i]['lat'] = $matches[2];
        } else {
            $res['rows'][$i]['lon'] = '';
            $res['rows'][$i]['lat'] = '';
        }
        $res['rows'][$i]['place'] = str_replace([';', '"'], [',', '\''], $res['rows'][$i]['place']);
        $res['rows'][$i]['note'] = str_replace([';', '"'], [',', '\''], $res['rows'][$i]['note']);
    }
} elseif ($_GET['data'] == 'lines') {
    $fields = ['id' => 'id', 'name' => 'name', 'coords' => 'coordinates', 'fibers' => 'fibers', 'marking' => 'marking', 'manufacturer' => 'manufacturer', 'length' => 'length', 'comment' => 'comment'];
    $res = getCableLineList(1, '');
    $i = -1;
    while (++$i < $res['count']) {
        $coords = '';
        $clp = getCableLinePoint_NetworkNodeName($res['rows'][$i]['id']);
        if ($clp['count']) {
            foreach ($clp['rows'] as $point) {
                if (preg_match('/\\(([0-9\\.]+)\\,([0-9\\.]+)\\)/', $point['OpenGIS'], $matches)) {
                    $coords .= $matches[1] . ',' . $matches[2] . ',0 ';
                } elseif (preg_match('/\\(([0-9\\.]+)\\,([0-9\\.]+)\\)/', $point['NNOpenGIS'], $matches)) {
                    $coords .= $matches[1] . ',' . $matches[2] . ',0 ';
                }
            }
        }
        $res['rows'][$i]['coords'] = trim($coords);
        $res['rows'][$i]['comment'] = str_replace([';', '"'], [',', '\''], $res['rows'][$i]['comment']);
    }
}
if (!$res['count']) {
    die_hdr('Не найдены объекты!');