コード例 #1
0
 public function actionTemplate2()
 {
     Yii::import('ext.heart.opentbs.EHeartOpenTBS', true);
     EHeartOpenTBS::init();
     // Initalize the TBS instance
     $TBS = new clsTinyButStrong();
     // new instance of TBS
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     // load the OpenTBS plugin
     $templatePath = Yii::getPathOfAlias('ext.heart.opentbs');
     $template = $templatePath . DIRECTORY_SEPARATOR . 'template.docx';
     $TBS->LoadTemplate($template);
     $modelPath = Yii::getPathOfAlias('application.models');
     $files = scandir($modelPath);
     $row = 2;
     $data = array();
     foreach ($files as $file) {
         if (is_file($modelPath . '/' . $file) && CFileHelper::getExtension($file) === 'php' && !in_array($file, array('ContactForm.php', 'LoginForm.php', 'Admin.php', 'User.php'))) {
             $file_arr = explode(".", $file);
             $filename = $file_arr[0];
             $data[$row - 2]['no'] = $row - 1;
             $data[$row - 2]['field1'] = $filename;
             $data[$row - 2]['field2'] = 'test/' . $filename;
             $row++;
         }
     }
     $data2[0]['title'] = "Template Generator";
     $data2[0]['field1'] = 'Model';
     $data2[0]['field2'] = 'Controller';
     $TBS->NoErr = true;
     $TBS->MergeBlock('data', 'array', $data);
     $TBS->MergeBlock('data2', 'array', $data2);
     $TBS->Show(OPENTBS_DOWNLOAD, 'template.docx');
 }
コード例 #2
0
ファイル: admin_user.php プロジェクト: viktoredz/1nf0k35-2016
 function excel()
 {
     $BulanIndo = array("Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
     $POST = array();
     $data['query'] = $this->admin_users_model->get_list();
     $userlist = $data['query'];
     for ($i = 0; $i < sizeof($userlist); $i++) {
         if ($userlist[$i]['birthdate'] != null) {
             $tgl_tmp = explode("/", $userlist[$i]['birthdate']);
             $userlist[$i]['birthdate'] = (int) $tgl_tmp[0] . " " . $BulanIndo[(int) $tgl_tmp[1] - 1] . " " . $tgl_tmp[2];
         }
         $userlist[$i]['last_login'] = "" . date("d-m-Y h:i:s", $userlist[$i]['last_login']);
         $userlist[$i]['last_active'] = "" . date("d-m-Y h:i:s", $userlist[$i]['last_active']);
     }
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = dirname(__FILE__) . '/../../public/files/excel/list_user.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('a,b', $userlist);
     $output_file_name = 'list_user.xlsx';
     $TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);
 }
コード例 #3
0
 function excel_upload($departemen)
 {
     $this->authentication->verify('spkp_personalia_kerjasama_int', 'show');
     $data = $this->spkp_personalia_kerjasama_int_model->json_upload($departemen);
     $rows = $data[0]['Rows'];
     $data['title'] = "Daftar File Kerjasama Internasional";
     $data['departemen'] = "Departemen " . $this->spkp_personalia_kerjasama_int_model->get_departemen($departemen);
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/kegiatan_kerjasama_int_file.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_kegiatan_kerjasama_int_file.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     // echo $output_file_name;
     echo '../public/doc_xls_export/report_kegiatan_kerjasama_int_file.xlsx';
 }
コード例 #4
0
 function data_export_dp3($id_pegawai = 0, $tahun = 0)
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $this->authentication->verify('kepegawaian', 'show');
     $rows = $this->drh_model->get_rowdataexport($id_pegawai, $tahun);
     $data_table = array();
     $no = 1;
     $data_table[] = array('skp' => $rows['skp'], 'nilaiskp' => $rows['skp'] * 60 / 100, 'id_pegawai' => $rows['id_pegawai'], 'tahun' => $rows['tahun'], 'id_pegawai_penilai' => $rows['id_pegawai_penilai'], 'id_pegawai_penilai_atasan' => $rows['id_pegawai_penilai_atasan'], 'pelayanan' => $rows['pelayanan'], 'nilai_pelayanan' => $this->nilaidata($rows['pelayanan']), 'integritas' => $rows['integritas'], 'nilai_integritas' => $this->nilaidata($rows['integritas']), 'komitmen' => $rows['komitmen'], 'nilai_komitmen' => $this->nilaidata($rows['komitmen']), 'disiplin' => $rows['disiplin'], 'nilai_disiplin' => $this->nilaidata($rows['disiplin']), 'kerjasama' => $rows['kerjasama'], 'nilai_kerjasama' => $this->nilaidata($rows['kerjasama']), 'kepemimpinan' => $rows['kepemimpinan'], 'nilai_kepemimpinan' => $this->nilaidata($rows['kepemimpinan']), 'jumlah' => $rows['jumlah'], 'nilai_jumlah' => $this->nilaidata($rows['jumlah']), 'ratarata' => $rows['ratarata'], 'nilai_ratarata' => $this->nilaidata($rows['ratarata']), 'nilai_rata' => $rows['ratarata'] * 40 / 100, 'nilai_prestasi' => $rows['nilai_prestasi'], 'nilai_nilai_prestasi' => $this->nilaidata($rows['nilai_prestasi']), 'keberatan' => $rows['keberatan'], 'keberatan_tgl' => $this->tgldatadp3($rows['keberatan_tgl']), 'tanggapan' => $rows['tanggapan'], 'tanggapan_tgl' => $this->tgldatadp3($rows['tanggapan_tgl']), 'keputusan' => $rows['keputusan'], 'keputusan_tgl' => $this->tgldatadp3($rows['keputusan_tgl']), 'rekomendasi' => $rows['rekomendasi'], 'tgl_diterima' => $this->tgldatadp3($rows['tgl_diterima']), 'tgl_dibuat' => $this->tgldatadp3($rows['tgl_dibuat']), 'tgl_diterima_atasan' => $this->tgldatadp3($rows['tgl_diterima_atasan']));
     // die(print_r($data_table));
     $datapenilai = $this->nipterakhirpenilaiprint($id_pegawai);
     $dataatasanpenilai = $this->atasannipterakhirpenilaiprint($id_pegawai);
     $pegawaiyangditilai = $this->yangditilai($id_pegawai);
     if ($datapenilai != '0') {
         $data_penilai[] = array('nama_penilai' => $datapenilai['gelar_depan'] . ' ' . $datapenilai['nama'] . ' ' . $datapenilai['gelar_belakang'], 'nip_nit_penilai' => $datapenilai['nip_nit'], 'pangkat_penilai' => $datapenilai['id_mst_peg_golruang'] . ' ' . $datapenilai['ruang'], 'jabatan_penilai' => $datapenilai['namajabatan'], 'unit_penilai' => 'Dinas Kesehatan ' . $datapenilai['value']);
     } else {
         $data_penilai[] = array('nama_penilai' => '-', 'nip_nit_penilai' => '-', 'pangkat_penilai' => '-', 'jabatan_penilai' => '-', 'unit_penilai' => '-');
     }
     if ($dataatasanpenilai != 0) {
         $dataatasan_penilai[] = array('nama_atasan_penilai' => $dataatasanpenilai['gelar_depan'] . ' ' . $dataatasanpenilai['nama'] . ' ' . $dataatasanpenilai['gelar_belakang'], 'nip_nit_atasan_penilai' => $dataatasanpenilai['nip_nit'], 'pangkat_atasan_penilai' => $dataatasanpenilai['id_mst_peg_golruang'] . ' ' . $dataatasanpenilai['ruang'], 'jabatan_atasan_penilai' => $dataatasanpenilai['namajabatan'], 'unit_atasan_penilai' => 'Dinas Kesehatan ' . $dataatasanpenilai['value']);
     } else {
         $dataatasan_penilai[] = array('nama_atasan_penilai' => '-', 'nip_nit_atasan_penilai' => '-', 'pangkat_atasan_penilai' => '-', 'jabatan_atasan_penilai' => '-', 'unit_atasan_penilai' => '-');
     }
     if ($pegawaiyangditilai != 0) {
         $data_yangdinilai[] = array('nama_pegawai' => $pegawaiyangditilai['gelar_depan'] . ' ' . $pegawaiyangditilai['nama'] . ' ' . $pegawaiyangditilai['gelar_belakang'], 'nip_nit_pegawai' => $pegawaiyangditilai['nip_nit'], 'pangkat_pegawai' => $pegawaiyangditilai['id_mst_peg_golruang'] . ' ' . $pegawaiyangditilai['ruang'], 'jabatan_pegawai' => $pegawaiyangditilai['namajabatan'], 'unit_pegawai' => 'Dinas Kesehatan ' . $pegawaiyangditilai['value']);
     } else {
         $data_yangdinilai[] = array('nama_pegawai' => '-', 'nama_pegawai' => '-', 'pangkat_pegawai' => '-', 'jabatan_pegawai' => '-', 'unit_pegawai' => '-');
     }
     $puskes = $this->input->post('puskes');
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->drh_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $puskes = $this->drh_model->get_nama('value', 'cl_phc', 'code', 'P' . $kode_sess);
     $kd_kab = $this->drh_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $kd_kec = 'KEC. ' . $this->drh_model->get_nama('nama', 'cl_kec', 'code', substr($kode_sess, 0, 7));
     $tahun_ = date("Y");
     $data_puskesmas[] = array('nama_puskesmas' => $puskes, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'tahun' => $tahun_);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/kepegawaian/dppp_pengukuran_belakang.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('d', $dataatasan_penilai);
     $TBS->MergeBlock('a', $data_table);
     $TBS->MergeBlock('b', $data_yangdinilai);
     $TBS->MergeBlock('c', $data_penilai);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_export_penilaiandppp' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #5
0
 function excel_upload()
 {
     $this->authentication->verify('srikandi', 'show');
     $data = $this->srikandi_model->json_judul();
     $rows = $data[0]['Rows'];
     $data['title'] = "Informasi dan Kajian";
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/srikandi.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_srikandi.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     echo $output_file_name;
 }
