Esempio n. 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);
 }
Esempio n. 2
0
 function tablaprestamo($primary_key, $valor, $valor1)
 {
     global $variableGlobal, $registro;
     $variableGlobal = $primary_key;
     $registro = urldecode($valor);
     $fecha = date("Y/m/d");
     $crud = new grocery_crud();
     $crud->set_table('prestamo');
     $crud->set_subject('Prestamos');
     $crud->display_as('datos', 'Datos del libro')->display_as('idUsuario', 'Nombre de Usuario');
     $crud->unset_edit();
     $crud->unset_delete();
     $crud->unset_print();
     $crud->unset_export();
     $crud->field_type('idLibro', 'hidden', $variableGlobal);
     $crud->callback_add_field('datos', array($this, 'recuperaDatos'));
     $crud->set_relation('idUsuario', 'usuario_biblioteca', '{nombre} {apellidos}');
     $crud->field_type('fecha_entrega', 'hidden', $this->calculaFecha("days", 14, $fecha));
     $crud->callback_after_insert(array($this, 'actualizarPrestamo'));
     $output = $crud->render();
     $this->_example_output($output);
 }
Esempio n. 3
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_permohonan' => $this->uri->segment(4)), array('id_disposisi', 'desc'));
     $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('id_permohonan', 'hidden', $this->uri->segment(4));
     // /$c->field_type('catatan', 'text');
     $c->display_as('catatan_user_asal', 'Disposisi');
     $c->display_as('id_perusahaan', 'nama perusahaan');
     $c->required_fields('user_tujuan', 'id_perusahaan');
     //lagi di level 2 didisposisi ke level 4
     if ($level == 6) {
         $c->field_type('status_progress', 'hidden', '9');
         $tujuan = 5;
         $c->callback_add_field('user_tujuan', function () {
             $dispo = $this->model->select('user_asal', 'disposisi', array('id_permohonan' => $this->uri->segment(4), 'status_progress' => 8));
             $users = $this->model->select('nama_lengkap', 'users', array('id_user' => $dispo->user_asal));
             return '<input type="hidden" maxlength="50" value="' . $dispo->user_asal . '" name="user_tujuan">' . $users->nama_lengkap;
         });
     } 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;
     }
     if ($level != 6) {
         $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->unset_fields('tanggal_masuk', 'tanggal_selesai', 'nilai', 'catatan');
     // if ($level == 3) {
     //     $c->callback_after_insert(array($this, 'update_permohonan_dokumen_skt'));
     // }
     $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/daftar_pengajuan_skt');
         } elseif ($level == 5) {
             redirect(site_url('all_admin/daftar_pengajuan_skt_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_skt/edit/' . $id_dokumenskt->id_dokumen);
         } 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');
     }
 }
Esempio n. 4
0
 public function registrasi()
 {
     $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');
     $c->display_as('npwp', 'Nomor NPWP');
     $c->display_as('file_siup', 'SIUP');
     $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->set_field_upload('file_surat_pernyataan', 'assets/uploads/file_register');
     $c->set_field_upload('file_struktur_organisasi', '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', 'file_struktur_organisasi');
     $c->set_relation('kota', 'ref_kota', 'kota', null, 'id_kota');
     $c->set_relation('provinsi', 'ref_provinsi', 'provinsi', null, 'id_provinsi');
     //$c->callback_insert(array($this, 'after_registrasi'));
     if ($this->uri->segment(3) == 'success') {
         // $data = '<h1>Selamat! Registrasi Anda Berhasil!</h1>';
         // $output = array('output' => '<h1>Selamat! Registrasi Anda Berhasil!</h1>');
         // $this->load->view('umum/registrasi', $output);
         redirect('hal/after_registrasi');
     }
     $output = $c->render();
     $state = $c->getState();
     $state_info = $c->getStateInfo();
     $this->logs();
     $this->load->view('umum/registrasi', $output);
 }