Please login with individual username (not the generic 'trd').
";
exit;
}
if(isset($_POST['uini'])) $uini = $_POST['uini'];
else die("
ERROR: ISEG HV PSU location and/or status change request without user identification!");
?>
New PSU ';
print 'Back to search ';
?>
Log Off
Voltage
ERROR: ISEG HV PSU location and/or status change request without serial!");
if(!$newloc && !$newstat) die ("
ERROR: ISEG HV PSU location and/or status change request without data!");
if($newloc)
echo '
Moving ISEG HV PSU '.$serial.' to location '.substr($location,1).'?
';
if($newstat)
echo '
Changing status of ISEG HV 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_iseg.php internal logical error!");
$pserial = $_POST['pser'];
$tosm = false; $toloc = false;
if(isset($_POST['ploc'])){
$ploc = $_POST['ploc'];
$type = substr($ploc,0,1);
if($type=="S") $tosm = true;
else if($type=="L") $toloc = true;
else die ("
ERROR: unknown new location type: ".$type);
$newid = substr($ploc,1);
}
$tostat = false;
if(isset($_POST['pstat'])) {
$newstat = $_POST['pstat'];
$tostat = true;
}
// commit the changes:
$query = "UPDATE psuhv SET ";
if(!$tosm && $toloc && !$tostat)
$query .= "loc_id=".$newid;
else if(!$tosm && $toloc && $tostat)
$query .= "loc_id=".$newid.", status='".$newstat."'";
else if(!$tosm && !$toloc && $tostat)
$query .= "status='".$newstat."'";
else die ("
ERROR: move_iseg.php internal logical error 2!");
$query .= ", person='".$uini."' WHERE psuhv_id='".$pserial."'";
$result = pg_query($query) or die ("
ERROR - Cannot execute ISEG HV PSU update: ".$query);
if($result)
print 'New ISEG HV PSU location and/or status successfully uploaded!
';
else
print '
ERROR : Cannot execute ISEG HV PSU update: '.$query.'
'.pg_result_error($result);
}
?>