/[wopi]/make_poll.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /make_poll.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by dpavlin, Thu Apr 24 19:39:14 2003 UTC revision 1.8 by dpavlin, Wed Sep 24 19:55:43 2003 UTC
# Line 194  close(PAGE); Line 194  close(PAGE);
194  # dump sql structure  # dump sql structure
195    
196  open(SQL,">$poll/$poll.sql") || die "$poll.sql: $!";  open(SQL,">$poll/$poll.sql") || die "$poll.sql: $!";
197    print SQL "drop database ".$prefix.$poll.";\n";
198    print SQL "create database ".$prefix.$poll.";\n";
199    print SQL "\\connect ".$prefix.$poll.";\n";
200  print SQL "create table poslani ( member_id int4 not null, unesen timestamp default now() );\n";  print SQL "create table poslani ( member_id int4 not null, unesen timestamp default now() );\n";
201  print SQL "create table $poll (do_stranice text default null, ",join(",\n",@sql_create),");\n";  print SQL "create table $poll (do_stranice text default null, ",join(",\n",@sql_create),");\n";
202  close(SQL);  close(SQL);
# Line 229  rename "$poll/01.php","$poll/index.php" Line 232  rename "$poll/01.php","$poll/index.php"
232    
233  # return unique name of pitanje  # return unique name of pitanje
234  sub new_pit {  sub new_pit {
235          my $out="p".$pitanje_nr.$p_suffix;          my $out="p".$pitanje_nr;
236            $out .= "_".$p_suffix if ($p_suffix);
237          $curr_suffix=$p_suffix;          $curr_suffix=$p_suffix;
238          $p_suffix++;          $p_suffix++;
239          return $out;          return $out;
# Line 743  sub checkboxes { Line 747  sub checkboxes {
747          }          }
748  }  }
749    
750    print "\n\nTo create database for poll $poll use:\n\n";
751    print "\$ psql template1 < $poll/$poll.sql\n\n";
752    print "THIS WILL DISTROY ALL DATA IN EXISTING DATABASE ".$prefix.$poll." !!\n";
753    
754  # read configuration data  # read configuration data
755  #  #
756  # FIX: write actually this :-)  # FIX: write actually this :-)

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26