Please login with individual username (not the generic 'trd').
";
exit(0);
}
if(isset($_POST['uini'])) $uini = $_POST['uini'];
else die("
ERROR: Wiener LV PSU location and/or status change request without user identification!");
?>
New PSU ';
print 'Back to search ';
?>
Log Off
Voltage
ERROR: Wiener LV PSU Location and/or status change request without data!");
if($toloc)
echo '
Moving Wiener LV PSU '.$serial.' from '.$_POST['oldloc'].' to location '.$location.'?
';
if($newstat)
echo '
Changing status of Wiener LV PSU with serial '.$serial.' to "'.$status.'"?
';
// confirmation request:
print '';
print "
or Go Back";
} else { // everything is set and confirmation received! Commit changes...
// get data:
if(!isset($_POST['pser'])) die ("
ERROR: move_wiener.php internal logical error!");
else {
$pserial = $_POST['pser'];
$ploc = $_POST['ploc'];
$pstat = $_POST['pstat'];
}
// commit the changes:
$query = "UPDATE psu SET ";
if(isset($ploc)){
$query .= "loc_id='".$ploc."'";
if(isset($pstat)) $query .= ", status='".$pstat."'";
}
if(isset($pstat)&& !isset($ploc)) $query .= " status='".$pstat."'";
$query .= ", person='".$uini."' WHERE serial='".$pserial."'";
$result = pg_query($query) or die ("
ERROR - Cannot execute Wiener update: ".$query);
if($result)
print 'New Wiener LV PSU location and/or status successfully uploaded!
';
else
print '
ERROR : Cannot execute Wiener LV PSU update: '.$query.'
'.pg_result_error($result);
print "
Back";
}
?>