Public landing page done

master
Hafidz Fachrisyah Widyarix 2021-09-21 15:19:35 +07:00
parent ef7a10356f
commit 5e94f90ac1
17 changed files with 3385 additions and 239 deletions

View File

@ -0,0 +1,219 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Bulanan extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("LaporanModel");
$this->load->model("KategoriModel");
$this->load->model("JenisModel");
}
public function index()
{
//cek ada laporan tahunan atau tidak
$countlaporan = $this->LaporanModel->getLaporanCount();
if($countlaporan>0){
$year = $this->LaporanModel->getLastYearLaporan()->tahun;
//cek ada laporan bulanan atau tidak
$countlaporanbulan = $this->LaporanModel->getLaporanCountByYear($year);
if($countlaporanbulan>0){
$data['tahun'] = $year;
if($this->input->post()){
$post = $this->input->post();
$month = $post['bulan'];
} else {
$month = $this->LaporanModel->getLastMonthLaporan($year)->bulan;
}
$data['bulan'] = $month;
$omset_jen1=0;
$omset_jen2=0;
$omset_jen3=0;
$umkm_jen1=0;
$umkm_jen2=0;
$umkm_jen3=0;
$umkm_jen1_ket1=0;
$umkm_jen1_ket2=0;
$umkm_jen1_ket3=0;
$umkm_jen2_ket1=0;
$umkm_jen2_ket2=0;
$umkm_jen2_ket3=0;
$umkm_jen3_ket1=0;
$umkm_jen3_ket2=0;
$umkm_jen3_ket3=0;
$aset_jen1=0;
$aset_jen2=0;
$aset_jen3=0;
$naker_jen1_l=0;
$naker_jen1_p=0;
$naker_jen2_l=0;
$naker_jen2_p=0;
$naker_jen3_l=0;
$naker_jen3_p=0;
$lap_kelurahan = $this->LaporanModel->getKelurahanByBulanAndYear($month,$year);
foreach($lap_kelurahan as $kelurahan){
$laporan = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($month,$year,$kelurahan->kelurahan);
$umkm_jen1= $umkm_jen1+$laporan->umkm_jen1_kat1+$laporan->umkm_jen1_kat2+$laporan->umkm_jen1_kat3;
$umkm_jen2= $umkm_jen2+$laporan->umkm_jen2_kat1+$laporan->umkm_jen2_kat2+$laporan->umkm_jen2_kat3;
$umkm_jen3= $umkm_jen3+$laporan->umkm_jen3_kat1+$laporan->umkm_jen3_kat2+$laporan->umkm_jen3_kat3;
$omset_jen1= $omset_jen1+$laporan->omset_jenis1;
$omset_jen2= $omset_jen2+$laporan->omset_jenis2;
$omset_jen3= $omset_jen3+$laporan->omset_jenis3;
$aset_jen1= $aset_jen1+$laporan->aset_jenis1;
$aset_jen2= $aset_jen2+$laporan->aset_jenis2;
$aset_jen3= $aset_jen3+$laporan->aset_jenis3;
$naker_jen1_l = $naker_jen1_l + $laporan->karyawan_jen1_l;
$naker_jen1_p = $naker_jen1_p + $laporan->karyawan_jen1_p;
$naker_jen2_l = $naker_jen2_l + $laporan->karyawan_jen2_l;
$naker_jen2_p = $naker_jen2_p + $laporan->karyawan_jen2_p;
$naker_jen3_l = $naker_jen3_l + $laporan->karyawan_jen3_l;
$naker_jen3_p = $naker_jen3_p + $laporan->karyawan_jen3_p;
$umkm_jen1_ket1=$umkm_jen1_ket1+$laporan->umkm_jen1_kat1;
$umkm_jen1_ket2=$umkm_jen1_ket2+$laporan->umkm_jen1_kat2;
$umkm_jen1_ket3=$umkm_jen1_ket3+$laporan->umkm_jen1_kat3;
$umkm_jen2_ket1=$umkm_jen2_ket1+$laporan->umkm_jen2_kat1;
$umkm_jen2_ket2=$umkm_jen2_ket2+$laporan->umkm_jen2_kat2;
$umkm_jen2_ket3=$umkm_jen2_ket3+$laporan->umkm_jen2_kat3;
$umkm_jen3_ket1=$umkm_jen3_ket1+$laporan->umkm_jen3_kat1;
$umkm_jen3_ket2=$umkm_jen3_ket2+$laporan->umkm_jen3_kat2;
$umkm_jen3_ket3=$umkm_jen3_ket3+$laporan->umkm_jen3_kat3;
}
$data['umkm_jen1_ket1']=$umkm_jen1_ket1;
$data['umkm_jen1_ket2']=$umkm_jen1_ket2;
$data['umkm_jen1_ket3']=$umkm_jen1_ket3;
$data['umkm_jen2_ket1']=$umkm_jen2_ket1;
$data['umkm_jen2_ket2']=$umkm_jen2_ket2;
$data['umkm_jen2_ket3']=$umkm_jen2_ket3;
$data['umkm_jen3_ket1']=$umkm_jen3_ket1;
$data['umkm_jen3_ket2']=$umkm_jen3_ket2;
$data['umkm_jen3_ket3']=$umkm_jen3_ket3;
$omset_bln_jen1= $omset_jen1;
$omset_bln_jen2= $omset_jen2;
$omset_bln_jen3= $omset_jen3;
$data['umkm_jen1']=$umkm_jen1;
$data['umkm_jen2']=$umkm_jen2;
$data['umkm_jen3']=$umkm_jen3;
$data['omset_bln_jen1'] = $omset_bln_jen1;
$data['omset_bln_jen2'] = $omset_bln_jen2;
$data['omset_bln_jen3'] = $omset_bln_jen3;
$data['aset_jen1'] = $aset_jen1;
$data['aset_jen2'] = $aset_jen2;
$data['aset_jen3'] = $aset_jen3;
$data['naker_jen1_l'] = $naker_jen1_l;
$data['naker_jen1_p'] = $naker_jen1_p;
$data['naker_jen2_l'] = $naker_jen2_l;
$data['naker_jen2_p'] = $naker_jen2_p;
$data['naker_jen3_l'] = $naker_jen3_l;
$data['naker_jen3_p'] = $naker_jen3_p;
//komulatif
$data['omset_1'] = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
$data['aset_1'] = $aset_jen1+$aset_jen2+$aset_jen3;
$data['umkm_1'] = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$naker_1 = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$data['naker_1'] = $naker_1+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$data['mikro_1'] = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$data['kecil_1'] = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$data['menengah_1'] = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
$data['msg'] = 'found';
}
} else {
$data['msg'] = 'empty';
}
$data['user_logged'] = $this->session->userdata('user_logged');
$bulanlist = array(
array(
'bulan'=>'1',
'text'=>'Januari'
),
array(
'bulan'=>'2',
'text'=>'Februari'
),
array(
'bulan'=>'3',
'text'=>'Maret'
),
array(
'bulan'=>'4',
'text'=>'April'
),
array(
'bulan'=>'5',
'text'=>'Mei'
),
array(
'bulan'=>'6',
'text'=>'Juni'
),
array(
'bulan'=>'7',
'text'=>'Juli'
),
array(
'bulan'=>'8',
'text'=>'Agustus'
),
array(
'bulan'=>'9',
'text'=>'September'
),
array(
'bulan'=>'10',
'text'=>'Oktober'
),
array(
'bulan'=>'11',
'text'=>'November'
),
array(
'bulan'=>'12',
'text'=>'Desember'
)
);
$data['bulan_list']= $bulanlist;
$this->load->view('bulanan',$data);
}
}

View File

