Exemple #1
0
 public function registrasi()
 {
     $this->config->load('grocery_crud');
     $this->config->set_item('grocery_crud_file_upload_allow_file_types', 'pdf');
     $this->config->set_item('grocery_crud_file_upload_max_file_size', '200KB');
     $c = new grocery_crud();
     $c->set_table('registrasi');
     // $c->unset_back_to_list();
     $c->unset_edit();
     //$c->unset_delete();
     $c->unset_read();
     $c->unset_list();
     if ($this->uri->segment(2) == 'registrasi' && $this->uri->segment(3) == NULL) {
         redirect($this->router->fetch_class() . '/' . $this->router->fetch_method() . '/add');
     }
     $c->set_rules('email', 'Email', 'required|valid_email');
     // unset field
     //        $c->unset_fields('tanggal_member', 'pengajuan', '');
     $c->unset_fields('tanggal_member', 'pengajuan', 'file_surat_pernyataan');
     $c->field_type('deskripsi_perusahaan', 'text');
     $c->field_type('alamat', 'text');
     $c->callback_add_field('syarat_ketentuan', function () {
         return '<input type="radio" maxlength="50" value="1" name="syarat_ketentuan">&nbsp;&nbsp;Dengan mencetang tanda ini berarti Anda telah menyetujui syarat & ketentuan yang berlaku';
     });
     $c->display_as('surat_ket_domisili', 'Nomor Surat Keterangan Domisili');
     $c->display_as('siup', 'Nomor SIUP/Perizinan Lainnya');
     $c->display_as('npwp', 'Nomor NPWP');
     $c->display_as('file_siup', 'SIUP/Perizinan Lainnya');
     $c->display_as('file_surat_ket_domisili', 'Surat Keterangan Domisili');
     $c->unset_texteditor('deskripsi_perusahaan', 'full_text');
     $c->unset_texteditor('alamat', 'full_text');
     $this->load->config('grocery_crud');
     $this->config->set_item('grocery_crud_file_upload_allow_file_types', 'pdf');
     $c->set_field_upload('file_surat_ket_domisili', 'assets/uploads/file_register');
     $c->set_field_upload('file_siup', 'assets/uploads/file_register');
     $c->required_fields('syarat_ketentuan', 'nama_perusahaan', 'direktur_utama', 'contact_person', 'email', 'alamat', 'provinsi', 'kota', 'npwp', 'akte_perusahaan', 'siup', 'file_akte', 'file_siup');
     $c->set_relation('kota', 'ref_kota', 'kota');
     $c->set_relation('provinsi', 'ref_provinsi', 'provinsi');
     $c->callback_field('email', function ($value, $row) {
         return '<input type="text" value="' . $value . '" name="email" id="field-email"> <span style="color:red; font-size:10px">*) Pastikan alamat email yang Anda masukkan valid</span>';
     });
     //$c->callback_insert(array($this, 'after_registrasi'));
     if ($this->uri->segment(3) == 'success') {
         redirect('umum/after_registrasi');
     }
     $output = $c->render();
     $state = $c->getState();
     $state_info = $c->getStateInfo();
     $this->logs();
     $this->load->view('umum/registrasi', $output);
 }
