Diff for /register/prgsrc/register.cgi between versions 1.7 and 1.10

version 1.7, 2001/09/17 02:57:51 version 1.10, 2002/01/28 17:00:56
Line 58  my $dbh = DBI->connect("DBI:mysql:chgk", Line 58  my $dbh = DBI->connect("DBI:mysql:chgk",
         die "Can't connect to DB chgk\n";          die "Can't connect to DB chgk\n";
     };      };
   
 print header;  print header(-charset=>'koi8-r');
   
   
 ##################################################  ##################################################
Line 87  my $self=url(); Line 87  my $self=url();
 ###############################################  ###############################################
 print <<END;  print <<END;
 <dl>  <dl>
   <dt><a href="$self">Home</a></dt>
 <dt><a href="$self?rid=1&level=1000&clubs=0">Все регионы</a></dt>  <dt><a href="$self?rid=1&level=1000&clubs=0">Все регионы</a></dt>
 <dt><a href="$self?rid=1&level=1000&clubs=1">Все клубы</a></dt>  <dt><a href="$self?rid=1&level=1000&clubs=1">Все клубы</a></dt>
 <dt><a href="$self?addclub=1">Добавить клуб</a></dt>  <dt><a href="$self?addclub=1">Добавить клуб</a></dt>
Line 171  END Line 172  END
 о клубе</a></dt>  о клубе</a></dt>
 <dt><a href="$self?whoiswho=1">Кто есть кто</a></dt>  <dt><a href="$self?whoiswho=1">Кто есть кто</a></dt>
 </dl>  </dl>
   <p align=center>
   END
   print &Include_virtual("../boris/register/regions.html");
   print <<END;
   </p>
 END  END
 }  }
   
 ####################################################################  ####################################################################
 # And the bottom of the page  # And the bottom of the page
 ###################################################################  ###################################################################
       my $sth=$dbh->prepare("select count(*) from Clubs");
       $sth->execute;
       my ($count) = $sth->fetchrow_array;
       $sth->finish;
   
     print "<p align=center>";      print "<p align=center>";
       print "Всего клубов: $count<br>\n";
     print "Эту страничку посмотрели ";      print "Эту страничку посмотрели ";
     print `/home/piataev/public_html/cgi-bin/counter.sh /znatoki/cgi-bin/register.cgi`;      print `/home/piataev/public_html/cgi-bin/counter.sh /znatoki/cgi-bin/register.cgi`;
     print " раз(а)</p>\n";      print " раз(а)</p>\n";
Line 248  SELECT Name FROM Regions WHERE RID=$args Line 259  SELECT Name FROM Regions WHERE RID=$args
   
         # Frist, we print clubs          # Frist, we print clubs
         if ($args{'clubs'}) {          if ($args{'clubs'}) {
               $result .= ListRegionURLs(%args);
             $result .= ListClubs(%args);              $result .= ListClubs(%args);
         }          }
         $sth=$args{'dbh'}->prepare("          $sth=$args{'dbh'}->prepare("
Line 276  SELECT rid FROM Regions WHERE $clause OR Line 288  SELECT rid FROM Regions WHERE $clause OR
 }  }
   
 ############################################################  ############################################################
   # List the URLs of a given region
   ###########################################################
   sub ListRegionURLs {
       my %args = @_;
       my $sth;
       $sth = $args{'dbh'}->prepare("
   SELECT URL FROM Regions WHERE rid=$args{'rid'} and NOT ISNULL(URL)");
   
       $sth->execute;
           
       if (!$sth->rows) {
           return "";
       }
       
       my $result;
           
       $result=<<END;
   <dl><dt>Странички:</dt>
   <dd><dl>\n
   END
       
       while (my ($string)=$sth->fetchrow_array) {
           $string=htmlize($string);
           $result .= p($string);
       }
       $result .= "</dl></dd></dl>\n";
       return $result;
   }
   
   
   ############################################################
 # List the clubs of a given region or a given association  # List the clubs of a given region or a given association
 ###########################################################  ###########################################################
 sub ListClubs {  sub ListClubs {
Line 724  sub AddClub { Line 767  sub AddClub {
 # Sending the letter with results  # Sending the letter with results
 #####################################################################  #####################################################################
 sub SendLetter {  sub SendLetter {
    open(MAIL,"| $SENDMAIL -t -n");     open(MAIL,"| $SENDMAIL -t");
     print MAIL <<END;      print MAIL <<END;
 To: $TO  To: $TO
 From: $FROM  From: $FROM

Removed from v.1.7  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>