@ -16,6 +16,16 @@ class Dashboard extends CI_Controller {
{
$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);

View File

@ -0,0 +1,249 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Kecamatan extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("LaporanModel");
$this->load->model("KategoriModel");
$this->load->model("JenisModel");
}
public function index()
{
if($this->input->post()){
$post = $this->input->post();
$kecamatan = $post['kecamatan'];
} else {
$kecamatan = 'Magelang Selatan';
}
//cek ada laporan atau tidak
$countlaporan = $this->LaporanModel->getLaporanCount();
if($countlaporan>0){
$year = $this->LaporanModel->getLastYearLaporan()->tahun;
} else {
redirect(site_url('admin/laporan'));die();
}
//cek ada laporan kecamatan atau tidak
$countlaporankec = $this->LaporanModel->getCountByTahunByKecamatan($year,$kecamatan);
if($countlaporankec>0){
$data['msg'] = 'found';
$listkel = $this->LaporanModel->getKelurahanByTahunAndKecamatan($year,$kecamatan);
foreach($listkel as $kel){
$listlapkel = $this->LaporanModel->getLaporanByTahunAndKelurahan($year,$kel->kelurahan);
$lap[$kel->kelurahan]['kelurahan']='';
$lap[$kel->kelurahan]['aset']=0;
$lap[$kel->kelurahan]['omset']=0;
$lap[$kel->kelurahan]['karyawan_jenis1']=0;
$lap[$kel->kelurahan]['karyawan_jenis2']=0;
$lap[$kel->kelurahan]['karyawan_jenis3']=0;
$lap[$kel->kelurahan]['omset_jenis1']=0;
$lap[$kel->kelurahan]['omset_jenis2']=0;
$lap[$kel->kelurahan]['omset_jenis3']=0;
$lap[$kel->kelurahan]['aset_jenis1']=0;
$lap[$kel->kelurahan]['aset_jenis2']=0;
$lap[$kel->kelurahan]['aset_jenis3']=0;
$lap[$kel->kelurahan]['karyawan_jen1_l']=0;
$lap[$kel->kelurahan]['karyawan_jen2_l']=0;
$lap[$kel->kelurahan]['karyawan_jen3_l']=0;
$lap[$kel->kelurahan]['karyawan_jen1_p']=0;
$lap[$kel->kelurahan]['karyawan_jen2_p']=0;
$lap[$kel->kelurahan]['karyawan_jen3_p']=0;
$lap[$kel->kelurahan]['umkm_jen1_kat1']=0;
$lap[$kel->kelurahan]['umkm_jen1_kat2']=0;
$lap[$kel->kelurahan]['umkm_jen1_kat3']=0;
$lap[$kel->kelurahan]['umkm_jen2_kat1']=0;
$lap[$kel->kelurahan]['umkm_jen2_kat2']=0;
$lap[$kel->kelurahan]['umkm_jen2_kat3']=0;
$lap[$kel->kelurahan]['umkm_jen3_kat1']=0;
$lap[$kel->kelurahan]['umkm_jen3_kat2']=0;
$lap[$kel->kelurahan]['umkm_jen3_kat3']=0;
foreach($listlapkel as $lapkel){
$lap[$kel->kelurahan]['kelurahan']=$lapkel->kelurahan;
$lap[$lapkel->kelurahan]['aset']=$lapkel->aset;
$lap[$lapkel->kelurahan]['omset']=$lap[$lapkel->kelurahan]['omset']+$lapkel->omset;
$lap[$lapkel->kelurahan]['karyawan_jenis1']=$lapkel->karyawan_jenis1;
$lap[$lapkel->kelurahan]['karyawan_jenis2']=$lapkel->karyawan_jenis2;
$lap[$lapkel->kelurahan]['karyawan_jenis3']=$lapkel->karyawan_jenis3;
$lap[$lapkel->kelurahan]['omset_jenis1']=$lap[$lapkel->kelurahan]['omset_jenis1']+$lapkel->omset_jenis1;
$lap[$lapkel->kelurahan]['omset_jenis2']=$lap[$lapkel->kelurahan]['omset_jenis2']+$lapkel->omset_jenis2;
$lap[$lapkel->kelurahan]['omset_jenis3']=$lap[$lapkel->kelurahan]['omset_jenis3']+$lapkel->omset_jenis3;
$lap[$lapkel->kelurahan]['aset_jenis1']=$lapkel->aset_jenis1;
$lap[$lapkel->kelurahan]['aset_jenis2']=$lapkel->aset_jenis2;
$lap[$lapkel->kelurahan]['aset_jenis3']=$lapkel->aset_jenis3;
$lap[$lapkel->kelurahan]['karyawan_jen1_l']=$lapkel->karyawan_jen1_l;
$lap[$lapkel->kelurahan]['karyawan_jen2_l']=$lapkel->karyawan_jen2_l;
$lap[$lapkel->kelurahan]['karyawan_jen3_l']=$lapkel->karyawan_jen3_l;
$lap[$lapkel->kelurahan]['karyawan_jen1_p']=$lapkel->karyawan_jen1_p;
$lap[$lapkel->kelurahan]['karyawan_jen2_p']=$lapkel->karyawan_jen2_p;
$lap[$lapkel->kelurahan]['karyawan_jen3_p']=$lapkel->karyawan_jen3_p;
$lap[$lapkel->kelurahan]['umkm_jen1_kat1']=$lapkel->umkm_jen1_kat1;
$lap[$lapkel->kelurahan]['umkm_jen1_kat2']=$lapkel->umkm_jen1_kat2;
$lap[$lapkel->kelurahan]['umkm_jen1_kat3']=$lapkel->umkm_jen1_kat3;
$lap[$lapkel->kelurahan]['umkm_jen2_kat1']=$lapkel->umkm_jen2_kat1;
$lap[$lapkel->kelurahan]['umkm_jen2_kat2']=$lapkel->umkm_jen2_kat2;
$lap[$lapkel->kelurahan]['umkm_jen2_kat3']=$lapkel->umkm_jen2_kat3;
$lap[$lapkel->kelurahan]['umkm_jen3_kat1']=$lapkel->umkm_jen3_kat1;
$lap[$lapkel->kelurahan]['umkm_jen3_kat2']=$lapkel->umkm_jen3_kat2;
$lap[$lapkel->kelurahan]['umkm_jen3_kat3']=$lapkel->umkm_jen3_kat3;
if($lapkel->bulan==12){
$lap[$lapkel->kelurahan]['omset'] = $lap[$lapkel->kelurahan]['omset']/12;
$lap[$lapkel->kelurahan]['omset_jenis1'] = $lap[$lapkel->kelurahan]['omset_jenis1']/12;
$lap[$lapkel->kelurahan]['omset_jenis2'] = $lap[$lapkel->kelurahan]['omset_jenis2']/12;
$lap[$lapkel->kelurahan]['omset_jenis3'] = $lap[$lapkel->kelurahan]['omset_jenis3']/12;
$lap[$lapkel->kelurahan]['umkm_jenis1'] = $lap[$lapkel->kelurahan]['umkm_jen1_kat1']+$lap[$lapkel->kelurahan]['umkm_jen1_kat2']+$lap[$lapkel->kelurahan]['umkm_jen1_kat3'];
$lap[$lapkel->kelurahan]['umkm_jenis2'] = $lap[$lapkel->kelurahan]['umkm_jen2_kat1']+$lap[$lapkel->kelurahan]['umkm_jen2_kat2']+$lap[$lapkel->kelurahan]['umkm_jen2_kat3'];
$lap[$lapkel->kelurahan]['umkm_jenis3'] = $lap[$lapkel->kelurahan]['umkm_jen3_kat1']+$lap[$lapkel->kelurahan]['umkm_jen3_kat2']+$lap[$lapkel->kelurahan]['umkm_jen3_kat3'];
}
}
}
$aset=0;
$omset=0;
$karyawan_jenis1=0;
$karyawan_jenis2=0;
$karyawan_jenis3=0;
$omset_jenis1=0;
$omset_jenis2=0;
$omset_jenis3=0;
$aset_jenis1=0;
$aset_jenis2=0;
$aset_jenis3=0;
$karyawan_jen1_l=0;
$karyawan_jen2_l=0;
$karyawan_jen3_l=0;
$karyawan_jen1_p=0;
$karyawan_jen2_p=0;
$karyawan_jen3_p=0;
$umkm_jen1_kat1=0;
$umkm_jen1_kat2=0;
$umkm_jen1_kat3=0;
$umkm_jen2_kat1=0;
$umkm_jen2_kat2=0;
$umkm_jen2_kat3=0;
$umkm_jen3_kat1=0;
$umkm_jen3_kat2=0;
$umkm_jen3_kat3=0;
$umkm_jenis1=0;
$umkm_jenis2=0;
$umkm_jenis3=0;
foreach($lap as $laporan){
$aset=$aset+$laporan['aset'];
$omset=$omset+$laporan['omset'];
$karyawan_jenis1=$karyawan_jenis1+$laporan['karyawan_jenis1'];
$karyawan_jenis2=$karyawan_jenis2+$laporan['karyawan_jenis2'];
$karyawan_jenis3=$karyawan_jenis3+$laporan['karyawan_jenis3'];
$omset_jenis1=$omset_jenis1+$laporan['omset_jenis1'];
$omset_jenis2=$omset_jenis2+$laporan['omset_jenis2'];
$omset_jenis3=$omset_jenis3+$laporan['omset_jenis3'];
$aset_jenis1=$aset_jenis1+$laporan['aset_jenis1'];
$aset_jenis2=$aset_jenis2+$laporan['aset_jenis2'];
$aset_jenis3=$aset_jenis3+$laporan['aset_jenis3'];
$karyawan_jen1_l=$karyawan_jen1_l+$laporan['karyawan_jen1_l'];
$karyawan_jen2_l=$karyawan_jen2_l+$laporan['karyawan_jen2_l'];
$karyawan_jen3_l=$karyawan_jen3_l+$laporan['karyawan_jen3_l'];
$karyawan_jen1_p=$karyawan_jen1_p+$laporan['karyawan_jen1_p'];
$karyawan_jen2_p=$karyawan_jen2_p+$laporan['karyawan_jen2_p'];
$karyawan_jen3_p=$karyawan_jen3_p+$laporan['karyawan_jen3_p'];
$umkm_jen1_kat1=$umkm_jen1_kat1+$laporan['umkm_jen1_kat1'];
$umkm_jen1_kat2=$umkm_jen1_kat2+$laporan['umkm_jen1_kat2'];
$umkm_jen1_kat3=$umkm_jen1_kat3+$laporan['umkm_jen1_kat3'];
$umkm_jen2_kat1=$umkm_jen2_kat1+$laporan['umkm_jen2_kat1'];
$umkm_jen2_kat2=$umkm_jen2_kat2+$laporan['umkm_jen2_kat2'];
$umkm_jen2_kat3=$umkm_jen2_kat3+$laporan['umkm_jen2_kat3'];
$umkm_jen3_kat1=$umkm_jen3_kat1+$laporan['umkm_jen3_kat1'];
$umkm_jen3_kat2=$umkm_jen3_kat2+$laporan['umkm_jen3_kat2'];
$umkm_jen3_kat3=$umkm_jen3_kat3+$laporan['umkm_jen3_kat3'];
$umkm_jenis1=$umkm_jenis1+$laporan['umkm_jenis1'];
$umkm_jenis2=$umkm_jenis2+$laporan['umkm_jenis2'];
$umkm_jenis3=$umkm_jenis3+$laporan['umkm_jenis3'];
$umkm = $umkm_jen1_kat1+$umkm_jen1_kat2+$umkm_jen1_kat3+$umkm_jen2_kat1+$umkm_jen2_kat2+$umkm_jen2_kat3+$umkm_jen3_kat1+$umkm_jen3_kat2+$umkm_jen3_kat3;
$karyawan = $karyawan_jenis1+$karyawan_jenis2+$karyawan_jenis3;
$umkm_kat1 = $umkm_jen1_kat1+$umkm_jen1_kat1+$umkm_jen1_kat1;
$umkm_kat2 = $umkm_jen1_kat2+$umkm_jen1_kat2+$umkm_jen1_kat2;
$umkm_kat3 = $umkm_jen1_kat3+$umkm_jen1_kat3+$umkm_jen1_kat3;
}
$data['listlaporan']=$lap;
$data['aset']=$aset;
$data['omset']=$omset;
$data['karyawan_jenis1']=$karyawan_jenis1;
$data['karyawan_jenis2']=$karyawan_jenis2;
$data['karyawan_jenis3']=$karyawan_jenis3;
$data['omset_jenis1']=$omset_jenis1;
$data['omset_jenis2']=$omset_jenis2;
$data['omset_jenis3']=$omset_jenis3;
$data['aset_jenis1']=$aset_jenis1;
$data['aset_jenis2']=$aset_jenis2;
$data['aset_jenis3']=$aset_jenis3;
$data['karyawan_jen1_l']=$karyawan_jen1_l;
$data['karyawan_jen2_l']=$karyawan_jen2_l;
$data['karyawan_jen3_l']=$karyawan_jen3_l;
$data['karyawan_jen1_p']=$karyawan_jen1_p;
$data['karyawan_jen2_p']=$karyawan_jen2_p;
$data['karyawan_jen3_p']=$karyawan_jen3_p;
$data['umkm_jen1_kat1']=$umkm_jen1_kat1;
$data['umkm_jen1_kat2']=$umkm_jen1_kat2;
$data['umkm_jen1_kat3']=$umkm_jen1_kat3;
$data['umkm_jen2_kat1']=$umkm_jen2_kat1;
$data['umkm_jen2_kat2']=$umkm_jen2_kat2;
$data['umkm_jen2_kat3']=$umkm_jen2_kat3;
$data['umkm_jen3_kat1']=$umkm_jen3_kat1;
$data['umkm_jen3_kat2']=$umkm_jen3_kat2;
$data['umkm_jen3_kat3']=$umkm_jen3_kat3;
$data['umkm_jenis1']=$umkm_jenis1;
$data['umkm_jenis2']=$umkm_jenis2;
$data['umkm_jenis3']=$umkm_jenis3;
$data['umkm']= $umkm;
$data['karyawan']= $karyawan;
$data['umkm_kat1']= $umkm_kat1;
$data['umkm_kat2']= $umkm_kat2;
$data['umkm_kat3']= $umkm_kat3;
} else {
$data['msg'] = 'empty';
}
$data['user_logged'] = $this->session->userdata('user_logged');
$kecamatanlist = array(
array(
'id'=>'1',
'kecamatan'=>'Magelang Selatan'
),
array(
'id'=>'2',
'kecamatan'=>'Magelang Tengah'
),
array(
'id'=>'3',
'kecamatan'=>'Magelang Utara'
)
);
$data['kecamatan_list']= $kecamatanlist;
$data['kecamatan'] = $kecamatan;
$data['tahun'] = $year;
$this->load->view('kecamatan',$data);
}
}

