From 727e4ab31aa6d1a754711d4cd29dbcefae2e952a Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Mon, 21 Mar 2016 20:11:55 +0100 Subject: NMS: NMS Public --- web/nms-public.gathering.org/old/change-switch-pos.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 web/nms-public.gathering.org/old/change-switch-pos.pl (limited to 'web/nms-public.gathering.org/old/change-switch-pos.pl') 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'); + -- cgit v1.2.3