TIF_E41201448/application/controllers/Welcome.php

66 lines
1.8 KiB
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Welcome extends CI_Controller
{
public function __construct()
{
parent::__construct();
date_default_timezone_set('Asia/Jakarta');
$this->load->helper('url');
$this->load->helper('vic_helper');
$this->load->helper('my_helper');
$this->load->helper('vic_convert_helper');
$this->load->model('m_vic');
$this->load->library(array('excel', 'session'));
}
public function index()
{
$data['title'] = "Beranda";
$this->load->view('welcome/home.php', $data);
}
public function tentang()
{
$data['title'] = "Tentang";
$this->load->view('welcome/tentang.php', $data);
}
public function Peta()
{
$tahunt2 = "SELECT DISTINCT(tahun) as th from predikat";
$ta22 = $this->db->query($tahunt2);
foreach ($ta22->result_array() as $tess2) {
$tahunnya2 = $tess2['th'];
}
$_thh = $_GET['tahun'];
if ($_thh == '') {
$t = $tahunnya2;
} else {
$t = $_thh;
}
if ($t == 1) {
$tahun = '';
} else {
$tahun = "AND predikat.tahun='$t'";
}
$data['kriteria'] = $this->m_vic->get_data('kriteria');
$data['alternatif'] = $this->m_vic->selectal($tahun);
$data = array(
'tinggi' => $this->m_vic->selecttinggi($tahun),
'sedang' => $this->m_vic->selectsedang($tahun),
'rendah' => $this->m_vic->selectrendah($tahun),
'tes' => $this->m_vic->get_data('tes'),
);
$data['user'] = $this->m_vic->get_data('admin');
$data['hit'] = $this->m_vic->selectcount('alternatif');
$data['title'] = "Peta";
$this->load->view('welcome/peta.php', $data);
}
}