本文整理汇总了PHP中simbio_table::printTable方法的典型用法代码示例。如果您正苦于以下问题:PHP simbio_table::printTable方法的具体用法?PHP simbio_table::printTable怎么用?PHP simbio_table::printTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simbio_table
的用法示例。
在下文中一共展示了simbio_table::printTable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
// hidden form
echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="bid" value="0" /><input type="hidden" name="remove" value="0" /></form>';
} else {
if ($_SESSION['biblioTopic']) {
$table = new simbio_table();
$table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
$row = 1;
$row_class = 'alterCell2';
foreach ($_SESSION['biblioTopic'] as $biblio_session) {
// remove link
$remove_link = '<a class="notAJAX btn button btn-danger btn-delete" href="iframe_topic.php?removesess=' . $biblio_session[0] . '">Remove</a>';
if ($biblio_session) {
$topic_q = $dbs->query("SELECT topic, topic_type FROM mst_topic WHERE topic_id=" . $biblio_session[0]);
$topic_d = $topic_q->fetch_row();
$topic = $topic_d[0];
$topic_type = $sysconf['subject_type'][$topic_d[1]];
}
$table->appendTableRow(array($remove_link, $topic, $topic_type, $sysconf['subject_level'][$biblio_session[1]]));
$table->setCellAttr($row, 0, 'class="' . $row_class . '" style="font-weight: bold; background-color: #ffc466; width: 10%;"');
$table->setCellAttr($row, 1, 'class="' . $row_class . '" style="background-color: #ffc466; width: 50%;"');
$table->setCellAttr($row, 2, 'class="' . $row_class . '" style="background-color: #ffc466; width: 20%;"');
$table->setCellAttr($row, 3, 'class="' . $row_class . '" style="background-color: #ffc466; width: 20%;"');
$row++;
}
echo $table->printTable();
}
}
/* main content end */
$content = ob_get_clean();
// include the page template
require SB . '/admin/' . $sysconf['admin_template']['dir'] . '/notemplate_page_tpl.php';
示例2: COUNT
$row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
// remove reserve link
$remove_link = '<a href="#" onclick="confirmProcess(' . $reserve_list_d['reserve_id'] . ', \'' . $reserve_list_d['title'] . '\')" title="Remove Reservation" class="trashLink"> </a>';
// check if item/collection is available
$avail_q = $dbs->query("SELECT COUNT(loan_id) FROM loan WHERE item_code='" . $reserve_list_d['item_code'] . "' AND is_lent=1 AND is_return=0");
$avail_d = $avail_q->fetch_row();
if ($avail_d[0] < 1) {
$reserve_list_d['title'] .= ' - <strong>' . strtoupper(__('Available')) . '</strong>';
}
// check if reservation are already expired
if ((strtotime(date('Y-m-d')) - strtotime($reserve_list_d['reserve_date'])) / (3600 * 24) > $sysconf['reserve_expire_periode']) {
$reserve_list_d['title'] .= ' - <strong style="color: red;">' . __('ALREADY EXPIRED') . '</strong>';
}
// row colums array
$fields = array($remove_link, $reserve_list_d['title'], $reserve_list_d['item_code'], $reserve_list_d['reserve_date']);
// append data to table row
$reserve_list->appendTableRow($fields);
// set the HTML attributes
$reserve_list->setCellAttr($row, null, "valign='top' class='{$row_class}'");
$reserve_list->setCellAttr($row, 0, "valign='top' align='center' class='{$row_class}' style='width: 5%;'");
$reserve_list->setCellAttr($row, 1, "valign='top' class='{$row_class}' style='width: 70%;'");
$row++;
}
echo $reserve_list->printTable();
// hidden form for return and extend process
echo '<form name="reserveHiddenForm" method="post" action="circulation_action.php"><input type="hidden" name="process" value="delete" /><input type="hidden" name="reserveID" value="" /></form>';
}
// get the buffered content
$content = ob_get_clean();
// include the page template
require SENAYAN_BASE_DIR . '/admin/' . $sysconf['admin_template']['dir'] . '/notemplate_page_tpl.php';
示例3:
if (isset($_GET['print'])) {
// html strings
$html_str = '<html><head><title>' . $sysconf['library_name'] . ' Membership General Statistic Report</title>';
$html_str .= '<style type="text/css">' . "\n";
$html_str .= 'body {padding: 0.2cm}' . "\n";
$html_str .= 'body * {color: black; font-size: 11pt;}' . "\n";
$html_str .= 'table {border: 1px solid #000000;}' . "\n";
$html_str .= '.dataListHeader {background-color: #000000; color: white; font-weight: bold;}' . "\n";
$html_str .= '.alterCell {border-bottom: 1px solid #666666; background-color: #CCCCCC;}' . "\n";
$html_str .= '.alterCell2 {border-bottom: 1px solid #666666; background-color: #FFFFFF;}' . "\n";
$html_str .= '</style>' . "\n";
$html_str .= '</head>';
$html_str .= '<body>' . "\n";
$html_str .= '<h3>' . $sysconf['library_name'] . ' - ' . __('Membership Report') . '</h3>';
$html_str .= '<hr size="1" />' . "\n";
$html_str .= $table->printTable();
$html_str .= '<script type="text/javascript">self.print();</script>' . "\n";
$html_str .= '</body></html>' . "\n";
// write to file
$file_write = @file_put_contents(REPORT_FILE_BASE_DIR . 'member_stat_print_result.html', $html_str);
if ($file_write) {
// open result in new window
echo '<script type="text/javascript">parent.openWin(\'' . SENAYAN_WEB_ROOT_DIR . '/' . FILES_DIR . '/' . REPORT_DIR . '/member_stat_print_result.html\', \'popMemberReport\', 800, 500, true)</script>';
} else {
utility::jsAlert('ERROR! Membership statistic report failed to generate, possibly because ' . REPORT_FILE_BASE_DIR . ' directory is not writable');
}
exit;
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner statisticIcon">
示例4: foreach
foreach ($_SESSION['temp_loan'] as $_loan_ID => $temp_loan_list_d) {
// alternate the row color
$row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
// remove link
$remove_link = '<a href="circulation_action.php?removeID=' . $temp_loan_list_d['item_code'] . '" title="Remove this item" class="trashLink"> </a>';
// check if manually changes loan and due date allowed
if ($sysconf['allow_loan_date_change']) {
$loan_date = '<a href="#" title="' . __('Click To Change Loan Date') . '" onclick="changeDateForm(\'' . $_loan_ID . '\', \'loan\', \'loanDate' . $row . '\')" id="loanDate' . $row . '">' . $temp_loan_list_d['loan_date'] . '</a>';
$due_date = '<a href="#" title="' . __('Click To Change Due Date') . '" onclick="changeDateForm(\'' . $_loan_ID . '\', \'due\', \'dueDate' . $row . '\')" id="dueDate' . $row . '">' . $temp_loan_list_d['due_date'] . '</a>';
} else {
$loan_date = $temp_loan_list_d['loan_date'];
$due_date = $temp_loan_list_d['due_date'];
}
// row colums array
$fields = array($remove_link, $temp_loan_list_d['item_code'], $temp_loan_list_d['title'], $loan_date, $due_date);
// append data to table row
$temp_loan_list->appendTableRow($fields);
// set the HTML attributes
$temp_loan_list->setCellAttr($row, null, "valign='top' class='{$row_class}'");
$temp_loan_list->setCellAttr($row, 0, "valign='top' align='center' class='{$row_class}' style='width: 5%;'");
$temp_loan_list->setCellAttr($row, 1, "valign='top' class='{$row_class}' style='width: 10%;'");
$temp_loan_list->setCellAttr($row, 2, "valign='top' class='{$row_class}' style='width: 60%;'");
$row++;
}
echo $temp_loan_list->printTable();
}
}
// get the buffered content
$content = ob_get_clean();
// include the page template
require SENAYAN_BASE_DIR . '/admin/' . $sysconf['admin_template']['dir'] . '/notemplate_page_tpl.php';
示例5: array
$reservedItem = $dbs->escape_string(trim($_GET['reserveAlert']));
// get reservation data
$reserve_q = $dbs->query(sprintf('SELECT r.member_id, m.member_name
FROM reserve AS r
LEFT JOIN member AS m ON r.member_id=m.member_id
WHERE item_code=\'%s\' ORDER BY reserve_date ASC LIMIT 1', $reservedItem));
$reserve_d = $reserve_q->fetch_row();
$member = $reserve_d[1] . ' (' . $reserve_d[0] . ')';
$reserve_msg = str_replace(array('{itemCode}', '{member}'), array('<b>' . $reservedItem . '</b>', '<b>' . $member . '</b>'), __('Item {itemCode} is being reserved by member {member}'));
echo '<div class="infoBox">' . $reserve_msg . '</div>';
}
// create e-mail lin if there is overdue
if ($is_overdue) {
echo '<div style="padding: 5px; background: #ccc;"><div id="emailStatus"></div><a class="sendEmail usingAJAX" href="' . MWB . 'membership/overdue_mail.php' . '" postdata="memberID=' . $memberID . '" loadcontainer="emailStatus">' . __('Send overdues notice e-mail') . '</a> | <span style="color: red; font-weight: bold;">' . __('Total of temporary fines') . ': ' . $_total_temp_fines . '.</span></div>' . "\n";
}
echo $loan_list->printTable();
// hidden form for return and extend process
echo '<form name="loanHiddenForm" method="post" action="circulation_action.php"><input type="hidden" name="process" value="return" /><input type="hidden" name="loanID" value="" /></form>';
?>
<script type="text/javascript">
// registering event for send email button
$(document).ready(function() {
$('a.usingAJAX').click(function(evt) {
evt.preventDefault();
var anchor = $(this);
// get anchor href
var url = anchor.attr('href');
var postData = anchor.attr('postdata');
var loadContainer = anchor.attr('loadcontainer');
if (loadContainer) { container = jQuery('#'+loadContainer); }
// set ajax
示例6: viewKardexes
/**
* View kardex list
* @return string
**/
public function viewKardexes()
{
$_can_read = utility::havePrivilege('serial_control', 'r');
$_can_write = utility::havePrivilege('serial_control', 'w');
// start the output buffer
ob_start();
?>
<script type="text/javascript">
function confirmProcess(int_serial_id, int_kardex_id)
{
var confirmBox = confirm('Are you sure to remove selected Kardex data?' + "\n" + 'Once deleted, it can\'t be restored!');
if (confirmBox) {
// set hidden element value
document.hiddenActionForm.serialID.value = int_serial_id;
document.hiddenActionForm.remove.value = int_kardex_id;
// submit form
document.hiddenActionForm.submit();
}
}
</script>
<?php
$_table = new simbio_table();
$_table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
$_table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
$_table->highlight_row = true;
$_table->setHeader(array(' ', __('Date Expected'), __('Date Received'), __('Seq. Number'), __('Note')));
if ($_can_read and $_can_write) {
$_add_link = '<span title="Add New Kardex" class="extendLink"> </span>';
$_date_exp = simbio_form_element::dateField('dateExpected[0]');
$_date_rec = simbio_form_element::dateField('dateReceived[0]');
$_seq_num = simbio_form_element::textField('text', 'seqNumber[0]', '', 'width: 100%;');
$_notes = simbio_form_element::textField('text', 'notes[0]', '', 'width: 100%;');
$_table->appendTableRow(array($_add_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
$_table->setCellAttr(1, null, 'valign="top" class="alterCell2" style="font-weight: bold; width: auto;"');
$_table->setCellAttr(1, 0, 'valign="top" class="alterCell2" style="font-weight: bold; width: 5%;"');
$_table->setCellAttr(1, 1, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
$_table->setCellAttr(1, 2, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
}
$_row = 2;
foreach ($this->getKardexes() as $_kardex) {
// alternate the row color
$_row_class = $_row % 2 == 0 ? 'alterCell' : 'alterCell2';
if ($_can_read and $_can_write) {
// kardex removal links
$_remove_link = '<a href="#" onclick="confirmProcess(' . $this->serial_id . ', ' . $_kardex['kardex_id'] . ')" class="trashLink notAJAX"> </a>';
$_date_exp = simbio_form_element::dateField('dateExpected[' . $_kardex['kardex_id'] . ']', $_kardex['date_expected']);
$_date_rec = simbio_form_element::dateField('dateReceived[' . $_kardex['kardex_id'] . ']', $_kardex['date_received']);
$_seq_num = simbio_form_element::textField('text', 'seqNumber[' . $_kardex['kardex_id'] . ']', $_kardex['seq_number'], 'width: 100%;');
$_notes = simbio_form_element::textField('text', 'notes[' . $_kardex['kardex_id'] . ']', $_kardex['notes'], 'width: 100%;');
} else {
$_remove_link = ' ';
$_date_exp = $_kardex['date_expected'];
$_date_rec = $_kardex['date_received'];
$_seq_num = $_kardex['seq_number'];
$_notes = $_kardex['notes'];
}
$_table->appendTableRow(array($_remove_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
$_table->setCellAttr($_row, null, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: auto;"');
$_table->setCellAttr($_row, 0, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 5%;"');
$_table->setCellAttr($_row, 1, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
$_table->setCellAttr($_row, 2, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
$_row++;
}
// button
$_button_grp = '<div style="padding: 3px; background: #999999;"><input type="submit" class="button" name="saveKardexes" value="' . __('Save') . '" /></div>';
// header
echo '<div style="padding: 5px; background: #CCCCCC;">' . __('Kardex Detail for subscription') . ' <strong>' . $this->serial_period . '</strong></div>';
if ($_can_read and $_can_write) {
echo '<form method="post" name="kardexListForm" id="kardexListForm" action="' . $_SERVER['PHP_SELF'] . '">';
echo $_button_grp;
}
echo $_table->printTable();
if ($_can_read and $_can_write) {
echo $_button_grp;
echo simbio_form_element::hiddenField('serialID', $this->serial_id);
echo '</form>';
// hidden form
echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="serialID" value="0" /><input type="hidden" name="remove" value="0" /></form>';
}
/* main content end */
$_content = ob_get_clean();
return $_content;
}
示例7: printOut
public function printOut()
{
// create table object
$_table = new simbio_table();
// set the table attr
$_table->table_attr = $this->table_attr;
if ($this->edit_mode) {
$this->disable = true;
}
// initialize result buffer
$_buffer = '';
// check if form tag is included
if ($this->with_form_tag) {
$this->submit_target = 'submitExec';
$_buffer .= $this->startForm() . "\n";
}
// loop the form element
$_row_num = 0;
foreach ($this->elements as $row) {
$_form_element = $row['element']->out();
if ($_form_element_info = trim($row['info'])) {
$_form_element .= '<div class="formElementInfo">' . $_form_element_info . '</div>';
}
// append row
$_table->appendTableRow(array($row['label'], ':', $_form_element));
// set the column header attr
$_table->setCellAttr($_row_num + 1, 0, 'width="20%" valign="top"' . $this->table_header_attr);
$_table->setCellAttr($_row_num + 1, 1, 'width="1%" valign="top"' . $this->table_header_attr);
// set the form element column attr
$_table->setCellAttr($_row_num + 1, 2, 'width="79%" ' . $this->table_content_attr);
$_row_num++;
}
// link and buttons
$_edit_link = '';
$_delete_button = '';
$_back_button = '';
$_del_value = __('Delete Record');
$_cancel_value = __('Cancel');
// check if we are on edit form mode
if ($this->edit_mode) {
$_edit_link .= '<a href="#" class="notAJAX editFormLink">EDIT</a>';
// delete button exists if the record_id properties exists
if ($this->record_id && $this->delete_button) {
// create delete button
$_delete_button = '<input type="button" value="' . $_del_value . '" class="button confirmSubmit" onclick="confSubmit(\'deleteForm\', \'Are you sure to delete ' . addslashes($this->record_title) . '?\\nOnce Deleted it cant be restored again\')" style="color: red; font-weight: bold;" />';
}
// back button
if ($this->back_button) {
$_back_button = '<input type="button" class="cancelButton button" value="' . $_cancel_value . '" />';
}
}
$_buttons = '';
// check if form tag is included
if ($this->with_form_tag) {
$_buttons = '<table cellspacing="0" cellpadding="3" style="width: 100%; background-color: #dcdcdc;">' . '<tr><td><input type="submit" ' . $this->submit_button_attr . ' /> ' . $_back_button . ' ' . $_delete_button . '</td><td align="right">' . $_edit_link . '</td>' . '</tr></table>' . "\n";
}
// get the table result
$_buffer .= $_buttons;
$_buffer .= $_table->printTable();
$_buffer .= $_buttons;
// extract all hidden elements here
foreach ($this->hidden_elements as $_hidden) {
$_buffer .= $_hidden->out();
}
// update ID hidden elements
if ($this->edit_mode and $this->record_id) {
// add hidden form element flag for detail editing purpose
$_buffer .= '<input type="hidden" name="updateRecordID" value="' . $this->record_id . '" />';
}
// check if form tag is included
if ($this->with_form_tag) {
$_buffer .= $this->endForm() . "\n";
}
if ($this->edit_mode) {
// hidden form for deleting records
$_buffer .= '<form action="' . preg_replace('/\\?.+/i', '', $this->form_action) . '" id="deleteForm" target="submitExec" method="post" style="display: inline;">' . '<input type="hidden" name="itemID" value="' . $this->record_id . '" /><input type="hidden" name="itemAction" value="true" /></form>';
}
// for debugging purpose only
// $_buffer .= '<iframe name="submitExec" style="visibility: visible; width: 100%; height: 500px;"></iframe>';
// hidden iframe for form executing
$_buffer .= '<iframe name="submitExec" class="noBlock" style="visibility: hidden; width: 100%; height: 0;"></iframe>';
return $_buffer;
}
示例8: printOut
/**
* Method to print out form table
*
* @return string
*/
public function printOut()
{
// create table object
$_table = new simbio_table();
// set the table attr
$_table->table_attr = $this->table_attr;
$_buffer = '';
// check if form tag is included
if ($this->with_form_tag) {
$_buffer .= $this->startForm() . "\n";
}
// loop the form element
$_row_num = 0;
foreach ($this->elements as $row) {
$_form_element = $row['element']->out();
if ($_form_element_info = trim($row['info'])) {
$_form_element .= '<div class="formElementInfo">' . $_form_element_info . '</div>';
}
// append row
$_table->appendTableRow(array($row['label'], ':', $_form_element));
// set the column header attr
$_table->setCellAttr($_row_num + 1, 0, 'width="20%" valign="top"' . $this->table_header_attr);
$_table->setCellAttr($_row_num + 1, 1, 'width="1%" valign="top"' . $this->table_header_attr);
// set the form element column attr
$_table->setCellAttr($_row_num + 1, 2, 'width="79%" ' . $this->table_content_attr);
$_row_num++;
}
// link and buttons
$_edit_link = '';
$_delete_button = '';
$_back_button = '';
if (defined('lang_sys_common_form_delete')) {
$_del_value = lang_sys_common_form_delete;
} else {
$_del_value = 'Delete Record';
}
if (defined('lang_sys_common_form_cancel')) {
$_cancel_value = lang_sys_common_form_cancel;
} else {
$_cancel_value = 'Cancel';
}
// check if we are on edit form mode
if ($this->edit_mode) {
$_edit_link .= '<a href="#" onclick="enableForm(\'' . $this->form_name . '\'); enableForm(\'deleteForm\');" style="font-weight: bold;" class="editFormLink">EDIT</a>';
// delete button exists if the record_id exists
if ($this->record_id && $this->delete_button) {
$_delete_button = '<input type="button" value="' . $_del_value . '" class="button" onclick="confSubmit(\'deleteForm\', \'Are you sure to delete ' . addslashes($this->record_title) . '?\\nOnce Deleted it cant be restored again\')" style="color: red; font-weight: bold;" />';
}
// back button
if ($this->back_button) {
$_back_button = '<input type="button" class="cancelButton button" value="' . $_cancel_value . '" onclick="javascript: self.history.back();" />';
}
}
$_buttons = '';
if ($this->with_form_tag) {
$_buttons = '<table cellspacing="0" cellpadding="3" style="width: 100%; background-color: #dcdcdc;">' . '<tr><td><input type="submit" ' . $this->submit_button_attr . ' /> ' . $_delete_button . ' ' . $_back_button . '</td><td align="right">' . $_edit_link . '</td>' . '</tr></table>' . "\n";
}
// get the table result
$_buffer .= $_buttons;
$_buffer .= $_table->printTable();
$_buffer .= $_buttons;
// extract all hidden elements here
foreach ($this->hidden_elements as $_hidden) {
$_buffer .= $_hidden->out();
}
// update ID hidden elements
if ($this->edit_mode and $this->record_id) {
// add hidden form element flag for detail editing purpose
$_buffer .= '<input type="hidden" name="updateRecordID" value="' . $this->record_id . '" />';
}
// check if form tag is included
if ($this->with_form_tag) {
$_buffer .= $this->endForm() . "\n";
}
if ($this->edit_mode) {
// hidden form for deleting records
$_buffer .= '<form action="' . $this->form_action . '" id="deleteForm" method="post" style="display: inline;"><input type="hidden" name="itemID" value="' . $this->record_id . '" /><input type="hidden" name="itemAction" value="true" /></form>';
// disabling form
$_buffer .= '<script type="text/javascript">disableForm(\'' . $this->form_name . '\');disableForm(\'deleteForm\');</script>';
}
// output
return $_buffer;
}