本文整理汇总了PHP中clsTinyButStrong::MergeBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP clsTinyButStrong::MergeBlock方法的具体用法?PHP clsTinyButStrong::MergeBlock怎么用?PHP clsTinyButStrong::MergeBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clsTinyButStrong
的用法示例。
在下文中一共展示了clsTinyButStrong::MergeBlock方法的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: getTemplateMerge
function getTemplateMerge($templateFileName, $vars = null)
{
$tbs = new clsTinyButStrong();
$tbs->LoadTemplate($this->getTemplateDir() . $templateFileName);
foreach ($vars as $name => $value) {
if (is_array($value)) {
$tbs->MergeBlock($name, $value);
} else {
$tbs->MergeField($name, $value);
}
}
$tbs->Show(TBS_NOTHING);
echo $tbs->Source;
}
示例3: 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);
}
示例4: array
//request success
}
}
}
}
//Display Results >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if ($proceed == true) {
$result = array();
$sql = "SELECT * FROM general_settings";
$query = @mysql_query($sql);
while ($result1 = @mysql_fetch_array($query)) {
$result[] = $result1;
}
}
////////////////////////////////
//display form with error message
////////////////////////////////
$show_content_menu = 0;
//display top tabs as set in /includes/menuloader
$template = "templates/main.html";
$inner_template1 = "templates/inner_settings.htm";
//middle of page
$TBS = new clsTinyButStrong();
$TBS->NoErr = true;
// no more error message displayed.
$TBS->LoadTemplate("{$template}");
$TBS->MergeBlock('adminblk', $result);
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die;
示例5: clsTinyButStrong
<?php
// Use this PHP File As your Development
// **************** Default include ****************
// include All file
include_once '../all.php';
// New template engine object
$TBS = new clsTinyButStrong();
// Load Your HTML file
$TBS->LoadTemplate('index.html');
// <----- Place this script HTML
// ****************************************************
// ************** Write Your Code Here **************
$title = 'Rojak Engine Examples';
$message = 'Examples';
// Scan All files in current directory
$links = scandir('./');
// Check each link for filter . .. index.php user and all .html
foreach ($links as $key => $link) {
if (substr($link, -5) == '.html' || $link == '.' || $link == '..' || $link == 'index.php' || $link == 'user') {
// Remove that array
unset($links[$key]);
}
}
// Merge array to HTML
$TBS->MergeBlock('blk1', $links);
// ****************************************************
// Show result
$TBS->Show();
示例6: 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;
}
示例7: 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;
}
示例8: errorcodes
$error_code = errorcodes($codes);
if (!empty($error_code)) {
$message_type = $error_code['error_type'];
$error_message = $error_code['error_message'];
$error_height = '230px;';
// display error
$template = "themes/{$user_theme}/templates/main_1.htm";
$inner_template1 = "themes/{$user_theme}/templates/inner_notification.htm";
$TBS = new clsTinyButStrong();
$TBS->NoErr = true;
$TBS->LoadTemplate("{$template}");
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die;
}
// get members overall site ranking for badge display
$member_id = $poster_id;
$member_badge = member_site_ranking($member_id);
$div_style_height = ($limit + $replies_count) * 160;
$blog_url = $base_url . "/read_blog/" . $blog_id . "/" . $result[title_seo];
$template = "themes/{$user_theme}/templates/main_1.htm";
$inner_template1 = "themes/{$user_theme}/templates/inner_read_blog.htm";
$TBS = new clsTinyButStrong();
$TBS->NoErr = true;
$TBS->LoadTemplate("{$template}");
$TBS->MergeBlock('blk1', $all_categories);
$TBS->MergeBlock('blk3', $result_search3);
$TBS->Render = TBS_OUTPUT;
$TBS->show();
die;
示例9: isset
$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.
// --------------------------------------------
// Merging and other operations on the template
// --------------------------------------------
// Merge data in a table (there is no need to select the slide with an ODP)
$TBS->MergeBlock('b', $data);
// Hide a slide
$TBS->PlugIn(OPENTBS_DISPLAY_SLIDES, 'slide to hide', false);
// Delete a slide
$TBS->PlugIn(OPENTBS_DELETE_SLIDES, 'slide to delete');
// -----------------
// Output the result
// -----------------
// Define the name of the output file
$save_as = isset($_POST['save_as']) && trim($_POST['save_as']) !== '' && $_SERVER['SERVER_NAME'] == 'localhost' ? trim($_POST['save_as']) : '';
$output_file_name = str_replace('.', '_' . date('Y-m-d') . $save_as . '.', $template);
if ($save_as === '') {
// Output the result as a downloadable file (only streaming, no data saved in the server)
$TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);
// Also merges all [onshow] automatic fields.
} else {
示例10: isset
<?php
include_once 'tbs_class.php';
//Connexion to the database
/* Use the example below.
$cnx_id = sqlite_open('mydatabase.dat');
*/
$sql_ok = isset($cnx_id) && is_resource($cnx_id) ? 1 : 0;
if ($sql_ok == 0) {
$cnx_id = 'clear';
}
// makes the block to be cleared instead of merged with an SQL query.
$TBS = new clsTinyButStrong();
$TBS->LoadTemplate('tbs_us_examples_datamysql.htm');
$TBS->MergeBlock('blk1', $cnx_id, 'SELECT * FROM t_tbs_exemples');
$TBS->Show();
示例11: excel
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';
}
示例12: getSettingValue
//$nom_fichier_xml_a_traiter ='content.xml';
//les chemins contenant les données
$fb_gab_perso = getSettingValue("fb_gab_perso");
if ($fb_gab_perso == "1") {
// Gestion du multisite
if ($_SESSION['rne'] != '') {
$rne = $_SESSION['rne'] . "/";
} else {
$rne = '';
}
$nom_dossier_modele_a_utiliser = "../../mod_ooo/mes_modeles/" . $rne;
} else {
$nom_dossier_modele_a_utiliser = "../../mod_ooo/modeles_gepi/";
}
// TODO vérifier les chemins comme /mod_ooo/lib/chemin.inc.php
// Création d'une classe TBS OOo class
$OOo = new clsTinyButStrong();
$OOo->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$OOo->LoadTemplate($nom_dossier_modele_a_utiliser . $nom_fichier_modele_ooo, OPENTBS_ALREADY_UTF8);
$OOo->MergeBlock('eleves', $tab_eleves_OOo);
//Génération du nom du fichier
$now = gmdate('d_M_Y_H:i:s');
$nom_fichier_modele = explode('.', $nom_fichier_modele_ooo);
$nom_fic = $nom_fichier_modele[0] . "_" . $now . "." . $nom_fichier_modele[1];
$OOo->Show(OPENTBS_DOWNLOAD, $nom_fic);
$OOo->remove();
//suppression des fichiers de travail
$OOo->close();
//=======================================
// FIN AFFICHAGE DES DONNÉES
//=======================================
示例13:
$OOo = new clsTinyButStrong; // new instance of TBS
$OOo->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load OpenTBS plugin
$OOo->LoadTemplate($nom_dossier_modele_a_utiliser.$nom_fichier_modele_ooo, OPENTBS_ALREADY_UTF8);
// Traitement des tableaux
// On insère ici les lignes concernant la gestion des tableaux
if (!$page_garde) {
//~ $OOo->mergeXml(
//~ array(
//~ 'name' => 'page_garde',
//~ 'type' => 'clear'));
$OOo->MergeBlock('page_garde','clear');
} else {
//~ $OOo->mergeXmlBlock('page_garde',array('fake')); // Juste pour que le bloc s'initialise correctement
$OOo->MergeBlock('page_garde',array('fake'));
}
if (!$releve) {
//~ $OOo->mergeXml(
//~ array(
//~ 'name' => 'releve',
//~ 'type' => 'clear'));
$OOo->MergeBlock('releve','clear');
} else {
//~ $OOo->mergeXmlBlock('releve',array('fake')); // Juste pour que le bloc s'initialise correctement
$OOo->MergeBlock('releve',array('fake'));
}
示例14: clsTinyButStrong
}
if (sizeof($albums_list) > 0) {
$show_albums = 1;
} else {
$show_albums = 0;
}
// PAGINATION PLUS >> start -- reusable code
$hide_numbering = true;
//show only <<previous Next>>>
$url = 'javascript:void(0)" onClick="javascript:ahahscript.ahah(\'albums_ajax.php';
//the url to be put in links - EDIT ME
$ahah_pagination = "', 'Ajax-Albums', '', 'GET', '', this);";
//for ajax pagination
$additional_url_variable = '?page=';
//add addtions information that goes in query string here
include 'includes/pagination.inc.php';
$ablums_pagination = $show_pages;
// PAGINATION PLUS >> end
$template = "themes/{$user_theme}/templates/inner_albums_ajax.htm";
$TBS = new clsTinyButStrong();
$TBS->NoErr = true;
$TBS->LoadTemplate("{$template}");
$TBS->MergeBlock('mp', $all_albums);
$TBS->MergeBlock('blk1', $albums_list);
$TBS->Render = TBS_OUTPUT;
$TBS->tbs_show();
@mysql_close();
die;
?>
示例15: errorcodes
} else {
$show_v = 2;
}
//PAGINATION PLUS >> start
$url = 'genre';
$additional_url_variable = '/' . $channel . '/';
include_once 'includes/pagination.inc.php';
//PAGINATION PLUS >> end
if ($codes == "") {
$codes = $codes_internal;
}
$error_code = errorcodes($codes);
if (!empty($error_code)) {
$blk_code = $error_code['error_display'];
$code_type = $error_code['error_type'];
$code_message = $error_code['error_message'];
}
$blk_id = 0;
//html table - error block
$template = "themes/{$user_theme}/templates/main_1.htm";
$inner_template1 = "themes/{$user_theme}/templates/inner_genre_home.htm";
$TBS = new clsTinyButStrong();
$TBS->NoErr = true;
$TBS->LoadTemplate("{$template}");
$TBS->MergeBlock('blkfeatured', $result_featured);
$TBS->MergeBlock('blk1', $all_categories);
$TBS->MergeBlock('blk2', $all_albums);
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die;