本文整理汇总了PHP中clsTinyButStrong::Plugin方法的典型用法代码示例。如果您正苦于以下问题:PHP clsTinyButStrong::Plugin方法的具体用法?PHP clsTinyButStrong::Plugin怎么用?PHP clsTinyButStrong::Plugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clsTinyButStrong
的用法示例。
在下文中一共展示了clsTinyButStrong::Plugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionTemplate2
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: excel
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: dirname
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: clsTinyButStrong
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: dirname
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: clsTinyButStrong
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: clsTinyButStrong
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: clsTinyButStrong
// 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' => 'sh@tbs.com', 'email_2' => 'sandra@tbs.com', 'email_3' => 's.hill@tbs.com');
$data[] = array('rank' => 'A', 'firstname' => 'Roger', 'name' => 'Smith', 'number' => '1234f', 'score' => 800, 'email_1' => 'rs@tbs.com', 'email_2' => 'robert@tbs.com', 'email_3' => 'r.smith@tbs.com');
$data[] = array('rank' => 'B', 'firstname' => 'William', 'name' => 'Mac Dowell', 'number' => '5491y', 'score' => 130, 'email_1' => 'wmc@tbs.com', 'email_2' => 'william@tbs.com', 'email_3' => 'w.m.dowell@tbs.com');
示例9: dirname
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: excel
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: export
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: clsTinyButStrong
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: clsTinyButStrong
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: excel
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: creeODS
/**
* 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 ();
}