umkm-app/application/controllers/Dashboard.php

37 lines
931 B
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("ProdukModel");
$this->load->model("UmkmModel");
}
public function index()
{
$data['produk'] = $this->ProdukModel->getThree();
$data['jumlah_umkm'] = $this->UmkmModel->getUmkmCount();
$list_umkm = $this->UmkmModel->getUmkm();
$jumlah_karyawan=0;
foreach($list_umkm as $umkm){
$jumlah_karyawan = $jumlah_karyawan + $umkm->karyawan_l + $umkm->karyawan_p;
}
$data['jumlah_karyawan'] = $jumlah_karyawan;
$data['jumlah_produk'] = $this->ProdukModel->getProdukCount();
$data['umkm'] = $this->UmkmModel->getThree();
$data['user_logged'] = $this->session->userdata('user_logged');
$this->load->view('dashboard',$data);
}
}