function Users_UPDATE($upd, $wr) { $query = 'UPDATE "Users" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } unset($field, $value); $result = PQuery($query); return $result; }
function OpticalFiberJoin_UPDATE($upd, $wr, $tmpT = FALSE) { $query = 'UPDATE "' . tmpTable('OpticalFiberJoin', $tmpT) . '" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } $result = PQuery($query); loggingIs(1, 'OpticalFiberJoin', $upd, $wr['id']); return $result; }
function OpticalFiber_UPDATE($upd, $wr) { $query = 'UPDATE "OpticalFiber" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } unset($field, $value); $result = PQuery($query); loggingIs(1, 'OpticalFiber', $upd, $wr['id']); return $result; }
function NetworkBoxType_UPDATE($upd, $wr) { $query = 'UPDATE "NetworkBoxType" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } unset($field, $value); $result = PQuery($query); loggingIs(1, 'NetworkBoxType', $upd, $wr['id']); return $result; }
function FSOT_UPDATE($upd, $wr) { $query = 'UPDATE "FiberSpliceOrganizerType" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } unset($field, $value); $result = PQuery($query); loggingIs(1, 'FiberSpliceOrganizerType', $upd, $wr['id']); return $result; }
function OpticalFiberSplice_UPDATE($upd, $wr) { if (isset($upd['attenuation'])) { $attenuation = str_replace(',', '.', $upd['attenuation']); if (is_numeric($attenuation)) { $upd['attenuation'] = floatval($attenuation) * 100; } else { $upd['attenuation'] = 'NULL'; } } $query = 'UPDATE "OpticalFiberSplice" SET '; $query .= genUpdate($upd); if ($wr != '') { $query .= genWhere($wr); } unset($field, $value); $result = PQuery($query); loggingIs(1, 'OpticalFiberSplice', $upd, $wr['id']); return $result; }
function moveNode($coors, $tmpT = FALSE) { $OpenGIS = "(" . $coors[0]->lon . "," . $coors[0]->lat . ")"; $wr['id'] = $coors[0]->id; $upd['OpenGIS'] = $OpenGIS; $query = 'UPDATE "' . tmpTable('NetworkNode', $tmpT) . '" SET' . genUpdate($upd) . genWhere($wr); PQuery($query); }
function CableLinePoint_UPDATE($upd, $wr, $tmpT = FALSE) { $query = 'UPDATE "' . tmpTable('CableLinePoint', $tmpT) . '" SET '; $query .= genUpdate($upd); $where = ''; if ($wr != '') { $where = genWhere($wr); } $val = ''; if (!isset($wr['id'])) { if ($wr != '') { $query1 = 'SELECT id FROM "' . tmpTable('CableLinePoint', $tmpT) . '" ' . $where; $result = PQuery($query1); $wr['id'] = $result['rows'][0]['id']; if ($result['count'] > 1) { $wr['id'] = ''; $val = $where; } } else { $wr['id'] = ''; } } $result = PQuery($query . $where); loggingIs(1, tmpTable('CableLinePoint', $tmpT), $upd, $wr['id']); return $result; }