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 |
|
|
$email_to="webmaster@pliva.hr"; |
25 |
|
|
if ($row=$sth->fetchrow_hash()) { |
26 |
|
|
$email_to=$row[email]; |
27 |
|
|
} |
28 |
|
|
|
29 |
dpavlin |
1.3 |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
30 |
dpavlin |
1.2 |
$sth->execute(); |
31 |
|
|
while ($row=$sth->fetchrow_hash()) { |
32 |
|
|
$countries[]=$row; |
33 |
|
|
} |
34 |
|
|
$smarty->assign(array(countries=>$countries, |
35 |
|
|
email_to=>$email_to, |
36 |
|
|
)); |
37 |
|
|
|
38 |
|
|
include("common.inc"); |
39 |
dpavlin |
1.1 |
$main=$smarty->fetch("$main_file.tpl"); |
40 |
|
|
|
41 |
dpavlin |
1.2 |
$smarty->assign( array(MAIN=>$main, from=>$from, |
42 |
|
|
contact_section=>1, |
43 |
|
|
)); |
44 |
|
|
|
45 |
dpavlin |
1.1 |
|
46 |
|
|
$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --". |
47 |
|
|
$url[0] . "from: $from"); |
48 |
|
|
|
49 |
|
|
|
50 |
|
|
$smarty->display("index.tpl"); |
51 |
|
|
?> |