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