diff options
author | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-22 11:14:46 +0100 |
---|---|---|
committer | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-22 11:14:46 +0100 |
commit | 7806081670c8c9807fc8b6628b3d7a6eff841ded (patch) | |
tree | 082e522b99cd5b864a8963523f2b3889f6cff808 /web/nms-public.gathering.org/old/change-switch-pos.pl | |
parent | e501dd7dd88bf52edd914a8f078141b91d53939b (diff) | |
parent | 2d19233ba32fd23ad7182d3cccb58cec9e377a75 (diff) |
MERGE fix.
Diffstat (limited to 'web/nms-public.gathering.org/old/change-switch-pos.pl')
-rwxr-xr-x | web/nms-public.gathering.org/old/change-switch-pos.pl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web/nms-public.gathering.org/old/change-switch-pos.pl b/web/nms-public.gathering.org/old/change-switch-pos.pl new file mode 100755 index 0000000..70d12f4 --- /dev/null +++ b/web/nms-public.gathering.org/old/change-switch-pos.pl @@ -0,0 +1,15 @@ +#! /usr/bin/perl +use CGI; +use GD; +use DBI; +use lib '../../include'; +use nms; +my $cgi = CGI->new; + +my $dbh = nms::db_connect(); +my $box = sprintf("(%d,%d)", $cgi->param('x'), $cgi->param('y')); + +$dbh->do('UPDATE placements SET placement=box(?::point, ?::point + point(width(placement),height(placement))) WHERE switch=?', + undef, $box, $box, $cgi->param('switch')); +print $cgi->header(-type=>'text/plain', -expires=>'now'); + |