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