// Value of 'company' is stored in .htaccess
// on site build from data in company_list table
// in api_templating database
$company_name = urlencode($_SERVER['company']);
if($company_name == "APi+National+Service+Group"){
//Fetch Partners Array from Intranet
ob_start();
include("/var/www/html/www/companies/nsg/partners.array.php");
//Attach to $partners and turn into usable Array
$partners = unserialize(ob_get_contents());
ob_end_clean();
//Load Company Names and Locations array from Intranet
//$company_names = Companies
//$branches = Company Branches
ob_start();
include("/var/www/html/www/include/core/company.array.php");
$company_names = unserialize(ob_get_contents());
ob_end_clean();
if (!empty($partners)){
foreach($partners as $id => $selected){
$detail .= "`co` = \"".$company_names[$id]."\"";
$count++;
if($count < count($partners)) {
$detail .= " OR ";
} else {
unset($count);
}
}
}
} else {
$detail = "`co` = \"".$company_name."\"";
}
/*$page_title = "Career Opportunities - API Supply, Inc.";
$page_js = "";
$page_body_var = "

API Supply Provides Scissor Lifts, Boom Lifts and other Aerial Lifts
624 Arthur Street NE
Minneapolis, Minnesota 55413
Phone: (612) 379 8000 - Fax: (612) 379 8038
";
include("header.php");
*/
#Content goes below
echo "
";
include("/var/www/html/www/dbconn.inc.php");
$conn = connectdb("recruiting");
$sql = "SELECT * FROM `jobs` WHERE `approved` = 'Yes' AND (".$detail.") ORDER BY `job` ASC, `co` ASC;";
//echo $sql;
$sql_result = mysql_query($sql, $conn) or die("There are no jobs at this time")/* die("QueryFailed")*/;
while ($row = mysql_fetch_array($sql_result)) {
$job_list[$row["loc"]][] = $row;
}
if ($company_name == "APi+National+Service+Group"){
ksort($job_list);
foreach ($job_list as $key=>$location){
foreach ($location as $row){
$job = $row["job"];
$nsg_job .= '
';
$nsg_job .= ''.$row["job"].'';
$nsg_job .= ' « ';
$nsg_job .= ''.$row["co"].'';
$nsg_job .= ' - ';
$nsg_job .= 'Details';
$nsg_job .= '';
}
$ul_filler .= '
'.$key.'';
$ul_filler .= '
';
unset($nsg_job);
}
}
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["id"];
$nsg_job = '
'.$row["job"].'';
$nsg_job .= '
« ';
$nsg_job .= '
'.$row["co"].'';
$job = $row["job"];
$ul_filler .= '
'.$job.' - ';
$ul_filler .= 'Details';
$ul_filler .= '';
}
if ($job == "") {
$ul_filler = "There are no job openings at this time.";
}
mysql_free_result($sql_result);
$href = htmlspecialchars('http://www.apigroupinc.com/application.php?co='.$company_name);
$title = ( isset($_GET['title']) && $_GET['title']=='false' ) ? '' : '
Job Listings:' ;
if ($company_name == "APi+National+Service+Group"){
?>
} else {
?>
}
?>