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 |
include("section.inc"); |
10 |
|
11 |
include("common.inc"); |
12 |
|
13 |
$main_file="./html/Careers-"; |
14 |
if (file_exists($main_file.$part.".htm")) { |
15 |
$main_file.=$part.".htm"; |
16 |
$main=join('',file($main_file)); |
17 |
} elseif (file_exists("./templates/Careers-".$part.".tpl")) { |
18 |
|
19 |
if ($part == "Mail" && !check_required()) $part="ApplicationForm"; |
20 |
|
21 |
$sql="select num,title,job_code,department,open_position_locations.location as location,description,edu_req,qual_req,open_position_locations.email as sendto |
22 |
from open_positions,open_position_locations |
23 |
where open_positions.location_id=open_position_locations.id and $visible_is_true"; |
24 |
if ($part == "ApplicationForm") { |
25 |
$sth = $dbh->prepare("select iso,name from countries order by name"); |
26 |
$sth->execute(); |
27 |
while ($row=$sth->fetchrow_hash()) { |
28 |
$countries[]=$row; |
29 |
} |
30 |
$smarty->assign("countries",$countries); |
31 |
|
32 |
if ($position) { |
33 |
$sql.=" and num=$position"; |
34 |
$sth = $dbh->prepare($sql); |
35 |
$sth->execute(); |
36 |
if ($row=$sth->fetchrow_hash()) { |
37 |
include("rot13.inc"); |
38 |
$row[sendto]=rot13($row[sendto]); |
39 |
$smarty->assign("position",$row); |
40 |
} |
41 |
} |
42 |
} elseif ($part == "OpenPositions") { |
43 |
$sql.=" and expiration >= date('now') order by num asc"; |
44 |
$sth = $dbh->prepare($sql); |
45 |
$sth->execute(); |
46 |
while ($row=$sth->fetchrow_hash()) { |
47 |
$positions[]=$row; |
48 |
} |
49 |
$smarty->assign("positions",$positions); |
50 |
} elseif ($part == "Mail") { |
51 |
|
52 |
$mail=" |
53 |
First name: $first_name |
54 |
Last name: $last_name |
55 |
Address: $address1 |
56 |
$address2 |
57 |
City: $city |
58 |
State: $state |
59 |
ZIP: $zip |
60 |
Country: $country |
61 |
e-mail: $email |
62 |
tel: $tel |
63 |
Purpose: $purpose $open_position |
64 |
Interest: $intereset |
65 |
$other_what |
66 |
Comments: |
67 |
$comments |
68 |
|
69 |
Resume: $resume_name ($resume_size bytes) |
70 |
"; |
71 |
$smarty->assign("mail","You sent following e-mail:<br><pre>$mail</pre>"); |
72 |
include("class.CMailFile"); |
73 |
if (!isset($sendto) || !strstr($sendto,"@")) { |
74 |
$sendto="careercenter@pliva.hr"; |
75 |
} else { |
76 |
include("rot13.inc"); |
77 |
$sendto=rot13($sendto); |
78 |
} |
79 |
$replyto="$first_name $last_name <$email>"; |
80 |
$mailfile = new CMailFile("Application for $open_position",$sendto,$replyto,$mail,$resume); |
81 |
$mailfile->sendfile(); |
82 |
@unlink($resume); |
83 |
} |
84 |
|
85 |
$main=$smarty->fetch("Careers-".$part.".tpl"); |
86 |
} else { |
87 |
$main_file.="Main.htm"; |
88 |
$main=join('',file($main_file)); |
89 |
} |
90 |
|
91 |
|
92 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
93 |
|
94 |
$smarty->assign("MAIN",$main); |
95 |
|
96 |
$smarty->assign("contact_url","careers.php?part=ContactUs"); |
97 |
|
98 |
$smarty->display("index.tpl"); |
99 |
?> |
100 |
|