コード例 #6
0
 function pengadaan_detail_export()
 {
     $this->authentication->verify('inventory', 'show');
     $id = $this->input->post('kode');
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tgl_update') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     $this->db->where('id_inv_hasbispakai_pembelian', $id);
     $rows_all_activity = $this->bhp_pengadaan_model->getItem();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tgl_update') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('puskesmas') != '') {
         $this->db->where('inv_inventaris_habispakai_pembelian_item.code_cl_phc', 'P' . $this->session->userdata('puskesmas'));
     }
     $this->db->where('inv_inventaris_habispakai_pembelian_item.id_inv_hasbispakai_pembelian', $id);
     $activity = $this->bhp_pengadaan_model->getItem();
     $no = 1;
     $datadetail = array();
     foreach ($activity as $act) {
         $datadetail[] = array('no' => $no++, 'id_inv_hasbispakai_pembelian' => $act->id_inv_hasbispakai_pembelian, 'id_mst_inv_barang_habispakai' => $act->id_mst_inv_barang_habispakai, 'uraian' => $act->uraian, 'jml' => $act->jml, 'batch' => $act->batch, 'harga' => number_format($act->harga, 2), 'subtotal' => number_format($act->jml * $act->harga, 2), 'tgl_update' => date("d-m-Y", strtotime($act->tgl_update)), 'edit' => 1, 'delete' => 1);
     }
     $data_puskesmas = $this->bhp_pengadaan_model->get_data_row($id);
     $nama_puskesmas = $this->bhp_pengadaan_model->get_data_nama($data_puskesmas['code_cl_phc']);
     $onshow['puskesmas'] = $nama_puskesmas['value'];
     $onshow['tgl_permohonan'] = date("d-m-Y", strtotime($data_puskesmas['tgl_permohonan']));
     $onshow['tgl_kwitansi'] = date("d-m-Y", strtotime($data_puskesmas['tgl_kwitansi']));
     $onshow['nomor_kwitansi'] = $data_puskesmas['nomor_kwitansi'];
     $onshow['nomor_kontrak'] = $data_puskesmas['nomor_kontrak'];
     $onshow['keterangan'] = $data_puskesmas['keterangan'];
     $onshow['jumlah_unit'] = $data_puskesmas['jumlah_unit'];
     $onshow['nilai_pembelian'] = number_format($data_puskesmas['nilai_pembelian'], 2);
     $onshow['tahun'] = date("Y");
     $onshow['pilihan_status_pembelian'] = $this->bhp_pengadaan_model->getPilihan("status_pembelian", $data_puskesmas['pilihan_status_pembelian']);
     $kode_sess = $this->session->userdata('puskesmas');
     $onshow['kd_prov'] = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $onshow['kd_kab'] = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $onshow;
     $dir = getcwd() . '/';
     if ($data_puskesmas['id_mst_inv_barang_habispakai_jenis'] == '8') {
         $template = $dir . 'public/files/template/inventory/bhp_pengadaanpermohonan_obat.xlsx';
     } else {
         $template = $dir . 'public/files/template/inventory/bhp_pengadaanpermohonan.xlsx';
     }
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     $TBS->MergeBlock('a', $datadetail);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_detail_export_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #7
0
 function permohonan_detail_export()
 {
     $code_cl_phc = $this->input->post('code_cl_phc');
     $id = $this->input->post('kode');
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     //[data_tabel.no;block=tbs:row]	[data_tabel.tgl]	[data_tabel.ruangan]	[data_tabel.jumlah]	[data_tabel.keterangan]	[data_tabel.status]
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tanggal_permohonan') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     #$rows = $this->permohonanbarang_model->get_data($this->input->post('recordstartindex'), $this->input->post('pagesize'));
     $this->db->where('code_cl_phc', $code_cl_phc);
     $activity = $this->permohonanbarang_model->getItem('inv_permohonan_barang_item', array('id_inv_permohonan_barang' => $id))->result();
     $data = array();
     $no = 1;
     $data_tabel = array();
     foreach ($activity as $act) {
         $data_tabel[] = array('no' => $no++, 'nama_barang' => $act->nama_barang, 'jumlah' => $act->jumlah, 'keterangan' => $act->keterangan);
     }
     if (empty($this->input->post('nama_puskesmas')) or $this->input->post('nama_puskesmas') == 'Pilih Puskesmas') {
         $nama = 'Semua Data Puskesmas';
     } else {
         $nama = $this->input->post('nama_puskesmas');
     }
     $tanggal = $this->input->post('tanggal');
     $keterangan = $this->input->post('keterangan');
     $ruang = $this->input->post('ruang');
     $puskesmas = $nama;
     #$data_puskesmas[] = array('nama_puskesmas' => $nama, 'tanggal'=> $tanggal, 'keterangan'=>$keterangan, 'ruang'=>$ruang);
     $data_puskesmas['nama_puskesmas'] = $nama;
     $data_puskesmas['tanggal'] = $tanggal;
     $data_puskesmas['ruang'] = $ruang;
     $data_puskesmas['keterangan'] = $keterangan;
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data_puskesmas;
     $template = dirname(__FILE__) . '\\..\\..\\..\\public\\files\\template\\inventory\\permohonan_barang_detail.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     #$TBS->MergeBlock('b', $data_puskesmas);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = dirname(__FILE__) . '\\..\\..\\..\\public\\files\\hasil\\hasil_detail_export_' . $code . '.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     // Also merges all [onshow] automatic fields.
     echo base_url() . 'public/files/hasil/hasil_detail_export_' . $code . '.xlsx';
 }
