public static function remove($checked)
 {
     $table = new CTable('members');
     if ($table->delete($checked)) {
         return true;
     } else {
         return false;
     }
 }
 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;
 }
Exemple #3
0
 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;
 }
 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();
 }
Exemple #5
0
	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;
	}	
Exemple #6
0
 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;
 }
 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';
 }
Exemple #8
0
	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;
	}	
 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;
 }
Exemple #10
0
    static function fetchAll($select="*", $where="1", $order="mlt_zMail, mlt_zDateCreation") {
        
        $oRes = parent::select($select, 'moul_tables', $where, COrder::formate($order));
 
        $toResults = array() ;
        if ($oRes){
            while ($toRes = mysql_fetch_assoc($oRes)){
                $toResults[] = $toRes ;
            }
        }

        return $toResults ;

    }
 public function bodyToString()
 {
     $this->cleanItems();
     $status = get_status();
     $server = $status['zabbix_server'] == _('Yes') ? new CSpan(_('running'), 'off') : new CSpan(_('not running'), 'on');
     $serverLink = CWebUser::$data['type'] == USER_TYPE_SUPER_ADMIN ? new CLink(_('Zabbix server'), 'report1.php') : _('Zabbix server');
     $this->addRow(new CCol(_('Zabbix server info'), 'nowrap ui-corner-all ui-widget-header'));
     $this->addRow(_('Updated') . NAME_DELIMITER . zbx_date2str(SERVER_INFO_DATE_FORMAT, time()));
     $this->addRow(_('Users (online)') . NAME_DELIMITER . $status['users_count'] . '(' . $status['users_online'] . ')');
     $this->addRow(new CCol(array(_('Logged in as') . SPACE, new CLink(CWebUser::$data['alias'], 'profile.php'))));
     $this->addRow(new CCol(array($serverLink, SPACE . _('is') . SPACE, $server)), 'status');
     $this->addRow(new CCol(array(_('Hosts (m/n/t)') . NAME_DELIMITER . $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(_('Items (m/d/n)') . NAME_DELIMITER . $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(_('Triggers (e/d)[p/o]') . NAME_DELIMITER . $status['triggers_count'] . '(' . $status['triggers_count_enabled'] . '/' . $status['triggers_count_disabled'] . ')[', new CSpan($status['triggers_count_on'], 'on'), '/', new CSpan($status['triggers_count_off'], 'off'), ']')));
     return parent::bodyToString();
 }
Exemple #12
0
 public function show($destroy = true)
 {
     $this->setHeader($this->header, 'header');
     $cssClass = 'content';
     if (!empty($this->alignment)) {
         $cssClass .= ' ' . $this->alignment;
     }
     if (!empty($this->paddings)) {
         $this->addRow($this->paddings);
         $this->addRow(new CSpan($this->message), $cssClass);
         $this->addRow($this->paddings);
     } else {
         $this->addRow(new CSpan($this->message), $cssClass);
     }
     $this->setFooter(new CDiv($this->buttons, 'buttons'), 'footer');
     parent::show($destroy);
 }
    public function toString($destroy = true)
    {
        $tableId = $this->getAttribute('id');
        if (!$tableId) {
            $tableId = uniqid('t');
            $this->setAttribute('id', $tableId);
        }
        $string = parent::toString($destroy);
        if ($this->addMakeVerticalRotationJs) {
            $string .= get_js('var makeVerticalRotationForTable = function() {
					var table = jQuery("#' . $tableId . '");

					table.makeVerticalRotation();

					if (IE8) {
						jQuery(".vertical_rotation_inner", table).css({
							filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"
						});
					}
					else if (IE9) {
						jQuery(".vertical_rotation_inner", table).css({
							"-ms-transform": "rotate(270deg)"
						});
					}

					if (!IE9) {
						jQuery(".vertical_rotation_inner", table).css({
							"writing-mode": "tb-rl"
						});
					}
				}

				if(!jQuery.isReady) {
					jQuery(document).ready(makeVerticalRotationForTable);
				}
				else {
					makeVerticalRotationForTable();
				}', true);
        }
        return $string;
    }
 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', ' &laquo; ', 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', ' &raquo; ', 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;
 }
 public function bodyToString()
 {
     $this->cleanItems();
     $config = select_config();
     // array of triggers (not classified, information, warning, average, high, disaster) in problem state
     $triggersProblemState = [];
     // number of triggers in OK state
     $triggersOkState = 0;
     $options = ['output' => ['triggerid', 'priority', 'value'], 'monitored' => true, 'skipDependent' => true];
     if ($this->groupid != 0) {
         $options['groupids'] = $this->groupid;
     }
     $triggers = API::Trigger()->get($options);
     foreach ($triggers as $trigger) {
         switch ($trigger['value']) {
             case TRIGGER_VALUE_TRUE:
                 if (!array_key_exists($trigger['priority'], $triggersProblemState)) {
                     $triggersProblemState[$trigger['priority']] = 0;
                 }
                 $triggersProblemState[$trigger['priority']]++;
                 break;
             case TRIGGER_VALUE_FALSE:
                 $triggersOkState++;
         }
     }
     $severityCells = [getSeverityCell(null, $config, $triggersOkState . SPACE . _('Ok'), true)];
     for ($severity = TRIGGER_SEVERITY_NOT_CLASSIFIED; $severity < TRIGGER_SEVERITY_COUNT; $severity++) {
         $severityCount = isset($triggersProblemState[$severity]) ? $triggersProblemState[$severity] : 0;
         $severityCells[] = getSeverityCell($severity, $config, $severityCount . SPACE . getSeverityName($severity, $config), !$severityCount);
     }
     if ($this->style == STYLE_HORIZONTAL) {
         $this->addRow($severityCells);
     } else {
         foreach ($severityCells as $severityCell) {
             $this->addRow($severityCell);
         }
     }
     return parent::bodyToString();
 }
Exemple #16
0
 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;
 }
