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

class Dashboard extends CI_Controller {
	function __construct() {
		parent::__construct();
		
	}
	
	public function index() {
		$a['versi'] = '3.4';
		$cek = $this->db->query("SELECT * FROM tb_kelurahan_komdanas LIMIT 1");
		   	foreach ($cek->result_array() as $row){
			$eselon		= $row['satker_code'];
				
				}
			if (empty($eselon)){
				$this->session->set_flashdata("k", "<div class=\"alert alert-warning\" id=\"alert\">Ups, Silahkan cek radius untuk tarik data komdanas.</div>");
				$this->load->view('admin/webpanjar_radius_nihil');
			}else{
				$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data Komdanas tersedia,sebaiknya sering update tarik data komdanas pada menu pengaturan -->cek komdanas</div>");
				$this->load->view('admin/webpanjar', $a);
			}
	}
	function bersihkan() {
		$this->db->query("DELETE FROM temp_panjar");
		$this->db->query("DELETE FROM temp_pos");
		$this->load->view('admin/webpanjar');
	}
	
}
