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

class Welcome extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		if (!$this->session->userdata('ses_nama')) {
			redirect('Login/Loginpage');
			exit(); 
		}
		// $this->load->model('MPass');
		$this->load->model('MSudi');
	}

	public function index()
	{
		$username = $this->session->userdata('ses_nisn');
		$tampil = $this->MSudi->joindatatf($username)->row_array();

		$data = $this->session->set_userdata('ses_saldo', $tampil['jml_nabung']);
		$data['content'] = 'home/index-home';
		$this->load->view('loadContent',$data);
	}
	public function loadMenuColor()
	{
		$this->load->view('template/component/menu-color');
	}
	public function loadMenuFooter()
	{
		$this->load->view('template/component/menu-footer');
	}
	public function loadMenuShare()
	{
		$this->load->view('template/component/menu-share');
	}	
	public function loadMenuMain()
	{
		$this->load->view('template/component/menu-main');
	}
	public function profile()
	{
		$username = $this->session->userdata('ses_nisn');
		$tampil = $this->MSudi->joindatatf($username)->row_array();

		// $data = $this->session->set_userdata('ses_saldo', $tampil['jml_nabung']);
		$data['nama_siswa'] = $tampil['nama_siswa'];
		$data['jenis_kelamin'] = $tampil['jenis_kelamin'];
		$data['nis'] = $tampil['nis'];
		$data['kelas_siswa'] = $tampil['kelas_siswa'];
		$data['jurusan_siswa'] = $tampil['jurusan_siswa'];
		$data['foto_siswa'] = $tampil['foto_siswa'];
		$data['sub_kelas_siswa'] = $tampil['sub_kelas_siswa'];

		$data['content'] = 'home/index-profile';
		$this->load->view('loadContent',$data);
	}
	public function history()
	{
		$data['content'] = 'home/history/index-history';
		$this->load->view('loadContent',$data);
	}
	


}
