| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/wamp/www/SIPBOS_2020/application/modules/penomoran/controllers/ |
Upload File : |
<?php
class Penomoran extends Admin_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('penomoran_model', 'data_model');
$this->load->model('auth/login_model', 'auth');
$user_data = $this->session->userdata;
$this->load->vars($user_data);
}
public function index()
{
$data['breadcrumbs'] = 'Prefix Penomoran';
$data['title'] = 'SIP Keuangan';
$data['main_content'] = 'penomoran_view';
$data['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
$this->load->view('layout/template', $data);
}
public function proses_form()
{
$response = (object) NULL;
$id = $this->input->post('id');
$template = $this->input->post('template');
if(preg_match("/skpd/", $template)) {
$angka = substr($template, -2,1);
if($angka > 2){
$response->isSuccess = FALSE;
$response->message = 'Kode SKPD salah.';
}
else{
$this->data_model->update_data($id);
$response->isSuccess = TRUE;
$response->message = 'Penomoran sudah di ubah';
}
}
else{
$this->data_model->update_data($id);
$response->isSuccess = TRUE;
$response->message = 'Penomoran sudah di ubah';
}
echo json_encode($response);
}
public function get_daftar()
{
$response = (object) NULL;
$result = $this->data_model->get_data();
$count = count($result);
$response->page = 1;
$response->total = 1;
$response->records = $count;
for($i=0; $i<count($result); $i++)
{
$response->rows[$i]['id'] = $result[$i]['TIPE'];
$response->rows[$i]['cell'] = array(
$result[$i]['NAMA'],
$result[$i]['TEMPLATE']
);
}
echo json_encode($response);
}
function duplikasi_kode($str)
{
$id = $this->input->post('id');
if ($this->data_model->check_duplication($str, $id))
{
$this->form_validation->set_message('duplikasi_kode', '%s "'.$str.'" sudah ada.');
return FALSE;
}
else
{
return TRUE;
}
}
}