コード例 #8
0
// Include classes
include_once 'tbs_class.php';
// Load the TinyButStrong template engine
include_once '../tbs_plugin_opentbs.php';
// Load the OpenTBS plugin
// prevent from a PHP configuration problem when using mktime() and date()
if (version_compare(PHP_VERSION, '5.1.0') >= 0) {
    if (ini_get('date.timezone') == '') {
        date_default_timezone_set('UTC');
    }
}
// Initialize the TBS instance
$TBS = new clsTinyButStrong();
// new instance of TBS
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
// load the OpenTBS plugin
// ------------------------------
// Prepare some data for the demo
// ------------------------------
// Retrieve the user name to display
$yourname = isset($_POST['yourname']) ? $_POST['yourname'] : '';
$yourname = trim('' . $yourname);
if ($yourname == '') {
    $yourname = "(no name)";
}
// A recordset for merging tables
$data = array();
$data[] = array('rank' => 'A', 'firstname' => 'Sandra', 'name' => 'Hill', 'number' => '1523d', 'score' => 200, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
$data[] = array('rank' => 'A', 'firstname' => 'Roger', 'name' => 'Smith', 'number' => '1234f', 'score' => 800, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
$data[] = array('rank' => 'B', 'firstname' => 'William', 'name' => 'Mac Dowell', 'number' => '5491y', 'score' => 130, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
コード例 #9
0
 function excel_upload($thn)
 {
     $this->authentication->verify('spkp_promotion_subdit', 'show');
     $data = $this->spkp_promotion_subdit_model->json_upload($thn);
     $rows = $data[0]['Rows'];
     $data['title'] = "Daftar File Kegiatan Subdit Promosi";
     $data['thn'] = "Tahun " . $thn;
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/kegiatan_subdit_promosi_file.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_kegiatan_subdit_promosi_file.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     // echo $output_file_name;
     echo '../public/doc_xls_export/report_kegiatan_subdit_promosi_file.xlsx';
 }
コード例 #10
0
 function excel()
 {
     $this->authentication->verify('spkp_manajemen_dokumen_eksternal', 'show');
     $data = $this->spkp_manajemen_dokumen_eksternal_model->json_dokumen();
     $rows = $data[0]['Rows'];
     $data['title'] = "QMS DOKUMEN EKSTERNAL";
     $data['title_down'] = "DIREKTORAT SURVEILAN DAN PENYULUHAN KEAMANAN PANGAN";
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/qms_manajemen_dokumen_eksternal.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_qms_manajemen_dokumen_eksternal.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     // echo $output_file_name;
     echo '../public/doc_xls_export/report_qms_manajemen_dokumen_eksternal.xlsx';
 }
コード例 #11
0
 function export($id)
 {
     $this->authentication->verify('spkp_pjas_a016', 'show');
     $arr_bulan = array("", "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
     $data = $this->spkp_pjas_a016_model->get_form($id);
     $data['title_form'] = "Form A016. Laporan Hasil Pengawasan Pangan dalam rangka Mobil Keliling";
     $data['title_a'] = "LAPORAN HASIL PENGAWASAN PANGAN DALAM RANGKA MOBIL KELILING";
     $data['title_b'] = "BULAN                   : " . $arr_bulan[$data['bulan']];
     $data['title_c'] = "BBPOM/ BPOM             : " . $this->spkp_pjas_a016_model->get_balai($data['id_balai']);
     $data['tanggal_form'] = $this->authentication->indonesian_date($data['tanggal'], 'l, j F Y', '');
     $data_hasil = $this->spkp_pjas_a016_model->get_hasil_pengawasan($id);
     $x = 1;
     foreach ($data_hasil as $row_hasil) {
         $hasil_uji = $this->spkp_pjas_a016_model->get_hasil_uji($id, $row_hasil->id_hasil);
         $param = array();
         $hasil_test = array();
         $kesimpulan = array();
         $y = 1;
         foreach ($hasil_uji as $row_uji) {
             $param[] = $y . ". " . $row_uji->parameter;
             $hasil_test[] = $y . ". " . $row_uji->hasil;
             $kesimpulan[] = $y . ". " . $row_uji->kesimpulan;
             $y++;
         }
         $hasil[] = array('no' => $x, 'lokasi' => $row_hasil->lokasi, 'alamat' => $row_hasil->alamat, 'kabkota' => ucwords(strtolower($this->spkp_pjas_a016_model->get_kota($row_hasil->kabkota))), 'kode_sampel' => $row_hasil->kode_sampel, 'produk' => $row_hasil->produk, 'pedagang' => $row_hasil->pedagang, 'pengolah' => $row_hasil->pengolah, 'jenis' => $row_hasil->jenis, 'no_pendaftaran' => $row_hasil->no_pendaftaran, 'kesimpulan_akhir' => $row_hasil->kesimpulan_akhir, 'tindaklanjut' => $row_hasil->tindaklanjut, 'parameter' => implode(', ', $param), 'hasil' => implode(', ', $hasil_test), 'kesimpulan' => implode(', ', $kesimpulan));
         $x++;
     }
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/spkp_pjas_a016.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('hasil', $hasil);
     $output_file_name = $path . 'export/report_spkp_pjas_a016.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     echo $output_file_name;
 }
コード例 #12
0
ファイル: inv_barang.php プロジェクト: viktoredz/epuskesmas
 function permohonan_export()
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     //[data_tabel.no;block=tbs:row]	[data_tabel.tgl]	[data_tabel.ruangan]	[data_tabel.jumlah]	[data_tabel.keterangan]	[data_tabel.status]
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'status_sertifikat_tanggal') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filterruangan') != '') {
         $filter = $this->session->userdata('filterruangan');
         $this->db->where("id_ruangan", $filter);
     }
     if ($this->session->userdata('filter_cl_phc') != '') {
         $kodeplch = $this->session->userdata('filter_cl_phc');
         $this->db->where("id_cl_phc", $kodeplch);
     }
     if ($this->session->userdata('filterHAPUS') != '') {
         $this->db->where("pilihan_status_invetaris", "3");
     }
     if ($this->session->userdata('filterHAPUS') == '' || $this->session->userdata('filterGIB') != '') {
         $this->db->where("pilihan_status_invetaris !=", "3");
     }
     $rows_all = $this->inv_barang_model->get_data_golongan_A();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'status_sertifikat_tanggal') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filterruangan') != '') {
         $filter = $this->session->userdata('filterruangan');
         $this->db->where("id_ruangan", $filter);
     }
     if ($this->session->userdata('filter_cl_phc') != '') {
         $kodeplch = $this->session->userdata('filter_cl_phc');
         $this->db->where("id_cl_phc", $kodeplch);
     }
     if ($this->session->userdata('filterHAPUS') != '') {
         $this->db->where("pilihan_status_invetaris", "3");
     }
     if ($this->session->userdata('filterHAPUS') == '' || $this->session->userdata('filterGIB') != '') {
         $this->db->where("pilihan_status_invetaris !=", "3");
     }
     $rows = $this->inv_barang_model->get_data_golongan_A();
     $data_tabel = array();
     $no = 1;
     foreach ($rows as $act) {
         $data_tabel[] = array('no' => $no++, 'id_inventaris_barang' => $act->id_inventaris_barang, 'id_mst_inv_barang' => $act->id_mst_inv_barang, 'uraian' => $act->uraian, 'id_pengadaan' => $act->id_pengadaan, 'barang_kembar_proc' => $act->barang_kembar_proc, 'satuan' => $act->satuan, 'id_ruangan' => $act->id_ruangan, 'hak' => $act->hak, 'id_cl_phc' => $act->id_cl_phc, 'register' => $act->register, 'asal_usul' => $act->asal_usul, 'keterangan_pengadaan' => $act->keterangan_pengadaan, 'harga' => number_format($act->harga, 2), 'jumlah' => $act->jumlah, 'jumlah_satuan' => $act->jumlah . ' ' . $act->satuan, 'penggunaan' => $act->penggunaan, 'luas' => $act->luas, 'alamat' => $act->alamat, 'pilihan_satuan_barang' => $act->pilihan_satuan_barang, 'pilihan_status_hak' => $act->pilihan_status_hak, 'status_sertifikat_tanggal' => date("d-m-Y", strtotime($act->status_sertifikat_tanggal)), 'status_sertifikat_nomor' => $act->status_sertifikat_nomor, 'pilihan_penggunaan' => $act->pilihan_penggunaan, 'edit' => 1, 'delete' => 1);
     }
     if (empty($this->input->post('puskes')) or $this->input->post('puskes') == 'Pilih Puskesmas') {
         $namapus = 'Semua Data Puskesmas';
     } else {
         $namapus = $this->input->post('puskes');
     }
     if (empty($this->input->post('ruang')) or $this->input->post('ruang') == 'Pilih Ruangan') {
         $namaruang = 'Semua Data Ruangan';
     } else {
         $namaruang = $this->input->post('ruang');
     }
     $data_puskesmas[] = array('nama_puskesmas' => $namapus, 'nama_puskesmas' => $namaruang);
     $template = dirname(__FILE__) . '\\..\\..\\..\\public\\files\\template\\inventory\\kiba.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     $output_file_name = dirname(__FILE__) . '\\..\\..\\..\\public\\files\\hasil\\hasil_export_' . $code . '.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     // Also merges all [onshow] automatic fields.
     echo base_url() . 'public/files/hasil/hasil_export_' . $code . '.xlsx';
 }
