--- careers.php 2001/02/19 16:22:20 1.1.1.1 +++ careers.php 2002/04/11 12:56:40 1.17 @@ -1,35 +1,119 @@ upload_dir = "/data/erec"; + + //ini_restore("include_path"); // no work? + ini_set("include_path",$old_inc); +} else { + require("Smarty.class.php"); +} + require("conn.inc"); $smarty = new Smarty; $smarty->assign( array ( Title=>"Pliva d.d." ) ); -$section=str_replace(".php","",basename($PHP_SELF)); -$smarty->assign("section",$section); +include("section.inc"); + +include("common.inc"); -$title="CAREERS"; -$lpic="careers"; $lext=".jpg"; -$mpic="careers.gif"; $main_file="./html/Careers-"; if (file_exists($main_file.$part.".htm")) { $main_file.=$part.".htm"; $main=join('',file($main_file)); +} elseif (file_exists("./templates/Careers-".$part.".tpl")) { + + if ($part == "Mail" && !check_required()) $part="ApplicationForm"; + + $sql="select num,title,job_code,department,open_position_locations.location as location,description,edu_req,qual_req,open_position_locations.email as sendto + from open_positions,open_position_locations + where open_positions.location_id=open_position_locations.id and $visible_is_true"; + if ($part == "ApplicationForm") { + $sth = $dbh->prepare("select iso,name from countries order by name"); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $countries[]=$row; + } + $smarty->assign("countries",$countries); + + if ($position) { + $sql.=" and num=$position"; + $sth = $dbh->prepare($sql); + $sth->execute(); + if ($row=$sth->fetchrow_hash()) { + include("rot13.inc"); + $row[sendto]=rot13($row[sendto]); + $smarty->assign("position",$row); + } + } + } elseif ($part == "OpenPositions") { + $sql.=" and expiration >= date('now') order by num asc"; + $sth = $dbh->prepare($sql); + $sth->execute(); + while ($row=$sth->fetchrow_hash()) { + $positions[]=$row; + } + $smarty->assign("positions",$positions); + } elseif ($part == "Mail") { + +$mail=" +First name: $first_name +Last name: $last_name +Address: $address1 + $address2 +City: $city +State: $state +ZIP: $zip +Country: $country +e-mail: $email +tel: $tel +Purpose: $purpose $open_position +Interest: $intereset + $other_what +Comments: +$comments + +Resume: $resume_name ($resume_size bytes) +"; + $smarty->assign("mail","You sent following e-mail:
$mail
"); + include("class.CMailFile"); + if (!isset($sendto) || !strstr($sendto,"@")) { + $sendto="careercenter@pliva.hr"; + } else { + include("rot13.inc"); + $sendto=rot13($sendto); + } + $replyto="$first_name $last_name <$email>"; + $mailfile = new CMailFile("Application for $open_position",$sendto,$replyto,$mail,$resume); + $mailfile->sendfile(); + @unlink($resume); + } + + $main=$smarty->fetch("Careers-".$part.".tpl"); +} elseif ($part == "erec") { + $main=$erec->page(); } else { $main_file.="Main.htm"; $main=join('',file($main_file)); } - $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); -include("common.inc"); $smarty->assign("MAIN",$main); -$smarty->assign("debug",$PHP_SELF." -- ".basename($PHP_SELF)); - $smarty->assign("contact_url","careers.php?part=ContactUs"); $smarty->display("index.tpl"); ?> +