View File

@ -0,0 +1,239 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Kelurahan extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("LaporanModel");
$this->load->model("KategoriModel");
$this->load->model("JenisModel");
$this->load->model("KelurahanModel");
$this->load->model("AbsensiModel");
$this->load->model("UmkmModel");
}
public function index()
{
if($this->input->post()){
$post = $this->input->post();
$kelurahan = $post['kelurahan'];
} else {
$kelurahan = 'Rejowinangun Selatan';
}
//cek ada laporan atau tidak
$countlaporan = $this->LaporanModel->getLaporanCount();
if($countlaporan>0){
$year = $this->LaporanModel->getLastYearLaporan()->tahun;
} else {
redirect(site_url('admin/laporan'));die();
}
//cek ada laporan kelurahan atau tidak
$countlaporankel = $this->LaporanModel->getCountByTahunByKelurahan($year,$kelurahan);
if($countlaporankel>0){
$data['msg'] = 'found';
$listlapkel = $this->LaporanModel->getLaporanByTahunAndKelurahan($year,$kelurahan);
$lap[$kelurahan]['kelurahan']='';
$lap[$kelurahan]['aset']=0;
$lap[$kelurahan]['omset']=0;
$lap[$kelurahan]['karyawan_jenis1']=0;
$lap[$kelurahan]['karyawan_jenis2']=0;
$lap[$kelurahan]['karyawan_jenis3']=0;
$lap[$kelurahan]['omset_jenis1']=0;
$lap[$kelurahan]['omset_jenis2']=0;
$lap[$kelurahan]['omset_jenis3']=0;
$lap[$kelurahan]['aset_jenis1']=0;
$lap[$kelurahan]['aset_jenis2']=0;
$lap[$kelurahan]['aset_jenis3']=0;
$lap[$kelurahan]['karyawan_jen1_l']=0;
$lap[$kelurahan]['karyawan_jen2_l']=0;
$lap[$kelurahan]['karyawan_jen3_l']=0;
$lap[$kelurahan]['karyawan_jen1_p']=0;
$lap[$kelurahan]['karyawan_jen2_p']=0;
$lap[$kelurahan]['karyawan_jen3_p']=0;
$lap[$kelurahan]['umkm_jen1_kat1']=0;
$lap[$kelurahan]['umkm_jen1_kat2']=0;
$lap[$kelurahan]['umkm_jen1_kat3']=0;
$lap[$kelurahan]['umkm_jen2_kat1']=0;
$lap[$kelurahan]['umkm_jen2_kat2']=0;
$lap[$kelurahan]['umkm_jen2_kat3']=0;
$lap[$kelurahan]['umkm_jen3_kat1']=0;
$lap[$kelurahan]['umkm_jen3_kat2']=0;
$lap[$kelurahan]['umkm_jen3_kat3']=0;
foreach($listlapkel as $lapkel){
$lap[$kelurahan]['kelurahan']=$lapkel->kelurahan;
$lap[$lapkel->kelurahan]['aset']=$lapkel->aset;
$lap[$lapkel->kelurahan]['omset']=$lap[$lapkel->kelurahan]['omset']+$lapkel->omset;
$lap[$lapkel->kelurahan]['karyawan_jenis1']=$lapkel->karyawan_jenis1;
$lap[$lapkel->kelurahan]['karyawan_jenis2']=$lapkel->karyawan_jenis2;
$lap[$lapkel->kelurahan]['karyawan_jenis3']=$lapkel->karyawan_jenis3;
$lap[$lapkel->kelurahan]['omset_jenis1']=$lap[$lapkel->kelurahan]['omset_jenis1']+$lapkel->omset_jenis1;
$lap[$lapkel->kelurahan]['omset_jenis2']=$lap[$lapkel->kelurahan]['omset_jenis2']+$lapkel->omset_jenis2;
$lap[$lapkel->kelurahan]['omset_jenis3']=$lap[$lapkel->kelurahan]['omset_jenis3']+$lapkel->omset_jenis3;
$lap[$lapkel->kelurahan]['aset_jenis1']=$lapkel->aset_jenis1;
$lap[$lapkel->kelurahan]['aset_jenis2']=$lapkel->aset_jenis2;
$lap[$lapkel->kelurahan]['aset_jenis3']=$lapkel->aset_jenis3;
$lap[$lapkel->kelurahan]['karyawan_jen1_l']=$lapkel->karyawan_jen1_l;
$lap[$lapkel->kelurahan]['karyawan_jen2_l']=$lapkel->karyawan_jen2_l;
$lap[$lapkel->kelurahan]['karyawan_jen3_l']=$lapkel->karyawan_jen3_l;
$lap[$lapkel->kelurahan]['karyawan_jen1_p']=$lapkel->karyawan_jen1_p;
$lap[$lapkel->kelurahan]['karyawan_jen2_p']=$lapkel->karyawan_jen2_p;
$lap[$lapkel->kelurahan]['karyawan_jen3_p']=$lapkel->karyawan_jen3_p;
$lap[$lapkel->kelurahan]['umkm_jen1_kat1']=$lapkel->umkm_jen1_kat1;
$lap[$lapkel->kelurahan]['umkm_jen1_kat2']=$lapkel->umkm_jen1_kat2;
$lap[$lapkel->kelurahan]['umkm_jen1_kat3']=$lapkel->umkm_jen1_kat3;
$lap[$lapkel->kelurahan]['umkm_jen2_kat1']=$lapkel->umkm_jen2_kat1;
$lap[$lapkel->kelurahan]['umkm_jen2_kat2']=$lapkel->umkm_jen2_kat2;
$lap[$lapkel->kelurahan]['umkm_jen2_kat3']=$lapkel->umkm_jen2_kat3;
$lap[$lapkel->kelurahan]['umkm_jen3_kat1']=$lapkel->umkm_jen3_kat1;
$lap[$lapkel->kelurahan]['umkm_jen3_kat2']=$lapkel->umkm_jen3_kat2;
$lap[$lapkel->kelurahan]['umkm_jen3_kat3']=$lapkel->umkm_jen3_kat3;
if($lapkel->bulan==12){
$lap[$lapkel->kelurahan]['omset'] = $lap[$lapkel->kelurahan]['omset']/12;
$lap[$lapkel->kelurahan]['omset_jenis1'] = $lap[$lapkel->kelurahan]['omset_jenis1']/12;
$lap[$lapkel->kelurahan]['omset_jenis2'] = $lap[$lapkel->kelurahan]['omset_jenis2']/12;
$lap[$lapkel->kelurahan]['omset_jenis3'] = $lap[$lapkel->kelurahan]['omset_jenis3']/12;
$lap[$lapkel->kelurahan]['umkm_jenis1'] = $lap[$lapkel->kelurahan]['umkm_jen1_kat1']+$lap[$lapkel->kelurahan]['umkm_jen1_kat2']+$lap[$lapkel->kelurahan]['umkm_jen1_kat3'];
$lap[$lapkel->kelurahan]['umkm_jenis2'] = $lap[$lapkel->kelurahan]['umkm_jen2_kat1']+$lap[$lapkel->kelurahan]['umkm_jen2_kat2']+$lap[$lapkel->kelurahan]['umkm_jen2_kat3'];
$lap[$lapkel->kelurahan]['umkm_jenis3'] = $lap[$lapkel->kelurahan]['umkm_jen3_kat1']+$lap[$lapkel->kelurahan]['umkm_jen3_kat2']+$lap[$lapkel->kelurahan]['umkm_jen3_kat3'];
}
}
$aset=0;
$omset=0;
$karyawan_jenis1=0;
$karyawan_jenis2=0;
$karyawan_jenis3=0;
$omset_jenis1=0;
$omset_jenis2=0;
$omset_jenis3=0;
$aset_jenis1=0;
$aset_jenis2=0;
$aset_jenis3=0;
$karyawan_jen1_l=0;
$karyawan_jen2_l=0;
$karyawan_jen3_l=0;
$karyawan_jen1_p=0;
$karyawan_jen2_p=0;
$karyawan_jen3_p=0;
$umkm_jen1_kat1=0;
$umkm_jen1_kat2=0;
$umkm_jen1_kat3=0;
$umkm_jen2_kat1=0;
$umkm_jen2_kat2=0;
$umkm_jen2_kat3=0;
$umkm_jen3_kat1=0;
$umkm_jen3_kat2=0;
$umkm_jen3_kat3=0;
$umkm_jenis1=0;
$umkm_jenis2=0;
$umkm_jenis3=0;
foreach($lap as $laporan){
$aset=$aset+$laporan['aset'];
$omset=$omset+$laporan['omset'];
$karyawan_jenis1=$karyawan_jenis1+$laporan['karyawan_jenis1'];
$karyawan_jenis2=$karyawan_jenis2+$laporan['karyawan_jenis2'];
$karyawan_jenis3=$karyawan_jenis3+$laporan['karyawan_jenis3'];
$omset_jenis1=$omset_jenis1+$laporan['omset_jenis1'];
$omset_jenis2=$omset_jenis2+$laporan['omset_jenis2'];
$omset_jenis3=$omset_jenis3+$laporan['omset_jenis3'];
$aset_jenis1=$aset_jenis1+$laporan['aset_jenis1'];
$aset_jenis2=$aset_jenis2+$laporan['aset_jenis2'];
$aset_jenis3=$aset_jenis3+$laporan['aset_jenis3'];
$karyawan_jen1_l=$karyawan_jen1_l+$laporan['karyawan_jen1_l'];
$karyawan_jen2_l=$karyawan_jen2_l+$laporan['karyawan_jen2_l'];
$karyawan_jen3_l=$karyawan_jen3_l+$laporan['karyawan_jen3_l'];
$karyawan_jen1_p=$karyawan_jen1_p+$laporan['karyawan_jen1_p'];
$karyawan_jen2_p=$karyawan_jen2_p+$laporan['karyawan_jen2_p'];
$karyawan_jen3_p=$karyawan_jen3_p+$laporan['karyawan_jen3_p'];
$umkm_jen1_kat1=$umkm_jen1_kat1+$laporan['umkm_jen1_kat1'];
$umkm_jen1_kat2=$umkm_jen1_kat2+$laporan['umkm_jen1_kat2'];
$umkm_jen1_kat3=$umkm_jen1_kat3+$laporan['umkm_jen1_kat3'];
$umkm_jen2_kat1=$umkm_jen2_kat1+$laporan['umkm_jen2_kat1'];
$umkm_jen2_kat2=$umkm_jen2_kat2+$laporan['umkm_jen2_kat2'];
$umkm_jen2_kat3=$umkm_jen2_kat3+$laporan['umkm_jen2_kat3'];
$umkm_jen3_kat1=$umkm_jen3_kat1+$laporan['umkm_jen3_kat1'];
$umkm_jen3_kat2=$umkm_jen3_kat2+$laporan['umkm_jen3_kat2'];
$umkm_jen3_kat3=$umkm_jen3_kat3+$laporan['umkm_jen3_kat3'];
$umkm_jenis1=$umkm_jenis1+$laporan['umkm_jenis1'];
$umkm_jenis2=$umkm_jenis2+$laporan['umkm_jenis2'];
$umkm_jenis3=$umkm_jenis3+$laporan['umkm_jenis3'];
$umkm = $umkm_jen1_kat1+$umkm_jen1_kat2+$umkm_jen1_kat3+$umkm_jen2_kat1+$umkm_jen2_kat2+$umkm_jen2_kat3+$umkm_jen3_kat1+$umkm_jen3_kat2+$umkm_jen3_kat3;
$karyawan = $karyawan_jenis1+$karyawan_jenis2+$karyawan_jenis3;
$umkm_kat1 = $umkm_jen1_kat1+$umkm_jen1_kat1+$umkm_jen1_kat1;
$umkm_kat2 = $umkm_jen1_kat2+$umkm_jen1_kat2+$umkm_jen1_kat2;
$umkm_kat3 = $umkm_jen1_kat3+$umkm_jen1_kat3+$umkm_jen1_kat3;
}
$data['listlaporan']=$lap;
$data['aset']=$aset;
$data['omset']=$omset;
$data['karyawan_jenis1']=$karyawan_jenis1;
$data['karyawan_jenis2']=$karyawan_jenis2;
$data['karyawan_jenis3']=$karyawan_jenis3;
$data['omset_jenis1']=$omset_jenis1;
$data['omset_jenis2']=$omset_jenis2;
$data['omset_jenis3']=$omset_jenis3;
$data['aset_jenis1']=$aset_jenis1;
$data['aset_jenis2']=$aset_jenis2;
$data['aset_jenis3']=$aset_jenis3;
$data['karyawan_jen1_l']=$karyawan_jen1_l;
$data['karyawan_jen2_l']=$karyawan_jen2_l;
$data['karyawan_jen3_l']=$karyawan_jen3_l;
$data['karyawan_jen1_p']=$karyawan_jen1_p;
$data['karyawan_jen2_p']=$karyawan_jen2_p;
$data['karyawan_jen3_p']=$karyawan_jen3_p;
$data['umkm_jen1_kat1']=$umkm_jen1_kat1;
$data['umkm_jen1_kat2']=$umkm_jen1_kat2;
$data['umkm_jen1_kat3']=$umkm_jen1_kat3;
$data['umkm_jen2_kat1']=$umkm_jen2_kat1;
$data['umkm_jen2_kat2']=$umkm_jen2_kat2;
$data['umkm_jen2_kat3']=$umkm_jen2_kat3;
$data['umkm_jen3_kat1']=$umkm_jen3_kat1;
$data['umkm_jen3_kat2']=$umkm_jen3_kat2;
$data['umkm_jen3_kat3']=$umkm_jen3_kat3;
$data['umkm_jenis1']=$umkm_jenis1;
$data['umkm_jenis2']=$umkm_jenis2;
$data['umkm_jenis3']=$umkm_jenis3;
$data['umkm']= $umkm;
$data['karyawan']= $karyawan;
$data['umkm_kat1']= $umkm_kat1;
$data['umkm_kat2']= $umkm_kat2;
$data['umkm_kat3']= $umkm_kat3;
} else {
$data['msg'] = 'empty';
}
$data['user_logged'] = $this->session->userdata('user_logged');
$kelurahanlist = $this->KelurahanModel->getKelurahan();
$umkmlist = $this->AbsensiModel->getDesemberAbsensiByYearAndByKelurahan($year,$kelurahan);
//var_dump($umkmlist);die();
$data['umkmlist'] = $umkmlist;
$data['kelurahan_list']= $kelurahanlist;
$data['kelurahan'] = $kelurahan;
$data['tahun'] = $year;
$this->load->view('kelurahan',$data);
}
}

