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 |
|
|
$sth = $dbh->prepare("select iso,name from countries order by name"); |
28 |
|
|
$sth->execute(); |
29 |
|
|
while ($row=$sth->fetchrow_hash()) { |
30 |
|
|
$countries[]=$row; |
31 |
|
|
} |
32 |
|
|
$smarty->assign(array(countries=>$countries, |
33 |
|
|
email_val=>$email_val, |
34 |
|
|
)); |
35 |
|
|
|
36 |
|
|
if (isset($mailto) && check_required()) { |
37 |
dpavlin |
1.3 |
$main="Sporoèilo je bilo poslano na naslov $mailto. Hvala."; |
38 |
dpavlin |
1.1 |
include("quoted-printable.inc"); |
39 |
|
|
iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment); |
40 |
|
|
# $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>"; |
41 |
|
|
} else { |
42 |
|
|
$main=$smarty->fetch("$main_file.tpl"); |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
$smarty->assign( array(MAIN=>$main, from=>$from, |
46 |
|
|
contact_section=>1, |
47 |
|
|
)); |
48 |
|
|
|
49 |
|
|
?> |