# Copyright (c) 1999 Ivan Kohler. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under
# the same terms as perl itself
# Copyright (c) 1999 Ivan Kohler. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under
# the same terms as perl itself
my $field;
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
my $field;
foreach $field ( @fields ) {
if ( $cgi->param( $field ) ) {
$cgi->param( $field ) =~ /^(.*)$/;
- $cgi->param( $field, $1);
+ my $param = $1 || 0;
+ if ( (DBI::looks_like_number($param))[0] ) {
+ $cgi->param( $field, $param );
+ } else {
+ $cgi->param( $field, $dbh->quote($param) );
+ }
+ my $set_id = $sth->{'insertid'};
+ warn $set_id;
+
+ $dbh->do( "DELETE FROM PERSONS_SETS WHERE ( SET_ID = $set_id )" )
+ or die $dbh->errstr;
+
+ my $person_id;
+ foreach $person_id ( $cgi->param('PERSON_ID') ) {
+ $dbh->do(
+ "INSERT INTO PERSONS_SETS ( PERSON_ID, SET_ID ) ".
+ "VALUES ( $person_id, $set_id )"
+ ) or die $dbh->errstr;
+ }
+
+ #my $rv = $sth->execute;
+ #die $sth->errstr unless $rv;
+
"Start Time: ", $cgi->textfield( -name => 'SETSTART' ), "<BR>",
"Length: ", $cgi->textfield( -name => 'DURATION' ), "<BR>",
"Filename: ", $cgi->textfield( -name => 'FILENAME' ), "<BR>",
"Short Description: ", $cgi->textarea( -name => 'DESCRIPTION', -cols => '45', -rows => '2' ), "<BR>",
"Long Description: ", $cgi->textarea( -name => 'INFO', -cols => '45', -rows => '5' ), "<BR>",
"Keywords: ", $cgi->textfield( -name => 'KEYWORDS' ), "<BR>",
"Start Time: ", $cgi->textfield( -name => 'SETSTART' ), "<BR>",
"Length: ", $cgi->textfield( -name => 'DURATION' ), "<BR>",
"Filename: ", $cgi->textfield( -name => 'FILENAME' ), "<BR>",
"Short Description: ", $cgi->textarea( -name => 'DESCRIPTION', -cols => '45', -rows => '2' ), "<BR>",
"Long Description: ", $cgi->textarea( -name => 'INFO', -cols => '45', -rows => '5' ), "<BR>",
"Keywords: ", $cgi->textfield( -name => 'KEYWORDS' ), "<BR>",
+ "People: ", $cgi->scrolling_list(
+ -name => "PERSON_ID",
+ '-values' => [ sort { $persons{$a} cmp $persons{$b} } keys(%persons) ],
+ '-labels' => \%persons,
+ '-multiple' => 'true',
+ ),
"Show?: ", $cgi->textfield( -name => 'SHOW_ID' ), "<BR>",
$cgi->hidden( -name => 'magic'),
$cgi->submit('Submit'),
"Show?: ", $cgi->textfield( -name => 'SHOW_ID' ), "<BR>",
$cgi->hidden( -name => 'magic'),
$cgi->submit('Submit'),