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