Commit 523f401e authored by Deddy Vita Kurniawan's avatar Deddy Vita Kurniawan

* tampilan dashboard

parent 65adc9f3
......@@ -29,6 +29,7 @@ class Home extends Userpage_Controller
$data['jml_tidak'] = $this->home_model->jumlah_tidak();
$data['jml_belum'] = $this->home_model->jumlah_belum();
$data['jml_sesuai'] = $this->home_model->jumlah_sesuai();
$data['data'] = $this->home_model->perhitungan_data();
$data['title'] = get_title();
$data['main_content'] = 'v_home';
//$data['unit'] = $unit;
......
......@@ -225,6 +225,21 @@ if ( ! function_exists('format_rupiah'))
}
}
if ( ! function_exists('format_numeric'))
{
function format_numeric($value)
{
if($value < 0)
{
return '( '.number_format(abs($value), 0, ',', '.').' )';
}
else
{
return ' '.number_format($value, 0, ',', '.').' ';
}
}
}
if ( ! function_exists('prepare_numeric'))
{
function prepare_numeric($value, $default = null)
......
......@@ -141,4 +141,30 @@ class Home_model extends CI_Model
$jumlah = $this->db->get();
return $jumlah->num_rows();
}
function perhitungan_data()
{
$this->db->select("
count(a.id_surat) st_terbit,
count(if(b.kode = 'Ad',1,NULL)) audit,
count(if(b.kode = 'A',1,NULL)) pdtt,
count(if(b.kode = 'M',1,NULL)) monev,
count(if(b.kode = 'E',1,NULL)) evaluasi,
count(if(b.kode = 'F',1,NULL)) verifikasi,
count(if(b.kode = 'V',1,NULL)) review,
count(if(b.kode = 'D',1,NULL)) pendampingan,
count(if(b.kode = 'G',1,NULL)) penilaian,
count(if(b.kode = 'Mo',1,NULL)) monitoring,
count(if(b.kode = 'G',1,NULL)) penilaian,
count(if(b.kode = 'Y',1,NULL)) penyusunan,
count(if(b.kode = 'P',1,NULL)) persiapan,
count(if(b.kode = 'S',1,NULL)) pemeriksaan_mendadak,
count(if(b.kode = 'Kj',1,NULL)) kinerja
", FALSE);
$this->db->from('surat_penugasan a');
$this->db->join('ref_jns_pemeriksaan b','b.id_jns=a.id_jns_pemeriksaan','left');
$this->db->where('a.tahun', $this->tahun);
$result = $this->db->get()->row_array();
return $result;
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment