/[corp_html]/contact.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /contact.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Mon Feb 19 16:22:20 2001 UTC revision 1.15 by dpavlin, Wed Nov 21 10:27:39 2001 UTC
# Line 6  $smarty = new Smarty; Line 6  $smarty = new Smarty;
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    $smarty->assign("from",$from);
20    
21    $email="webmaster@pliva.hr";    // default
22    
23  $sth = $dbh->prepare("select email from emails where referer='$from' limit 1");  $sth = $dbh->prepare("select email from emails where referer='$from' limit 1");
24  $sth->execute();  $sth->execute();
 $email_to="webmaster@pliva.hr";  
25  if ($row=$sth->fetchrow_hash()) {  if ($row=$sth->fetchrow_hash()) {
26          $email_to=$row[email];          $email=$row[email];
27    } else {
28            $sth = $dbh->prepare("select email from emails,menu where menu.section=referer and url like '$from%'");
29            $sth->execute();
30            if ($row=$sth->fetchrow_hash()) {
31                    $email=$row[email];
32            }
33  }  }
34    
35  $main=$smarty->fetch("$main_file.tpl");  $email=str_replace("\n","",$email);
36    $email=str_replace(" ","",$email);
37    $email_val=explode(",",$email);
38    
39  $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");
40    $sth->execute();
41  $smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)." -- $section --".  while ($row=$sth->fetchrow_hash()) {
42          $url[0] . "from: $from");          $countries[]=$row;
43    }
44    $smarty->assign(array(countries=>$countries,
45            email_val=>$email_val,
46            ));
47    
48    include("common.inc");
49    
50    if (isset($mailto) && check_required()) {
51            $main="Your comment is sent to $mailto. Thank you.";
52            include("quoted-printable.inc");
53            iso_mail("$fullname ($country) <$mailfrom>",$mailto,$subject,$comment);
54    #       $main.="<pre>$mailto $fullname $mailfrom $country $subject $comment</pre>";
55    } else {
56            $main=$smarty->fetch("$main_file.tpl");
57    }
58    
59    $smarty->assign( array(MAIN=>$main,
60            contact_section=>1,
61            ));
62    
63  $smarty->display("index.tpl");  $smarty->display("index.tpl");
64  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.26