Exemple #17
0
 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);
 }
$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 {
                                <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">&times;</button>
                        <h4 class="modal-title">Reply</h4>
**
** 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();
    show_messages();
    $test = true;
} else {
    $test = false;
}
//------------------------ </ACTIONS> --------------------------
//------------------------ <FORM> ---------------------------
$frm_test = new CFormTable(_('Test'), 'tr_testexpr.php');
$frm_test->setHelp('web.testexpr.service.php');
$frm_test->setTableClass('formlongtable formtable');
$frm_test->addVar('form_refresh', get_request('form_refresh', 1));
$frm_test->addVar('expression', $expression);
/* test data */
$frm_test->addRow(_('Test data'), $data_table);
/* result */
$res_table = new CTable(null, 'tableinfo');
$res_table->setAttribute('id', 'result_list');
$res_table->setOddRowClass('even_row');
$res_table->setEvenRowClass('even_row');
$res_table->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
    $result = '-';
    if ($allowedTesting && $test && isset($e['expression'])) {
        $result = evalExpressionData($e['expression']['value'], $macrosData, $octet);
    }
    $style = 'text-align: center;';
    if ($result != '-') {
        $style = $result == 'TRUE' ? 'background-color: #ccf; color: #00f;' : 'background-color: #fcc; color: #f00;';
    }
    $col = new CCol($result);
