<?php
/*
 * @package Sj JSJOB Filter
 * @version 1.0.0
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @copyright (c) 2016 YouTech Company. All Rights Reserved.
 * @author YouTech Company http://www.smartaddons.com
 *
 */
use Joomla\CMS\Factory;
// no direct access
defined('_JEXEC') or die('Restricted access');
$app  = Factory::getApplication();
$controller = 'job';
$task = $app->input->getWord('task');
$post   = JFactory::getApplication()->input->get('POST');

jimport('joomla.filesystem.file');
jimport('joomla.html.parameter');

if (JFile::exists(JPATH_COMPONENT.'/controllers/'.$controller.'.php')) {
	if( JFile::exists(JPATH_BASE.'/components/com_jsjobs/jsjobs.php')) {
		require_once (JPATH_COMPONENT.'/controllers/'.$controller.'.php');
		$classname = 'SJJsJobFilterController'.$controller;
		$controller = new $classname();
		$controller->execute($task);
		$controller->redirect();
		
	}else{
		$app = JFactory::getApplication();
		$app->redirect('index.php',JText::_('COMPONENT_NOT_FOUND'),'error');
		
	}
}
else {
	throw new Exception(JText::_('COMPONENT_NOT_FOUND'),404);
}

