#!/opt/gnu/bin/perl
#   Par Patrick Lapointe
#   7 aout 96
#   Module effectuant l'ecriture de COMT.PL
#
push (@INC,"/opt/httpd/cgi-bin");
require 'cgi-lib.pl';

######################################
# 
# Programme principal
#
     &ReadParse;
     &Ecrit;
#
#    Fin du programme  principal
#
######################################
sub Ecrit
    { 
      $Ecrit = 1;
      foreach $key (sort keys %in)
              {     
                if ( $in{$key} eq  "" ) { $Ecrit = 0; }
              }
  
     if ($Ecrit eq 1)
        {
#______________________
         open (OUT, ">>theme2.txt");
         foreach $key (sort keys %in)
              {     
               print OUT "$in{$key}";
               print OUT "\n";
              }
         print OUT "\n";
         close(OUT);
         &EcritOui;
        }
         else { &EcritNon }
    }
#
#    Module n'ecrit pas.
#
 sub EcritOui {
             print &PrintHeader;
             print "<HTML>\n";
             print "<BODY  BGCOLOR=#ebdedc TEXT=#b53934>\n";
             print " <H1>Votre demande a &eacute;t&eacute;";
             print " effectu&eacutee.<\/H1><\/P>\n";
#-----------------------------
             print "<a href= \"theme2.pl\"> Page pr&eacute;c&eacute;dente </a><\/P>\n";
             print "</BODY>\n";
             print "</HTML>\n";
}

#
#   Module n'ecrit pas.
#
 sub EcritNon {
             print &PrintHeader;
             print "<HTML>\n";
             print "<BODY  BGCOLOR=#ebdedc TEXT=#b53934>\n";
             print " <H1>Votre demande a &eacute;t&eacute;";
             print " refus&eacutee.<\/H1><\/P>\n";
#__________________________
             print "<a href= \"theme2.pl\"> Page pr&eacute;c&eacute;dente </a><\/P>\n";
             print "</BODY>\n";
             print "</HTML>\n";
}

