header("Location: ../../login.php"); exit; } if (!defined('ROOT_PATH')) { define("ROOT_PATH", $_SESSION['path']); } require_once ROOT_PATH . '/lib/models/hrfunct/EmpPhoto.php'; require_once ROOT_PATH . '/lib/extractor/hrfunct/EXTRACTOR_EmpPhoto.php'; require_once ROOT_PATH . '/lib/common/Language.php'; require_once ROOT_PATH . '/lib/common/CommonFunctions.php'; require_once ROOT_PATH . '/language/default/lang_default_full.php'; $lan = new Language(); require_once $lan->getLangPath("full.php"); $photo = new EmpPicture(); $employeeId = $_GET['id']; $edit = $photo->filterEmpPic($employeeId); $styleSheet = CommonFunctions::getTheme(); if (isset($_GET['action']) && $_GET['action'] == 'VIEW') { if ($edit) { header("Content-length: " . $edit[0][4]); header("Content-type: " . $edit[0][3]); echo $edit[0][1]; exit; } else { // TODO: Use the current theme instead of hard-coded 'beyondT'; Use the $styleSheet variable $tmpName = ROOT_PATH . '/themes/beyondT/pictures/default_employee_image.gif'; $fp = fopen($tmpName, 'r'); $contents = fread($fp, filesize($tmpName)); fclose($fp); header("Content-type: image/gif"); echo $contents;
*/ session_start(); if (!isset($_SESSION['fname'])) { header("Location: ../../login.php"); exit; } define("ROOT_PATH", $_SESSION['path']); require_once ROOT_PATH . '/lib/models/hrfunct/EmpPhoto.php'; require_once ROOT_PATH . '/lib/extractor/hrfunct/EXTRACTOR_EmpPhoto.php'; require_once ROOT_PATH . '/lib/common/Language.php'; require_once ROOT_PATH . '/lib/common/CommonFunctions.php'; require_once ROOT_PATH . '/language/default/lang_default_full.php'; $lan = new Language(); require_once $lan->getLangPath("full.php"); $photo = new EmpPicture(); $edit = $photo->filterEmpPic($_GET['id']); if (isset($_GET['action']) && $_GET['action'] == 'VIEW') { if ($edit) { header("Content-length: " . $edit[0][4]); header("Content-type: " . $edit[0][3]); echo $edit[0][1]; exit; } else { $tmpName = ROOT_PATH . '/themes/beyondT/pictures/default_employee_image.gif'; $fp = fopen($tmpName, 'r'); $contents = fread($fp, filesize($tmpName)); fclose($fp); header("Content-type: image/gif"); echo $contents; exit; }