%PDF-1.4
Directory : /var/www/vhosts/lautnusantara.com/httpdocs/mis/app/Controllers/ |
<?php namespace App\Controllers; use App\Models\History_model; use App\Models\Artikel_Model; use App\Models\Video_Model; use App\Models\Produk_Model; use App\Models\Wa_Model; use App\Models\Artikel_category_Model; use App\Models\User_Model; use App\Models\list_artikel_Model; use App\Models\Dataclient_Model; class Home extends BaseController { protected $History; protected $session; protected $Artikel_Model; protected $Video_Model; protected $Product_Model; protected $Wa_Model; protected $Artikel_category_Model; protected $User_Model; protected $Dataclient_Model; public function __construct() { $this->History = new History_model(); $this->session = session(); $this->Artikel_Model = new Artikel_Model(); $this->Video_Model = new Video_Model(); $this->Product_Model = new Produk_Model(); $this->Wa_Model = new Wa_Model(); $this->Artikel_category_Model = new Artikel_category_Model(); $this->User_Model = new User_Model(); $this->Dataclient_Model = new Dataclient_Model(); } public function index() { $user_id = session()->get('user_id'); $username = session()->get('username'); $firstname = session()->get('firstname'); $lastname = session()->get('lastname'); // $this->History->save([ // 'user_id' => $user_id, // 'username' => $username, // 'name' => $firstname.' '.$lastname, // 'kegiatan' => 'Dashboard', // 'jenis_kegiatan' => 'Login/Dashboard', // 'tanggal_waktu' => date('Y-m-d H:i:s') // ]); // $this->data_dashboard = new DashboardModel(); $thn = date('Y'); $bln = date('m'); $date = date_create(); date_add($date, date_interval_create_from_date_string("-1 days")); $kemarin = date_format($date, "Y-m-d"); $data = array( 'title' => 'MCS - Manajemen Compro System', 'description' => 'Aplikasi MCS - Manajemen Compro System', 'keywords' => 'MCS, Manajemen, Compro', 'author' => 'SSN', 'parent_id_menu' => '0', 'parent_id_submenu' => '', 'id_menu' => '7', 'page1' => 'Dashboard', 'page2' => '', 'link01' => base_url(), 'new_artikel' => $this->Artikel_Model->get_artikel(false, false, 4)->get()->getResult(), 'unik_user' => $this->Dataclient_Model->get_user_bln($thn, $bln), 'data_browser' => $this->Dataclient_Model->get_data_browser($thn, $bln)->getResult(), 'data_online' => $this->Dataclient_Model->get_data_online($thn, $bln)->getResult(), 'jml_artikel_bln' => $this->Artikel_Model->get_artikel_perbulan($thn, $bln), 'jml_artikel_thn' => $this->Artikel_Model->get_artikel_pertahun($thn), 'online_user' => $this->Dataclient_Model->get_user_online()->getResult(), 'jml_view_bln' => $this->Artikel_Model->get_view_perbulan($thn, $bln)->getResult(), 'jml_view_thn' => $this->Artikel_Model->get_view_pertahun($thn)->getResult(), 'wa_hits' => $this->Wa_Model->get_user_wa_pertahun()->getResultArray(), 'wa_hits_jml' => $this->Wa_Model->get_user_wa_pertahun_jml()->getResult(), 'wa_hits_jml_kemarin' => $this->Wa_Model->get_user_wa_pertahun_hari($kemarin)->getResult(), 'wa_hits_jml_hari' => $this->Wa_Model->get_user_wa_pertahun_hari()->getResult(), 'wa_hits_jml_bln' => $this->Wa_Model->get_user_wa_pertahun_bulan()->getResult(), 'jml_view_video_bln' => $this->Video_Model->get_view_perbulan($thn, $bln)->getResult(), 'jml_view_video_thn' => $this->Video_Model->get_view_pertahun($thn)->getResult(), 'jml_view_produk_bln' => $this->Product_Model->get_view_perbulan($thn, $bln)->getResult(), 'jml_view_produk_thn' => $this->Product_Model->get_view_pertahun($thn)->getResult(), // 'data_member' => $this->data_dashboard->getjmlMember(), // 'data_customer' => $this->data_dashboard->getjmlCustomer(), // 'data_order' => $this->data_dashboard->getjmlOrder(), // 'data_jual' => $this->data_dashboard->getjmlJual(), // 'popular_product' => $this->data_dashboard->popular_product(), // 'invoice_terbaru' => $this->data_dashboard->invoice_terbaru(), 'componen' => 'theme/BeyondAdmin/halaman/dashboard' ); echo view('layout', $data); } } ?>