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