コード例 #13
0
 function pengadaan_detail_export()
 {
     $this->authentication->verify('inventory', 'show');
     $id = $this->input->post('kode');
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tgl_pengadaan') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     $data = array();
     $activity = $this->pengadaanbarang_model->getItem('inv_inventaris_barang', array('id_pengadaan' => $id))->result();
     foreach ($activity as $act) {
         $data[] = array('id_inventaris_barang' => $act->id_inventaris_barang, 'id_mst_inv_barang' => substr(chunk_split($act->id_mst_inv_barang, 2, '.'), 0, 14), 'nama_barang' => $act->nama_barang, 'jumlah' => $act->jumlah, 'harga' => number_format($act->harga, 2), 'totalharga' => number_format($act->totalharga, 2), 'keterangan' => $act->keterangan_pengadaan, 'pilihan_status_invetaris' => $this->pengadaanbarang_model->getPilihan("status_inventaris", $act->pilihan_status_invetaris), 'barang_kembar_proc' => $act->barang_kembar_proc, 'tanggal_diterima' => date("d-m-Y", strtotime($act->tanggal_diterima)), 'waktu_dibuat' => $act->waktu_dibuat, 'terakhir_diubah' => $act->terakhir_diubah, 'value' => $act->value);
     }
     $data_puskesmas = $this->pengadaanbarang_model->get_data_row($id);
     $nama_puskesmas = $this->pengadaanbarang_model->get_data_nama($data_puskesmas['code_cl_phc']);
     $data_puskesmas['puskesmas'] = $nama_puskesmas['value'];
     $data_puskesmas['tgl_pengadaan'] = date("d-m-Y", strtotime($data_puskesmas['tgl_pengadaan']));
     $data_puskesmas['tgl_kwitansi'] = date("d-m-Y", strtotime($data_puskesmas['tgl_kwitansi']));
     $data_puskesmas['nomor_kwitansi'] = $data_puskesmas['nomor_kwitansi'];
     $data_puskesmas['nilai_pengadaan'] = number_format($data_puskesmas['nilai_pengadaan'], 2);
     $data_puskesmas['pilihan_status_pengadaan'] = $this->pengadaanbarang_model->getPilihan("status_pengadaan", $data_puskesmas['pilihan_status_pengadaan']);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data_puskesmas;
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/pengadaan_barang_detail.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     $TBS->MergeBlock('a', $data);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_detail_export_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #14
0
 function excel()
 {
     $this->authentication->verify('spkp_absen_bulanan', 'show');
     $data = $this->spkp_absen_bulanan_model->json();
     $rows = array();
     $dt = isset($data[0]['Rows']) ? $data[0]['Rows'] : array();
     foreach ($dt as $r) {
         $r['bulan'] = $this->crud->bulan($r['bulan']);
         $rows[] = $r;
     }
     $data['title'] = "Absensi Bulanan";
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/absensi_bulanan.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_absensi_bulanan.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     //echo $output_file_name;
     echo '../public/doc_xls_export/report_absensi_bulanan.xlsx';
 }
コード例 #15
0
ファイル: stat_justifications.php プロジェクト: rhertzog/lcs
/**
 * Crée et envoie un fichier .ods avec le tableau des justifications
 * @param array $donnees
 * @param objet $justifications 
 */
function creeODS($donnees, $justifications) {
  $date = date("d-m-Y_H-i");
  $nom_fichier = "Justifications_".$date.".ods";
  
  $nbre_colonnes = count($justifications);
  foreach ($justifications as $justifie) {
	$libelle[] = $justifie->getNom();
  }
  
  $titre = 'extraction des justifications du ';
  $titre .= unserialize($_SESSION['statJustifie']['date_absence_eleve_debut']);
  $titre .= ' au ';
  $titre .= unserialize($_SESSION['statJustifie']['date_absence_eleve_fin']); 
  if (isset ($_SESSION['statJustifie']['erreur']) && $_SESSION['statJustifie']['erreur']) {
	$titre .=  ' (Total des justifications différent des absences justifiées)';
  }
  
  $colonnes_individu = array();
  $colonnes_individu[1] = 'nom';
  $colonnes_individu[2] = 'classe';
  
  if (count($donnees)) {
  	foreach ($donnees as &$donnee) {
	  $j=1;
	  foreach ($donnee['traitement'] as $justifie) {
		$donnee['traite_'.$j] = $justifie;
		$j++;
	  }
	}
  }
  
  // load the TinyButStrong libraries
  include_once('../tbs/tbs_class.php'); // TinyButStrong template engine
  $TBS = new clsTinyButStrong; // new instance of TBS
  include_once('../tbs/plugins/tbs_plugin_opentbs.php');
  $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load OpenTBS plugin
  // Load the template
  $extraction_Justifications = repertoire_modeles('absence_nb_justifications.ods');
  $TBS->LoadTemplate($extraction_Justifications, OPENTBS_ALREADY_UTF8);
  
  $TBS->MergeBlock('c2', 'num', $nbre_colonnes);
  $TBS->MergeField('titre', $titre);
  $TBS->MergeBlock('a', $libelle);
  $TBS->MergeBlock('b2', $donnees);
  
  // Output as a download file (some automatic fields are merged here)
  $TBS->Show(OPENTBS_DOWNLOAD + TBS_EXIT, $nom_fichier);
  die ();
}
コード例 #16
0
 function laporan_json_allopname($id = 0)
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tgl_update') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($id != 0) {
         $this->db->where('inv_inventaris_habispakai_opname_item.id_inv_inventaris_habispakai_opname', $id);
     }
     if ($this->session->userdata('filter_jenisbarang') != '') {
         if ($this->session->userdata('filter_jenisbarang') == "all") {
         } else {
             $this->db->where("jenis_bhp", $this->session->userdata('filter_jenisbarang'));
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_bulan') != '') {
         if ($this->session->userdata('filter_bulan') == "all") {
         } else {
             $this->db->where("MONTH(tgl_opname)", $this->session->userdata('filter_bulan'));
         }
     } else {
         $this->db->where("MONTH(tgl_opname)", date("m"));
     }
     if ($this->session->userdata('filter_tahun') != '') {
         if ($this->session->userdata('filter_tahun') == "all") {
         } else {
             $this->db->where("YEAR(tgl_opname)", $this->session->userdata('filter_tahun'));
         }
     } else {
         $this->db->where("YEAR(tgl_opname)", date("Y"));
     }
     if ($this->session->userdata('filter_code_cl_phc') != '') {
         if ($this->session->userdata('filter_code_cl_phc') == 'all') {
             # code...
         } else {
             $this->db->where('code_cl_phc', $this->session->userdata('filter_code_cl_phc'));
         }
     }
     $rows_all_activity = $this->bhp_pemusnahan_model->getallopname();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tgl_update') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($id != 0) {
         $this->db->where('inv_inventaris_habispakai_opname_item.id_inv_inventaris_habispakai_opname', $id);
     }
     if ($this->session->userdata('filter_jenisbarang') != '') {
         if ($this->session->userdata('filter_jenisbarang') == "all") {
         } else {
             $this->db->where("jenis_bhp", $this->session->userdata('filter_jenisbarang'));
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_bulan') != '') {
         if ($this->session->userdata('filter_bulan') == "all") {
         } else {
             $this->db->where("MONTH(tgl_opname)", $this->session->userdata('filter_bulan'));
         }
     } else {
         $this->db->where("MONTH(tgl_opname)", date("m"));
     }
     if ($this->session->userdata('filter_tahun') != '') {
         if ($this->session->userdata('filter_tahun') == "all") {
         } else {
             $this->db->where("YEAR(tgl_opname)", $this->session->userdata('filter_tahun'));
         }
     } else {
         $this->db->where("YEAR(tgl_opname)", date("Y"));
     }
     if ($this->session->userdata('filter_code_cl_phc') != '') {
         if ($this->session->userdata('filter_code_cl_phc') == 'all') {
             # code...
         } else {
             $this->db->where('code_cl_phc', $this->session->userdata('filter_code_cl_phc'));
         }
     }
     $activity = $this->bhp_pemusnahan_model->getallopname();
     $data_tabel = array();
     $kodepuskesmas = $this->session->userdata('puskesmas');
     if (substr($kodepuskesmas, -2) == "01") {
         $unlock = 1;
     } else {
         $unlock = 0;
     }
     $no = 1;
     foreach ($activity as $act) {
         $data_tabel[] = array('no' => $no++, 'id_mst_inv_barang_habispakai' => $act->id_mst_inv_barang_habispakai, 'batch' => $act->batch, 'uraian' => $act->uraian, 'id_inv_inventaris_habispakai_opname' => $act->id_inv_inventaris_habispakai_opname, 'jml_awal' => $act->jml_awal, 'jml_akhir' => $act->jml_akhir, 'tipe' => ucfirst($act->tipe), 'harga' => $act->harga, 'merek_tipe' => $act->merek_tipe, 'tgl_opname' => date("d-m-Y", strtotime($act->tgl_opname)), 'jml_selisih' => ($act->jml_akhir - $act->jml_awal) * -1, 'edit' => 1, 'delete' => 1);
     }
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $nama_puskesmas = $this->input->post('nama_puskesmas');
     //$tgl = date("d-m-Y");
     $jenis_barang = $this->input->post('jenisbarang');
     $tgl = $this->input->post('bulan');
     $tahun = $this->input->post('tahun');
     $data_puskesmas[] = array('jenis_barang' => $jenis_barang, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'nama_puskesmas' => $nama_puskesmas, 'bulan' => $tgl, 'tahun' => $tahun);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/bhp_telahdimusnahkan.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_bhptelahdimusnahkan_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #17
0
 public function reporteAction($contratoproducto_id)
 {
     include_once 'tbs_us/tbs_class.php';
     // Load the TinyButStrong template engine
     include_once 'tbs_us/tbs_plugin_opentbs/tbs_plugin_opentbs.php';
     // Load the OpenTBS plugin
     $this->view->disable();
     $model = new Planpagos();
     $resul = $model->getcontrato($contratoproducto_id);
     $this->view->setVar('contratoproducto', $resul[0]);
     $garantia = Garantias::find(array('baja_logica=1 and contratoproducto_id = ' . $contratoproducto_id, 'order' => 'tipo,fecha_deposito ASC'));
     // $derechollave = Garantias::findFirst(array('baja_logica=1 and tipo=2 and contratoproducto_id = '.$contratoproducto_id, 'order'=>'tipo ASC'));
     $TBS = new clsTinyButStrong();
     // new instance of TBS
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     // load the OpenTBS plugin
     $TBS->VarRef['usuario'] = $this->_user->nombre . ' ' . $this->_user->paterno;
     $TBS->VarRef['contrato'] = $resul[0]->contrato;
     $TBS->VarRef['razon_social'] = $resul[0]->razon_social;
     $TBS->VarRef['fecha_inicio'] = date('d-m-Y', strtotime($resul[0]->fecha_inicio));
     $TBS->VarRef['fecha_fin'] = date('d-m-Y', strtotime($resul[0]->fecha_fin));
     $TBS->VarRef['grupo'] = $resul[0]->grupo;
     $TBS->VarRef['linea'] = $resul[0]->linea;
     $TBS->VarRef['estacion'] = $resul[0]->estacion;
     $TBS->VarRef['producto'] = $resul[0]->producto;
     $model = new Planpagos();
     $resul = $model->listacontrolpago($contratoproducto_id);
     $contrato = $model->datoscontrato($contratoproducto_id);
     $hoy = date("Y-m-d");
     // $dias =10;
     // $fecha_10 = date("Y-m-d",strtotime( '+'.$dias.' day' , strtotime($hoy)));
     $data = array();
     foreach ($resul as $v) {
         $html = $this->depositos($v->id, $v->diferencia, 1);
         $diff = $v->monto_programado - $v->monto_reprogramado;
         $diff_text = '';
         if ($diff > 0) {
             $diff_text = '<span class="label label-primary" style="float:left">' . number_format($diff, 2, ".", ",") . '</span>';
         }
         /* calculo de mora */
         $dias_atraso = '';
         $mora = '';
         $fecha_tolerancia = date("Y-m-d", strtotime('+' . $contrato[0]->dias_tolerancia . ' day', strtotime($v->fecha_programado)));
         if ($fecha_tolerancia < date("Y-m-d")) {
             if ($v->mora > 0) {
                 $dias_atraso = $v->dias_atraso;
                 $mora = $v->mora;
             } elseif ($v->deposito_total < $v->monto_reprogramado) {
                 $datetime1 = new DateTime($fecha_tolerancia);
                 $datetime2 = new DateTime(date("Y-m-d"));
                 $interval = $datetime1->diff($datetime2);
                 $dias_atraso = $interval->format('%R%a');
                 $mora = $contrato[0]->total / $contrato[0]->nro_dias * $contrato[0]->porcentaje_mora * $dias_atraso;
             }
         }
         /* fin calculo de mora*/
         $data[] = array('rank' => 'A', 'fecha_programado' => date("d-m-Y", strtotime($v->fecha_programado)), 'monto_programado' => $v->monto_reprogramado, 'nro_factura' => str_replace("</div>", "\n", str_replace("<div>", "", $html[6])), 'fecha_factura' => str_replace("</div>", "\n", str_replace("<div>", "", $html[7])), 'monto_factura' => str_replace("</div>", "\n", str_replace("<div>", "", $html[8])), 'nro_deposito' => str_replace("</div>", "\n", str_replace("<div>", "", $html[0])), 'fecha_deposito' => str_replace("</div>", "\n", str_replace("<div>", "", $html[1])), 'monto_deposito' => str_replace("</div>", "\n", str_replace("<div>", "", $html[2])), 'dias_atraso' => $v->dias_atraso, 'mora' => $mora, 'nro_deposito_mora' => str_replace("</div>", "\n", str_replace("<div>", "", $html[3])), 'fecha_deposito_mora' => str_replace("</div>", "\n", str_replace("<div>", "", $html[4])), 'monto_deposito_mora' => str_replace("</div>", "\n", str_replace("<div>", "", $html[5])), 'factura_total' => $v->factura_total, 'deposito_total' => $v->deposito_total, 'mora_total' => $v->mora_total);
     }
     $data1 = array();
     foreach ($garantia as $g) {
         $data1[] = array('rank' => 'C', 'tipo' => $this->tipo[$g->tipo], 'nro_deposito' => $g->nro_deposito, 'fecha_deposito' => date("d-m-Y", strtotime($g->fecha_deposito)), 'monto_deposito' => $g->monto_deposito);
     }
     $template = 'file/template/temp_reporte_planpagos.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Also merge some [onload] automatic fields (depends of the type of document).
     // ----------------------
     // Debug mode of the demo
     // ----------------------
     // if (isset($_POST['debug']) && ($_POST['debug']=='current')) $TBS->Plugin(OPENTBS_DEBUG_XML_CURRENT, true); // Display the intented XML of the current sub-file, and exit.
     // if (isset($_POST['debug']) && ($_POST['debug']=='info'))    $TBS->Plugin(OPENTBS_DEBUG_INFO, true); // Display information about the document, and exit.
     // if (isset($_POST['debug']) && ($_POST['debug']=='show'))    $TBS->Plugin(OPENTBS_DEBUG_XML_SHOW); // Tells TBS to display information when the document is merged. No exit.
     // Merge data in the first sheet
     $TBS->MergeBlock('a,b', $data);
     $TBS->MergeBlock('c,d', $data1);
     // -----------------
     // Output the result
     // -----------------
     // $output_file_name = str_replace('.', '_'.date('Y-m-d').'.', $template);
     $output_file_name = date('Y-m-d') . ' ' . 'reporte.xlsx';
     $TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);
     // Also merges all [onshow] automatic fields.
     exit;
 }