Exemple #2
0
 function index()
 {
     $crud = new grocery_crud();
     $crud->set_table('libro');
     $crud->set_subject('Libros');
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_delete();
     $crud->unset_print();
     $crud->unset_export();
     $crud->columns('clasificacion', 'titulo', 'autor', 'editorial', 'ISBN', 'estado');
     $output = $crud->render();
     $this->_example_output($output);
 }
 public function csr()
 {
     $c = new grocery_crud();
     $c->set_table('csr');
     // if($this->glo_jenis_permo != ''){
     // $c->unset_delete();
     // $c->unset_read();
     // $c->unset_edit();
     $sl_permohonan = select('*', 'permohonan', array('id_permohonan' => $this->session->userdata('id_permohonan'), 'selesai' => 2));
     if (!$sl_permohonan) {
         $c->unset_delete();
         $c->unset_read();
         $c->unset_edit();
     }
     $c->columns('kegiatan', 'waktu', 'lokasi');
     $c->callback_column('status', function ($value, $row) {
         $ada = NULL;
         $cek_if_has_data_permohonan = select('status_pemakaian', 'csr', array('id_perusahaan' => $this->session->userdata('id_perusahaan'), 'id_csr' => $row->id_csr));
         $temp = explode(',', $cek_if_has_data_permohonan->status_pemakaian);
         if ($cek_if_has_data_permohonan != NULL) {
             foreach ($temp as $key => $status_pemakaian) {
                 if ($status_pemakaian == $this->session->userdata('id_permohonan')) {
                     $ada = 'ada';
                 }
             }
         }
         if ($ada != NULL) {
             return 'Dipilih';
         } else {
             return '';
         }
     });
     $c->add_action('Pilih', base_url('assets/grocery_crud/themes/flexigrid/css/images/success.png'), 'perusahaan/pilih/csr/csr', 'ui-icon-plus', function ($primary_key, $row) {
         $ada = NULL;
         $cek_if_has_data_permohonan = select('status_pemakaian', 'csr', array('id_perusahaan' => $this->session->userdata('id_perusahaan'), 'id_csr' => $primary_key));
         $temp = explode(',', $cek_if_has_data_permohonan->status_pemakaian);
         if ($cek_if_has_data_permohonan != NULL) {
             foreach ($temp as $key => $status_pemakaian) {
                 if ($status_pemakaian == $this->session->userdata('id_permohonan')) {
                     $ada = 'ada';
                 }
             }
         }
         if ($ada != NULL) {
             return base_url('perusahaan/ganti') . '/csr/csr/' . $primary_key;
         } else {
             return base_url('perusahaan/pilih') . '/csr/csr/' . $primary_key;
         }
     });
     // }
     $c->where('id_perusahaan', $this->session->userdata('id_perusahaan'));
     $c->required_fields('kegiatan', 'waktu', 'lokasi');
     $c->set_relation('lokasi', 'ref_kota', 'kota', null, 'id_kota');
     $c->field_type('id_perusahaan', 'hidden', $this->session->userdata('id_perusahaan'));
     $c->set_field_upload('file_csr', 'assets/uploads/file_csr');
     $c->unset_fields('catatan_petugas', 'status_pemakaian');
     //$c->unset_columns('id_perusahaan', 'catatan_petugas', 'status_pemakaian');
     $c->display_as('file_csr', 'File CSR');
     //$c->unset_delete();
     $output = $c->render();
     $this->logs();
     $level = $this->session->userdata('level');
     if ($level != NULL) {
         if ($level == 1) {
             $this->load->view('level1/skt_tabel', $output);
         } else {
             redirect('all_users/dashboard');
         }
     } elseif ($level == NULL) {
         redirect('umum/logout');
     }
 }
Exemple #4
0
 function tabla()
 {
     $fecha = date("Y/m/d");
     $crud = new grocery_crud();
     $crud->set_table('prestamo');
     $crud->set_subject('Prestamos');
     $crud->required_fields('Fecha_salida', 'Fecha_entrega');
     $crud->display_as('idUsuario', 'Nombre de Usuario')->display_as('idLibro', 'Nombre del libro');
     $crud->columns('idLibro', 'idUsuario', 'fecha_salida', 'fecha_entrega');
     $crud->add_action('Entrega', 'https://cdn3.iconfinder.com/data/icons/musthave/16/Check.png', '', '', array($this, 'redirigir'));
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_delete();
     $crud->unset_print();
     $crud->unset_export();
     $crud->set_relation('idLibro', 'libro', 'titulo');
     $crud->set_relation('idUsuario', 'usuario_biblioteca', '{nombre} {apellidos}');
     $crud->field_type('fecha_salida', 'hidden', $fecha);
     $output = $crud->render();
     $this->_example_output($output);
 }
