diff options
author | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-21 20:33:44 +0100 |
---|---|---|
committer | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-21 20:33:44 +0100 |
commit | 5ba657e0bca0e4970b08583f6dfc94bfae34741c (patch) | |
tree | 44ed77deecd40ca984aae4bfa1bb949cb87bf7a0 /web/nms-public.gathering.org/old/change-switch-pos.pl | |
parent | d528cad67897dd2c3b98ec15a82868ac2764e2c7 (diff) | |
parent | 727e4ab31aa6d1a754711d4cd29dbcefae2e952a (diff) |
Merge branch 'master' of https://github.com/tech-server/tgmanage
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'); + |