17 |
|
|
18 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
19 |
|
|
20 |
$from=str_replace(".php","",basename($HTTP_REFERER)); |
if (! isset($from) || $from == "") { |
21 |
|
$from=str_replace(".php","",basename($HTTP_REFERER)); |
22 |
|
if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); |
23 |
|
if ($from == $HTTP_HOST) $from="index"; |
24 |
|
} |
25 |
|
|
26 |
|
$email="webmaster@pliva.hr"; // default |
27 |
|
|
28 |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
29 |
$sth->execute(); |
$sth->execute(); |
|
$email_to="webmaster@pliva.hr"; |
|
30 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
31 |
$email_to=$row[email]; |
$email=$row[email]; |
32 |
|
} else { |
33 |
|
$sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url like '$from%'"); |
34 |
|
$sth->execute(); |
35 |
|
if ($row=$sth->fetchrow_hash()) { |
36 |
|
$email=$row[email]; |
37 |
|
} |
38 |
} |
} |
39 |
|
|
40 |
|
$email=str_replace("\n","",$email); |
41 |
|
$email=str_replace(" ","",$email); |
42 |
|
$email_val=explode(",",$email); |
43 |
|
|
44 |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
45 |
$sth->execute(); |
$sth->execute(); |
46 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
47 |
$countries[]=$row; |
$countries[]=$row; |
48 |
} |
} |
49 |
$smarty->assign(array(countries=>$countries, |
$smarty->assign(array(countries=>$countries, |
50 |
email_to=>$email_to, |
email_val=>$email_val, |
51 |
)); |
)); |
52 |
|
|
53 |
include("common.inc"); |
include("common.inc"); |
54 |
$main=$smarty->fetch("$main_file.tpl"); |
|
55 |
|
if (isset($mailto) && check_required()) { |
56 |
|
$main="Your comment is sent to $mailto. Thank you."; |
57 |
|
include("quoted-printable.inc"); |
58 |
|
iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment); |
59 |
|
# $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>"; |
60 |
|
} else { |
61 |
|
$main=$smarty->fetch("$main_file.tpl"); |
62 |
|
} |
63 |
|
|
64 |
$smarty->assign( array(MAIN=>$main, from=>$from, |
$smarty->assign( array(MAIN=>$main, from=>$from, |
65 |
contact_section=>1, |
contact_section=>1, |
66 |
)); |
)); |
67 |
|
|
|
|
|
|
$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". |
|
|
$url[0] . "from: $from"); |
|
|
|
|
|
|
|
68 |
$smarty->display("index.tpl"); |
$smarty->display("index.tpl"); |
69 |
?> |
?> |