<?php
defined('BASEPATH') or exit('Direct access is not allowed');
require_once ROOT . '/trainingportal/app/models/Applicationstatus/ApplicationstatusModel.php';//trainingportal
require_once LIBS_ROUTE .'Session.php';

/**
 * Automotive controller
 */
class ApplicationstatusController extends Controller
{
  /**
   * string 
   */
  public $nombre;
  private $session;
  /**
   * object 
   */
  public $model;

  /**
   * Inicializa valores 
   */
  public function __construct()
  {
    $this->model = new ApplicationstatusModel();
    $this->session = new Session();
  }

  /**
  * Método estándar
  */
  public function exec()
  {
    $this->show();
    
  }

  /**
  * Método de ejemplo
  */
  public function show()
  {
    //$params = array('nombre' => $this->nombre);
    $this->session->init();
    $segment_id= $this->session->get('segment_id');
    $applied_trainings = $this->model->get_applied_trainings($segment_id);
    $params = array('applied_trainings' => $applied_trainings,'email' => $this->session->get('email'),'user_name' => $this->session->get('user_name'),'role_id' => $this->session->get('role_id'),'emp_code' => $this->session->get('emp_code'),'segment_name' => $this->session->get('segment_name'),'rating' => $this->session->get('rating'),'designation' => $this->session->get('designation'),'enroll_courses' => $this->session->get('enroll_courses'),'profile_image_path' => $this->session->get('profile_image_path'));

    $this->render(__CLASS__,$params); 
  }

  /**
  * Método de ejemplo con model. Obtiene un usuario segun ID
  */
  public function usuario($param)
  {
    $res = $this->model->getUser($param);
    $this->nombre = $res['usuario_dev'];
    $this->show();
  }

  public function herfpage(){
    $this->render("MainController",$params); 
    //echo "MeThod";
  }

}