Add anual report feature
This commit is contained in:
@@ -27,8 +27,12 @@ class DetailUmkm extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$get = $this->input->get();
|
||||
if($this->input->get()){
|
||||
$get = $this->input->get();
|
||||
if(isset($get['msg'])){
|
||||
$data['msg'] = 'success';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$umkm = $this->UmkmModel->getUmkmsById($get['id_umkm']);
|
||||
@@ -41,6 +45,9 @@ class DetailUmkm extends CI_Controller {
|
||||
|
||||
$post = $this->input->post();
|
||||
if($this->AbsensiModel->update($post['id_absensi'])){
|
||||
|
||||
$this->UmkmModel->updateAset($umkm->id_umkm,$post['aset']);
|
||||
|
||||
redirect(site_url('user/detailumkm?id_umkm='.$umkm->id_umkm.'&msg=success'));
|
||||
} else {
|
||||
$data['msg']="error!";
|
||||
|
||||
@@ -76,8 +76,6 @@ class Produk extends CI_Controller {
|
||||
$data['umkm'] = $umkm;
|
||||
$data['pemilik'] = $pemilik;
|
||||
$data['user_logged'] = $this->session->userdata('user_logged');
|
||||
|
||||
|
||||
|
||||
$this->load->view('user/produk',$data);
|
||||
|
||||
|
||||
45
application/controllers/user/ResetPassword.php
Normal file
45
application/controllers/user/ResetPassword.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class ResetPassword extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model("UserModel");
|
||||
|
||||
if($this->UserModel->isNotLogin()) {
|
||||
redirect(site_url('login'));
|
||||
} elseif(!($this->UserModel->isPemilik())) {
|
||||
redirect(site_url('admin/dashboard'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['user_logged'] = $this->session->userdata('user_logged');
|
||||
|
||||
if($this->input->get()){
|
||||
$get = $this->input->get();
|
||||
if(isset($get['msg'])){
|
||||
$data['msg'] = $get['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
if($this->input->post()){
|
||||
|
||||
if($this->UserModel->resetPassword($data['user_logged']->id_user)){
|
||||
redirect(site_url('user/resetpassword?&msg=success'));
|
||||
} else {
|
||||
$data['msg']="error!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->load->view('user/resetpassword',$data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -40,6 +40,7 @@ class RiwayatAbsensi extends CI_Controller {
|
||||
|
||||
|
||||
$cekabsensiakhir = $this->AbsensiModel->getLatestSignedAbsensiCountByUmkmId($umkm->id_umkm);
|
||||
//var_dump($cekabsensiakhir);die();
|
||||
|
||||
if($cekabsensiakhir > 0 ){
|
||||
$absensiakhir = $this->AbsensiModel->getLatestSignedAbsensiByUmkmId($umkm->id_umkm);
|
||||
|
||||
79
application/controllers/user/setting.php
Normal file
79
application/controllers/user/setting.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Setting extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model("UserModel");
|
||||
$this->load->model("KelurahanModel");
|
||||
|
||||
if($this->UserModel->isNotLogin()) {
|
||||
redirect(site_url('login'));
|
||||
} elseif(!($this->UserModel->isPemilik())) {
|
||||
redirect(site_url('admin/dashboard'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$current_user['user_logged'] = $this->session->userdata('user_logged');
|
||||
$pemilik = $this->UserModel->getUsersById($current_user['user_logged']->id_user);
|
||||
|
||||
if($this->input->get()){
|
||||
$get = $this->input->get();
|
||||
if(isset($get['msg'])){
|
||||
$data['msg'] = $get['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
if($this->input->post()){
|
||||
|
||||
if(strlen($_FILES['foto_user']['tmp_name'])>0){
|
||||
$config['upload_path'] = './assets/images/';
|
||||
$config['allowed_types'] = 'jpg|jpeg|gif|png';
|
||||
$config['max_size'] = 100;
|
||||
$config['max_width'] = 1024;
|
||||
$config['max_height'] = 768;
|
||||
$config['file_name'] = $pemilik->username;
|
||||
$config['overwrite'] = TRUE;
|
||||
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if ( ! $this->upload->do_upload('foto_user')){
|
||||
$data['error_upload'] = $this->upload->display_errors();
|
||||
}else{
|
||||
$foto_lama = $pemilik->foto_user;
|
||||
$file = $this->upload->data();
|
||||
if($this->UserModel->selfUpdate($pemilik->id_user,$file['file_name'])){
|
||||
if($pemilik->foto_user!=='user.png'){
|
||||
unlink('./assets/images/'.$foto_lama);
|
||||
}
|
||||
redirect(site_url('user/setting?&msg=success'));
|
||||
} else {
|
||||
$data['msg']="error!";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$foto_user = $pemilik->foto_user;
|
||||
if($this->UserModel->selfUpdate($pemilik->id_user,$foto_user)){
|
||||
redirect(site_url('user/setting?&msg=success'));
|
||||
} else {
|
||||
$data['msg']="error!";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data['pemilik'] = $pemilik;
|
||||
$data['listkelurahan'] = $this->KelurahanModel->getKelurahan();
|
||||
$data['user_logged'] = $this->session->userdata('user_logged');
|
||||
$this->load->view('user/setting',$data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user