コード例 #18
0
 function permohonan_export()
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     //[data_tabel.no;block=tbs:row]	[data_tabel.tgl]	[data_tabel.ruangan]	[data_tabel.jumlah]	[data_tabel.keterangan]	[data_tabel.status]
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tanggal_permohonan') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     $rows_all = $this->lap_bhp_pengadaan_model->get_data_permohonan();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tanggal_permohonan') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     #$rows = $this->permohonanbarang_model->get_data($this->input->post('recordstartindex'), $this->input->post('pagesize'));
     $rows = $this->lap_bhp_pengadaan_model->get_data_permohonan();
     $data = array();
     //die(print_r($rows));
     $no = 0;
     $temp = '';
     $data_tabel = array();
     foreach ($rows as $key => $val) {
         $no++;
         foreach ($val as $act => $value) {
             if ($key == $temp) {
                 $data_tabel[$key]["harga_akhir"] = $value['hargabeli'];
                 $data_tabel[$key]["totaljumlah"] = $data_tabel["{$key}"]["totaljumlah"] + $value['total'];
                 $data_tabel[$key]['nilaiaset'] = $data_tabel["{$key}"]["totaljumlah"] * $data_tabel["{$key}"]["harga_akhir"];
                 $data_tabel[$key]["harga_beli{$act}"] = $value['hargabeli'];
                 $data_tabel[$key]["jmlbeli{$act}"] = $value['total'];
                 $data_tabel[$key]["total{$act}"] = $value['total'] * $value['hargabeli'];
             } else {
                 $temp = $key;
                 $bulanex = $act;
                 $data_tabel[$key] = array('no' => $no, 'uraian' => $key, 'harga_akhir' => $value['hargabeli'], 'value' => $value['pilihan_satuan'], 'totaljumlah' => $value['total'], 'nilaiaset' => $value['total'] * $value['hargabeli'], 'harga_beli1' => $bulanex == '01' ? $value['hargabeli'] : '', 'jmlbeli1' => $bulanex == '01' ? $value['total'] : '', 'total1' => $bulanex == '01' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli2' => $bulanex == '02' ? $value['hargabeli'] : '', 'jmlbeli2' => $bulanex == '02' ? $value['total'] : '', 'total2' => $bulanex == '02' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli3' => $bulanex == '03' ? $value['hargabeli'] : '', 'jmlbeli3' => $bulanex == '03' ? $value['total'] : '', 'total3' => $bulanex == '03' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli4' => $bulanex == '04' ? $value['hargabeli'] : '', 'jmlbeli4' => $bulanex == '04' ? $value['total'] : '', 'total4' => $bulanex == '04' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli5' => $bulanex == '05' ? $value['hargabeli'] : '', 'jmlbeli5' => $bulanex == '05' ? $value['total'] : '', 'total5' => $bulanex == '05' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli6' => $bulanex == '06' ? $value['hargabeli'] : '', 'jmlbeli6' => $bulanex == '06' ? $value['total'] : '', 'total6' => $bulanex == '06' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli7' => $bulanex == '07' ? $value['hargabeli'] : '', 'jmlbeli7' => $bulanex == '07' ? $value['total'] : '', 'total7' => $bulanex == '07' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli8' => $bulanex == '08' ? $value['hargabeli'] : '', 'jmlbeli8' => $bulanex == '08' ? $value['total'] : '', 'total8' => $bulanex == '08' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli9' => $bulanex == '09' ? $value['hargabeli'] : '', 'jmlbeli9' => $bulanex == '09' ? $value['total'] : '', 'total9' => $bulanex == '09' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli10' => $bulanex == '10' ? $value['hargabeli'] : '', 'jmlbeli10' => $bulanex == '10' ? $value['total'] : '', 'total10' => $bulanex == '10' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli11' => $bulanex == '11' ? $value['hargabeli'] : '', 'jmlbeli11' => $bulanex == '11' ? $value['total'] : '', 'total11' => $bulanex == '11' ? $value['total'] * $value['hargabeli'] : '', 'harga_beli12' => $bulanex == '12' ? $value['hargabeli'] : '', 'jmlbeli12' => $bulanex == '12' ? $value['total'] : '', 'total12' => $bulanex == '12' ? $value['total'] * $value['hargabeli'] : '');
             }
         }
     }
     // die(print_r($data_tabel));
     $puskes = $this->input->post('puskes');
     if (empty($puskes) or $puskes == 'Pilih Puskesmas') {
         $nama = 'Semua Data Puskesmas';
     } else {
         $nama = $this->inv_barang_model->get_nama('value', 'cl_phc', 'code', $this->input->post('puskes'));
     }
     $tanggal = $this->input->post('filter_tanggal');
     $tanggal1 = $this->input->post('filter_tanggal1');
     if (empty($tanggal) or $tanggal == '' or empty($tanggal1) or $tanggal1 == '') {
         $tanggal = date('d-m-Y');
         $tanggal1 = date('d-m-Y');
     } else {
         $tanggals = explode("-", $this->input->post('filter_tanggal'));
         $tanggal = $tanggals[2] . '-' . $tanggals[1] . '-' . $tanggals[0];
         $tanggals1 = explode("-", $this->input->post('filter_tanggal1'));
         $tanggal1 = $tanggals1[2] . '-' . $tanggals1[1] . '-' . $tanggals1[0];
     }
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $kd_kec = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode_sess, 0, 7));
     $data_puskesmas[] = array('nama_puskesmas' => $nama, 'tgl1' => $tanggal, 'tgl2' => $tanggal1, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/lap_bhp_pengadaan.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     $output_file_name = 'public/files/hasil/laporan_bhp_pengadaan_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #19
0
 function excel()
 {
     $this->authentication->verify('spkp_personalia_jadwal_kegiatan', 'show');
     $data = $this->spkp_personalia_jadwal_kegiatan_model->json_kegiatan($id);
     $rows = $data[0]['Rows'];
     $data['title'] = "KP4 Pegawai";
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/personalia_cuti.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_personalia_cuti.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     echo $output_file_name;
 }
コード例 #20
0
 function permohonan_export()
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     //[data_tabel.no;block=tbs:row]	[data_tabel.tgl]	[data_tabel.ruangan]	[data_tabel.jumlah]	[data_tabel.keterangan]	[data_tabel.status]
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'status_sertifikat_tanggal') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->input->post('status') != '') {
         $this->db->where("inv_pengadaan.pilihan_status_pengadaan", $this->input->post('status'));
     }
     if ($this->input->post('puskesmas') != '' or empty($this->input->post('puskesmas'))) {
         $this->db->where('inv_inventaris_barang.code_cl_phc', $this->input->post('puskesmas'));
     }
     $rows_all = $this->lap_pengadaan_model->get_data();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'status_sertifikat_tanggal') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->input->post('status') != '') {
         $this->db->where("inv_pengadaan.pilihan_status_pengadaan", $this->input->post('status'));
     }
     if ($this->input->post('puskesmas') != '' or empty($this->input->post('puskesmas'))) {
         $this->db->where('inv_inventaris_barang.code_cl_phc', $this->input->post('puskesmas'));
     }
     $rows = $this->lap_pengadaan_model->get_data();
     $data_tabel = array();
     $no = 1;
     foreach ($rows as $act) {
         $data_tabel[] = array('no' => $no++, 'nama_barang' => $act->nama_barang, 'tgl_pengadaan' => date("d-m-Y", strtotime($act->tgl_pengadaan)), 'nomor_kontrak' => $act->nomor_kontrak, 'tgl_kwitansi' => date("d-m-Y", strtotime($act->tgl_kwitansi)), 'nomor_kwitansi' => $act->nomor_kwitansi, 'jumlah' => $act->jumlah, 'hargasatuan' => $act->hargasatuan, 'totalharga' => $act->totalharga, 'keterangan' => $act->keterangan);
     }
     $tanggal_export1 = $this->input->post('filter_tanggal1');
     $tanggal_export = $this->input->post('filter_tanggal');
     if (empty($tanggal_export) or $tanggal_export == '' or empty($tanggal_export1) or $tanggal_export1 == '') {
         $tanggal_export = date('d-m-Y');
         $tanggal_export1 = date('d-m-Y');
     } else {
         $tanggals = explode("-", $this->input->post('filter_tanggal'));
         $tanggal_export = $tanggals[2] . '-' . $this->bulan($tanggals[1]) . '-' . $tanggals[0];
         $tanggals1 = explode("-", $this->input->post('filter_tanggal1'));
         $tanggal_export1 = $tanggals1[2] . '-' . $this->bulan($tanggals1[1]) . '-' . $tanggals1[0];
     }
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $puskesmas = $this->inv_barang_model->get_nama('value', 'cl_phc', 'code', 'P' . $kode_sess);
     $data_puskesmas[] = array('tanggal_export' => $tanggal_export, 'tanggal_export1' => $tanggal_export1, 'kd_kab' => $kd_kab, 'kd_prov' => $kd_prov, 'puskesmas' => $puskesmas);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/lap_pengadaan.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     $output_file_name = 'public/files/hasil/hasil_export_lapPengadaan_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #21
0
<?php

