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)); |
$from=str_replace(".php","",basename($HTTP_REFERER)); |
21 |
|
if (strstr($from,"?")) $from=substr($from,0,strpos($from,"?")); |
22 |
|
|
23 |
|
$email="webmaster@pliva.hr"; // default |
24 |
|
|
25 |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
$sth = $dbh->prepare("select email from emails where referer='$from' limit 1"); |
26 |
$sth->execute(); |
$sth->execute(); |
|
$email_to="webmaster@pliva.hr"; |
|
27 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
28 |
$email_to=$row[email]; |
$email=$row[email]; |
29 |
|
} else { |
30 |
|
$sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url='results.php?type=a'"); |
31 |
|
$sth->execute(); |
32 |
|
if ($row=$sth->fetchrow_hash()) { |
33 |
|
$email=$row[email]; |
34 |
|
} |
35 |
} |
} |
36 |
|
|
37 |
|
$email=str_replace("\n","",$email); |
38 |
|
$email=str_replace(" ","",$email); |
39 |
|
$email_val=explode(",",$email); |
40 |
|
|
41 |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
42 |
$sth->execute(); |
$sth->execute(); |
43 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
44 |
$countries[]=$row; |
$countries[]=$row; |
45 |
} |
} |
46 |
$smarty->assign(array(countries=>$countries, |
$smarty->assign(array(countries=>$countries, |
47 |
email_to=>$email_to, |
email_val=>$email_val, |
48 |
)); |
)); |
49 |
|
|
50 |
include("common.inc"); |
include("common.inc"); |
51 |
$main=$smarty->fetch("$main_file.tpl"); |
|
52 |
|
if (! isset($mailto)) { |
53 |
|
$main=$smarty->fetch("$main_file.tpl"); |
54 |
|
} else { |
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 |
|
} |
60 |
|
|
61 |
$smarty->assign( array(MAIN=>$main, from=>$from, |
$smarty->assign( array(MAIN=>$main, from=>$from, |
62 |
contact_section=>1, |
contact_section=>1, |
63 |
)); |
)); |
64 |
|
|
|
|
|
|
$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". |
|
|
$url[0] . "from: $from"); |
|
|
|
|
|
|
|
65 |
$smarty->display("index.tpl"); |
$smarty->display("index.tpl"); |
66 |
?> |
?> |