// create form list
$proxyFormList = new CFormList('proxyFormList');
$nameTextBox = new CTextBox('host', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64);
$nameTextBox->attr('autofocus', 'autofocus');
$proxyFormList->addRow(_('Proxy name'), $nameTextBox);
// append status to form list
$statusBox = new CComboBox('status', $this->data['status'], 'submit()');
$statusBox->addItem(HOST_STATUS_PROXY_ACTIVE, _('Active'));
$statusBox->addItem(HOST_STATUS_PROXY_PASSIVE, _('Passive'));
$proxyFormList->addRow(_('Proxy mode'), $statusBox);
if ($this->data['status'] == HOST_STATUS_PROXY_PASSIVE) {
    if (isset($this->data['interface']['interfaceid'])) {
        $proxyForm->addVar('interface[interfaceid]', $this->data['interface']['interfaceid']);
        $proxyForm->addVar('interface[hostid]', $this->data['interface']['hostid']);
    }
    $interfaceTable = new CTable(null, 'formElementTable');
    $interfaceTable->addRow(array(_('IP address'), _('DNS name'), _('Connect to'), _('Port')));
    $connectByComboBox = new CRadioButtonList('interface[useip]', $this->data['interface']['useip']);
    $connectByComboBox->addValue(_('IP'), 1);
    $connectByComboBox->addValue(_('DNS'), 0);
    $connectByComboBox->useJQueryStyle();
    $interfaceTable->addRow(array(new CTextBox('interface[ip]', $this->data['interface']['ip'], ZBX_TEXTBOX_SMALL_SIZE, 'no', 64), new CTextBox('interface[dns]', $this->data['interface']['dns'], ZBX_TEXTBOX_SMALL_SIZE, 'no', 64), $connectByComboBox, new CTextBox('interface[port]', $this->data['interface']['port'], 18, 'no', 64)));
    $proxyFormList->addRow(_('Interface'), new CDiv($interfaceTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
}
// append hosts to form list
$hostsTweenBox = new CTweenBox($proxyForm, 'hosts', $this->data['hosts']);
foreach ($this->data['dbHosts'] as $host) {
    // show only normal hosts, and discovered hosts monitored by the current proxy
    // for new proxies display only normal hosts
    if ($this->data['proxyid'] && idcmp($this->data['proxyid'], $host['proxy_hostid']) || $host['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
        $hostsTweenBox->addItem($host['hostid'], $host['name'], null, empty($host['proxy_hostid']) || !empty($this->data['proxyid']) && bccomp($host['proxy_hostid'], $this->data['proxyid']) == 0 && $host['flags'] == ZBX_FLAG_DISCOVERY_NORMAL);
Exemple #23
0
}
$admin = uint_in_array($USER_DETAILS['type'], array(USER_TYPE_ZABBIX_ADMIN, USER_TYPE_SUPER_ADMIN));
$rows_per_page = $USER_DETAILS['rows_per_page'];
$search_wdgt = new CWidget('search_wdgt');
$search = get_request('search', '');
// Header
if (zbx_empty($search)) {
    $search = 'Search pattern is empty';
}
$search_wdgt->addHeader(array(S_SEARCH_BIG . ': ', bold($search)), SPACE);
//-------------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->setAttribute('border', 0);
$right_tab = new CTable();
$right_tab->setCellPadding(3);
$right_tab->setCellSpacing(3);
$right_tab->setAttribute('border', 0);
// FIND Hosts
$params = array('nodeids' => get_current_nodeid(), 'extendoutput' => true, 'pattern' => $search, 'extend_pattern' => true, 'limit' => $rows_per_page, 'order' => 'host');
$db_hosts = CHost::get($params);
$hosts = selectByPattern($db_hosts, 'host', $search, $rows_per_page);
$hostids = array_keys($hosts);
$hostsgroups = array();
$sql = 'SELECT * FROM hosts_groups hg WHERE ' . DBcondition('hg.hostid', $hostids);
$res = DBselect($sql);
while ($hostgroup = DBfetch($res)) {
    $hostsgroups[$hostgroup['hostid']] = $hostgroup['groupid'];
}
$params = array('nodeids' => get_current_nodeid(), 'pattern' => $search, 'extend_pattern' => true, 'count' => 1);
         $calcTypeComboBox = new CComboBox('new_operation[evaltype]', $this->data['new_operation']['evaltype'], 'submit()');
         $calcTypeComboBox->addItem(ACTION_EVAL_TYPE_AND_OR, _('AND / OR'));
         $calcTypeComboBox->addItem(ACTION_EVAL_TYPE_AND, _('AND'));
         $calcTypeComboBox->addItem(ACTION_EVAL_TYPE_OR, _('OR'));
         $newOperationsTable->addRow(array(_('Type of calculation'), array($calcTypeComboBox, new CTextBox('preview', $grouped_opconditions, ZBX_TEXTBOX_STANDARD_SIZE, 'yes'))));
     } else {
         $operationConditionsTable->addItem(new CVar('new_operation[evaltype]', ACTION_EVAL_TYPE_AND_OR));
     }
     if (!isset($_REQUEST['new_opcondition'])) {
         $operationConditionsTable->addRow(new CCol(new CSubmit('new_opcondition', _('New'), null, 'link_menu')));
     }
     $newOperationsTable->addRow(array(_('Conditions'), new CDiv($operationConditionsTable, 'objectgroup inlineblock border_dotted ui-corner-all')), 'indent_top');
 }
 // append new operation condition to form list
 if (isset($_REQUEST['new_opcondition'])) {
     $newOperationConditionTable = new CTable(null, 'formElementTable');
     $allowedOpConditions = get_opconditions_by_eventsource($this->data['eventsource']);
     $new_opcondition = get_request('new_opcondition', array());
     if (!is_array($new_opcondition)) {
         $new_opcondition = array();
     }
     if (empty($new_opcondition)) {
         $new_opcondition['conditiontype'] = CONDITION_TYPE_EVENT_ACKNOWLEDGED;
         $new_opcondition['operator'] = CONDITION_OPERATOR_LIKE;
         $new_opcondition['value'] = 0;
     }
     if (!str_in_array($new_opcondition['conditiontype'], $allowedOpConditions)) {
         $new_opcondition['conditiontype'] = $allowedOpConditions[0];
     }
     $rowCondition = array();
     $conditionTypeComboBox = new CComboBox('new_opcondition[conditiontype]', $new_opcondition['conditiontype'], 'submit()');
require_once dirname(__FILE__) . '/include/triggers.inc.php';
require_once dirname(__FILE__) . '/include/services.inc.php';
$page['title'] = _('IT services');
$page['file'] = 'srv_status.php';
$page['hist_arg'] = array();
define('ZBX_PAGE_DO_REFRESH', 1);
require_once dirname(__FILE__) . '/include/page_header.php';
$periods = array('today' => _('Today'), 'week' => _('This week'), 'month' => _('This month'), 'year' => _('This year'), 24 => _('Last 24 hours'), 24 * 7 => _('Last 7 days'), 24 * 30 => _('Last 30 days'), 24 * DAY_IN_YEAR => _('Last 365 days'));
// VAR	TYPE	OPTIONAL	FLAGS	VALIDATION	EXCEPTION
$fields = array('serviceid' => array(T_ZBX_INT, O_OPT, P_SYS | P_NZERO, DB_ID, null), 'showgraph' => array(T_ZBX_INT, O_OPT, P_SYS, IN('1'), 'isset({serviceid})'), 'period' => array(T_ZBX_STR, O_OPT, P_SYS, IN('"' . implode('","', array_keys($periods)) . '"'), null), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null));
check_fields($fields);
if (isset($_REQUEST['serviceid']) && isset($_REQUEST['showgraph'])) {
    $service = API::Service()->get(array('output' => array('serviceid'), 'serviceids' => getRequest('serviceid')));
    $service = reset($service);
    if ($service) {
        $table = new CTable(null, 'chart');
        $table->addRow(new CImg('chart5.php?serviceid=' . $service['serviceid'] . url_param('path')));
        $table->show();
    } else {
        access_deny();
    }
} else {
    $period = getRequest('period', 7 * 24);
    $period_end = time();
    switch ($period) {
        case 'today':
            $period_start = mktime(0, 0, 0, date('n'), date('j'), date('Y'));
            break;
        case 'week':
            $period_start = strtotime('last sunday');
            break;
if ($this->data['type'] == SHOW_TRIGGERS) {
    $hintTable->addRow(array(new CCol(SPACE, 'normal'), _('OK')));
}
for ($i = 0; $i < TRIGGER_SEVERITY_COUNT; $i++) {
    $hintTable->addRow(array(getSeverityCell($i), _('PROBLEM')));
}
$config = select_config();
if ($this->data['type'] == SHOW_TRIGGERS) {
    // blinking preview in help popup (only if blinking is enabled)
    if ($config['blink_period'] > 0) {
        $row = new CRow(null);
        $row->addItem(new CCol(SPACE, 'normal'));
        for ($i = 0; $i < TRIGGER_SEVERITY_COUNT; $i++) {
            $row->addItem(new CCol(SPACE, getSeverityStyle($i)));
        }
        $col = new CTable('', 'blink overview-mon-severities');
        $col->addRow($row);
        // double div necassary for FireFox
        $col = new CCol(new CDiv(new CDiv($col), 'overview-mon-severities-container'));
        $hintTable->addRow(array($col, _s('Age less than %s', convertUnitsS($config['blink_period']))));
    }
    $hintTable->addRow(array(new CCol(SPACE), _('No trigger')));
} else {
    $hintTable->addRow(array(new CCol(SPACE), _('OK or no trigger')));
}
$help = new CHelp('web.view.php', 'right');
$help->setHint($hintTable, '', '', true, false);
// header right
$overviewWidget->addPageHeader(_('OVERVIEW'), array(get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen'])), SPACE, $help));
// header left
$styleComboBox = new CComboBox('view_style', $this->data['view_style'], 'submit()');
	function down_rang() {
		parent::down_rang();
	}
Exemple #28
0
	function reverse_etat() {
		$this->table['tablename'] = "rdvContact";
		parent::reverse_etat();
	}
Exemple #29
0
     array_push($page_header_r_col, new CLink(S_LOGOUT, 'index.php?reconnect=1', 'small_font', null, 'nosid'));
 } else {
     $page_header_r_col[] = array('|', new CLink(S_LOGIN, 'index.php?reconnect=1', 'small_font', null, 'nosid'));
 }
 $logo = new CLink(new CDiv(SPACE, 'zabbix_logo'), 'http://www.zabbix.com/', 'image', null, 'nosid');
 $logo->setTarget('_blank');
 $td_r = new CCol($page_header_r_col, 'page_header_r');
 $td_r->setAttribute('width', '100%');
 $top_page_row = array(new CCol($logo, 'page_header_l'), $td_r);
 unset($logo, $page_header_r_col, $help, $support);
 $table = new CTable(NULL, 'page_header');
 $table->setCellSpacing(0);
 $table->setCellPadding(5);
 $table->addRow($top_page_row);
 $table->show();
 $menu_table = new CTable(NULL, 'menu');
 $menu_table->setCellSpacing(0);
 $menu_table->setCellPadding(5);
 $menu_table->addRow($main_menu);
 $node_form = null;
 if (ZBX_DISTRIBUTED && !defined('ZBX_HIDE_NODE_SELECTION')) {
     insert_js_function('check_all');
     $available_nodes = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_LIST, PERM_RES_DATA_ARRAY);
     $available_nodes = get_tree_by_parentid($ZBX_LOCALNODEID, $available_nodes, 'masterid');
     //remove parent nodes
     if (!empty($available_nodes)) {
         $node_form = new CForm();
         $node_form->setMethod('get');
         $node_form->setAttribute('id', 'node_form');
         // +++ create Combo Box with selected nodes +++
         $combo_node_list = null;
Exemple #30
0
 private function createFlicker($col1, $col2 = null)
 {
     $table = new CTable(null, 'textwhite maxwidth middle flicker');
     $table->setCellSpacing(0);
     $table->setCellPadding(1);
     if (!is_null($col2)) {
         $td_r = new CCol($col2, 'flicker_r');
         $td_r->setAttribute('align', 'right');
         $table->addRow(array(new CCol($col1, 'flicker_l'), $td_r));
     } else {
         $td_c = new CCol($col1, 'flicker_c');
         $td_c->setAttribute('align', 'center');
         $table->addRow($td_c);
     }
     return $table;
 }