// Include classes
include_once 'tbs_class.php';
// Load the TinyButStrong template engine
include_once '../tbs_plugin_opentbs.php';
// Load the OpenTBS plugin
// Initalize the TBS instance
$TBS = new clsTinyButStrong();
// new instance of TBS
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
// load the OpenTBS plugin
// ------------------------------
// Prepare some data for the demo
// ------------------------------
// Retrieve the user name to display
$yourname = isset($_POST['yourname']) ? $_POST['yourname'] : '';
$yourname = trim('' . $yourname);
if ($yourname == '') {
    $yourname = "(no name)";
}
// A recordset for merging tables
$data = array();
$data[] = array('rank' => 'A', 'firstname' => 'Sandra', 'name' => 'Hill', 'number' => '1523d', 'score' => 200, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
$data[] = array('rank' => 'A', 'firstname' => 'Roger', 'name' => 'Smith', 'number' => '1234f', 'score' => 800, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
$data[] = array('rank' => 'B', 'firstname' => 'William', 'name' => 'Mac Dowell', 'number' => '5491y', 'score' => 130, 'email_1' => '*****@*****.**', 'email_2' => '*****@*****.**', 'email_3' => '*****@*****.**');
// Other single data items
$x_num = 3152.456;
$x_pc = 0.2567;
$x_dt = mktime(13, 0, 0, 2, 15, 2010);
$x_bt = true;
コード例 #22
0
 function datakepalakeluaraexport()
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $this->authentication->verify('eform', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             $this->db->like($field, $value);
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filter_code_kelurahan') != '') {
         $this->db->where('data_keluarga.id_desa', $this->session->userdata('filter_code_kelurahan'));
     } else {
         if ($this->session->userdata('filter_code_kecamatan') != '') {
             $this->db->where('data_keluarga.id_kecamatan', $this->session->userdata('filter_code_kecamatan'));
         }
     }
     if ($this->session->userdata('filter_code_rukunwarga') != '') {
         $this->db->where('data_keluarga.rw', $this->session->userdata('filter_code_rukunwarga'));
     }
     /*	if($this->session->userdata('filter_code_cl_rukunrumahtangga') != '') {
     			$this->db->where('data_keluarga.rt',$this->session->userdata('filter_code_cl_rukunrumahtangga'));
     		}*/
     $rows_all = $this->datakeluarga_model->get_data_export();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             $this->db->like($field, $value);
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filter_code_kelurahan') != '') {
         $this->db->where('data_keluarga.id_desa', $this->session->userdata('filter_code_kelurahan'));
     } else {
         if ($this->session->userdata('filter_code_kecamatan') != '') {
             $this->db->where('data_keluarga.id_kecamatan', $this->session->userdata('filter_code_kecamatan'));
         }
     }
     if ($this->session->userdata('filter_code_rukunwarga') != '') {
         $this->db->where('data_keluarga.rw', $this->session->userdata('filter_code_rukunwarga'));
     }
     /*	if($this->session->userdata('filter_code_cl_rukunrumahtangga') != '') {
     			$this->db->where('data_keluarga.rt',$this->session->userdata('filter_code_cl_rukunrumahtangga'));
     		}
     */
     $rows = $this->datakeluarga_model->get_data_export();
     $no = 1;
     $data_tabel = array();
     foreach ($rows as $act) {
         $data_tabel[] = array('no' => $no++, 'id_data_keluarga' => $act->id_data_keluarga, 'tanggal_pengisian' => $act->tanggal_pengisian, 'jam_data' => $act->jam_data, 'alamat' => $act->alamat, 'id_propinsi' => $act->id_propinsi, 'id_kota' => $act->id_kota, 'id_kecamatan' => $act->id_kecamatan, 'value' => $act->value, 'rt' => $act->rt, 'rw' => $act->rw, 'norumah' => $act->norumah, 'nourutkel' => $act->nourutkel, 'id_kodepos' => $act->id_kodepos, 'namakepalakeluarga' => $act->namakepalakeluarga, 'notlp' => $act->notlp, 'namadesawisma' => $act->namadesawisma, 'id_pkk' => $act->id_pkk, 'nama_komunitas' => $act->nama_komunitas, 'laki' => $act->laki, 'pr' => $act->pr, 'jmljiwa' => $act->jmljiwa, 'edit' => 1, 'delete' => 1);
     }
     $kode = 'P ' . $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode, 2, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode, 2, 4));
     $nama = $this->inv_barang_model->get_nama('value', 'cl_phc', 'code', $kode);
     $kd_kec = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode, 2, 7));
     $kd_upb = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode, 2, 7));
     if ($this->input->post('kecamatan') != '' || $this->input->post('kecamatan') != 'null') {
         $kecamatan = $this->input->post('kecamatan');
     } else {
         $kecamatan = '-';
     }
     if ($this->input->post('kelurahan') != '' || $this->input->post('kelurahan') != 'null') {
         $kelurahan = $this->input->post('kelurahan');
     } else {
         $kelurahan = '-';
     }
     if ($this->input->post('rukunwarga') != '' || $this->input->post('rukunwarga') != 'null') {
         $rukunwarga = $this->input->post('rukunwarga');
     } else {
         $rukunwarga = '-';
     }
     /*if ($this->input->post('rukunrumahtangga')!='' || $this->input->post('rukunrumahtangga')!='null') {
     			$rukunrumahtangga = $this->input->post('rukunrumahtangga');
     		}else{
     			$rukunrumahtangga = '-';
     		}
     			'rt' => $rukunrumahtangga
     		*/
     $tanggal_export = date("Y-m-d");
     $data_puskesmas[] = array('nama_puskesmas' => $nama, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'tanggal_export' => $tanggal_export, 'kd_kab' => $kd_kab, 'rw' => $rukunwarga);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/data_kepala_keluarga.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     $output_file_name = 'public/files/hasil/hasil_ketokpintu_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #23
