--- careers.php 2001/03/06 09:02:05 1.7 +++ careers.php 2001/04/10 11:02:47 1.11 @@ -9,6 +9,8 @@ $section=str_replace(".php","",basename($PHP_SELF)); $smarty->assign("section",$section); +include("common.inc"); + $title="CAREERS"; if ($menu_item) $title.=" : $menu_item"; $lpic="careers"; $lext=".jpg"; @@ -19,6 +21,11 @@ $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 + 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(); @@ -26,8 +33,18 @@ $countries[]=$row; } $smarty->assign("countries",$countries); + + if ($position) { + $sql.=" and num=$position"; + $sth = $dbh->prepare($sql); + $sth->execute(); + if ($row=$sth->fetchrow_hash()) { + $smarty->assign("position",$row); + } + } } elseif ($part == "OpenPositions") { - $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"; + $sth = $dbh->prepare($sql); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $positions[]=$row; @@ -46,7 +63,7 @@ Country: $country e-mail: $email tel: $tel -Purpose: $purpose +Purpose: $purpose $open_position Interest: $intereset $other_what Comments: @@ -56,7 +73,8 @@ "; $smarty->assign("mail","You sent following e-mail:
$mail
"); include("class.CMailFile"); - $sendto="careercenter@pliva.hr"; +# $sendto="careercenter@pliva.hr"; + $sendto="dpavlin@pliva.hr"; $replyto="$first_name $last_name <$email>"; $mailfile = new CMailFile("application for submission",$sendto,$replyto,$mail,$resume); $mailfile->sendfile(); @@ -72,7 +90,6 @@ $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); -include("common.inc"); $smarty->assign("MAIN",$main); $smarty->assign("contact_url","careers.php?part=ContactUs");