/[corp_html]/careers.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 /careers.php

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

revision 1.8 by dpavlin, Mon Mar 12 14:01:50 2001 UTC revision 1.18 by dpavlin, Thu Apr 25 12:16:41 2002 UTC
# Line 1  Line 1 
1  <?php  <?php
2  require("Smarty.class.php");  
3    if ($part == "erec") {
4            // fix include path for included code
5            $old_inc = ini_get("include_path");
6            $new_inc = ereg_replace( ":[^:]*inc","", $old_inc).":/data/erec/inc";
7            ini_set("include_path", $new_inc);
8            require("/data/erec/inc/Smarty.class.php");
9            include("DB.php");      // PEAR
10            require("/data/erec/erec.class.php");
11            // ini_restore("include_path"); // no work?
12            ini_set("include_path", $old_inc);
13    } else require("Smarty.class.php");
14    
15  require("conn.inc");  require("conn.inc");
16    
17  $smarty = new Smarty;  $smarty = new Smarty();
18    
19  $smarty->assign( array ( Title=>"Pliva d.d." ) );  $smarty->assign( array ( Title=>"Pliva d.d." ) );
20    
21  $section=str_replace(".php","",basename($PHP_SELF));  include("section.inc");
22  $smarty->assign("section",$section);  
23    include("common.inc");
24    
 $title="CAREERS";  
 if ($menu_item) $title.=" : $menu_item";  
 $lpic="careers"; $lext=".jpg";  
 $mpic="careers.gif";  
25  $main_file="./html/Careers-";  $main_file="./html/Careers-";
26  if (file_exists($main_file.$part.".htm")) {  if (file_exists($main_file.$part.".htm")) {
27          $main_file.=$part.".htm";          $main_file.=$part.".htm";
28          $main=join('',file($main_file));          $main=join('',file($main_file));
29  } elseif (file_exists("./templates/Careers-".$part.".tpl")) {  } elseif (file_exists("./templates/Careers-".$part.".tpl")) {
30    
31            if ($part == "Mail" && !check_required()) $part="ApplicationForm";
32    
33            $sql="select num,title,job_code,department,open_position_locations.location as location,description,edu_req,qual_req,open_position_locations.email as sendto
34                    from open_positions,open_position_locations
35                    where open_positions.location_id=open_position_locations.id and $visible_is_true";
36          if ($part == "ApplicationForm") {          if ($part == "ApplicationForm") {
37                  $sth = $dbh->prepare("select iso,name from countries order by name");                  $sth = $dbh->prepare("select iso,name from countries order by name");
38                  $sth->execute();                  $sth->execute();
# Line 28  if (file_exists($main_file.$part.".htm") Line 42  if (file_exists($main_file.$part.".htm")
42                  $smarty->assign("countries",$countries);                  $smarty->assign("countries",$countries);
43    
44                  if ($position) {                  if ($position) {
45                          $sth = $dbh->prepare("select num,title,job_code,department,location from open_positions where visible is true and num=$position");                          $sql.=" and num=$position";
46                            $sth = $dbh->prepare($sql);
47                          $sth->execute();                          $sth->execute();
48                          if ($row=$sth->fetchrow_hash()) {                          if ($row=$sth->fetchrow_hash()) {
49                                    include("rot13.inc");
50                                    $row[sendto]=rot13($row[sendto]);
51                                  $smarty->assign("position",$row);                                  $smarty->assign("position",$row);
52                          }                          }
53                  }                  }
54          } elseif ($part == "OpenPositions") {          } elseif ($part == "OpenPositions") {
55                  $sth = $dbh->prepare("select num,title,job_code,department,location,description,edu_req,qual_req from open_positions where visible is true order by num asc");                  $sql.=" and expiration >= date('now') order by num asc";
56                    $sth = $dbh->prepare($sql);
57                  $sth->execute();                  $sth->execute();
58                  while ($row=$sth->fetchrow_hash()) {                  while ($row=$sth->fetchrow_hash()) {
59                          $positions[]=$row;                          $positions[]=$row;
# Line 64  Resume: $resume_name ($resume_size bytes Line 82  Resume: $resume_name ($resume_size bytes
82  ";  ";
83                  $smarty->assign("mail","You sent following e-mail:<br><pre>$mail</pre>");                  $smarty->assign("mail","You sent following e-mail:<br><pre>$mail</pre>");
84                  include("class.CMailFile");                  include("class.CMailFile");
85                  $sendto="careercenter@pliva.hr";                  if (!isset($sendto) || !strstr($sendto,"@")) {
86                            $sendto="careercenter@pliva.hr";
87                    } else {
88                            include("rot13.inc");
89                            $sendto=rot13($sendto);
90                    }
91                  $replyto="$first_name $last_name <$email>";                  $replyto="$first_name $last_name <$email>";
92                  $mailfile = new CMailFile("application for submission",$sendto,$replyto,$mail,$resume);                  $mailfile = new CMailFile("Application for $open_position",$sendto,$replyto,$mail,$resume);
93                  $mailfile->sendfile();                  $mailfile->sendfile();
94                  @unlink($resume);                  @unlink($resume);
95          }          }
96    
97          $main=$smarty->fetch("Careers-".$part.".tpl");          $main=$smarty->fetch("Careers-".$part.".tpl");
98  } else {  } elseif ($part != "erec") {
99          $main_file.="Main.htm";          $main_file.="Main.htm";
100          $main=join('',file($main_file));          $main=join('',file($main_file));
101  }  }
102    
   
103  $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) );  $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) );
104    
 include("common.inc");  
 $smarty->assign("MAIN",$main);  
   
105  $smarty->assign("contact_url","careers.php?part=ContactUs");  $smarty->assign("contact_url","careers.php?part=ContactUs");
106    
107    if ($part == "erec") {
108            $erec = new ERec();
109            $erec->upload_dir = "/data/erec";
110            $main = $erec->page();
111    }
112    
113    $smarty->assign("MAIN", $main);
114    
115  $smarty->display("index.tpl");  $smarty->display("index.tpl");
116  ?>  ?>
   

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.26