0
 function laporan_opname($id = 0)
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             $this->db->like($field, $value);
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filter_jenisbarang') != '') {
         if ($this->session->userdata('filter_jenisbarang') == "all") {
         } else {
             //$this->db->where("jenis_bhp",$this->session->userdata('filter_jenisbarang'));
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_bulan') != '') {
         if ($this->session->userdata('filter_bulan') == "all") {
         } else {
             //$this->db->where("MONTH(tgl_opname)",$this->session->userdata('filter_bulan'));
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_tahun') != '') {
         if ($this->session->userdata('filter_tahun') == "all") {
         } else {
             //	$this->db->where("YEAR(tgl_opname)",$this->session->userdata('filter_tahun'));
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     $rows_all = $this->bhp_opname_model->get_data();
     $filtername = '';
     $order = '';
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             $filtername = "and {$field} like " . '"%' . $value . '%"' . "";
         }
         if (!empty($ord)) {
             //$this->db->order_by($ord, $this->input->post('sortorder'));
             $val = $this->input->post('sortorder');
             $order = "order by {$ord} {$val}";
         }
     }
     $filbulan = date("m");
     $filtahun = date("Y");
     $filterbhp = "";
     if ($this->session->userdata('filter_jenisbarang') != '') {
         if ($this->session->userdata('filter_jenisbarang') == "all") {
             $filterbhp = "";
         } else {
             if ($this->session->userdata('filter_jenisbarang') == 'obat') {
                 $jenis = 'obat';
             } else {
                 $jenis = 'umum';
             }
             $filterbhp = " and inv_inventaris_habispakai_opname.jenis_bhp = " . '"' . $jenis . '"' . "";
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_bulan') != '') {
         if ($this->session->userdata('filter_bulan') == "all") {
         } else {
             //$this->db->where("MONTH(tgl_opname)",$this->session->userdata('filter_bulan'));
             $filbulan = $this->session->userdata('filter_bulan');
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     if ($this->session->userdata('filter_tahun') != '') {
         if ($this->session->userdata('filter_tahun') == "all") {
         } else {
             //$this->db->where("YEAR(tgl_opname)",$this->session->userdata('filter_tahun'));
             $filtahun = $this->session->userdata('filter_tahun');
         }
     } else {
         //$this->db->where("mst_inv_barang_habispakai.id_mst_inv_barang_habispakai_jenis",$kode);
     }
     $puskesmas = $this->input->post('puskesmas');
     $rows = $this->bhp_opname_model->get_data_lap_opname($filbulan, $filtahun, $filterbhp, $filtername, $order, $puskesmas);
     //die(print_r($rows));
     //	$get_jumlahawal = $this->bhp_opname_model->get_jumlahawal();
     $data = array();
     $no = 0;
     $data_tabel = array();
     $temp = '';
     $jml = 0;
     foreach ($rows as $key => $val) {
         $no++;
         foreach ($val as $act => $value) {
             if ($key == $temp) {
                 $data_tabel["{$key}"]["keluar{$act}"] = $value['pengeluaranperhari'] * -1;
                 $data_tabel["{$key}"]["harga"] = $value['harga'];
                 $data_tabel["{$key}"]["jumlah_op"] = $data_tabel["{$key}"]["jumlah_op"] + $value['pengeluaranperhari'];
                 $data_tabel["{$key}"]['nilai_aset_total'] = ($data_tabel["{$key}"]["jumlah_awal"] + $data_tabel["{$key}"]["jumlah_op"]) * $value['harga'];
                 $data_tabel["{$key}"]['total'] = $data_tabel["{$key}"]["jumlah_awal"] + $data_tabel["{$key}"]["jumlah_op"];
                 $data_tabel["{$key}"]['nilai_aset_awal'] = $value['jumlah_awal'] * $value['harga'];
             } else {
                 $temp = $key;
                 $data_tabel[$key] = array('no' => $no, 'uraian' => $key, 'harga' => $value['harga'], 'jumlah_op' => $value['pengeluaranperhari'], 'jumlah_awal' => $value['jumlah_awal'], 'nilai_aset_awal' => $value['jumlah_awal'] * $value['harga'], 'total' => $value['jumlah_awal'] + $value['pengeluaranperhari'], 'nilai_aset_total' => ($value['jumlah_awal'] + $value['pengeluaranperhari']) * $value['harga'], 'keluar1' => $act == 1 ? $value['pengeluaranperhari'] * -1 : '', 'keluar2' => $act == 2 ? $value['pengeluaranperhari'] * -1 : '', 'keluar3' => $act == 3 ? $value['pengeluaranperhari'] * -1 : '', 'keluar4' => $act == 4 ? $value['pengeluaranperhari'] * -1 : '', 'keluar5' => $act == 5 ? $value['pengeluaranperhari'] * -1 : '', 'keluar6' => $act == 6 ? $value['pengeluaranperhari'] * -1 : '', 'keluar7' => $act == 7 ? $value['pengeluaranperhari'] * -1 : '', 'keluar8' => $act == 8 ? $value['pengeluaranperhari'] * -1 : '', 'keluar9' => $act == 9 ? $value['pengeluaranperhari'] * -1 : '', 'keluar10' => $act == 10 ? $value['pengeluaranperhari'] * -1 : '', 'keluar11' => $act == 11 ? $value['pengeluaranperhari'] * -1 : '', 'keluar12' => $act == 12 ? $value['pengeluaranperhari'] * -1 : '', 'keluar13' => $act == 13 ? $value['pengeluaranperhari'] * -1 : '', 'keluar14' => $act == 14 ? $value['pengeluaranperhari'] * -1 : '', 'keluar15' => $act == 15 ? $value['pengeluaranperhari'] * -1 : '', 'keluar16' => $act == 16 ? $value['pengeluaranperhari'] * -1 : '', 'keluar17' => $act == 17 ? $value['pengeluaranperhari'] * -1 : '', 'keluar18' => $act == 18 ? $value['pengeluaranperhari'] * -1 : '', 'keluar19' => $act == 19 ? $value['pengeluaranperhari'] * -1 : '', 'keluar20' => $act == 20 ? $value['pengeluaranperhari'] * -1 : '', 'keluar21' => $act == 21 ? $value['pengeluaranperhari'] * -1 : '', 'keluar22' => $act == 22 ? $value['pengeluaranperhari'] * -1 : '', 'keluar23' => $act == 23 ? $value['pengeluaranperhari'] * -1 : '', 'keluar24' => $act == 24 ? $value['pengeluaranperhari'] * -1 : '', 'keluar25' => $act == 25 ? $value['pengeluaranperhari'] * -1 : '', 'keluar26' => $act == 26 ? $value['pengeluaranperhari'] * -1 : '', 'keluar27' => $act == 27 ? $value['pengeluaranperhari'] * -1 : '', 'keluar28' => $act == 28 ? $value['pengeluaranperhari'] * -1 : '', 'keluar29' => $act == 29 ? $value['pengeluaranperhari'] * -1 : '', 'keluar30' => $act == 30 ? $value['pengeluaranperhari'] * -1 : '', 'keluar31' => $act == 31 ? $value['pengeluaranperhari'] * -1 : '');
             }
         }
     }
     ///die(print_r($data_tabel));
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $nama_puskesmas = $this->input->post('nama_puskesmas');
     //$tgl = date("d-m-Y");
     $jenis_barang = $this->input->post('jenisbarang');
     $tgl = $this->input->post('bulan');
     $tahun = $this->input->post('tahun');
     $tgl1 = date("m-m-Y");
     $tgl2 = date("d-m-Y");
     $data_puskesmas[] = array('jenis_barang' => $jenis_barang, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'nama_puskesmas' => $nama_puskesmas, 'bulan' => $tgl, 'tahun' => $tahun, 'tgl1' => $tgl1, 'tgl2' => $tgl2, 'tanggal_export' => $tgl2);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/lap_bhp_pengeluaran.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_daftarstokopname_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #24
0
 function excel()
 {
     $this->authentication->verify('spkp_renstra_dit', 'show');
     $data = $this->spkp_renstra_dit_model->json_renstra_dit();
     $rows = $data[0]['Rows'];
     $data['title'] = "Rencana Strategis DIT/SPKP";
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/renstra_dit.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_renstra_dit.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     //echo $output_file_name;
     echo '../public/doc_xls_export/report_renstra_dit.xlsx';
 }
コード例 #25
0
$traitements_col = $query->paginate($page_number, $item_per_page);
$nb_pages = floor($traitements_col->getNbResults() / $item_per_page) + 1;
if ($page_number > $nb_pages) {
    $page_number = $nb_pages;
}
$results = $traitements_col->getResults();
if ($affichage == 'tableur') {
    include_once 'lib/function.php';
    // load the TinyButStrong libraries
    include_once '../tbs/tbs_class.php';
    // TinyButStrong template engine
    //include_once('../tbs/plugins/tbsdb_php.php');
    $TBS = new clsTinyButStrong();
    // new instance of TBS
    include_once '../tbs/plugins/tbs_plugin_opentbs.php';
    $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
    // load OpenTBS plugin
    // Load the template
    $extraction_traitement = repertoire_modeles('absence_extraction_traitements.ods');
    $TBS->LoadTemplate($extraction_traitement, OPENTBS_ALREADY_UTF8);
    $titre = 'Extrait des traitement d\'absences';
    $TBS->MergeField('titre', $titre);
    $traitement_array_avec_data = array();
    foreach ($results as $traitement) {
        if (isset($_POST['envoye_depuis_liste_traitements'])) {
            if (isset($_POST['liste_traitements_id_traitement']) && in_array($traitement->getPrimaryKey(), $_POST['liste_traitements_id_traitement'])) {
                $extraire_ce_traitement = "y";
            } else {
                $extraire_ce_traitement = "n";
            }
        } else {
コード例 #26
0
 function export_detail()
 {
     $this->authentication->verify('inventory', 'show');
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $filter_group = $this->session->userdata('filter_group');
     $no = 1;
     $data_tabel = array();
     if (!empty($filter_group) and $filter_group == '1') {
         $rows = $this->inv_ruangan_model->get_data_detail_group();
         $data = array();
         foreach ($rows as $act) {
             $act['no'] = $no++;
             $act['harga'] = number_format($act['harga']);
             $act['kode_barang'] = substr(chunk_split($act['id_mst_inv_barang'], 2, '.'), 0, 14);
             $act['keterangan'] = "";
             $data_tabel[] = $act;
         }
     } else {
         $rows = $this->inv_ruangan_model->get_data_detail();
         $data = array();
         foreach ($rows as $act) {
             $act['no'] = $no++;
             $act['kode_barang'] = substr(chunk_split($act['id_mst_inv_barang'], 2, '.'), 0, 14);
             $act['harga'] = number_format($act['harga']);
             $data_tabel[] = $act;
         }
     }
     $code_cl_phc = $this->input->post('filter_code_cl_phc');
     $ruang = $this->input->post('filter_id_ruang');
     $tanggal = $this->input->post('filter_tanggal');
     if (empty($code_cl_phc) or $code_cl_phc == 'Pilih Puskesmas') {
         $kode = "P" . $this->session->userdata('puskesmas');
         $nama = "Data Seluruh Puskesmas";
     } else {
         $kode = $this->input->post('filter_code_cl_phc');
         $puskesmas = $this->inv_barang_model->get_nama('value', 'cl_phc', 'code', $kode);
         $nama = $puskesmas;
     }
     if (empty($ruang) or $ruang == 'Pilih Ruangan') {
         $namaruang = 'Data Seluruh Ruangan';
     } else {
         $this->db->where('id_mst_inv_ruangan', $ruang);
         $this->db->where('code_cl_phc', $kode);
         $ruang = $this->db->get('mst_inv_ruangan')->row();
         $namaruang = !empty($ruang) ? $ruang->nama_ruangan : "-";
     }
     $propinsi = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode, 1, 2));
     $kabkota = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode, 1, 4));
     $kecamatan = $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode, 1, 7));
     $tanggals = explode("-", $tanggal);
     $tanggal_export = $tanggals[2] . '-' . $tanggals[1] . '-' . $tanggals[0];
     $data_puskesmas['puskesmas'] = $nama;
     $data_puskesmas['tanggal'] = $tanggal_export;
     $data_puskesmas['ruangan'] = $namaruang;
     $data_puskesmas['kecamatan'] = $kecamatan;
     $data_puskesmas['kabkota'] = $kabkota;
     $data_puskesmas['propinsi'] = $propinsi;
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data_puskesmas;
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/kir.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     $TBS->MergeBlock('a', $data_tabel);
     $code = date('Y-m-d-H-i-s');
     $output_file_name = 'public/files/hasil/hasil_kir_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #27
0
 function excel_tukin($id, $thn = "", $bln = "")
 {
     $this->authentication->verify('spkp_absen_tunjangan', 'show');
     $data = $this->spkp_absen_tunjangan_model->json_absen($id, $thn, $bln);
     $rows = $data[0]['Rows'];
     if (!is_array($rows)) {
         $rows = array();
     }
     $data['title'] = "Absensi - Tunjangan Kinerja " . $thn . "-" . $bln;
     $path = dirname(__FILE__) . '/../../public/doc_xls_';
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $TBS->ResetVarRef(false);
     $TBS->VarRef =& $data;
     $template = $path . 'templates/absensi_tukin.xlsx';
     $TBS->LoadTemplate($template);
     $TBS->MergeBlock('data', $rows);
     $output_file_name = $path . 'export/report_absensi_tukin.xlsx';
     $TBS->Show(OPENTBS_FILE, $output_file_name);
     echo '../public/doc_xls_export/report_absensi_tukin.xlsx';
 }
コード例 #28
0
ファイル: export.php プロジェクト: viktoredz/1nf0k35-2016
 function permohonan_export_kibf()
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     //[data_tabel.no;block=tbs:row]	[data_tabel.tgl]	[data_tabel.ruangan]	[data_tabel.jumlah]	[data_tabel.keterangan]	[data_tabel.status]
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tanggal_mulai') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filterruangan') != '') {
         $filter = $this->session->userdata('filterruangan');
         $this->db->where("id_ruangan", $filter);
     }
     if ($this->input->post('puskes') != '') {
         $this->db->where("id_cl_phc", $this->input->post('puskes'));
     } else {
         $this->db->where("id_cl_phc", $this->session->userdata('filter_cl_phc'));
     }
     $rows_all = $this->inv_barang_model->get_data_golongan_F();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'tanggal_mulai') {
                 $value = date("Y-m-d", strtotime($value));
                 $this->db->where($field, $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     if ($this->session->userdata('filterruangan') != '') {
         $filter = $this->session->userdata('filterruangan');
         $this->db->where("id_ruangan", $filter);
     }
     if ($this->input->post('puskes') != '') {
         $this->db->where("id_cl_phc", $this->input->post('puskes'));
     } else {
         $this->db->where("id_cl_phc", $this->session->userdata('filter_cl_phc'));
     }
     $rows = $this->inv_barang_model->get_data_golongan_F();
     $no = 1;
     $data_tabel = array();
     foreach ($rows as $act) {
         $data_tabel[] = array('no' => $no++, 'id_inventaris_barang' => $act->id_inventaris_barang, 'id_mst_inv_barang' => $act->id_mst_inv_barang, 'uraian' => $act->uraian, 'tanah' => $act->tanah, 'beton' => $act->beton, 'tingkat' => $act->tingkat, 'id_pengadaan' => $act->id_pengadaan, 'id_cl_phc' => $act->id_cl_phc, 'register' => $act->register, 'harga' => number_format($act->harga, 2), 'keterangan_pengadaan' => $act->keterangan_pengadaan, 'asal_usul' => $act->asal_usul, 'jumlah' => $act->jumlah, 'barang_kembar_proc' => $act->barang_kembar_proc, 'bangunan' => $act->bangunan, 'pilihan_konstruksi_bertingkat' => $act->pilihan_konstruksi_bertingkat, 'pilihan_konstruksi_beton' => $act->pilihan_konstruksi_beton, 'luas' => $act->luas, 'lokasi' => $act->lokasi, 'dokumen_tanggal' => $act->dokumen_tanggal, 'dokumen_nomor' => $act->dokumen_nomor, 'tanggal_mulai' => $act->tanggal_mulai, 'pilihan_status_tanah' => $act->pilihan_status_tanah, 'edit' => 1, 'delete' => 1);
     }
     $puskes = $this->input->post('puskes');
     $ruang = $this->input->post('ruang');
     $tanggal_export = $this->input->post('filter_tanggal');
     if (empty($puskes) or $puskes == 'Pilih Puskesmas') {
         $kode = 'P ' . $this->session->userdata('puskesmas');
         $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode, 2, 2));
         $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode, 2, 4));
         $kd_kec = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode, 2, 7));
         $kd_upb = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode, 2, 7));
     } else {
         $kode_sess = $this->session->userdata('puskesmas');
         $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
         $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
         $kd_kec = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode_sess, 0, 7));
         $kd_upb = $this->input->post('namepuskes');
         $kode = $this->input->post('puskes');
     }
     if (empty($ruang) or $ruang == 'Pilih Ruangan') {
         $namaruang = 'Semua Data Ruangan';
     } else {
         $namaruang = $this->input->post('ruang');
     }
     if (empty($tanggal_export) or $tanggal_export == '') {
         $tanggal_export = date('d-m-Y');
     } else {
         $tanggals = explode("-", $this->input->post('filter_tanggal'));
         $tanggal_export = $tanggals[2] . '-' . $tanggals[1] . '-' . $tanggals[0];
     }
     $data_puskesmas[] = array('kode' => $kode, 'namaruang' => $namaruang, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'kd_kec' => $kd_kec, 'kd_upb' => $kd_upb, 'tanggal_export' => $tanggal_export);
     $dir = getcwd() . '/';
     $template = $dir . 'public/files/template/inventory/kibf.xlsx';
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     $output_file_name = 'public/files/hasil/hasil_export_KIBF_' . $code . '.xlsx';
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #29
0
 function permintaan_detail_export($id = 0)
 {
     $TBS = new clsTinyButStrong();
     $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
     $this->authentication->verify('inventory', 'show');
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'harga') {
                 $this->db->where('inv_inventaris_habispakai_permintaan_item.harga', $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     $this->db->where('inv_inventaris_habispakai_permintaan_item.id_inv_hasbispakai_permintaan', $id);
     $rows_all_activity = $this->bhp_permintaan_model->getItem();
     if ($_POST) {
         $fil = $this->input->post('filterscount');
         $ord = $this->input->post('sortdatafield');
         for ($i = 0; $i < $fil; $i++) {
             $field = $this->input->post('filterdatafield' . $i);
             $value = $this->input->post('filtervalue' . $i);
             if ($field == 'harga') {
                 $this->db->where('inv_inventaris_habispakai_permintaan_item.harga', $value);
             } elseif ($field != 'year') {
                 $this->db->like($field, $value);
             }
         }
         if (!empty($ord)) {
             $this->db->order_by($ord, $this->input->post('sortorder'));
         }
     }
     $this->db->where('inv_inventaris_habispakai_permintaan_item.id_inv_hasbispakai_permintaan', $id);
     $activity = $this->bhp_permintaan_model->getItem();
     $data_tabel = array();
     $kodepuskesmas = $this->session->userdata('puskesmas');
     if (substr($kodepuskesmas, -2) == "01") {
         $unlock = 1;
     } else {
         $unlock = 0;
     }
     $no = 1;
     foreach ($activity as $act) {
         $data_tabel[] = array('no' => $no++, 'id_inv_hasbispakai_permintaan' => $act->id_inv_hasbispakai_permintaan, 'id_mst_inv_barang_habispakai' => $act->id_mst_inv_barang_habispakai, 'uraian' => $act->uraian, 'jml' => $act->jml, 'harga' => number_format($act->harga, 2), 'subtotal' => number_format($act->jml * $act->harga, 2), 'tgl_permintaan' => $act->tgl_permintaan, 'status_permintaan' => $act->status_permintaan, 'pilihan_satuan' => $act->pilihan_satuan, 'merek_tipe' => $act->merek_tipe);
     }
     $kode_sess = $this->session->userdata('puskesmas');
     $kd_prov = $this->inv_barang_model->get_nama('value', 'cl_province', 'code', substr($kode_sess, 0, 2));
     $kd_kab = $this->inv_barang_model->get_nama('value', 'cl_district', 'code', substr($kode_sess, 0, 4));
     $kd_kec = 'KEC. ' . $this->inv_barang_model->get_nama('nama', 'cl_kec', 'code', substr($kode_sess, 0, 7));
     $namapus = $this->inv_barang_model->get_nama('value', 'cl_phc', 'code', 'P' . $kode_sess);
     $tahun = date("Y");
     $datautama = $this->bhp_permintaan_model->get_data_row($id);
     $tgl_permintaan = date("d-m-Y", strtotime($datautama['tgl_permintaan']));
     $kategori_barang = $this->inv_barang_model->get_nama('uraian', 'mst_inv_barang_habispakai_jenis', 'id_mst_inv_barang_habispakai_jenis', $datautama['id_mst_inv_barang_habispakai_jenis']);
     $status = $datautama['status_permintaan'];
     $jumlah_unit = $datautama['jumlah_unit'];
     $nilai_unit = number_format($datautama['nilai_pembelian'], 2);
     $data_puskesmas[] = array('nama_puskesmas' => $namapus, 'kd_prov' => $kd_prov, 'kd_kab' => $kd_kab, 'tahun' => $tahun, 'kategori_barang' => $kategori_barang, 'tgl_permintaan' => $tgl_permintaan, 'status' => $status, 'jumlah_unit' => $jumlah_unit, 'nilai_unit' => $nilai_unit);
     $dir = getcwd() . '/';
     if ($datautama['id_mst_inv_barang_habispakai_jenis'] == '8') {
         $template = $dir . 'public/files/template/inventory/bhp_permintaan_detail_obat.xlsx';
     } else {
         $template = $dir . 'public/files/template/inventory/bhp_permintaan_detail.xlsx';
     }
     $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
     // Merge data in the first sheet
     $TBS->MergeBlock('a', $data_tabel);
     $TBS->MergeBlock('b', $data_puskesmas);
     $code = uniqid();
     if ($datautama['id_mst_inv_barang_habispakai_jenis'] == '8') {
         $output_file_name = 'public/files/hasil/hasil_export_bhppermintaandetailobat_' . $code . '.xlsx';
     } else {
         $output_file_name = 'public/files/hasil/hasil_export_bhppermintaandetail_' . $code . '.xlsx';
     }
     $output = $dir . $output_file_name;
     $TBS->Show(OPENTBS_FILE, $output);
     // Also merges all [onshow] automatic fields.
     echo base_url() . $output_file_name;
 }
コード例 #30
0
                echo "<p><a href='$chemin_fichier' target='_blank'>Télécharger le CSV</a> ou le <a href='$chemin_fichier1' target='_blank'>CSV avec nom, prénom, classe</a></p>
                <script type='text/javascript'>
                    document.getElementById('p_csv').innerHTML=\"<a href='$chemin_fichier' target='_blank'>Télécharger le CSV</a> ou le <a href='$chemin_fichier1' target='_blank'>CSV avec nom, prénom, classe</a>\";
                    document.getElementById('p_csv').style.display='';
                </script>\n";
            }
        }
    }
} else if ($affichage == 'ods') {
    // load the TinyButStrong libraries    
	include_once('../tbs/tbs_class.php'); // TinyButStrong template engine
    
    //include_once('../tbs/plugins/tbsdb_php.php');
    $TBS = new clsTinyButStrong; // new instance of TBS
    include_once('../tbs/plugins/tbs_plugin_opentbs.php');
    $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load OpenTBS plugin

    // Load the template
	$extraction_demi_journees=repertoire_modeles('absence_extraction_demi-journees.ods');
    $TBS->LoadTemplate($extraction_demi_journees, OPENTBS_ALREADY_UTF8);

    $titre = 'Extrait des demi-journées d\'absences du '.$dt_date_absence_eleve_debut->format('d/m/Y').' au '.$dt_date_absence_eleve_fin->format('d/m/Y');
    $classe = null;
    if ($id_classe != null && $id_classe != '') {
	$classe = ClasseQuery::create()->findOneById($id_classe);
	if ($classe != null) {
	    $titre .= ' pour la classe '.$classe->getNom();
	}
    }
    if ($nom_eleve != null && $nom_eleve != '' ) {
	$titre .= ' pour les élèves dont le nom ou le prénom contient '.$nom_eleve;