View File

@ -0,0 +1,38 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Produk extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("ProdukModel");
$this->load->model("UmkmModel");
}
public function index()
{
$data['listproduk'] = $this->ProdukModel->getProduk();
$data['user_logged'] = $this->session->userdata('user_logged');
$this->load->view('produk',$data);
}
public function getdata()
{
$listproduk['data'] = $this->ProdukModel->getProduk();
$json = json_encode($listproduk);
echo $json;
}
}

View File

@ -0,0 +1,271 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Tahunan extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("LaporanModel");
$this->load->model("KategoriModel");
$this->load->model("JenisModel");
}
public function index()
{
//cek ada laporan tahunan atau tidak
$countlaporan = $this->LaporanModel->getLaporanCount();
if($countlaporan>0){
$year = $this->LaporanModel->getLastYearLaporan()->tahun;
$data['tahun'] = $year;
$lap_bulan = $this->LaporanModel->getBulanLaporanByYear($year);
$omset_jen1=0;
$omset_jen2=0;
$omset_jen3=0;
foreach($lap_bulan as $bulan){
$umkm_jen1=0;
$umkm_jen2=0;
$umkm_jen3=0;
$umkm_jen1_ket1=0;
$umkm_jen1_ket2=0;
$umkm_jen1_ket3=0;
$umkm_jen2_ket1=0;
$umkm_jen2_ket2=0;
$umkm_jen2_ket3=0;
$umkm_jen3_ket1=0;
$umkm_jen3_ket2=0;
$umkm_jen3_ket3=0;
$aset_jen1=0;
$aset_jen2=0;
$aset_jen3=0;
$naker_jen1_l=0;
$naker_jen1_p=0;
$naker_jen2_l=0;
$naker_jen2_p=0;
$naker_jen3_l=0;
$naker_jen3_p=0;
$lap_kelurahan = $this->LaporanModel->getKelurahanByBulanAndYear($bulan->bulan,$year);
foreach($lap_kelurahan as $kelurahan){
$laporan = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($bulan->bulan,$year,$kelurahan->kelurahan);
$umkm_jen1= $umkm_jen1+$laporan->umkm_jen1_kat1+$laporan->umkm_jen1_kat2+$laporan->umkm_jen1_kat3;
$umkm_jen2= $umkm_jen2+$laporan->umkm_jen2_kat1+$laporan->umkm_jen2_kat2+$laporan->umkm_jen2_kat3;
$umkm_jen3= $umkm_jen3+$laporan->umkm_jen3_kat1+$laporan->umkm_jen3_kat2+$laporan->umkm_jen3_kat3;
$omset_jen1= $omset_jen1+$laporan->omset_jenis1;
$omset_jen2= $omset_jen2+$laporan->omset_jenis2;
$omset_jen3= $omset_jen3+$laporan->omset_jenis3;
$aset_jen1= $aset_jen1+$laporan->aset_jenis1;
$aset_jen2= $aset_jen2+$laporan->aset_jenis2;
$aset_jen3= $aset_jen3+$laporan->aset_jenis3;
$naker_jen1_l = $naker_jen1_l + $laporan->karyawan_jen1_l;
$naker_jen1_p = $naker_jen1_p + $laporan->karyawan_jen1_p;
$naker_jen2_l = $naker_jen2_l + $laporan->karyawan_jen2_l;
$naker_jen2_p = $naker_jen2_p + $laporan->karyawan_jen2_p;
$naker_jen3_l = $naker_jen3_l + $laporan->karyawan_jen3_l;
$naker_jen3_p = $naker_jen3_p + $laporan->karyawan_jen3_p;
$umkm_jen1_ket1=$umkm_jen1_ket1+$laporan->umkm_jen1_kat1;
$umkm_jen1_ket2=$umkm_jen1_ket2+$laporan->umkm_jen1_kat2;
$umkm_jen1_ket3=$umkm_jen1_ket3+$laporan->umkm_jen1_kat3;
$umkm_jen2_ket1=$umkm_jen2_ket1+$laporan->umkm_jen2_kat1;
$umkm_jen2_ket2=$umkm_jen2_ket2+$laporan->umkm_jen2_kat2;
$umkm_jen2_ket3=$umkm_jen2_ket3+$laporan->umkm_jen2_kat3;
$umkm_jen3_ket1=$umkm_jen3_ket1+$laporan->umkm_jen3_kat1;
$umkm_jen3_ket2=$umkm_jen3_ket2+$laporan->umkm_jen3_kat2;
$umkm_jen3_ket3=$umkm_jen3_ket3+$laporan->umkm_jen3_kat3;
}
}
$data['umkm_jen1_ket1']=$umkm_jen1_ket1;
$data['umkm_jen1_ket2']=$umkm_jen1_ket2;
$data['umkm_jen1_ket3']=$umkm_jen1_ket3;
$data['umkm_jen2_ket1']=$umkm_jen2_ket1;
$data['umkm_jen2_ket2']=$umkm_jen2_ket2;
$data['umkm_jen2_ket3']=$umkm_jen2_ket3;
$data['umkm_jen3_ket1']=$umkm_jen3_ket1;
$data['umkm_jen3_ket2']=$umkm_jen3_ket2;
$data['umkm_jen3_ket3']=$umkm_jen3_ket3;
$omset_bln_jen1= $omset_jen1/12;
$omset_bln_jen2= $omset_jen2/12;
$omset_bln_jen3= $omset_jen3/12;
$data['umkm_jen1']=$umkm_jen1;
$data['umkm_jen2']=$umkm_jen2;
$data['umkm_jen3']=$umkm_jen3;
$data['omset_bln_jen1'] = $omset_bln_jen1;
$data['omset_bln_jen2'] = $omset_bln_jen2;
$data['omset_bln_jen3'] = $omset_bln_jen3;
$data['aset_jen1'] = $aset_jen1;
$data['aset_jen2'] = $aset_jen2;
$data['aset_jen3'] = $aset_jen3;
$data['naker_jen1_l'] = $naker_jen1_l;
$data['naker_jen1_p'] = $naker_jen1_p;
$data['naker_jen2_l'] = $naker_jen2_l;
$data['naker_jen2_p'] = $naker_jen2_p;
$data['naker_jen3_l'] = $naker_jen3_l;
$data['naker_jen3_p'] = $naker_jen3_p;
//komulatif
$data['omset_1'] = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
$data['aset_1'] = $aset_jen1+$aset_jen2+$aset_jen3;
$data['umkm_1'] = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$naker_1 = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$data['naker_1'] = $naker_1+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$data['mikro_1'] = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$data['kecil_1'] = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$data['menengah_1'] = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
//cek ada laporan tahun sebelumnya atau tidak
$countlaporanbefore = $this->LaporanModel->getLaporanBeforeCount();
if($countlaporanbefore>0){
$yearbefore = $this->LaporanModel->getLastYearLaporanBefore()->tahun;
$data['tahun_0'] = $yearbefore;
$lap_bulan_0 = $this->LaporanModel->getBulanLaporanByYear($yearbefore);
$omset_jen1_0=0;
$omset_jen2_0=0;
$omset_jen3_0=0;
foreach($lap_bulan_0 as $bulan_0){
$umkm_jen1_0=0;
$umkm_jen2_0=0;
$umkm_jen3_0=0;
$umkm_jen1_ket1_0=0;
$umkm_jen1_ket2_0=0;
$umkm_jen1_ket3_0=0;
$umkm_jen2_ket1_0=0;
$umkm_jen2_ket2_0=0;
$umkm_jen2_ket3_0=0;
$umkm_jen3_ket1_0=0;
$umkm_jen3_ket2_0=0;
$umkm_jen3_ket3_0=0;
$aset_jen1_0=0;
$aset_jen2_0=0;
$aset_jen3_0=0;
$naker_jen1_l_0=0;
$naker_jen1_p_0=0;
$naker_jen2_l_0=0;
$naker_jen2_p_0=0;
$naker_jen3_l_0=0;
$naker_jen3_p_0=0;
$lap_kelurahan_0 = $this->LaporanModel->getKelurahanByBulanAndYear($bulan_0->bulan,$yearbefore);
foreach($lap_kelurahan_0 as $kelurahan_0){
$laporan_0 = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($bulan_0->bulan,$yearbefore,$kelurahan_0->kelurahan);
$umkm_jen1_0= $umkm_jen1_0+$laporan_0->umkm_jen1_kat1+$laporan_0->umkm_jen1_kat2+$laporan_0->umkm_jen1_kat3;
$umkm_jen2_0= $umkm_jen2_0+$laporan_0->umkm_jen2_kat1+$laporan_0->umkm_jen2_kat2+$laporan_0->umkm_jen2_kat3;
$umkm_jen3_0= $umkm_jen3_0+$laporan_0->umkm_jen3_kat1+$laporan_0->umkm_jen3_kat2+$laporan_0->umkm_jen3_kat3;
$omset_jen1_0= $omset_jen1_0+$laporan_0->omset_jenis1;
$omset_jen2_0= $omset_jen2_0+$laporan_0->omset_jenis2;
$omset_jen3_0= $omset_jen3_0+$laporan_0->omset_jenis3;
$aset_jen1_0= $aset_jen1_0+$laporan_0->aset_jenis1;
$aset_jen2_0= $aset_jen2_0+$laporan_0->aset_jenis2;
$aset_jen3_0= $aset_jen3_0+$laporan_0->aset_jenis3;
$naker_jen1_l_0 = $naker_jen1_l_0 + $laporan_0->karyawan_jen1_l;
$naker_jen1_p_0 = $naker_jen1_p_0 + $laporan_0->karyawan_jen1_p;
$naker_jen2_l_0 = $naker_jen2_l_0 + $laporan_0->karyawan_jen2_l;
$naker_jen2_p_0 = $naker_jen2_p_0 + $laporan_0->karyawan_jen2_p;
$naker_jen3_l_0 = $naker_jen3_l_0 + $laporan_0->karyawan_jen3_l;
$naker_jen3_p_0 = $naker_jen3_p_0 + $laporan_0->karyawan_jen3_p;
$umkm_jen1_ket1_0=$umkm_jen1_ket1_0+$laporan_0->umkm_jen1_kat1;
$umkm_jen1_ket2_0=$umkm_jen1_ket2_0+$laporan_0->umkm_jen1_kat2;
$umkm_jen1_ket3_0=$umkm_jen1_ket3_0+$laporan_0->umkm_jen1_kat3;
$umkm_jen2_ket1_0=$umkm_jen2_ket1_0+$laporan_0->umkm_jen2_kat1;
$umkm_jen2_ket2_0=$umkm_jen2_ket2_0+$laporan_0->umkm_jen2_kat2;
$umkm_jen2_ket3_0=$umkm_jen2_ket3_0+$laporan_0->umkm_jen2_kat3;
$umkm_jen3_ket1_0=$umkm_jen3_ket1_0+$laporan_0->umkm_jen3_kat1;
$umkm_jen3_ket2_0=$umkm_jen3_ket2_0+$laporan_0->umkm_jen3_kat2;
$umkm_jen3_ket3_0=$umkm_jen3_ket3_0+$laporan_0->umkm_jen3_kat3;
}
}
$data['umkm_jen1_ket1_0']=$umkm_jen1_ket1_0;
$data['umkm_jen1_ket2_0']=$umkm_jen1_ket2_0;
$data['umkm_jen1_ket3_0']=$umkm_jen1_ket3_0;
$data['umkm_jen2_ket1_0']=$umkm_jen2_ket1_0;
$data['umkm_jen2_ket2_0']=$umkm_jen2_ket2_0;
$data['umkm_jen2_ket3_0']=$umkm_jen2_ket3_0;
$data['umkm_jen3_ket1_0']=$umkm_jen3_ket1_0;
$data['umkm_jen3_ket2_0']=$umkm_jen3_ket2_0;
$data['umkm_jen3_ket3_0']=$umkm_jen3_ket3_0;
$omset_bln_jen1_0= $omset_jen1_0/12;
$omset_bln_jen2_0= $omset_jen2_0/12;
$omset_bln_jen3_0= $omset_jen3_0/12;
$data['umkm_jen1_0']=$umkm_jen1_0;
$data['umkm_jen2_0']=$umkm_jen2_0;
$data['umkm_jen3_0']=$umkm_jen3_0;
$data['omset_bln_jen1_0'] = $omset_bln_jen1_0;
$data['omset_bln_jen2_0'] = $omset_bln_jen2_0;
$data['omset_bln_jen3_0'] = $omset_bln_jen3_0;
$data['aset_jen1_0'] = $aset_jen1_0;
$data['aset_jen2_0'] = $aset_jen2_0;
$data['aset_jen3_0'] = $aset_jen3_0;
$data['naker_jen1_l_0'] = $naker_jen1_l_0;
$data['naker_jen1_p_0'] = $naker_jen1_p_0;
$data['naker_jen2_l_0'] = $naker_jen2_l_0;
$data['naker_jen2_p_0'] = $naker_jen2_p_0;
$data['naker_jen3_l_0'] = $naker_jen3_l_0;
$data['naker_jen3_p_0'] = $naker_jen3_p_0;
//komulatif
$data['omset_0'] = $omset_bln_jen1_0+$omset_bln_jen2_0+$omset_bln_jen3_0;
$data['aset_0'] = $aset_jen1_0+$aset_jen2_0+$aset_jen3_0;
$data['umkm_0'] = $umkm_jen1_0+$umkm_jen2_0+$umkm_jen3_0;
$naker_0 = $naker_jen1_l_0+$naker_jen2_l_0+$naker_jen3_l_0;
$data['naker_0'] = $naker_0+$naker_jen1_p_0+$naker_jen2_p_0+$naker_jen3_p_0;
$data['mikro_0'] = $umkm_jen1_ket1_0+$umkm_jen2_ket1_0+$umkm_jen3_ket1_0;
$data['kecil_0'] = $umkm_jen1_ket2_0+$umkm_jen2_ket2_0+$umkm_jen3_ket2_0;
$data['menengah_0'] = $umkm_jen1_ket3_0+$umkm_jen2_ket3_0+$umkm_jen3_ket3_0;
}
$data['msg'] = 'found';
} else {
$data['msg'] = 'empty';
}
$this->load->view('laporan',$data);
}
}

