public function pelaporan_periodik() { $c = new grocery_crud(); $c->set_table('pelaporan_periodik'); $permohonan = $this->session->userdata('id_permohonan'); $c->unset_delete(); $c->unset_read(); $c->unset_print(); $c->unset_export(); $c->unset_mytools(); $c->set_field_upload('file_pelaporan_periodik', 'assets/uploads/file_pelaporan_periodik'); $c->columns('semester', 'file_pelaporan_periodik', 'status_laporan'); $c->fields('semester', 'id_permohonan', 'file_pelaporan_periodik', 'id_evaluator', 'id_perusahaan', 'status_laporan', 'create_at', 'catatan_evaluator'); $c->field_type('id_permohonan', 'hidden', $permohonan); $c->field_type('id_perusahaan', 'hidden', $this->session->userdata('id_perusahaan')); $c->field_type('status_laporan', 'hidden', '1'); $c->field_type('create_at', 'hidden', strftime('%Y-%m-%d')); $c->field_type('catatan_evaluator', 'hidden'); $c->callback_after_update(function ($post_array, $primary_key) { $this->db->update('pelaporan_periodik', array('catatan_evaluator' => NULL), array('id_pelaporan_periodik' => $primary_key)); return TRUE; }); $c->callback_column('status_laporan', function ($value, $row) { if ($value == 1) { return 'Diajukan'; } elseif ($value == 2) { return 'Revisi | <a class="link-pilih" title="Edit data" href="' . base_url() . 'perusahaan/pelaporan_periodik/edit/' . $row->id_pelaporan_periodik . '"><img class="mybtn-edit"></a>'; } elseif ($value == 3) { return 'Disetujui'; } elseif ($value == 4) { return 'Ditolak'; } }); $c->where('id_permohonan', $permohonan); $c->set_relation('semester', 'ref_semester', 'semester', array('is_delete' => 0)); $sl_permohonan = select('user_tujuan', 'disposisi', array('id_permohonan' => $permohonan, 'status_progress' => 8), array('id_disposisi', 'DESC')); $smohon = select('*', 'users', array('id_user' => $sl_permohonan->user_tujuan, 'level' => 6)); //$retVal = ($smohon) ? $smohon->id_user : 0 ; $c->field_type('id_evaluator', 'hidden', $smohon->id_user); $output = $c->render(); $this->logs(); $level = $this->session->userdata('level'); $status = $this->session->userdata('status_lap_periodik'); if ($level != NULL) { if ($level == 1 && $status == 1) { $this->load->view('level1/view_list', $output); } else { redirect('all_users/dashboard'); } } elseif ($level == NULL) { redirect('umum/logout'); } if ($c->getState() != 'add') { $c->change_field_type('semester', 'readonly'); if ($c->getState() == 'success') { redirect('perusahaan/pelaporan_periodik'); } } }
public function pelaporan_periodik($permohonan = NULL) { # code... $c = new grocery_crud(); $c->set_table('pelaporan_periodik'); $c->set_field_upload('file_pelaporan_periodik', 'assets/uploads/file_pelaporan_periodik'); $c->columns('semester', 'file_pelaporan_periodik'); $c->fields('semester', 'id_permohonan', 'file_pelaporan_periodik'); $c->field_type('id_permohonan', 'hidden', $permohonan); $c->where('id_permohonan', $permohonan); $c->set_relation('semester', 'ref_semester', 'semester'); $output = $c->render(); $this->logs(); view('level1/view_list', $output); if ($c->getState() != 'add') { $c->change_field_type('semester', 'readonly'); } // if ($c->getState() != 'list') { // // $this->menej_ref($output); // } else { // return $output; // } }
public function daftar_pengajuan_skt_perpanjangan_admin_naik() { $c = new grocery_crud(); $permohonan = $this->model->select('*', 'permohonan', array('jenis_permohonan' => 'Perpanjangan SKT')); $c->set_table('disposisi'); $level = $this->session->userdata('level'); if ($level == 5) { $c->where('status_progress', 9); $id_per = $this->model->select('id_perusahaan', 'disposisi', array('status_progress' => 9)); } elseif ($level == 4) { $c->where('status_progress', 11); $id_per = $this->model->select('id_perusahaan', 'disposisi', array('status_progress' => 11)); } elseif ($level == 3) { $c->where('status_progress', 12); $id_per = $this->model->select('id_perusahaan', 'disposisi', array('status_progress' => 12)); } elseif ($level == 2) { $c->where('status_progress', 13); $id_per = $this->model->select('id_perusahaan', 'disposisi', array('status_progress' => 13)); } if ($id_per != NULL) { $id_per = $id_per->id_perusahaan; } else { $id_per = ''; } $permohonan = $this->model->selects('*', 'permohonan', array('jenis_permohonan' => 'Perpanjangan SKT', 'id_perusahaan' => $id_per)); if ($permohonan != NULL) { foreach ($permohonan as $key => $value) { $c->where('id_perusahaan', $value->id_perusahaan); } } else { $c->where('id_perusahaan', ''); } $c->unset_add(); //$c->unset_delete(); $c->unset_edit(); $c->unset_read(); $c->field_type('id_user', 'hidden', $this->session->userdata('id_user')); $c->field_type('alamat', 'text'); $c->unset_columns('id_user', 'status_user', 'contact_person', 'alamat', 'provinsi', 'website', 'deskripsi_perusahaan', 'status_progress', 'keterangan'); // $c->add_action('Revisi','sR', base_url('all_admin/revisi_pengajuan_skt/').'/'); // $c->add_action('Lanjut','text', base_url('all_admin/pengajuan_skt_diterima/add').'/'); $c->add_action('Detail Evaluasi', 'sd', 'all_admin/detail_evaluasi/perpanjangan_skt'); $c->set_crud_url_path(base_url(strtolower(__CLASS__ . "/" . __FUNCTION__)), base_url(strtolower(__CLASS__ . "/daftar_pengajuan_skt"))); $c->required_fields('nama_perusahaan', 'direktur_utama', 'contact_person', 'email', 'alamat', 'kota', 'provinsi', 'website'); $c->unset_fields('tanggal_member', 'status_user', 'keterangan'); $output = $c->render(); $this->logs(); if ($c->getState() != 'list') { $this->daftar_pengajuan_skt_admin($output); } else { return $output; } }
public function ref_semester() { $c = new grocery_crud(); $c->set_table('ref_semester'); $c->unset_delete(); $c->unset_columns('is_delete'); $c->where('is_delete', 0); $c->fields('semester'); $c->set_crud_url_path(base_url(strtolower(__CLASS__ . "/" . __FUNCTION__)), base_url(strtolower(__CLASS__ . "/menej_ref"))); $c->add_action('More', '', 'admin/soft_delete', 'delete-icon'); $output = $c->render(); if ($c->getState() != 'list') { $this->menej_ref($output); } else { return $output; } }
public function laporan_berkala_kasie() { $this->config->load('grocery_crud'); $this->config->set_item('grocery_crud_dialog_forms', true); $this->config->set_item('grocery_crud_default_per_page', 10); $this->load->config('grocery_crud'); $c = new grocery_crud(); $c->set_table('pelaporan_periodik'); $c->where('id_kasie', $this->session->userdata('id_user')); $c->where('status_laporan', 1); $c->or_where('id_kasie', NULL); $c->or_where('status_laporan', 2); $c->columns('id_perusahaan', 'no_skt', 'bidang_usaha', 'semester', 'file_pelaporan_periodik', 'catatan_evaluator', 'status_laporan', 'aksi'); $c->field_type('id_permohonan', 'hidden'); $c->field_type('id_kasie', 'hidden', $this->session->userdata('id_user')); $c->set_relation('id_perusahaan', 'biodata_perusahaan', 'nama_perusahaan'); $c->set_relation('id_evaluator', 'users', 'nama_lengkap', array('level' => 6)); $c->fields('file_pelaporan_periodik', 'id_permohonan', 'semester', 'id_perusahaan', 'id_kasie', 'id_evaluator'); $c->required_fields('file_pelaporan_periodik', 'id_permohonan', 'semester', 'id_perusahaan', 'id_kasie', 'id_evaluator'); $c->edit_fields('id_evaluator', 'id_kasie', 'skrip'); $c->set_field_upload('file_pelaporan_periodik', 'assets/uploads/file_pelaporan_periodik'); $c->unset_delete(); //$c->unset_edit(); //$c->unset_read(); $c->unset_add(); $c->unset_export(); $c->unset_print(); $c->callback_field('skrip', function ($value, $row) { return '<script> $("#skrip_display_as_box").remove(); $("div.crud-form div.mDiv div.ftitle").remove(); $(".ptogtitle").remove(); $(".pDiv").css("border", "none"); $(".form-div").css("border", "none"); $(".ui-dialog-content").dialog( "option", "height", 250 ); $(".ui-dialog-content").dialog( "option", "width", 650 ); $("#save-and-go-back-button").attr("value", "Submit"); $("#form-button-save").remove(); $("#cancel-button").remove(); </script>'; }); $c->unset_mytools(); $c->callback_column('aksi', function ($value, $row) { return '<div style="text-align:center; margin: 0px !important"><a class="link-pilih edit-anchor edit_button" title="Lihat Catatan Evaluator" href="' . base_url() . 'all_admin/lihat_catatan_evaluator/read/' . $row->id_pelaporan_periodik . '">Detail Evaluasi</a> | <a class="link-pilih edit-anchor edit_button" title="Tugaskan evaluator" href="' . base_url() . 'all_admin/laporan_berkala_kasie/edit/' . $row->id_pelaporan_periodik . '">Tugaskan</a> | <a class="link-pilih" title="Lihat detail laporan" href="' . base_url() . 'all_admin/detail_perusahaan/laporan_berkala_kasie/' . $row->id_permohonan . '">Lihat detail </a><hr style="margin: 6px 0px 6px 0px; border: 0; border-top: 1px solid #BDC3C7;"/> <a class="link-pilih" title="Revisi laporan" href="' . base_url() . 'all_admin/aksi_kasie/revisi/' . $row->id_pelaporan_periodik . '">Revisi</a> | <a class="link-pilih" title="Terima Laporan" href="' . base_url() . 'all_admin/aksi_kasie/terima/' . $row->id_pelaporan_periodik . '">Terima</a> | <a class="link-pilih" title="Tolak Laporan" href="' . base_url() . 'all_admin/aksi_kasie/tolak/' . $row->id_pelaporan_periodik . '">Tolak</a></div>'; }); $c->callback_column('status_laporan', function ($value, $row) { if ($value == 1 && $row->id_evaluator != NULL && $row->catatan_evaluator == NULL) { return '<span style="background-color:#F7CA18; color:#fff; border-radius:3px; padding: 0px 2px 0px 2px;">Belum Dievaluasi</span>'; } elseif ($value == 1 && $row->id_evaluator != NULL && $row->catatan_evaluator != NULL) { return '<span style="background-color:#3498DB; color:#fff; border-radius:3px; padding: 0px 2px 0px 2px;">Sudah Dievaluasi</span>'; } elseif ($value == 2) { return '<span style="background-color:#6C7A89; color:#fff; border-radius:3px; padding: 0px 2px 0px 2px;">Direvisi</span>'; } }); $c->unset_columns('action', 'pilihan'); $c->callback_column('no_skt', function ($value, $row) { $dok_skt = $this->model->select('*', 'dokumen_skt', array('id_permohonan' => $row->id_permohonan)); return $dok_skt->no_dokumen; }); $c->callback_column('bidang_usaha', function ($value, $row) { $permohonan = $this->model->select('*', 'permohonan', array('id_permohonan' => $row->id_permohonan)); $bidang_usaha = select('*', 'ref_bidang_usaha', array('id_bidang_usaha' => $permohonan->bidang_usaha)); $sub_bidang = select('*', 'ref_sub_bidang', array('id_sub_bidang' => $permohonan->sub_bidang)); return $bidang_usaha->bidang_usaha . ' /<br/>' . $sub_bidang->sub_bidang; }); $c->display_as('id_perusahaan', 'Perusahaan'); $c->display_as('bidang_usaha', 'Bidang & Sub Bidang'); $c->display_as('no_skt', 'No SKT'); $c->display_as('file_pelaporan_periodik', 'File Laporan'); $c->display_as('id_evaluator', 'Nama Evaluator'); $c->display_as('catatan_evaluator', 'Hasil Evaluasi'); $c->set_crud_url_path(base_url(strtolower(__CLASS__ . "/" . __FUNCTION__)), base_url(strtolower(__CLASS__ . "/laporan_berkala_kasie"))); $c->set_lang_string('update_success_message', 'Data Anda berhasil disimpan. <script type="text/javascript"> window.location = "' . site_url(strtolower(__CLASS__) . '/' . strtolower(__FUNCTION__)) . '"; </script> <div style="display:none"> '); $output = $c->render(); $this->logs(); if ($c->getState() != 'read') { $c->fields('file_pelaporan_periodik', 'id_permohonan', 'semester', 'id_perusahaan'); } if ($c->getState() != 'edit' && $c->getState() != 'list') { redirect('all_admin/laporan_berkala_kasie'); } else { $this->load->view('level5/laporan_berkala_kasie', $output); } }
public function csr() { $c = new grocery_crud(); $c->set_table('csr'); $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'); } }
public function daftar_pengajuan_skt_baru_dtlm() { if ($this->session->userdata('level') != 3) { $this->logout(); } $c = new grocery_crud(); $c->set_table('biodata_perusahaan'); $c->where('status_progress', 4); $c->unset_add(); //$c->unset_delete(); $c->unset_edit(); $c->unset_read(); $c->field_type('id_user', 'hidden', $this->session->userdata('id_user')); $c->field_type('alamat', 'text'); $c->unset_columns('id_user', 'status_user', 'contact_person', 'alamat', 'provinsi', 'website', 'deskripsi_perusahaan', 'status_progress', 'tanggal_disetujui'); $c->add_action('Revisi', 'sR', base_url('hal/revisi_pengajuan_skt_dtlm/add') . '/'); $c->add_action('Lanjut', 'text', base_url('hal/pengajuan_skt_diterima_dtlm/add') . '/'); $c->add_action('Detail', 'sd', 'hal/detail_perusahaan/pengajuan_skt'); $c->required_fields('nama_perusahaan', 'direktur_utama', 'contact_person', 'email', 'alamat', 'kota', 'provinsi', 'website'); $c->unset_fields('tanggal_member', 'status_user'); $output = $c->render(); $this->logs(); $level = $this->session->userdata('level'); if ($level != NULL) { $this->load->view('level' . $level . '/view_list', $output); } }