Exemple #5
0
 public function pengajuan_skt_diterima_naik()
 {
     // merubah status_user menjadi dokumen lengkap
     $c = new grocery_crud();
     $c->set_table('disposisi');
     //$c->unset_delete();
     $c->unset_edit();
     $last_disposisi = $this->model->select('*', 'disposisi', array('id_disposisi' => $this->uri->segment(4)));
     $level = $this->session->userdata('level');
     $c->field_type('user_asal', 'hidden', $this->session->userdata('id_user'));
     $c->field_type('id_parent', 'hidden', $last_disposisi->id_disposisi);
     // /$c->field_type('catatan', 'text');
     $c->display_as('id_perusahaan', 'nama perusahaan');
     //lagi di level 2 didisposisi ke level 4
     if ($level == 6) {
         $c->field_type('status_progress', 'hidden', '9');
     } elseif ($level == 5) {
         # code...
         $c->field_type('status_progress', 'hidden', '11');
     } elseif ($level == 4) {
         $c->field_type('status_progress', 'hidden', '12');
     } elseif ($level == 3) {
         $c->field_type('status_progress', 'hidden', '13');
     }
     //untuk polih user tujuan
     if ($level == 6) {
         $level = 5;
     } elseif ($level == 5) {
         $level = 4;
     } elseif ($level == 4) {
         $level = 3;
     } elseif ($level == 3) {
         $level = 2;
     }
     $l4 = $this->model->selects('*', 'users', array('level' => $level));
     foreach ($l4 as $key => $l4o) {
         # code...
         $ListUser = array($l4o->id_user => $l4o->nama_lengkap);
     }
     $c->field_type('user_tujuan', 'dropdown', $ListUser);
     $c->set_relation('id_perusahaan', 'biodata_perusahaan', 'nama_perusahaan', array('id_perusahaan' => $last_disposisi->id_perusahaan));
     $c->unset_fields('tanggal_masuk', 'tanggal_selesai', 'nilai', 'catatan', 'id_permohonan');
     $c->callback_after_insert(array($this, 'update_pengajuan_skt_diterima_naik'));
     $output = $c->render();
     $state = $c->getState();
     $state_info = $c->getStateInfo();
     if ($state == 'success') {
         $level = $this->session->userdata('level');
         if ($level == 6) {
             redirect('all_admin/konsep_dokumen_skt/add/' . $this->uri->segment(4));
         } elseif ($level == 5) {
             redirect('all_admin/no_dokumen_skt/add/' . $this->uri->segment(4));
         } else {
             redirect(base_url('all_admin/daftar_pengajuan_skt_admin_naik'));
         }
     }
     $level = $this->session->userdata('level');
     if ($level != NULL) {
         $this->load->view('level' . $level . '/view_list', $output);
     } elseif ($level == NULL) {
         redirect('umum/logout');
     }
 }
Exemple #6
0
 public function pengajuan_skp_diterima_naik()
 {
     // merubah status_user menjadi dokumen lengkap
     $c = new grocery_crud();
     $c->set_table('disposisi');
     //$c->unset_delete();
     $c->unset_edit();
     $last_disposisi = $this->model->select('*', 'disposisi', array('id_permohonan' => $this->uri->segment(4)), array('id_disposisi', 'desc'));
     $level = $this->session->userdata('level');
     $c->fields('user_asal', 'id_parent', 'status_progress', 'id_perusahaan', 'user_tujuan', 'id_permohonan', 'catatan_user_asal');
     $c->field_type('id_permohonan', 'hidden', $this->uri->segment(4));
     $c->field_type('user_asal', 'hidden', $this->session->userdata('id_user'));
     $c->field_type('id_parent', 'hidden', $last_disposisi->id_disposisi);
     // $c->field_type('catatan', 'text');
     $c->required_fields('user_tujuan', 'id_perusahaan');
     $c->display_as('catatan_user_asal', 'Catatan');
     $c->display_as('id_perusahaan', 'nama perusahaan');
     //lagi di level 2 didisposisi ke level 4
     if ($level == 6) {
         $c->field_type('status_progress', 'hidden', '9');
         $tujuan = 5;
     } elseif ($level == 5) {
         $c->field_type('status_progress', 'hidden', '11');
         $tujuan = 4;
     } elseif ($level == 4) {
         $c->field_type('status_progress', 'hidden', '12');
         $tujuan = 3;
     } elseif ($level == 3) {
         $c->field_type('status_progress', 'hidden', '13');
         $tujuan = 7;
     }
     $c->set_relation('user_tujuan', 'users', 'nama_lengkap', array('level' => $tujuan));
     $c->set_relation('id_perusahaan', 'biodata_perusahaan', 'nama_perusahaan', array('id_perusahaan' => $last_disposisi->id_perusahaan));
     $c->callback_after_insert(array($this, 'update_pengajuan_skt_diterima_naik'));
     $output = $c->render();
     $state = $c->getState();
     $state_info = $c->getStateInfo();
     if ($state == 'success') {
         $level = $this->session->userdata('level');
         if ($level == 6) {
             $dok_pendukung = $this->model->select('*', 'dokumen_pendukung_pjit', array('id_permohonan' => ''));
             redirect('all_admin/konsep_dokumen_skp/add/' . $this->uri->segment(4));
         } elseif ($level == 5) {
             redirect(site_url('all_admin/daftar_pengajuan_skp_admin_naik'));
         } elseif ($level == 7) {
             $dokumenskt = select('*', 'disposisi', array('id_disposisi' => $this->uri->segment(4)));
             $id_dokumenskt = select('*', 'dokumen_skt', array('id_permohonan' => $dokumenskt->id_permohonan));
             redirect('all_admin/no_dokumen_skp/edit/' . $id_dokumenskt->id_dokumen);
         } else {
             redirect(base_url('all_admin/daftar_pengajuan_skp_admin_naik'));
         }
     }
     $level = $this->session->userdata('level');
     if ($level != NULL) {
         $this->load->view('level' . $level . '/view_list', $output);
     } elseif ($level == NULL) {
         redirect('umum/logout');
     }
 }
