本文整理汇总了PHP中CTable类的典型用法代码示例。如果您正苦于以下问题:PHP CTable类的具体用法?PHP CTable怎么用?PHP CTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
public static function remove($checked)
{
$table = new CTable('members');
if ($table->delete($checked)) {
return true;
} else {
return false;
}
}
示例2: setDoubleHeader
public function setDoubleHeader($left, $right)
{
$table = new CTable();
$table->addStyle('width: 100%;');
$lCol = new CCol($left);
$lCol->addStyle('text-align: left; border: 0;');
$rCol = new CCol($right);
$rCol->addStyle('text-align: right; border: 0;');
$table->addRow(array($lCol, $rCol));
$this->_header = new CDiv(null, 'nowrap ui-corner-all ui-widget-header ' . $this->css_class);
$this->_header->addItem($table);
return $this->_header;
}
示例3: makeRow
private function makeRow($id)
{
$table = new CTable();
$tr = $this->makeSImgStr($id);
$tr->addItem($this->tree[$id]['caption']);
$table->addRow($tr);
$tr = new CRow();
$tr->addItem($table);
$tr->setAttribute('id', 'id_' . $id);
$tr->setAttribute('style', $this->tree[$id]['parentid'] != '0' ? 'display: none;' : '');
foreach ($this->fields as $value) {
$tr->addItem($this->makeCol($id, $value));
}
return $tr;
}
示例4: get_option
static function get_option($selectedvalue, $tablename="pays", $colvaluename="id", $colvuename="nom", $where=1) {
$option = "";
$result = CTable::select($colvaluename . " , " . $colvuename, $tablename, $where, $colvuename);
while($array = mysql_fetch_array($result)) {
$selected = CForm::get_selected($selectedvalue, $array[$colvaluename]);
$option = $option . "<option value='" . $array[$colvaluename] . "'" . $selected . ">" . ucfirst(utf8_encode(substr($array[$colvuename], 0, 25))) . "</option>\n";
}
return $option;
}
示例5: get_option
static function get_option($selectedvalue, $tablename, $colvaluename="id", $colvuename="nom", $where=1, $order = null) {
$option = "";
if(!$order) {
$order = $colvuename;
}
$result = CTable::select($colvaluename . " , " . $colvuename, $tablename, $where, $order);
while($array = mysql_fetch_array($result)) {
$selected = CForm::get_selected($selectedvalue, $array[$colvaluename]);
$option = $option . "<option value='" . $array[$colvaluename] . "'" . $selected . ">" . $array[$colvuename] . "</option>\n";
}
return $option;
}
示例6: makeRow
private function makeRow($id)
{
$table = new CTable();
$tr = $this->makeSImgStr($id);
$tr->addItem($this->tree[$id]['caption']);
$table->addRow($tr);
$tr = new CRow();
$tr->addItem($table);
$tr->setAttribute('id', 'id_' . $id);
$tr->setAttribute('style', $this->tree[$id]['parentid'] != '0' ? 'display: none;' : '');
foreach ($this->fields as $key => $value) {
$style = null;
if ($value == 'status' && $this->tree[$id]['serviceid'] > 0) {
switch ($this->tree[$id][$value]) {
case TRIGGER_SEVERITY_DISASTER:
$this->tree[$id][$value] = S_DISASTER;
$style = 'disaster';
break;
case TRIGGER_SEVERITY_HIGH:
$this->tree[$id][$value] = S_HIGH;
$style = 'high';
break;
case TRIGGER_SEVERITY_AVERAGE:
$this->tree[$id][$value] = S_AVERAGE;
$style = 'average';
break;
case TRIGGER_SEVERITY_WARNING:
$this->tree[$id][$value] = S_WARNING;
$style = 'warning';
break;
case TRIGGER_SEVERITY_INFORMATION:
default:
$this->tree[$id][$value] = new CSpan(S_OK_BIG, 'green');
break;
}
}
$tr->addItem(new CCol($this->tree[$id][$value], $style));
}
return $tr;
}
示例7: get
public function get($caption_l = null, $caption_r = null)
{
if (empty($caption_l)) {
$caption_l = _('In');
}
if (empty($caption_r)) {
$caption_r = _('Other');
}
$grp_tab = new CTable();
$grp_tab->attr('name', $this->name);
$grp_tab->attr('id', zbx_formatDomId($this->name));
$grp_tab->setCellSpacing(0);
$grp_tab->setCellPadding(0);
if (!is_null($caption_l) || !is_null($caption_r)) {
$grp_tab->addRow(array($caption_l, SPACE, $caption_r));
}
$add_btn = new CButton('add', ' « ', null, 'formlist');
$add_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_r . '", "' . $this->id_l . '", "add");');
$rmv_btn = new CButton('remove', ' » ', null, 'formlist');
$rmv_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_l . '", "' . $this->id_r . '", "rmv");');
$grp_tab->addRow(array($this->lbox, new CCol(array($add_btn, BR(), $rmv_btn), 'top'), $this->rbox));
return $grp_tab;
}
示例8: get
public function get($caption_l = S_IN, $caption_r = S_OTHER)
{
$grp_tab = new CTable();
$grp_tab->addOption('name', $this->name);
$grp_tab->addOption('id', $this->name);
$grp_tab->setCellSpacing(0);
$grp_tab->setCellPadding(0);
if (!is_null($caption_l) || !is_null($caption_r)) {
$grp_tab->addRow(array($caption_l, SPACE, $caption_r));
}
$add_btn = new CButton('add', ' « ');
//S_ADD);//
$add_btn->setType('button');
$add_btn->setAction('javascript: moveListBoxSelectedItem("' . $this->form->GetName() . '","' . $this->varname . '","' . $this->id_r . '","' . $this->id_l . '","add");');
$rmv_btn = new CButton('remove', ' » ');
//S_REMOVE);//
$rmv_btn->setType('button');
$rmv_btn->setAction('javascript: moveListBoxSelectedItem("' . $this->form->GetName() . '","' . $this->varname . '","' . $this->id_l . '","' . $this->id_r . '","rmv");');
$grp_tab->addRow(array($this->lbox, new CCol(array($add_btn, BR(), $rmv_btn), 'top'), $this->rbox));
return $grp_tab;
}
示例9: stage5
function stage5()
{
$dbType = $this->getConfig('DB_TYPE');
$frontendSetup = new FrontendSetup();
$databases = $frontendSetup->getSupportedDatabases();
$table = new CTable(null, 'requirements');
$table->setAlign('center');
$table->addRow(array(new CCol(_('Database type'), 'header'), $databases[$dbType]));
switch ($dbType) {
case ZBX_DB_SQLITE3:
$table->addRow(array(new CCol(_('Database file'), 'header'), $this->getConfig('DB_DATABASE')));
break;
default:
$table->addRow(array(new CCol(_('Database server'), 'header'), $this->getConfig('DB_SERVER')));
$dbPort = $this->getConfig('DB_PORT');
$table->addRow(array(new CCol(_('Database port'), 'header'), $dbPort == 0 ? _('default') : $dbPort));
$table->addRow(array(new CCol(_('Database name'), 'header'), $this->getConfig('DB_DATABASE')));
$table->addRow(array(new CCol(_('Database user'), 'header'), $this->getConfig('DB_USER')));
$table->addRow(array(new CCol(_('Database password'), 'header'), preg_replace('/./', '*', $this->getConfig('DB_PASSWORD'))));
if ($dbType == ZBX_DB_DB2) {
$table->addRow(array(new CCol(_('Database schema'), 'header'), $this->getConfig('DB_SCHEMA')));
}
break;
}
$table->addRow(BR());
$table->addRow(array(new CCol(_('Zabbix server'), 'header'), $this->getConfig('ZBX_SERVER')));
$table->addRow(array(new CCol(_('Zabbix server port'), 'header'), $this->getConfig('ZBX_SERVER_PORT')));
$table->addRow(array(new CCol(_('Zabbix server name'), 'header'), $this->getConfig('ZBX_SERVER_NAME')));
return array('Please check configuration parameters.', BR(), 'If all is correct, press "Next" button, or "Previous" button to change configuration parameters.', BR(), BR(), $table);
}
示例10: foreach
$triggersForm->addVar('hostid', $this->data['hostid']);
$triggersForm->addVar('action', $this->data['action']);
if ($this->data['parent_discoveryid']) {
$triggersForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
foreach ($this->data['g_triggerid'] as $triggerid) {
$triggersForm->addVar('g_triggerid[' . $triggerid . ']', $triggerid);
}
// create form list
$triggersFormList = new CFormList('triggersFormList');
// append severity to form list
$severityDiv = new CSeverity(array('id' => 'priority_div', 'name' => 'priority', 'value' => $this->data['priority']));
$triggersFormList->addRow(array(_('Severity'), SPACE, new CVisibilityBox('visible[priority]', isset($this->data['visible']['priority']), 'priority_div', _('Original'))), $severityDiv);
// append dependencies to form list
if (empty($this->data['parent_discoveryid'])) {
$dependenciesTable = new CTable(_('No dependencies defined.'), 'formElementTable');
$dependenciesTable->setAttribute('style', 'min-width: 500px;');
$dependenciesTable->setAttribute('id', 'dependenciesTable');
$dependenciesTable->setHeader(array(_('Name'), _('Action')));
foreach ($this->data['dependencies'] as $dependency) {
$triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
$hostNames = array();
foreach ($dependency['hosts'] as $host) {
$hostNames[] = CHtml::encode($host['name']);
$hostNames[] = ', ';
}
array_pop($hostNames);
if ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
$description = new CLink(array($hostNames, NAME_DELIMITER, CHtml::encode($dependency['description'])), 'triggers.php?form=update&hostid=' . $dependency['hostid'] . '&triggerid=' . $dependency['triggerid']);
$description->setAttribute('target', '_blank');
} else {
示例11: CTable
<li><a id="btn-logout" role="button" href="#">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="well well-lg">
<div class="row">
<?php
if (isset($_GET['id'])) {
$eventid = $_GET['id'];
CFeedback::createFeedback($eventid);
$table = new CTable("feedback" . $eventid, 'table-feedback');
$response = $table->drawTable(array('#', '', 'Name', 'Department', 'Section', 'Year', 'Email', 'Date Of Birth', 'GSC Member', 'Feedback'), true);
echo "{$response}";
} else {
echo "<p>Invalid event index</p>";
exit;
}
?>
</div>
</div>
<div class="modal fade" id="modal-reply-suggest">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Reply</h4>
示例12: CWidget
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
$hostInventoryWidget = new CWidget();
$rForm = new CForm('get');
$rForm->addItem(array(_('Group'), SPACE, $this->data['pageFilter']->getGroupsCB()));
$hostInventoryWidget->addPageHeader(_('HOST INVENTORY'), SPACE);
$hostInventoryWidget->addHeader(_('Hosts'), $rForm);
$filterTable = new CTable('', 'filter filter-center');
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $this->data['filterField']);
foreach ($inventoryFields as $inventoryField) {
$inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $this->data['filterExact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories');
$filter = new CSubmit('filter_set', _('Filter'));
$filter->useJQueryStyle('main');
$reset = new CSubmit('filter_rst', _('Reset'));
$reset->useJQueryStyle();
示例13: bodyToString
public function bodyToString()
{
global $USER_DETAILS;
$this->cleanItems();
$status = get_status();
if ($status['zabbix_server'] == S_YES) {
$server = new CSpan(S_RUNNING, 'off');
} else {
$server = new CSpan(S_NOT_RUNNING, 'on');
}
$header = new CCol('Zabbix ' . S_SERVER_INFO, 'header');
$this->addRow($header);
$this->addRow('Updated: ' . date('r', time()));
$this->addRow(new CCol(array('Refreshed every: ' . $USER_DETAILS['refresh'] . ' sec ', '(', new CLink('refresh now', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']), ')')));
$this->addRow(S_NUMBER_OF_USERS_SHORT . ': ' . $status['users_count'] . '(' . $status['users_online'] . ')');
$this->addRow(new CCol(array('Logged in as ', new CLink($USER_DETAILS['alias'], 'profile.php'))));
$this->addRow(new CCol(array(new CLink('Zabbix server', 'report1.php'), ' is ', $server)), 'status');
//$this->addRow(S_VALUES_STORED.': '.$status['history_count']);
//$this->addRow(S_TRENDS_STORED.': '.$status['trends_count']);
$this->addRow(new CCol(array(S_NUMBER_OF_HOSTS_SHORT . ': ' . $status['hosts_count'] . '(', new CSpan($status['hosts_count_monitored'], 'off'), '/', new CSpan($status['hosts_count_not_monitored'], 'on'), '/', new CSpan($status['hosts_count_template'], 'unknown'), ')')));
$this->addRow(new CCol(array(S_NUMBER_OF_ITEMS_SHORT . ': ' . $status['items_count'] . '(', new CSpan($status['items_count_monitored'], 'off'), '/', new CSpan($status['items_count_disabled'], 'on'), '/', new CSpan($status['items_count_not_supported'], 'unknown'), ')')));
$this->addRow(new CCol(array(S_NUMBER_OF_TRIGGERS_SHORT . ': ' . $status['triggers_count'] . '(' . $status['triggers_count_enabled'] . '/' . $status['triggers_count_disabled'] . ')' . '[', new CSpan($status['triggers_count_on'], 'on'), '/', new CSpan($status['triggers_count_unknown'], 'unknown'), '/', new CSpan($status['triggers_count_off'], 'off'), ']')));
// $this->addRow(S_NUMBER_OF_EVENTS.': '.$status['events_count']);
// $this->addRow(S_NUMBER_OF_ALERTS.': '.$status['alerts_count']);
return parent::bodyToString();
}
示例14: endToString
public function endToString()
{
$ret = '';
if ($this->rownum == 0 && $this->message !== null) {
$ret .= $this->prepareRow(new CCol($this->message), ZBX_STYLE_NOTHING_TO_SHOW)->toString();
}
$ret .= parent::endToString();
return $ret;
}
示例15: __construct
public function __construct($message = '...', $class = 'tableinfo')
{
parent::__construct($message, $class);
$this->setOddRowClass('odd_row');
$this->setEvenRowClass('even_row');
$this->attributes['cellpadding'] = 3;
$this->attributes['cellspacing'] = 1;
$this->headerClass = 'header';
$this->footerClass = 'footer';
}