/[pliva-si]/sections/pisite_nam.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /sections/pisite_nam.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Wed Nov 21 09:10:52 2001 UTC (22 years, 5 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +6 -1 lines
slovenija prva

1 dpavlin 1.1 <?php
2    
3     if (! isset($from) || $from == "") {
4     $from=str_replace(".php","",basename($HTTP_REFERER));
5     if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?"));
6 dpavlin 1.2 if ($from == $HTTP_HOST || $from=="www.pliva.si") $from="index";
7 dpavlin 1.1 }
8    
9 dpavlin 1.2 $email="info@pliva.si"; // default
10 dpavlin 1.1
11     $sth = $dbh->prepare("select email from emails where referer='$from' limit 1");
12     $sth->execute();
13     if ($row=$sth->fetchrow_hash()) {
14     $email=$row[email];
15     } else {
16     $sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url like '$from%'");
17     $sth->execute();
18     if ($row=$sth->fetchrow_hash()) {
19     $email=$row[email];
20     }
21     }
22    
23     $email=str_replace("\n","",$email);
24     $email=str_replace(" ","",$email);
25     $email_val=explode(",",$email);
26    
27 dpavlin 1.4 $countries[]=array(
28     "iso" => "SI",
29     "name" => "Slovenia"
30     );
31    
32     $sth = $dbh->prepare("select iso,name from countries where upper(iso)<>'SI' order by name");
33 dpavlin 1.1 $sth->execute();
34     while ($row=$sth->fetchrow_hash()) {
35     $countries[]=$row;
36     }
37     $smarty->assign(array(countries=>$countries,
38     email_val=>$email_val,
39     ));
40    
41     if (isset($mailto) && check_required()) {
42 dpavlin 1.3 $main="Sporoèilo je bilo poslano na naslov $mailto. Hvala.";
43 dpavlin 1.1 include("quoted-printable.inc");
44     iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment);
45     # $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>";
46     } else {
47     $main=$smarty->fetch("$main_file.tpl");
48     }
49    
50     $smarty->assign( array(MAIN=>$main, from=>$from,
51     contact_section=>1,
52     ));
53    
54     ?>

  ViewVC Help
Powered by ViewVC 1.1.26