Exemple #7
0
 public function pengajuan_skt_diterima_dtlm($id_perusahaan = NULL)
 {
     // merubah status_user menjadi dokumen lengkap
     $c = new grocery_crud();
     $c->set_table('disposisi');
     //$c->unset_delete();
     $c->unset_edit();
     // $c->field_type('id_perusahaan', 'hidden', $id_perusahaan);
     $last_disposisi = $this->model->select('*', 'disposisi', array('id_perusahaan' => $this->uri->segment(4)));
     $c->field_type('user_asal', 'hidden', $this->session->userdata('id_user'));
     $c->field_type('id_parent', 'hidden', $last_disposisi->id_disposisi);
     $c->field_type('catatan', 'text');
     $c->display_as('id_perusahaan', 'nama_perusahaan');
     $query = $this->db->query('SELECT * FROM users WHERE level=4 AND status=1')->result_array();
     foreach ($query as $key => $row) {
         $listDtlm = array($row['id_user'] => $row['nama_lengkap']);
     }
     $c->field_type('user_tujuan', 'dropdown', $listDtlm);
     $c->set_relation('id_perusahaan', 'biodata_perusahaan', 'nama_perusahaan', array('id_perusahaan' => $this->uri->segment(4)));
     $c->unset_fields('tanggal_masuk', 'tanggal_selesai');
     $c->callback_after_insert(array($this, 'update_pengajuan_skt_diterima'));
     $output = $c->render();
     $state = $c->getState();
     $state_info = $c->getStateInfo();
     if ($state == 'success') {
         redirect(base_url('hal/daftar_pengajuan_skt_baru_admin'));
     }
     $this->load->view('level2/view_list', $output);
 }
 public function csr()
 {
     $c = new grocery_crud();
     $c->set_table('csr');
     if ($this->glo_jenis_permo != '') {
         $c->unset_delete();
         $c->unset_read();
         $c->unset_edit();
         $c->add_action('Pilih', 'sd', 'perusahaan/pilih/csr', 'ui-icon-plus');
     }
     $c->where('id_perusahaan', $this->session->userdata('id_perusahaan'));
     $c->required_fields('kegiatan', 'waktu', 'lokasi');
     $c->set_relation('lokasi', 'ref_kota', 'kota', null, 'id_kota');
     $c->field_type('id_perusahaan', 'hidden', $this->session->userdata('id_perusahaan'));
     $c->set_field_upload('file_csr', 'assets/uploads/file_csr');
     $c->unset_fields('catatan_petugas', 'status_pemakaian');
     $c->unset_columns('id_perusahaan', 'catatan_petugas', 'status_pemakaian');
     $c->display_as('file_csr', 'File CSR');
     //$c->unset_delete();
     $output = $c->render();
     $this->logs();
     $level = $this->session->userdata('level');
     if ($level != NULL) {
         if ($level == 1) {
             $this->load->view('level1/skt_tabel', $output);
         } else {
             redirect('all_users/dashboard');
         }
     } elseif ($level == NULL) {
         redirect('umum/logout');
     }
 }