<%args> $entry=>"" $book=>"" $cover=>"" $title=>"" $author=>"" $publisher=>"" $firm=>"" $ad=>"" $designer=>"" $addl=>"" <%init> use RubyCore::ObjectInit; use designobserver::Config(); my $rso = new RubyCore::ObjectInit { %designobserver::Config::c }; $rso->dbconnect(); my $cookie_header = $r->headers_in->get('Cookie'); my @cookies = split (";",$cookie_header); my ($key,$value,$sessid); my ($sql, $sth, $url, $nomid); foreach my $cookie (@cookies){ ($key,$value) = split("=",$cookie); if ($key eq "DO" || $key eq " DO"){ $sessid = $value; } } $sql = "SELECT signupid FROM sitesessions WHERE session = '$sessid'"; $sth = $rso->dosql($sql); my $signupid = $sth->fetchrow_array (); if ($sessid){ $book = $rso->rsan($book); $cover = $rso->rsan($cover); $title = $rso->rsan($title); $title =~ s/\'/\\'/g; $author = $rso->rsan($author); $author =~ s/\'/\\'/g; $publisher = $rso->rsan($publisher); $publisher =~ s/\'/\\'/g; $firm = $rso->rsan($firm); $firm =~ s/\'/\\'/g; $ad = $rso->rsan($ad); $ad =~ s/\'/\\'/g; $designer = $rso->rsan($designer); $designer =~ s/\'/\\'/g; $addl = $rso->rsan($addl); $addl =~ s/\'/\\'/g; $sql = "UPDATE 5050_2013 SET "; if ($book eq "on"){ $book = 'y'; } else { $book = 'n'; } $sql .= "book='$book', "; if ($cover eq "on"){ $cover = 'y'; } else { $cover = 'n'; } $sql .= "cover='$cover', "; $sql .= "title='$title', "; $sql .= "author='$author', "; $sql .= "publisher='$publisher', "; $sql .= "designfirm='$firm', "; $sql .= "artdirector='$ad', "; $sql .= "designer='$designer', "; $sql .= "othercredits='$addl' "; $sql .= "WHERE id = '$entry'"; $sth = $rso->dosql($sql); $url = "nomination.html?entry=$entry"; } else { $url = "entries.html"; } $m->redirect($url);