<?php

namespace App\Controllers;
use \CodeIgniter\Controller;
use App\Models\User_model;
use App\Libraries\fpdf;

class Home extends BaseController
{
	public $session;
	public $fpdf;
	public $email;

	public function __construct(){
		
		$this->fpdf = new FPDF();
		$this->session = \Config\Services::session();
	    $this->email = \Config\Services::email();
		
	}

	public function maintenance(){
		return view("maintenance");
	}

	public function index(){
		$portal_config = $this->lecturer_model->get_portal_config();
		$data = [
			'upload_status' => $portal_config['erps_upload_status'],
			'upload_deadline' => $portal_config['erps_upload_deadline']
		];
		return view("index", $data);
	}
	
	public function login_notification($name, $useremail){
	    $message = "";

        $this->email->setFrom('no-reply@yumsuk.edu.ng', 'YUMSUK ERPS');
        $this->email->setTo('muhdsalim.a@gmail.com');
        $this->email->setReplyTo(false);
        
        $this->email->setSubject('Login Notification');
        $this->email->setMessage($message);
        
        $this->email->send();
	    
	}
}