View File

@ -0,0 +1,25 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Umkm extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model("UserModel");
$this->load->model("ProdukModel");
$this->load->model("UmkmModel");
}
public function index()
{
$data['listumkm'] = $this->UmkmModel->getUmkm();
$data['user_logged'] = $this->session->userdata('user_logged');
$this->load->view('umkm',$data);
}
}

View File

@ -25,10 +25,19 @@ class ProdukModel extends CI_Model
$this->db->where('id_produk', $id_produk);
return $produk = $this->db->get($this->_table)->row();
}
public function getProduk(){
$this->db->join('tb_umkm','tb_umkm.id_umkm = tb_produk.id_umkm');
return $produk = $this->db->get($this->_table)->result();
}
public function getProdukCount(){
return $produk = count($this->db->get($this->_table)->result());
}
public function getThree(){
$this->db->order_by('id_produk', 'DESC');
$this->db->limit('3');
$this->db->limit('6');
return $produk = $this->db->get($this->_table)->result();
}

View File

@ -79,7 +79,7 @@ class UmkmModel extends CI_Model
public function getThree(){
$this->db->order_by('id_umkm', 'DESC');
$this->db->limit('3');
$this->db->limit('4');
return $umkm = $this->db->get($this->_table)->result();
}

View File

@ -0,0 +1,474 @@
<?php
function rupiah($angka){
$hasil_rupiah = "Rp " . number_format($angka,2,',','.');
return $hasil_rupiah;
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan <span class="sr-only">(current)</span></a>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<?php
if($bulan==1){
$bulantext = 'Januari';
}elseif($bulan==1){
$bulantext = 'Februari';
}elseif($bulan==2){
$bulantext = 'Februari';
}elseif($bulan==3){
$bulantext = 'Maret';
}elseif($bulan==4){
$bulantext = 'April';
}elseif($bulan==5){
$bulantext = 'Mei';
}elseif($bulan==6){
$bulantext = 'Juni';
}elseif($bulan==7){
$bulantext = 'Julai';
}elseif($bulan==8){
$bulantext = 'Agustus';
}elseif($bulan==9){
$bulantext = 'September';
}elseif($bulan==10){
$bulantext = 'Oktober';
}elseif($bulan==11){
$bulantext = 'November';
}elseif($bulan==12){
$bulantext = 'Desember';
}
?>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="bulan">Pilih Bulan</label>
<select name="bulan" class="form-control" id="bulan" onchange="this.form.submit()" required>
<?php foreach($bulan_list as $list) {?>
<option value="<?php echo $list['bulan'] ?>" <?php if($list['bulan']===$bulan){echo "selected";}?>>
<?php echo $list['text'] ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Bulan <?php echo $bulantext ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<?php if($msg!=='empty'){?>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3">Jumlah UMKM</th>
<th class="align-middle" colspan="3">Omset/Bulan</th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1 ?></small></td>
<td><small><?php echo $umkm_jen2 ?></small></td>
<td><small><?php echo $umkm_jen3 ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen1) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen2) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen3) ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="3"><small>Total</small></th>
</tr>
<?php
$umkm = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$omset = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $umkm ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($omset) ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-lg table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3" rowspan="2">Aset</th>
<th class="align-middle" colspan="6" >Jumlah Naker</th>
</tr>
<tr>
<th colspan="2" ><small>P</small></th>
<th colspan="2" ><small>J</small></th>
<th colspan="2" ><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo rupiah($aset_jen1) ?></small></td>
<td><small><?php echo rupiah($aset_jen2) ?></small></td>
<td><small><?php echo rupiah($aset_jen3) ?></small></td>
<td><small><?php echo $naker_jen1_l ?></small></td>
<td><small><?php echo $naker_jen1_p ?></small></td>
<td><small><?php echo $naker_jen2_l ?></small></td>
<td><small><?php echo $naker_jen2_p ?></small></td>
<td><small><?php echo $naker_jen3_l ?></small></td>
<td><small><?php echo $naker_jen3_p ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="6"><small>Total</small></th>
</tr>
<?php
$naker = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$naker = $naker+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$aset = $aset_jen1+$aset_jen2+$aset_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($aset) ?></small></th>
<th class="align-middle" colspan="6" ><small><?php echo $naker ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="9" >Klasifikasi</th>
</tr>
<tr>
<th colspan="3" ><small>P</small></th>
<th colspan="3" ><small>J</small></th>
<th colspan="3" ><small>I</small></th>
</tr>
<tr>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1_ket1?></small></td>
<td><small><?php echo $umkm_jen1_ket2?></small></td>
<td><small><?php echo $umkm_jen1_ket3?></small></td>
<td><small><?php echo $umkm_jen2_ket1?></small></td>
<td><small><?php echo $umkm_jen2_ket2?></small></td>
<td><small><?php echo $umkm_jen2_ket3?></small></td>
<td><small><?php echo $umkm_jen3_ket1?></small></td>
<td><small><?php echo $umkm_jen3_ket2?></small></td>
<td><small><?php echo $umkm_jen3_ket3?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Mikro</small></th>
<th class="align-middle" colspan="3"><small>Kecil</small></th>
<th class="align-middle" colspan="3"><small>Menengah</small></th>
</tr>
<?php
$mikro = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$kecil = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$menengah = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $mikro ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $kecil ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $menengah ?></small></th>
</tr>
</tfoot>
</table>
</div>
</div>
<?php } else {?>
<div class="card-body text-center">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
<script>
const element = document.querySelectorAll('#btn_hapus')
element.forEach(function(el){
el.addEventListener('click', function (e) {
e.preventDefault();
var urlToRedirect = e.currentTarget.getAttribute('href'); //use currentTarget because the click may be on the nested i tag and not a tag causing the href to be empty
console.log(urlToRedirect); // verify if this is the right URL
swal({
title: "Kamu yakin ?",
text: "Data yang dihapus tidak bisa dikembalikan.",
icon: "warning",
buttons: [
'Batal',
'Hapus'
],
dangerMode: true,
}).then(function(isConfirm) {
if (isConfirm) {
swal({
title: 'Berhasil',
text: 'Data berhasil terhapus',
icon: 'success'
}).then(function() {
window.location.href = urlToRedirect;
});
} else {
swal("Batal", "Data tidak terhapus.)", "error");
}
});
});
});
</script>
</body>
</html>

View File

@ -8,243 +8,151 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<link rel="icon" type="image/png" href="../assets/images/favicon.png" />
<title>Portal Data UMKM Kota Magelang</title>
<title>Aplikasi UMKM</title>
</head>
<body>
<style>
.carousel .item {
height: 100px;
}
.item img {
position: absolute;
top: 0;
left: 0;
min-height: 100px;
}
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */
/* MARKETING CONTENT
-------------------------------------------------- */
/* Center align the text within the three columns below the carousel */
.marketing .col-lg-4 {
margin-bottom: 1.5rem;
text-align: center;
}
.marketing h2 {
font-weight: 400;
}
.marketing .col-lg-4 p {
margin-right: .75rem;
margin-left: .75rem;
}
/* Featurettes
------------------------- */
.featurette-divider {
margin: 5rem 0; /* Space out the Bootstrap <hr> more */
}
/* Thin out the marketing headings */
.featurette-heading {
font-weight: 300;
line-height: 1;
letter-spacing: -.05rem;
}
/* RESPONSIVE CSS
-------------------------------------------------- */
@media (min-width: 40em) {
/* Bump up size of carousel content */
.featurette-heading {
font-size: 50px;
}
}
@media (min-width: 62em) {
.featurette-heading {
margin-top: 7rem;
}
}
</style>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">
<img src="../assets/images/favicon.png" width="30" height="30" class="d-inline-block align-top" alt="">
PORTAL UMKM
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporan">Laporan Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporanbulanan">Laporan Bulanan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporankecamatan">Laporan Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporankelurahan">Laporan Kelurahan</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<a class="btn btn-outline-light btn-sm my-2 my-sm-0" href="<?php echo base_url()?>index.php/login">Login</a>
</form>
</div>
</nav>
</header>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2">
<div class="col-12">
<h5>Data Terkini</h5>
</div>
</div>
<div class="row mt-3 mb-3">
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-warning">
<h4 class="card-title">UMKM AKTIF</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_umkm ?></h5>
</div>
</div>
</div>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-success">
<h4 class="card-title">TENAGA KERJA</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_karyawan ?></h5>
</div>
</div>
</div>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-primary text-light">
<h4 class="card-title">PRODUK</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_produk ?></h5>
</div>
</div>
</div>
</div>
<hr>
<div class="row pl-2 pr-2 pt-2 bg-success">
<div class="col-12 text-light">
<h3>UMKM</h3>
</div>
</div>
<div class="row mb-3 bg-success">
<?php foreach($umkm as $um){?>
<div class="col col-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<img class="card-img-top" src="<?php echo base_url()?>assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Card image cap">
<div class="card-body">
<h5 class="card-title"><?php echo $um->nama ?></h5>
<p class="card-text"><?php echo $um->deskripsi ?></p>
</div>
</div>
</div>
<?php } ?>
<div class="col-12 text-center mt-3 pb-4">
<a href="<?php echo base_url()?>index.php/umkm" class="btn btn-warning">Lihat Daftar UMKM</a>
</div>
</div>
<hr>
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>PRODUK</h3>
</div>
</div>
<div class="row mb-3">
<?php foreach($produk as $pr){?>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<img class="card-img-top" src="<?php echo base_url()?>assets/images/produk/<?php echo $pr->foto_produk ?>" alt="Card image cap">
<div class="card-body">
<h5 class="card-title"><?php echo $pr->produk ?></h5>
<p class="card-text"><?php echo $pr->deskripsi ?></p>
</div>
</div>
</div>
<?php } ?>
<div class="col-12 text-center mt-3 pb-4">
<a href="<?php echo base_url()?>index.php/produk" class="btn btn-warning">Lihat Daftar produk</a>
</div>
</div>
<div class="fluid" >
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="../assets/images/corousel1.jpg" alt="First slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>UMKM KOTA MAGELANG</h1>
<h3>saat ini, kota magelang mempunyai <strong>5</strong> UMKM aktif</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../assets/images/corousel2.jpg" alt="Second slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>TENAGA KERJA</h1>
<h3><strong>500</strong> Tenaga kerja terserap oleh kegiatan UMKM</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../assets/images/corousel3.jpg" alt="Third slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>PRODUK UMKM</h1>
<h3>UMKM kota magelang menghasilkan <strong>500</strong> produk</h3>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<!-- Three columns of text below the carousel -->
<div class="container mt-4">
<div class="container marketing">
<div class="text-center text-secondary"><h3><u>PRODUK UMKM</u></h3></div>
<div class="row mt-4">
<?php
foreach($produk as $prod){
?>
<div class="col-lg-4">
<img class="rounded-circle" src="../assets/images/produk/<?php echo $prod->foto_produk ?>" alt="Generic placeholder image" width="140" height="140">
<h2><?php echo $prod->produk ?></h2>
<p><a class="btn btn-secondary" href="#" role="button">View details &raquo;</a></p>
</div><!-- /.col-lg-4 -->
<?php
}
?>
</div>
<div class="text-center"> <label><a href="#" class="btn btn-outline-primary">Lihat Produk Lengkap</a></label></div>
<hr>
<!-- START THE FEATURETTES -->
<?php
$no='ganjil';
foreach($umkm as $um){
if($no=='ganjil'){
?>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading"><?php echo $um->nama ?></h2>
<p class="lead"><?php echo $um->deskripsi ?></p>
</div>
<div class="col-md-5">
<img class="featurette-image img-fluid mx-auto" src="../assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Generic placeholder image">
</div>
</div>
<?php
$no = 'genap';
}else{
?>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7 order-md-2">
<h2 class="featurette-heading"><?php echo $um->nama ?></h2>
<p class="lead"><?php echo $um->deskripsi ?></p>
</div>
<div class="col-md-5 order-md-1">
<img class="featurette-image img-fluid mx-auto" src="../assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Generic placeholder image">
</div>
</div>
<?php
$no='ganjil';
}
}
?>
<!-- /END THE FEATURETTES -->
</div>
</div>
<div class="bg-dark text-light mt-5" style="padding-top: 50px;padding-bottom:40px;">
<footer class="container">
<p class="float-right"><a href="#">Back to top</a></p>
<p>&copy; 2021 , Ardi Ferdianto</p>
</footer>
</div>
</div>
</div>
@ -254,8 +162,10 @@
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
</body>

View File

@ -0,0 +1,425 @@
<?php
function rupiah($angka){
$hasil_rupiah = "Rp " . number_format($angka,2,',','.');
return $hasil_rupiah;
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan <span class="sr-only">(current)</span></a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="kecamatan">Pilih Kecamatan</label>
<select name="kecamatan" class="form-control" id="kecamatan" onchange="this.form.submit()" required>
<?php foreach($kecamatan_list as $list) {?>
<option value="<?php echo $list['kecamatan'] ?>" <?php if($list['kecamatan']===$kecamatan){echo "selected";}?>>
<?php echo $list['kecamatan'] ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<?php if($msg!=='empty'){?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Kecamatan <?php echo $kecamatan ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive table-striped">
<thead>
<tr>
<th rowspan="3"><small>No</small></th>
<th rowspan="3"><small>kelurahan</small></th>
<th rowspan="2" colspan="3"><small>Jml Umkm</small></th>
<th rowspan="2" colspan="3"><small>Omset/Bulan</small></th>
<th rowspan="2" colspan="3"><small>Aset</small></th>
<th rowspan="1" colspan="6"><small>Jml Naker</small></th>
<th rowspan="1" colspan="9"><small>Klasifikasi</small></th>
</tr>
<tr>
<th colspan="2"><small>P</small></th>
<th colspan="2"><small>J</small></th>
<th colspan="2"><small>I</small></th>
<th colspan="3"><small>P</small></th>
<th colspan="3"><small>J</small></th>
<th colspan="3"><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($listlaporan as $laporan){
$no++;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left"><small><?php echo $laporan['kelurahan'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis1'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis2'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis3'] ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis3']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis3']) ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_p'] ?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat3']?></small></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="2"><small>Total</small></th>
<th><small><?php echo $umkm_jenis1 ?></small></th>
<th><small><?php echo $umkm_jenis2 ?></small></th>
<th><small><?php echo $umkm_jenis3 ?></small></th>
<th><small><?php echo rupiah($omset_jenis1) ?></small></th>
<th><small><?php echo rupiah($omset_jenis2) ?></small></th>
<th><small><?php echo rupiah($omset_jenis3) ?></small></th>
<th><small><?php echo rupiah($aset_jenis1) ?></small></th>
<th><small><?php echo rupiah($aset_jenis2) ?></small></th>
<th><small><?php echo rupiah($aset_jenis3) ?></small></th>
<th><small><?php echo $karyawan_jen1_l ?></small></th>
<th><small><?php echo $karyawan_jen1_p ?></small></th>
<th><small><?php echo $karyawan_jen2_l ?></small></th>
<th><small><?php echo $karyawan_jen2_p ?></small></th>
<th><small><?php echo $karyawan_jen3_l ?></small></th>
<th><small><?php echo $karyawan_jen3_p ?></small></th>
<th><small><?php echo $umkm_jen1_kat1 ?></small></th>
<th><small><?php echo $umkm_jen1_kat2 ?></small></th>
<th><small><?php echo $umkm_jen1_kat3 ?></small></th>
<th><small><?php echo $umkm_jen2_kat1 ?></small></th>
<th><small><?php echo $umkm_jen2_kat2 ?></small></th>
<th><small><?php echo $umkm_jen2_kat3 ?></small></th>
<th><small><?php echo $umkm_jen3_kat1 ?></small></th>
<th><small><?php echo $umkm_jen3_kat2 ?></small></th>
<th><small><?php echo $umkm_jen3_kat3 ?></small></th>
</tr>
<tr>
<th colspan="26" style="height:1px;">&nbsp;</th>
</tr>
<tr>
<th colspan="2" rowspan="2"><badge>Total</badge></th>
<th colspan="3"><badge>Jml Umkm</badge></th>
<th colspan="3"><badge>Omset/Bln</badge></th>
<th colspan="3"><badge>Aset</badge></th>
<th colspan="6"><badge>Naker</badge></th>
<th colspan="3"><badge>Mikro</badge></th>
<th colspan="3"><badge>Kecil</badge></th>
<th colspan="3"><badge>Menengah</badge></th>
</tr>
<tr>
<th colspan="3"><badge><?php echo $umkm ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($omset) ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($aset) ?></badge></th>
<th colspan="6"><badge><?php echo $karyawan ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat1 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat2 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat3 ?></badge></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<?php } else {?>
<div class="row-container text-center mt-3">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
<script>
const element = document.querySelectorAll('#btn_hapus')
element.forEach(function(el){
el.addEventListener('click', function (e) {
e.preventDefault();
var urlToRedirect = e.currentTarget.getAttribute('href'); //use currentTarget because the click may be on the nested i tag and not a tag causing the href to be empty
console.log(urlToRedirect); // verify if this is the right URL
swal({
title: "Kamu yakin ?",
text: "Data yang dihapus tidak bisa dikembalikan.",
icon: "warning",
buttons: [
'Batal',
'Hapus'
],
dangerMode: true,
}).then(function(isConfirm) {
if (isConfirm) {
swal({
title: 'Berhasil',
text: 'Data berhasil terhapus',
icon: 'success'
}).then(function() {
window.location.href = urlToRedirect;
});
} else {
swal("Batal", "Data tidak terhapus.)", "error");
}
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,498 @@
<?php
function rupiah($angka){
$hasil_rupiah = "Rp " . number_format($angka,2,',','.');
return $hasil_rupiah;
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan <span class="sr-only">(current)</span></a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="kelurahan">Pilih Kelurahan</label>
<select name="kelurahan" class="form-control" id="kelurahan" onchange="this.form.submit()" required>
<?php foreach($kelurahan_list as $list) {?>
<option value="<?php echo $list->kelurahan ?>" <?php if($list->kelurahan===$kelurahan){echo "selected";}?>>
<?php echo $list->kelurahan ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<?php if($msg!=='empty'){?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Kelurahan <?php echo $kelurahan ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive table-striped">
<thead>
<tr>
<th class="align-middle" rowspan="3"><small>No</small></th>
<th class="align-middle" rowspan="3"><small>kelurahan</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Jml Umkm</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Omset/Bulan</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Aset</small></th>
<th class="align-middle" rowspan="1" colspan="6"><small>Jml Naker</small></th>
<th class="align-middle" rowspan="1" colspan="9"><small>Klasifikasi</small></th>
</tr>
<tr>
<th colspan="2"><small>P</small></th>
<th colspan="2"><small>J</small></th>
<th colspan="2"><small>I</small></th>
<th colspan="3"><small>P</small></th>
<th colspan="3"><small>J</small></th>
<th colspan="3"><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($listlaporan as $laporan){
$no++;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left"><small><?php echo $laporan['kelurahan'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis1'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis2'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis3'] ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis3']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis3']) ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_p'] ?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat3']?></small></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="2"><small>Total</small></th>
<th><small><?php echo $umkm_jenis1 ?></small></th>
<th><small><?php echo $umkm_jenis2 ?></small></th>
<th><small><?php echo $umkm_jenis3 ?></small></th>
<th><small><?php echo rupiah($omset_jenis1) ?></small></th>
<th><small><?php echo rupiah($omset_jenis2) ?></small></th>
<th><small><?php echo rupiah($omset_jenis3) ?></small></th>
<th><small><?php echo rupiah($aset_jenis1) ?></small></th>
<th><small><?php echo rupiah($aset_jenis2) ?></small></th>
<th><small><?php echo rupiah($aset_jenis3) ?></small></th>
<th><small><?php echo $karyawan_jen1_l ?></small></th>
<th><small><?php echo $karyawan_jen1_p ?></small></th>
<th><small><?php echo $karyawan_jen2_l ?></small></th>
<th><small><?php echo $karyawan_jen2_p ?></small></th>
<th><small><?php echo $karyawan_jen3_l ?></small></th>
<th><small><?php echo $karyawan_jen3_p ?></small></th>
<th><small><?php echo $umkm_jen1_kat1 ?></small></th>
<th><small><?php echo $umkm_jen1_kat2 ?></small></th>
<th><small><?php echo $umkm_jen1_kat3 ?></small></th>
<th><small><?php echo $umkm_jen2_kat1 ?></small></th>
<th><small><?php echo $umkm_jen2_kat2 ?></small></th>
<th><small><?php echo $umkm_jen2_kat3 ?></small></th>
<th><small><?php echo $umkm_jen3_kat1 ?></small></th>
<th><small><?php echo $umkm_jen3_kat2 ?></small></th>
<th><small><?php echo $umkm_jen3_kat3 ?></small></th>
</tr>
<tr>
<th colspan="26" style="height:1px;">&nbsp;</th>
</tr>
<tr>
<th colspan="2" rowspan="2"><badge>Total</badge></th>
<th colspan="3"><badge>Jml Umkm</badge></th>
<th colspan="3"><badge>Omset/Bln</badge></th>
<th colspan="3"><badge>Aset</badge></th>
<th colspan="6"><badge>Naker</badge></th>
<th colspan="3"><badge>Mikro</badge></th>
<th colspan="3"><badge>Kecil</badge></th>
<th colspan="3"><badge>Menengah</badge></th>
</tr>
<tr>
<th colspan="3"><badge><?php echo $umkm ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($omset) ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($aset) ?></badge></th>
<th colspan="6"><badge><?php echo $karyawan ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat1 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat2 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat3 ?></badge></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Daftar UMKM <?php echo $kelurahan ?> Tahun <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row mt-3 table-responsive">
<table id="tabeldata" class="table table-sm table-bordered table-striped text-center">
<thead>
<tr>
<th class="align-middle" rowspan="2"><small>No</small></th>
<th class="align-middle" rowspan="2"><small>Nama UMKM</small></th>
<th class="align-middle" rowspan="2"><small>Pemilik</small></th>
<th class="align-middle" rowspan="2"><small>Kelurahan</small></th>
<th class="align-middle" rowspan="2"><small>Alamat</small></th>
<th class="align-middle" rowspan="2"><small>Telp</small></th>
<th class="align-middle" rowspan="2"><small>Deskripsi</small></th>
<th class="align-middle" rowspan="2"><small>Jenis</small></th>
<th class="align-middle" rowspan="2"><small>Omset/Bulan</small></th>
<th class="align-middle" rowspan="2"><small>Aset</small></th>
<th class="align-middle" colspan="2"><small>Naker</small></th>
<th class="align-middle" rowspan="2"><small>Skala Usaha</small></th>
</tr>
<tr>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($umkmlist as $umkm){
$no++;
$usaha = $this->UmkmModel->getUmkmsById($umkm->id_umkm);
$jenis = $this->JenisModel->getJenisById($umkm->id_jenis);
$kategori = $this->KategoriModel->getKategoriById($umkm->id_kategori);
$listomset = $this->AbsensiModel->getAbsensiByTahunAndUmkmId($umkm->tahun,$umkm->id_umkm);
$ttl_omset=0;
foreach($listomset as $oms){
$ttl_omset = $ttl_omset+$oms->omset;
}
$r_omset = $ttl_omset/12;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left text-nowrap"><small><?php echo $usaha->nama?></small></td>
<td class="text-left text-nowrap"><small><?php echo $umkm->nama?></small></td>
<td class="text-left"><small><?php echo $umkm->kelurahan ?></small></td>
<td class="text-left"><small><?php echo $usaha->alamat ?></small></td>
<td><small><?php echo $usaha->telp ?></small></td>
<td class="text-left"><small><?php echo $usaha->deskripsi ?></small></td>
<td><small><?php echo $jenis->jenis ?></small></td>
<td class="text-left"><small><?php echo rupiah($r_omset) ?></small></td>
<td class="text-left"><small><?php echo rupiah($umkm->aset) ?></small></td>
<td><small><?php echo $umkm->karyawan_l ?></small></td>
<td><small><?php echo $umkm->karyawan_p ?></small></td>
<td><small><?php echo $kategori->kategori ?></small></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<?php } else {?>
<div class="row-container text-center mt-3">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
<script>
const element = document.querySelectorAll('#btn_hapus')
element.forEach(function(el){
el.addEventListener('click', function (e) {
e.preventDefault();
var urlToRedirect = e.currentTarget.getAttribute('href'); //use currentTarget because the click may be on the nested i tag and not a tag causing the href to be empty
console.log(urlToRedirect); // verify if this is the right URL
swal({
title: "Kamu yakin ?",
text: "Data yang dihapus tidak bisa dikembalikan.",
icon: "warning",
buttons: [
'Batal',
'Hapus'
],
dangerMode: true,
}).then(function(isConfirm) {
if (isConfirm) {
swal({
title: 'Berhasil',
text: 'Data berhasil terhapus',
icon: 'success'
}).then(function() {
window.location.href = urlToRedirect;
});
} else {
swal("Batal", "Data tidak terhapus.)", "error");
}
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,514 @@
<?php
function rupiah($angka){
$hasil_rupiah = "Rp " . number_format($angka,2,',','.');
return $hasil_rupiah;
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/tahunan">Tahunan <span class="sr-only">(current)</span></a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<?php if(isset($tahun_0)){?>
<div class="card">
<div class="card-header bg-primary text-white">
<h6>Monografi Kota Magelang Tahun <?php echo $tahun ?></h6>
</div>
<div class="card-body">
<div class="row">
<div class="col col-12 col-sm-12 col-md-5 col-lg-5">
<div class="row">
<canvas id="myChart" width="400" height="300"></canvas>
</div>
<div class="row">
<table class="table text-center text-nowarp table-sm table-bordered table-striped">
<thead>
<tr>
<th></th>
<th><small>Aset</small></th>
<th><small>Omset</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo rupiah($aset_1) ?></small></td>
<td><small><?php echo rupiah($omset_1) ?></small></td>
</tr>
<tr>
<td><small><?php echo $tahun_0 ?></small></td>
<td><small><?php echo rupiah($aset_0) ?></small></td>
<td><small><?php echo rupiah($omset_0) ?></small></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col col col-12 col-sm-12 col-md-7 col-lg-7">
<div class="row pl-2">
<canvas id="myChart2" width="550" height="300"></canvas>
</div>
<div class="row pl-2">
<table class="table text-center table-sm table-responsive-sm table-bordered table-striped">
<thead>
<tr>
<th></th>
<th><small>Jml UMKM</small></th>
<th><small>Tenaga Kerja</small></th>
<th><small>Mikro</small></th>
<th><small>Kecil</small></th>
<th><small>Menengah</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo $umkm_1 ?></small></td>
<td><small><?php echo $naker_1 ?></small></td>
<td><small><?php echo $mikro_1 ?></small></td>
<td><small><?php echo $kecil_1 ?></small></td>
<td><small><?php echo $menengah_1 ?></small></td>
</tr>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo $umkm_0 ?></small></td>
<td><small><?php echo $naker_0 ?></small></td>
<td><small><?php echo $mikro_0 ?></small></td>
<td><small><?php echo $kecil_0 ?></small></td>
<td><small><?php echo $menengah_0 ?></small></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Tahun <?php echo $tahun ?></h6>
</div>
</div>
</div>
<?php if($msg!=='empty'){?>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3">Jumlah UMKM</th>
<th class="align-middle" colspan="3">Omset/Bulan</th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1 ?></small></td>
<td><small><?php echo $umkm_jen2 ?></small></td>
<td><small><?php echo $umkm_jen3 ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen1) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen2) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen3) ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="3"><small>Total</small></th>
</tr>
<?php
$umkm = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$omset = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $umkm ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($omset) ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-lg table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3" rowspan="2">Aset</th>
<th class="align-middle" colspan="6" >Jumlah Naker</th>
</tr>
<tr>
<th colspan="2" ><small>P</small></th>
<th colspan="2" ><small>J</small></th>
<th colspan="2" ><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo rupiah($aset_jen1) ?></small></td>
<td><small><?php echo rupiah($aset_jen2) ?></small></td>
<td><small><?php echo rupiah($aset_jen3) ?></small></td>
<td><small><?php echo $naker_jen1_l ?></small></td>
<td><small><?php echo $naker_jen1_p ?></small></td>
<td><small><?php echo $naker_jen2_l ?></small></td>
<td><small><?php echo $naker_jen2_p ?></small></td>
<td><small><?php echo $naker_jen3_l ?></small></td>
<td><small><?php echo $naker_jen3_p ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="6"><small>Total</small></th>
</tr>
<?php
$naker = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$naker = $naker+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$aset = $aset_jen1+$aset_jen2+$aset_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($aset) ?></small></th>
<th class="align-middle" colspan="6" ><small><?php echo $naker ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="9" >Klasifikasi</th>
</tr>
<tr>
<th colspan="3" ><small>P</small></th>
<th colspan="3" ><small>J</small></th>
<th colspan="3" ><small>I</small></th>
</tr>
<tr>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1_ket1?></small></td>
<td><small><?php echo $umkm_jen1_ket2?></small></td>
<td><small><?php echo $umkm_jen1_ket3?></small></td>
<td><small><?php echo $umkm_jen2_ket1?></small></td>
<td><small><?php echo $umkm_jen2_ket2?></small></td>
<td><small><?php echo $umkm_jen2_ket3?></small></td>
<td><small><?php echo $umkm_jen3_ket1?></small></td>
<td><small><?php echo $umkm_jen3_ket2?></small></td>
<td><small><?php echo $umkm_jen3_ket3?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Mikro</small></th>
<th class="align-middle" colspan="3"><small>Kecil</small></th>
<th class="align-middle" colspan="3"><small>Menengah</small></th>
</tr>
<?php
$mikro = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$kecil = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$menengah = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $mikro ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $kecil ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $menengah ?></small></th>
</tr>
</tfoot>
</table>
</div>
</div>
<?php } else {?>
<div class="card-body text-center">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
<script>
const element = document.querySelectorAll('#btn_hapus')
element.forEach(function(el){
el.addEventListener('click', function (e) {
e.preventDefault();
var urlToRedirect = e.currentTarget.getAttribute('href'); //use currentTarget because the click may be on the nested i tag and not a tag causing the href to be empty
console.log(urlToRedirect); // verify if this is the right URL
swal({
title: "Kamu yakin ?",
text: "Data yang dihapus tidak bisa dikembalikan.",
icon: "warning",
buttons: [
'Batal',
'Hapus'
],
dangerMode: true,
}).then(function(isConfirm) {
if (isConfirm) {
swal({
title: 'Berhasil',
text: 'Data berhasil terhapus',
icon: 'success'
}).then(function() {
window.location.href = urlToRedirect;
});
} else {
swal("Batal", "Data tidak terhapus.)", "error");
}
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,132 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>PRODUK</h3>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<table id="tabeldata" class="table table-sm datatable w-100 " >
<thead>
<tr>
<th>Foto</th>
<th>Produk</th>
<th>Deskripsi</th>
<th>UMKM</th>
<th>Kontak</th>
</tr>
</thead>
<tbody>
<?php foreach($listproduk as $produk){ ?>
<tr>
<td class="align-middle text-center"><img src="<?php echo base_url()?>/assets/images/produk/<?php echo $produk->foto_produk ?>" width="150" class="img-thumbnail"></td>
<td class="align-middle"><?php echo $produk->produk ?></td>
<td class="align-middle"><?php echo $produk->deskripsi ?></td>
<td class="align-middle"><?php echo $produk->nama ?></td>
<td class="align-middle"><?php echo $produk->telp ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
</body>
</html>

View File

@ -0,0 +1,130 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
<link rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<div class="container">
<a class="navbar-brand" href="#">
<img src="<?php echo base_url()?>assets/images/logo-white.png" width="100" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>UMKM</h3>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<table id="tabeldata" class="table table-sm datatable w-100 " >
<thead>
<tr>
<th>Foto</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Kontak</th>
</tr>
</thead>
<tbody>
<?php foreach($listumkm as $umkm){ ?>
<tr>
<td class="align-middle text-center"><img src="<?php echo base_url()?>/assets/images/umkm/<?php echo $umkm->foto_umkm ?>" width="150" class="img-thumbnail"></td>
<td class="align-middle"><?php echo $umkm->nama ?></td>
<td class="align-middle"><?php echo $umkm->deskripsi ?></td>
<td class="align-middle"><?php echo $umkm->telp ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
<script>
$(document).ready(function() {
$('#tabeldata').DataTable();
} );
</script>
</body>
</html>

View File

@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 19, 2021 at 02:23 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.23
-- Generation Time: Sep 21, 2021 at 10:17 AM
-- Server version: 10.4.16-MariaDB
-- PHP Version: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
@ -444,7 +444,10 @@ CREATE TABLE `tb_produk` (
--
INSERT INTO `tb_produk` (`id_produk`, `foto_produk`, `id_umkm`, `produk`, `deskripsi`) VALUES
(11, '11.png', 14, 'Aplikasi Dashboard UMKM', 'Aplikasi untuk pendataan UMKM');
(11, '11.png', 14, 'Aplikasi Dashboard UMKM', 'Aplikasi untuk pendataan UMKM'),
(12, '12.jpg', 1, 'Kursi Rotan', 'Kursi Rotan Kuat dan Indah'),
(13, '13.jpg', 1, 'Meja Rotan', 'Meja Minimalis'),
(15, '15.jpg', 1, 'Hiasan Rotan', 'Ornamen Interior Rotan');
-- --------------------------------------------------------
@ -476,10 +479,10 @@ CREATE TABLE `tb_umkm` (
INSERT INTO `tb_umkm` (`id_umkm`, `id_pemilik`, `nama`, `id_kategori`, `kecamatan`, `kelurahan`, `alamat`, `telp`, `id_jenis`, `omset_awal`, `aset_awal`, `karyawan_l`, `karyawan_p`, `deskripsi`, `foto_umkm`) VALUES
(1, '2', 'Meubel Rotan', 1, 'Magelang Utara', 'Kramat Utara', 'Jl. Jeruk Purut, Kupatan, Kramat Utara, Magelang', '08121212121', 1, 0, 100000000, 20, 8, 'Sedia berbagai furnitur dan Meubel', '1.jpg'),
(2, '2', 'Percetakan Jaya Muya', 1, 'Magelang Selatan', 'Tidar Selatan', 'Kiringan III, Tidar Selatan, Kota Magelang', '0811111111', 2, 0, 30000000, 30, 12, 'Jasa Reklame, Baliho, Banner dan Printing Sepanduk', 'umkm.png'),
(3, '2', 'Frozen Food Magelang', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Tanon, Jl. Singosari, Rejowinangun Selatan, Magelang', '08121212121', 2, 0, 5000000, 5, 8, 'Reseller Produk makanan beku : Sosis, Daging, Tempura, Nuget, dll', 'umkm.png'),
(4, '6', 'Putih Abu Workshop', 1, 'Magelang Tengah', 'Cacaban', 'Cacaban Tengah', '+6233333923', 3, 0, 10000000, 3, 6, 'Souvenir Nikah Karakter', 'umkm.png'),
(14, '16', 'Mage Soft', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Rejowinangun Selatan, Magelang Selatan', '081228868280', 3, 156000000, 10000000, 1, 0, 'Software Developer', 'umkm.png');
(2, '2', 'Percetakan Jaya Muya', 1, 'Magelang Selatan', 'Tidar Selatan', 'Kiringan III, Tidar Selatan, Kota Magelang', '0811111111', 2, 0, 30000000, 30, 12, 'Jasa Reklame, Baliho, Banner dan Printing Sepanduk', '2.jpg'),
(3, '2', 'Frozen Food Magelang', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Tanon, Jl. Singosari, Rejowinangun Selatan, Magelang', '08121212121', 2, 0, 5000000, 5, 8, 'Reseller Produk makanan beku : Sosis, Daging, Tempura, Nuget, dll', '3.jpg'),
(4, '6', 'Putih Abu Workshop', 1, 'Magelang Tengah', 'Cacaban', 'Cacaban Tengah', '+6233333923', 3, 0, 10000000, 3, 6, 'Souvenir Nikah Karakter', '4.jpg'),
(14, '16', 'Mage Soft', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Rejowinangun Selatan, Magelang Selatan', '081228868280', 3, 156000000, 10000000, 1, 0, 'Software Developer', '14.jpg');
-- --------------------------------------------------------
@ -630,7 +633,7 @@ ALTER TABLE `tb_laporan`
-- AUTO_INCREMENT for table `tb_produk`
--
ALTER TABLE `tb_produk`
MODIFY `id_produk` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
MODIFY `id_produk` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `tb_umkm`