Beispiel #1
0
 if ($res['maxfiber'] < 1) {
     $message = 'Узлу должен принадлежать минимум 1 кабель!';
     showMessage($message, 0);
 }
 $table_text_cols = '<th>№</th>';
 $table_text_marking = $table_text_fiber_count = $table_text_direction = $table_text_CableLineNames = $table_text_info = $table_text_fibers = '';
 for ($i = 0; $i < count($res['CableLines']); $i++) {
     $table_text_cols .= '<th colspan=3>' . ($i + 1) . '</th>';
     if (isset($_GET['print'])) {
         $table_text_marking .= '<td colspan=3>' . $res['cl_array']['rows'][$i]['manufacturer'] . '<br>' . $res['cl_array']['rows'][$i]['marking'] . '</td>';
     } else {
         $table_text_marking .= '<td colspan=3><a href="CableType.php?mode=charac&cabletypeid=' . $res['cl_array']['rows'][$i]['ctid'] . '">' . $res['cl_array']['rows'][$i]['manufacturer'] . '<br>' . $res['cl_array']['rows'][$i]['marking'] . '</a></td>';
     }
     $table_text_fiber_count .= '<td colspan=3>' . $res['cl_array']['rows'][$i]['fiber'] . '</td>';
     //$direction = getCableLineDirection($res['cl_array']['rows'][$i]['clpid'], $networkNodeId);
     $direction_rows = getCableLineDirection(-1, $res['cl_array']['rows'][$i]['clpid'], $networkNodeId);
     if (isset($direction_rows[0]['NetworkNode']) && $direction_rows[0]['NetworkNode'] == $networkNodeId) {
         $direction['name'] = $direction_rows[1]['name'];
         $direction['place'] = $direction_rows[1]['place'];
         $direction['NetworkNode'] = $direction_rows[1]['NetworkNode'];
     } else {
         $direction['name'] = $direction_rows[0]['name'];
         $direction['place'] = isset($direction_rows[0]['place']) ? $direction_rows[0]['place'] : '';
         $direction['NetworkNode'] = isset($direction_rows[0]['NetworkNode']) ? $direction_rows[0]['NetworkNode'] : '';
     }
     if ($direction['name'] == '-') {
         $table_text_direction .= '<td colspan=3>' . '-' . '</td>';
     } else {
         $place = isset($direction['place']) && strlen($direction['place']) > 0 ? '<br><small>' . $direction['place'] . '</small>' : '';
         if (isset($_GET['print'])) {
             $table_text_direction .= '<td colspan=3>' . $direction['name'] . $place . '</td>';
Beispiel #2
0
 $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'];
         $node->appendChild($node_attr);
         $node_attr = $dom->createAttribute('lon');
         $node_attr->value = $value[$i][$j]['lon'];
         $node->appendChild($node_attr);
         $node_attr = $dom->createAttribute('id');
         $node_attr->value = $value[$i][$j]['id'];
         $node->appendChild($node_attr);
     }
     $direction_row = getCableLineDirection($cableLineId, -1, -1);
     $direction_href = '';
     if (isset($direction_row[0]) && $direction_row[0]['name'] != '-') {
         $direction_href .= '<a href="NetworkNodes.php?mode=charac&nodeid=' . $direction_row[0]['NetworkNode'] . '">' . $direction_row[0]['name'] . '</a>';
     }
     $direction_href .= '-';
     if (isset($direction_row[1]) && $direction_row[1]['name'] != '-') {
         $direction_href .= '<a href="NetworkNodes.php?mode=charac&nodeid=' . $direction_row[1]['NetworkNode'] . '">' . $direction_row[1]['name'] . '</a>';
     }
     $cableId = $cableLine->appendChild($dom->createElement('cableLineId'));
     $cableId = $cableId->appendChild($dom->createTextNode($cableLineId));
     $name = $cableLine->appendChild($dom->createElement('name'));
     $name = $name->appendChild($dom->createTextNode($cableInfo[$cableLineId]['name']));
     $cableTypeId = $cableLine->appendChild($dom->createElement('cableTypeId'));
     if (isset($cableInfo[$cableLineId]['CableType'])) {
         $cableTypeId = $cableTypeId->appendChild($dom->createTextNode($cableInfo[$cableLineId]['CableType']));