本文整理汇总了PHP中getSelect函数的典型用法代码示例。如果您正苦于以下问题:PHP getSelect函数的具体用法?PHP getSelect怎么用?PHP getSelect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSelect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: printNewitemTR
function printNewitemTR()
{
printOpFormIntro('add');
echo '<tr>';
echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>';
echo "<td> </td>";
echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end1_conn_id')) . '</td>';
echo '<td>' . getSelect(getPatchCableTypeOptions(), array('name' => 'pctype_id')) . '</td>';
echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end2_conn_id')) . '</td>';
echo '<td><input type=text size=6 name=length value="1.00"></td>';
echo '<td><input type=text size=48 name=description></td>';
echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>';
echo '</tr></form>';
}
开发者ID:spartak-radchenko,项目名称:racktables,代码行数:14,代码来源:interface-cables.php
示例2: getAllColumns
/**
*
* @param unknown $tableName
*/
function getAllColumns($tableName)
{
$pdo = DbUtil::connect();
$sql = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'numeracy' AND TABLE_NAME = '" . $tableName . "'";
//$sql ="DESCRIBE numeracy.m01_user";
$values = $pdo->query($sql);
$count = 1;
$result = "";
$colnameArray = array();
if (is_array($values) || is_object($values)) {
foreach ($values as $row) {
$colnameArray[] = $row['COLUMN_NAME'];
}
}
$tableName = strtoupper($tableName);
$idField = findIdField($tableName, $colnameArray);
print '<br/>';
print 'private static $insertSQL = "INSERT INTO ' . $tableName . ' (' . getInsert1($tableName, $colnameArray) . ') VALUES (' . getInsert2($tableName, $colnameArray) . ')";</br>';
print '<br/>';
if ($idField != '') {
print 'private static $selectSQL = "SELECT ' . getSelect($colnameArray) . ' FROM ' . $tableName . ' ORDER BY ' . $idField . ' DESC "; </br>';
} else {
print 'private static $selectSQL = "SELECT ' . getSelect($colnameArray) . ' FROM ' . $tableName . ' "; </br>';
}
print '<br/>';
if ($idField != '') {
print 'private static $updateSQL = "UPDATE ' . $tableName . ' SET ' . getUpdate($tableName, $colnameArray) . ' WHERE ' . $idField . ' = ? ";</br>';
} else {
//('private static $updateSQL = "UPDATE '.$tableName.' SET '.getUpdate($tableName, $colnameArray).' ";</br>');
print 'private static $updateSQL = "UPDATE ' . $tableName . ' SET ' . getUpdate($tableName, $colnameArray) . ' WHERE CONDITIONFIELD = ? ";</br>';
}
print '<br/>';
print 'private static $deleteSQL = "DELETE FROM ' . $tableName . ' WHERE ' . $idField . ' = ? ";</br>';
print '<br/>';
print 'private static $selectByIdSQL = "SELECT * FROM ' . $tableName . ' WHERE ' . $idField . ' = ? ";</br>';
printCreateFunction($tableName, $colnameArray);
printGetAllFunction($tableName, $colnameArray);
printUpdateFunction($tableName, $colnameArray);
printDeleteFunction($tableName, $colnameArray);
printGetByIdFunction($tableName, $colnameArray, $idField);
DbUtil::disconnect();
//return $$colnameArray;
}
开发者ID:vijay8090,项目名称:numeracy,代码行数:47,代码来源:GenerateDao.php
示例3: execute
function execute( $par ) {
global $wgOut, $wgUser, $wgRequest;
$wgOut->setPageTitle( 'Add Collection' );
if ( !$wgUser->isAllowed( 'addcollection' ) ) {
$wgOut->addHTML( 'You do not have permission to add a collection.' );
return false;
}
$dbr = wfGetDB( DB_MASTER );
if ( $wgRequest->getText( 'collection' ) ) {
require_once( 'WikiDataAPI.php' );
require_once( 'Transaction.php' );
$dc = $wgRequest->getText( 'dataset' );
$collectionName = $wgRequest->getText( 'collection' );
startNewTransaction( $wgUser->getID(), wfGetIP(), 'Add collection ' . $collectionName );
bootstrapCollection( $collectionName, $wgRequest->getText( 'language' ), $wgRequest->getText( 'type' ), $dc );
$wgOut->addHTML( wfMsg( 'ow_collection_added', $collectionName ) . "<br />" );
}
$datasets = wdGetDatasets();
$datasetarray[''] = wfMsgSc( "none_selected" );
foreach ( $datasets as $datasetid => $dataset ) {
$datasetarray[$datasetid] = $dataset->fetchName();
}
$wgOut->addHTML( getOptionPanel(
array(
'Collection name:' => getTextBox( 'collection' ),
'Language of name:' => getSuggest( 'language', 'language' ),
'Collection type:' => getSelect( 'type', array( '' => 'None', 'RELT' => 'RELT', 'LEVL' => 'LEVL', 'CLAS' => 'CLAS', 'MAPP' => 'MAPP' ) ),
'Dataset:' => getSelect( 'dataset', $datasetarray )
),
'', array( 'create' => wfMsg( 'ow_create' ) )
) );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:39,代码来源:SpecialAddCollection.php
示例4: getLanguageSelect
function getLanguageSelect( $name, $languageIdsToExclude = array() ) {
global $wgLang ;
$userLanguageId = getLanguageIdForCode( $wgLang->getCode() ) ;
return getSelect( $name, getLanguageOptions( $languageIdsToExclude ), $userLanguageId );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:6,代码来源:forms.php
示例5: getNiftySelect
function getNiftySelect($groupList, $select_attrs, $selected_id = NULL, $tree = false)
{
// special treatment for ungrouped data
if (count($groupList) == 1 and isset($groupList['other'])) {
return getSelect($groupList['other'], $select_attrs, $selected_id);
}
if (!array_key_exists('name', $select_attrs)) {
return '';
}
if (!array_key_exists('id', $select_attrs)) {
$select_attrs['id'] = $select_attrs['name'];
}
if ($tree) {
# it is safe to call many times for the same file
addJS('js/jquery.optionTree.js');
$ret = "<input type=hidden name={$select_attrs['name']}>\n";
$ret .= "<script type='text/javascript'>\n";
$ret .= "\$(function() {\n";
$ret .= " var option_tree = {\n";
foreach ($groupList as $groupname => $groupdata) {
$ret .= " '{$groupname}': {";
foreach ($groupdata as $dict_key => $dict_value) {
$ret .= "\"{$dict_value}\":'{$dict_key}', ";
}
$ret .= "},\n";
}
$ret .= " };\n";
$ret .= " var options = {empty_value: '', choose: 'select...'};\n";
$ret .= " \$('input[name={$select_attrs['name']}]').optionTree(option_tree, options);\n";
$ret .= "});\n";
$ret .= "</script>\n";
} else {
$ret = '<select';
foreach ($select_attrs as $attr_name => $attr_value) {
$ret .= " {$attr_name}={$attr_value}";
}
$ret .= ">\n";
foreach ($groupList as $groupname => $groupdata) {
$ret .= "<optgroup label='{$groupname}'>\n";
foreach ($groupdata as $dict_key => $dict_value) {
$ret .= "<option value='{$dict_key}'" . ($dict_key == $selected_id ? ' selected' : '') . ">{$dict_value}</option>\n";
}
$ret .= "</optgroup>\n";
}
$ret .= "</select>\n";
}
return $ret;
}
开发者ID:ivladdalvi,项目名称:racktables,代码行数:48,代码来源:interface-lib.php
示例6: snmpgeneric_snmpconfig
//.........这里部分代码省略.........
$snmpconfig['priv_protocol'] = NULL;
}
if (!isset($snmpconfig['priv_passphrase'])) {
$snmpconfig['priv_passphrase'] = NULL;
}
if (!isset($snmpconfig['asnewobject'])) {
$snmpconfig['asnewobject'] = NULL;
}
if (!isset($snmpconfig['object_type_id'])) {
$snmpconfig['object_type_id'] = '8';
}
if (!isset($snmpconfig['object_name'])) {
$snmpconfig['object_name'] = NULL;
}
if (!isset($snmpconfig['object_label'])) {
$snmpconfig['object_label'] = NULL;
}
if (!isset($snmpconfig['object_asset_no'])) {
$snmpconfig['object_asset_no'] = NULL;
}
if (!isset($snmpconfig['save'])) {
$snmpconfig['save'] = true;
}
// sg_var_dump_html($snmpconfig);
// $snmpv3displaystyle = ($snmpconfig['version'] == "3" ? "style=\"\"" : "style=\"display:none;\"");
echo '<h1 align=center>SNMP Config</h1>';
echo '<form method=post name="snmpconfig" onsubmit="return checkInput()" action=' . $_SERVER['REQUEST_URI'] . ' />';
echo '<table cellspacing=0 cellpadding=5 align=center class=widetable>
<tr><th class=tdright>Host:</th><td>';
//if($snmpconfig['asnewobject'] == '1' )
if ($snmpconfig['host'] != '-1' and !isset($endpoints[$snmpconfig['host']])) {
$endpoints[$snmpconfig['host']] = $snmpconfig['host'];
}
echo getSelect($endpoints, array('id' => 'host', 'name' => 'host'), $snmpconfig['host'], FALSE);
echo '</td></tr>
<tr>
<th class=tdright><label for=snmpversion>Version:</label></th>
<td class=tdleft>';
echo getSelect(array("v1" => 'v1', "v2c" => 'v2c', "v3" => 'v3'), array('name' => 'version', 'id' => 'snmpversion', 'onchange' => 'showsnmpv3(this)'), $snmpconfig['version'], FALSE);
echo '</td>
</tr>
<tr>
<th id="snmp_community_label" class=tdright><label for=community>Community:</label></th>
<th name="snmpv3" style="display:none;" class=tdright><label for=community>Security Name:</label></th>
<td class=tdleft><input type=text name=community value=' . $snmpconfig['community'] . ' ></td>
</tr>
<tr name="snmpv3" style="display:none;">
<th></th>
</tr>
<tr name="snmpv3" style="display:none;">
<th class=tdright><label">Security Level:</label></th>
<td class=tdleft>';
echo getSelect(array('noAuthNoPriv' => 'no Auth and no Priv', 'authNoPriv' => 'auth without Priv', 'authPriv' => 'auth with Priv'), array('name' => 'sec_level'), $snmpconfig['sec_level'], FALSE);
echo '</td></tr>
<tr name="snmpv3" style="display:none;">
<th class=tdright><label>Auth Type:</label></th>
<td class=tdleft>
<input name=auth_protocol type=radio value=MD5 ' . ($snmpconfig['auth_protocol'] == 'MD5' ? ' checked="checked"' : '') . '/><label>MD5</label>
<input name=auth_protocol type=radio value=SHA ' . ($snmpconfig['auth_protocol'] == 'SHA' ? ' checked="checked"' : '') . '/><label>SHA</label>
</td>
</tr>
<tr name="snmpv3" style="display:none;">
<th class=tdright><label>Auth Key:</label></th>
<td class=tdleft><input type=password id=auth_passphrase name=auth_passphrase value="' . $snmpconfig['auth_passphrase'] . '"></td>
</tr>
<tr name="snmpv3" style="display:none;">
开发者ID:dot-Sean,项目名称:racktables-contribs,代码行数:67,代码来源:snmpgeneric.php
示例7: getNiftySelect
function getNiftySelect($groupList, $select_attrs, $selected_id = NULL)
{
// special treatment for ungrouped data
if (count($groupList) == 1 and isset($groupList['other'])) {
return getSelect($groupList['other'], $select_attrs, $selected_id);
}
if (!array_key_exists('name', $select_attrs)) {
return '';
}
if (!array_key_exists('id', $select_attrs)) {
$select_attrs['id'] = $select_attrs['name'];
}
$ret = '<select';
foreach ($select_attrs as $attr_name => $attr_value) {
$ret .= " {$attr_name}={$attr_value}";
}
$ret .= ">\n";
foreach ($groupList as $groupname => $groupdata) {
$ret .= "<optgroup label='{$groupname}'>\n";
foreach ($groupdata as $dict_key => $dict_value) {
$ret .= "<option value='{$dict_key}'" . ($dict_key == $selected_id ? ' selected' : '') . ">{$dict_value}</option>\n";
}
$ret .= "</optgroup>\n";
}
$ret .= "</select>\n";
return $ret;
}
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:27,代码来源:interface-lib.php
示例8: execute
//.........这里部分代码省略.........
// query to get the definitions
// ****************************
$qry = 'SELECT txt.text_text, trans.language_id ';
$qry .= "FROM {$dc}_text txt, {$dc}_translated_content trans, {$dc}_defined_meaning dm ";
$qry .= 'WHERE txt.text_id = trans.text_id ';
$qry .= 'AND trans.translated_content_id = dm.meaning_text_tcid ';
$qry .= "AND dm.defined_meaning_id = $dm_id ";
$qry .= 'AND trans.language_id IN (';
for ( $i = 0; $i < count( $languages ); $i++ ) {
$language = $languages[$i];
if ( $i > 0 )
$qry .= ",";
$qry .= $language['language_id'];
}
$qry .= ') AND ' . getLatestTransactionRestriction( 'trans' );
$qry .= 'AND ' . getLatestTransactionRestriction( 'dm' );
// wfDebug($qry."\n"); // uncomment this if you accept having 1700+ queries in the log
$definitions = $dbr->query( $qry );
while ( $row = $dbr->fetchRow( $definitions ) ) {
// $key becomes something like def_eng
$key = 'def_' . $isoLookup['id' . $row['language_id']];
$data[$key] = $row['text_text'];
}
$dbr->freeResult( $definitions );
// *****************************
// query to get the translations
// *****************************
$qry = "SELECT exp.spelling, exp.language_id ";
$qry .= "FROM {$dc}_expression exp ";
$qry .= "INNER JOIN {$dc}_syntrans trans ON exp.expression_id=trans.expression_id ";
$qry .= "WHERE trans.defined_meaning_id=$dm_id ";
$qry .= "AND " . getLatestTransactionRestriction( "exp" );
$qry .= "AND " . getLatestTransactionRestriction( "trans" );
// wfDebug($qry."\n"); // uncomment this if you accept having 1700+ queries in the log
$translations = $dbr->query( $qry );
while ( $row = $dbr->fetchRow( $translations ) ) {
// qry gets all languages, we filter them here. Saves an order
// of magnitude execution time.
if ( isset( $isoLookup['id' . $row['language_id']] ) ) {
// $key becomes something like trans_eng
$key = 'trans_' . $isoLookup['id' . $row['language_id']];
if ( !isset( $data[$key] ) )
$data[$key] = $row['spelling'];
else
$data[$key] = $data[$key] . '|' . $row['spelling'];
}
}
$dbr->freeResult( $translations );
// now that we have everything, output the row.
foreach ( $isoCodes as $isoCode ) {
// if statements save a bunch of notices in the log about
// undefined indices.
echo( "\t" );
if ( isset( $data['def_' . $isoCode] ) )
echo( $this->escapeDelimitedValue( $data['def_' . $isoCode] ) );
echo( "\t" );
if ( isset( $data['trans_' . $isoCode] ) )
echo( $data['trans_' . $isoCode] );
}
echo( "\r\n" );
}
}
else {
// Get the collections
$colQuery = "SELECT col.collection_id, exp.spelling " .
"FROM {$dc}_collection col INNER JOIN {$dc}_defined_meaning dm ON col.collection_mid=dm.defined_meaning_id " .
"INNER JOIN {$dc}_expression exp ON dm.expression_id=exp.expression_id " .
"WHERE " . getLatestTransactionRestriction( 'col' );
$collections = array();
$colResults = $dbr->query( $colQuery );
while ( $row = $dbr->fetchRow( $colResults ) ) {
$collections['cid' . $row['collection_id']] = $row['spelling'];
}
// render the page
$wgOut->setPageTitle( wfMsg( 'ow_exporttsv_title' ) );
$wgOut->addHTML( wfMsg( 'ow_exporttsv_header' ) );
$wgOut->addHTML( getOptionPanel(
array(
wfMsg( 'ow_Collection_colon' ) => getSelect( 'collection', $collections, 'cid376322' ),
wfMsg( 'ow_exporttsv_languages' ) => getTextBox( 'languages', 'ita, eng, deu, fra, cat' ),
),
'', array( 'create' => wfMsg( 'ow_create' ) )
) );
}
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:101,代码来源:SpecialExportTSV.php
示例9: renderPopupPortSelector
function renderPopupPortSelector()
{
if (isset($_REQUEST['do_link'])) {
return handlePopupPortLink();
}
assertPermission('depot', 'default');
assertUIntArg('port');
$port_id = $_REQUEST['port'];
$port_info = getPortInfo($port_id);
$in_rack = isCheckSet('in_rack');
// fill port filter structure
$filter = array('racks' => array(), 'objects' => '', 'ports' => '', 'asset_no' => '');
if (isset($_REQUEST['filter-obj'])) {
$filter['objects'] = trim($_REQUEST['filter-obj']);
}
if (isset($_REQUEST['filter-port'])) {
$filter['ports'] = trim($_REQUEST['filter-port']);
}
if (isset($_REQUEST['filter-asset_no'])) {
$filter['asset_no'] = trim($_REQUEST['filter-asset_no']);
}
if ($in_rack) {
$object = spotEntity('object', $port_info['object_id']);
if ($object['rack_id']) {
// the object itself is mounted in a rack
$filter['racks'] = getProximateRacks($object['rack_id'], getConfigVar('PROXIMITY_RANGE'));
} elseif ($object['container_id']) {
$container = spotEntity('object', $object['container_id']);
if ($container['rack_id']) {
$filter['racks'] = getProximateRacks($container['rack_id'], getConfigVar('PROXIMITY_RANGE'));
}
}
}
$spare_ports = array();
if (!empty($filter['racks']) || !empty($filter['objects']) || !empty($filter['ports']) || !empty($filter['asset_no'])) {
$spare_ports = findSparePorts($port_info, $filter);
}
// display search form
echo 'Link ' . formatPort($port_info) . ' to...';
echo '<form method=GET>';
startPortlet('Port list filter');
echo '<input type=hidden name="module" value="popup">';
echo '<input type=hidden name="helper" value="portlist">';
echo '<input type=hidden name="port" value="' . $port_id . '">';
echo '<table align="center" valign="bottom"><tr>';
echo '<td class="tdleft"><label>Object name:<br><input type=text size=8 name="filter-obj" value="' . htmlspecialchars($filter['objects'], ENT_QUOTES) . '"></label></td>';
echo '<td class="tdleft"><label>Asset tag:<br><input type=text size=8 name="filter-asset_no" value="' . htmlspecialchars($filter['asset_no'], ENT_QUOTES) . '"></label></td>';
echo '<td class="tdleft"><label>Port name:<br><input type=text size=6 name="filter-port" value="' . htmlspecialchars($filter['ports'], ENT_QUOTES) . '"></label></td>';
echo '<td class="tdleft" valign="bottom"><label><input type=checkbox name="in_rack"' . ($in_rack ? ' checked' : '') . '>Nearest racks</label></td>';
echo '<td valign="bottom"><input type=submit value="show ports"></td>';
echo '</tr></table>';
finishPortlet();
// display results
startPortlet('Compatible spare ports');
if (empty($spare_ports)) {
echo '(nothing found)';
} else {
echo getSelect($spare_ports, array('name' => 'remote_port', 'size' => getConfigVar('MAXSELSIZE')), NULL, FALSE);
echo "<p>Cable ID: <input type=text id=cable name=cable>";
// suggest patch cables where it makes sense
$heaps = getPatchCableHeapOptionsForOIF($port_info['oif_id']);
if (count($heaps)) {
// Use + instead of array_merge() to avoid renumbering the keys.
echo '<p>Patch cable: ' . getSelect(array(0 => 'none') + $heaps, array('name' => 'heap_id'));
}
echo "<p><input type='submit' value='Link' name='do_link'>";
}
finishPortlet();
echo '</form>';
}
开发者ID:spartak-radchenko,项目名称:racktables,代码行数:70,代码来源:popup.php
示例10: print_r
<table width="40%" border=0 cellspacing=0 cellpadding=0 class="border">
<tr valign="top" >
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=4>
<?php
print_r($this);
?>
<tr valign="middle" class="bg1">
<td nowrap width="45%" class="fNormal">Type:</td>
<td width="55%">
<?php
echo getSelect("task", array("tools_editdetails_player" => "Player", "tools_editdetails_clan" => "Clan"));
?>
</td>
</tr>
<tr valign="middle" class="bg1">
<td nowrap width="45%" class="fNormal">ID Number:</td>
<td width="55%"><input type="text" name="id" size=15 maxlength=12 class="textbox"></td>
</tr>
</table></td>
<td align="right">
<table border=0 cellspacing=0 cellpadding=10>
<tr>
<td><input type="submit" value=" Edit >> " class="submit"></td>
</tr>
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:tools_editdetails.php
示例11: linkmgmt_renderPopupPortSelectorbyName
function linkmgmt_renderPopupPortSelectorbyName()
{
$linktype = $_REQUEST['linktype'];
$object_id = $_REQUEST['object_id'];
$object = spotEntity('object', $object_id);
$objectlist = linkmgmt_findSparePorts(NULL, NULL, $linktype, false, true, TRUE, false, $object_id);
$objectname = $object['dname'];
/* remove self from list */
unset($objectlist[$object_id]);
if (isset($_REQUEST['remote_object'])) {
$remote_object = $_REQUEST['remote_object'];
} else {
/* choose first object from list */
$keys = array_keys($objectlist);
if (isset($keys[0])) {
$remote_object = $keys[0];
} else {
$remote_object = NULL;
}
}
if ($remote_object) {
$filter['object_id'] = $remote_object;
$link_list = linkmgmt_findSparePorts(NULL, $filter, $linktype, false, false, TRUE, false, $object_id);
} else {
$link_list = linkmgmt_findSparePorts(NULL, NULL, $linktype, false, false, TRUE, false, $object_id);
}
// display search form
echo 'Link ' . $linktype . ' of ' . formatPortLink($object_id, $objectname, NULL, NULL) . ' Ports by Name to...';
echo '<form method=POST>';
echo '<table align="center"><tr><td>';
startPortlet('Object list');
$maxsize = getConfigVar('MAXSELSIZE');
$objectcount = count($objectlist);
echo 'Object name (count ports)<br>';
echo getSelect($objectlist, array('name' => 'remote_object', 'size' => $objectcount <= $maxsize ? $objectcount : $maxsize), $remote_object, FALSE);
echo '</td><td><input type=submit value="show ' . $linktype . ' ports>"></td>';
finishPortlet();
echo '<td>';
// display results
startPortlet('Possible Backend Link List');
echo "Select links to create:<br>";
if (empty($link_list)) {
echo '(nothing found)';
} else {
$linkcount = count($link_list);
$options = array('name' => 'link_list[]', 'size' => $linkcount <= $maxsize ? $linkcount : $maxsize, 'multiple' => 'multiple');
echo getSelect($link_list, $options, NULL, FALSE);
echo "<p>{$linktype} Cable ID: <input type=text id=cable name=cable>";
echo "<p><input type='submit' value='Link {$linktype}' name='do_link'>";
}
finishPortlet();
echo '</td></tr></table>';
echo '</form>';
}
开发者ID:dot-Sean,项目名称:racktables-contribs,代码行数:54,代码来源:linkmgmt.php
示例12: while
?>
<form method="get" action="<?php
echo $g_options["scripturl"];
?>
">
<input type="hidden" name="mode" value="admin" />
<input type="hidden" name="task" value="<?php
echo $code;
?>
" />
<input type="hidden" name="sort" value="<?php
echo $sort;
?>
" />
<input type="hidden" name="sortorder" value="<?php
echo $sortorder;
?>
" />
<b style="padding-left:35px;">•</b> Show only events of type: <?php
$resultTypes = $db->query("\r\n\t\tSELECT\r\n\t\t\tDISTINCT eventType\r\n\t\tFROM\r\n\t\t\thlstats_AdminEventHistory\r\n\t\tORDER BY\r\n\t\t\teventType ASC\r\n\t");
$types[""] = "(All)";
while (list($k) = $db->fetch_row($resultTypes)) {
$types[$k] = $k;
}
echo getSelect("type", $types, $type);
?>
<input type="submit" value="Filter" class="smallsubmit" /><br /><br />
</form>
<?php
$table->draw($result, $numitems, 95, "center");
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:31,代码来源:tools_adminevents.php
示例13: draw
function draw($value)
{
global $g_options;
?>
<tr valign="middle">
<td width="45%" bgcolor="<?php
echo $g_options["table_bgcolor1"];
?>
">
<?php
echo $g_options["font_normal"];
echo l($this->title) . ":";
echo $g_options["fontend_normal"];
?>
</td>
<td width="55%" bgcolor="<?php
echo $g_options["table_bgcolor1"];
?>
"><?php
switch ($this->type) {
case "textarea":
echo "<textarea name=\"{$this->name}\" cols=35 rows=4 wrap=\"virtual\">" . htmlspecialchars($value) . "</textarea>";
break;
case 'checkbox':
echo '<input type="checkbox" name=' . $this->name . ' value="0" />';
break;
case "select":
// for manual datasource in format "key/value;key/value" or "key;key"
foreach (explode(";", $this->datasource) as $v) {
if (ereg("/", $v)) {
list($a, $b) = explode("/", $v);
$coldata[$a] = $b;
} else {
$coldata[$v] = $v;
}
}
echo getSelect($this->name, $coldata, $value);
break;
default:
echo "<input type=\"text\" name=\"{$this->name}\" size=35 value=\"" . htmlspecialchars(l($value)) . "\" class=\"textbox\">";
break;
}
?>
</td>
</tr>
<?php
}
开发者ID:BlackMajic,项目名称:HLStats,代码行数:47,代码来源:admin.inc_old.php
示例14: renderPopupPortSelector
function renderPopupPortSelector()
{
assertUIntArg('port');
$port_id = $_REQUEST['port'];
$port_info = getPortInfo($port_id);
$in_rack = isCheckSet('in_rack');
// fill port filter structure
$filter = array('racks' => array(), 'objects' => '', 'ports' => '');
if (isset($_REQUEST['filter-obj'])) {
$filter['objects'] = trim($_REQUEST['filter-obj']);
}
if (isset($_REQUEST['filter-port'])) {
$filter['ports'] = trim($_REQUEST['filter-port']);
}
if ($in_rack) {
$object = spotEntity('object', $port_info['object_id']);
if ($object['rack_id']) {
$filter['racks'] = getProximateRacks($object['rack_id'], getConfigVar('PROXIMITY_RANGE'));
}
}
$spare_ports = array();
if (!empty($filter['racks']) || !empty($filter['objects']) || !empty($filter['ports'])) {
$spare_ports = findSparePorts($port_info, $filter);
}
// display search form
echo 'Link ' . formatPort($port_info) . ' to...';
echo '<form method=GET>';
startPortlet('Port list filter');
echo '<input type=hidden name="module" value="popup">';
echo '<input type=hidden name="helper" value="portlist">';
echo '<input type=hidden name="port" value="' . $port_id . '">';
echo '<table align="center" valign="bottom"><tr>';
echo '<td class="tdleft"><label>Object name:<br><input type=text size=8 name="filter-obj" value="' . htmlspecialchars($filter['objects'], ENT_QUOTES) . '"></label></td>';
echo '<td class="tdleft"><label>Port name:<br><input type=text size=6 name="filter-port" value="' . htmlspecialchars($filter['ports'], ENT_QUOTES) . '"></label></td>';
echo '<td class="tdleft" valign="bottom"><label><input type=checkbox name="in_rack"' . ($in_rack ? ' checked' : '') . '>Nearest racks</label></td>';
echo '<td valign="bottom"><input type=submit value="show ports"></td>';
echo '</tr></table>';
finishPortlet();
// display results
startPortlet('Compatible spare ports');
if (empty($spare_ports)) {
echo '(nothing found)';
} else {
echo getSelect($spare_ports, array('name' => 'remote_port', 'size' => getConfigVar('MAXSELSIZE')), NULL, FALSE);
echo "<p>Cable ID: <input type=text id=cable name=cable>";
echo "<p><input type='submit' value='Link' name='do_link'>";
}
finishPortlet();
echo '</form>';
}
开发者ID:ehironymous,项目名称:racktables,代码行数:50,代码来源:popup.php
示例15: renderNodePingChecks
function renderNodePingChecks($object_id)
{
$accounts = getNodePingAccounts();
$account_options = array();
foreach ($accounts as $account) {
$account_options[$account['id']] = $account['name'];
}
startPortlet('Add new check');
echo "<table cellspacing=0 cellpadding=5 align='center'>\n";
echo "<tr><th> </th><th>Account</th><th>Check ID</th><th></th><th> </th></tr>\n";
printOpFormIntro('add');
echo '<tr><td>';
printImageHREF('add', 'add check', TRUE);
echo '</td><td>' . getSelect($account_options, array('name' => 'account_id'));
echo '</td><td><input type=text size=25 name=np_check_id tabindex=101></td><td>';
printImageHREF('add', 'add check', TRUE);
echo "</td></tr></form></table>\n";
finishPortlet();
$checks = getUnlinkedNodePingChecks($object_id);
if (count($checks) > 0) {
$check_options = array();
foreach ($checks as $check) {
$check_options[$check['id']] = sprintf("%s - %s", $check['label'], $check['type']);
}
startPortlet('Link existing check (' . count($checks) . ')');
echo "<table cellspacing=0 cellpadding=5 align='center'>\n";
printOpFormIntro('link');
echo '<tr><td>' . getSelect($check_options, array('name' => 'check_id'));
echo '</td><td class=tdleft>';
printImageHREF('ATTACH', 'Link check', TRUE);
echo "</td></tr></form></table>\n";
finishPortlet();
}
addJs(<<<END
function toggleVisibility(tbodyId) {
\t\$("#" + tbodyId).toggle();
}
END
, TRUE);
$checks = getNodePingChecks($object_id);
startPortlet('NodePing checks (' . count($checks) . ')');
if (count($checks)) {
echo "<table cellspacing=0 cellpadding=5 align=center class=widetable>\n";
echo "<tr><th> </th><th>Type</th><th>Label</th><th>Interval</th><th>Reason</th><th>Result</th><th>Unlink</th><th> </th></tr>\n";
$token = '';
foreach ($checks as $check) {
printOpFormIntro('upd', array('check_id' => $check['check_id']));
echo '<tr><td><a href="' . makeHrefProcess(array('op' => 'del', 'check_id' => $check['check_id'])) . '">';
echo getImageHREF('delete', 'Unlink and delete this check') . '</a></td>';
echo "<td><a href=\"#\" onclick=\"toggleVisibility('{$check['check_id']}');\">{$check['type']}</a></td>";
echo "<td>{$check['label']}</td>";
echo "<td>{$check['check_interval']}</td>";
// re-use a nodeping object if it already exists and is using the same token as this check
if ($check['token'] != $token) {
$nodeping = new NodePingClient(array('token' => $check['token']));
}
$token = $check['token'];
$np_result_raw = $nodeping->result->get(array('id' => $check['np_check_id'], 'limit' => 5, 'clean' => true));
if (isset($np_result_raw['error'])) {
echo "<td colspan=5>Error: {$check_status_raw['error']}</td>";
} else {
$np_result = $np_result_raw[0];
if ($np_result['su']) {
$reason = '';
$result_str = 'PASS';
$result_class = 'msg_success';
} else {
$reason = $np_result['sc'];
$result_str = 'FAIL';
$result_class = 'msg_error';
}
echo "<td>{$reason}</td>";
echo "<td><span class='{$result_class}'>{$result_str}</span></td>";
}
echo '<td class=center><a href="' . makeHrefProcess(array('op' => 'unlink', 'link_id' => $check['link_id'])) . '">';
echo getImageHREF('cut', 'Unlink this check') . '</a></td>';
echo '<td class=tdleft>';
printImageHREF('save', 'Save changes', TRUE);
echo "</td></tr>\n";
echo "<tbody id='{$check['check_id']}' style='display:none;'><tr><td colspan=8>";
echo '<table cellspacing=0 cellpadding=5 align=left>';
// override the td styling so it doesn't have a border
echo '<tr><th>Account</th><td align=left style="border-top: 0px;">' . getSelect($account_options, array('name' => 'account_id'), $check['account_id']) . '</td></tr>';
echo '<tr><th>Check ID</th><td align=left style="border-top: 0px;"><input type=text size=25 name=np_check_id value="' . $check['np_check_id'] . '"></td></tr>';
echo "<tr><th>Target</th><td align=left style=\"border-top:0px; word-wrap:break-word; max-width:250px;\">{$check['target']}</td></tr>";
echo '</table></form>';
echo '<table cellspacing=0 cellpadding=5 align=right>';
echo '<tr><th colspan=5>Last 5 Results</th></tr>';
echo '<tr><th>Time</th><th>Loc</th><th>Run Time</th><th>Response</th><th>Result</th></tr>';
foreach ($np_result_raw as $np_row) {
// time is reported in miliseconds, so trim off the last 3 digits
printf('<tr><td>%s</td>', date('H:i:s A', substr($np_row['s'], 0, -3)));
printf('<td>%s</td>', strtoupper($np_row['l'][$np_row['s']]));
if ($np_row['su']) {
$result_str = 'PASS';
$result_class = 'msg_success';
} else {
$result_str = 'FAIL';
$result_class = 'msg_error';
}
//.........这里部分代码省略.........
开发者ID:cengn-tao,项目名称:racktables-contribs,代码行数:101,代码来源:nodeping.php
示例16: renderEditVlan
function renderEditVlan($vlan_ck)
{
global $vtoptions;
$vlan = getVLANInfo($vlan_ck);
startPortlet('Modify');
printOpFormIntro('upd');
// static attributes
echo '<table border=0 cellspacing=0 cellpadding=2 align=center>';
echo '<tr><th class=tdright>Name:</th><td class=tdleft>' . "<input type=text size=40 name=vlan_descr value='{$vlan['vlan_descr']}'>" . '</td></tr>';
echo '<tr><th class=tdright>Type:</th><td class=tdleft>' . getSelect($vtoptions, array('name' => 'vlan_type', 'tabindex' => 102), $vlan['vlan_prop']) . '</td></tr>';
echo '</table>';
echo '<p>';
echo '<input type="hidden" name="vdom_id" value="' . htmlspecialchars($vlan['domain_id'], ENT_QUOTES) . '">';
echo '<input type="hidden" name="vlan_id" value="' . htmlspecialchars($vlan['vlan_id'], ENT_QUOTES) . '">';
printImageHREF('SAVE', 'Update VLAN', TRUE);
echo '</form><p>';
// get configured ports count
$portc = 0;
foreach (getVLANConfiguredPorts($vlan_ck) as $subarray) {
$portc += count($subarray);
}
$clear_line = '';
$delete_line = '';
if ($portc) {
$clear_line .= '<p>';
$clear_line .= '<a href="' . makeHrefProcess(array('op' => 'clear', 'vlan_ck' => $vlan_ck)) . '">';
$clear_line .= getImageHREF('clear', "remove this vlan from {$portc} ports") . ' remove</a>' . ' this VLAN from ' . '<a href="' . makeHref(array('page' => 'vlan', 'tab' => 'default', 'vlan_ck' => $vlan_ck)) . '">' . "{$portc} ports</a>";
}
$reason = '';
if ($vlan['vlan_id'] == VLAN_DFL_ID) {
$reason = "You can not delete default VLAN";
} elseif ($portc) {
$reason = "Can not delete: {$portc} ports configured";
}
if (!empty($reason)) {
echo getOpLink(NULL, 'delete VLAN', 'nodestroy', $reason);
} else {
echo getOpLink(array('op' => 'del', 'vlan_ck' => $vlan_ck), 'delete VLAN', 'destroy');
}
echo $clear_line;
finishPortlet();
}
开发者ID:rhysm,项目名称:racktables,代码行数:42,代码来源:interface.php
示例17: snmpgeneric_snmpconfig
//.........这里部分代码省略.........
$ip = ip_format(ip_parse($value['addrinfo']['ip']));
if (!in_array($ip, $endpoints)) {
$endpoints[$ip] = $ip;
}
}
unset($value);
/* ask for ip/host name on submit see js checkInput() */
$endpoints['-1'] = 'ask me';
$snmpconfig = $_POST;
if (!isset($snmpconfig['host'])) {
$snmpconfig['host'] = -1;
/* try to find first FQDN or IP */
foreach ($endpoints as $value) {
if (preg_match('/^[^ .]+(\\.[^ .]+)+\\.?/', $value)) {
$snmpconfig['host'] = $value;
break;
}
}
unset($value);
}
// sg_var_dump_html($endpoints);
if (!isset($snmpconfig['snmpversion'])) {
$snmpconfig['version'] = mySNMP::SNMP_VERSION;
}
if (!isset($snmpconfig['community'])) {
$snmpconfig['community'] = getConfigVar('DEFAULT_SNMP_COMMUNITY');
}
if (empty($snmpconfig['community'])) {
$snmpconfig['community'] = mySNMP::SNMP_COMMUNITY;
}
if (!isset($snmpconfig['sec_level'])) {
$snmpconfig['sec_level'] = NULL;
}
if (!
|
请发表评论