예제 #1
0
require_once 'backend/functions.php';
require_once 'backend/CableType.php';
require_once 'backend/NetworkNode.php';
require_once 'backend/FS.php';
ini_set('display_errors', false);
if ($_GET['mode'] == 'GetCableLines') {
    // кабельные линии
    $res = getCableLineList(0, '', -1, -1);
    /* if ( $res[ 'count' ] == 0 )
       {
       die();
       } */
    $rows = $res['rows'];
    $dom = new DomDocument('1.0', 'UTF-8');
    $cableLines = $dom->appendChild($dom->createElement('cableLines'));
    $cableLinesFrag = getCableLinesFrag($rows, FALSE);
    //print_r($cableLinesFrag);
    $cableInfo = array();
    for ($i = 0; $i < $res['count']; $i++) {
        $cableInfo[$rows[$i]['id']] = $rows[$i];
    }
    foreach ($cableLinesFrag as $key => $value) {
        //print_r($value);
        //print_r($key);
        $cableLineId = $key;
        for ($i = 0; $i < count($value); $i++) {
            $cableLine = $cableLines->appendChild($dom->createElement('cableLine'));
            for ($j = 0; $j < count($value[$i]); $j++) {
                $node = $cableLine->appendChild($dom->createElement('node'));
                $node_attr = $dom->createAttribute('lat');
                $node_attr->value = $value[$i][$j]['lat'];
예제 #2
0
<?php

require_once 'backend/functions.php';
require_once 'backend/CableType.php';
require_once 'backend/NetworkNode.php';
require_once 'backend/FS.php';
require_once 'backend/map.php';
ini_set('display_errors', false);
checkData();
if ($_GET['mode'] == 'GetCableLines') {
    // кабельные линии
    $res = getCableLineList(0, '', -1, -1, TRUE);
    $rows = $res['rows'];
    $dom = new DomDocument('1.0', 'UTF-8');
    $cableLines = $dom->appendChild($dom->createElement('cableLines'));
    $cableLinesFrag = getCableLinesFrag($rows, TRUE);
    //print_r( $cableLinesFrag );
    //print_r( $res );
    $cableInfo = array();
    for ($i = 0; $i < $res['count']; $i++) {
        $cableInfo[$rows[$i]['id']] = $rows[$i];
    }
    foreach ($cableLinesFrag as $key => $value) {
        //print_r($value);
        //print_r($key);
        $cableLineId = $key;
        for ($i = 0; $i < count($value); $i++) {
            $cableLine = $cableLines->appendChild($dom->createElement('cableLine'));
            for ($j = 0; $j < count($value[$i]); $j++) {
                $node = $cableLine->appendChild($dom->createElement('node'));
                $node_attr = $dom->createAttribute('lat');