<?php namespace App\Modules\generic\Controllers;

//use App\Modules\Pages\Models\UserPagesModel;
use CodeIgniter\Controller;

class Generic extends MX_Controller{
  public $pdf_upload_url;
  public $mail_env;
  
	function __construct() {
    parent::__construct();  
    
    $this->pdf_upload_url = $_SERVER['DOCUMENT_ROOT'].'/';
		$this->mail_env = 'live';
	}

	/* 
  **    GET NAME
  */
  function getName($table, $id, $name){
    $result = $this->Mdl_generic->getByValues($table,array('id' => $id));
    if($result !== "No Data"){
      return  $result[0]->$name;
    }else{
      return "NA";
    }
  }
  
    function removeImage($url){
    unlink($url);
  }
}

