<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mahasiswa extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->library('UnilaSecure');
		$this->load->model('MhsModel');
	}
	public function index()
	{
		echo 'Auth Controller';
	}

	public function token()
	{
		$jwt = new JWT();

		$JWTSecretKey = 'aplikasiSimponilaDummy';
		$data = array('userId' => 145, 'email' => 'ardiansyah@fmipa.unila.ac.id', 'userType' => 'admin');

		$token = $jwt->encode($data, $JWTSecretKey, 'HS256');
		echo $token;
	}

	public function get_mhs()
	{
		$npm = $this->input->post('npm');

		$result = $this->MhsModel->get_mhs($npm);

		echo json_encode($result);

	}


}
