本文整理汇总了PHP中form_start函数的典型用法代码示例。如果您正苦于以下问题:PHP form_start函数的具体用法?PHP form_start怎么用?PHP form_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: page_admin_images
function page_admin_images($act = "", $id = "")
{
requires_admin();
use_template("admin");
if ($act == "add") {
if (form_file_uploaded("file")) {
$fname = $_FILES["file"]['name'];
db_query("INSERT INTO images (link) VALUES ('')");
$id = db_last_id();
$fname = $id . "." . fileext($fname);
form_file_uploaded_move("file", "img/" . $fname);
db_query("UPDATE images SET link='img/{$fname}' WHERE id=%d", $id);
redir("admin/images");
}
form_start("", "post", " enctype='multipart/form-data' ");
form_file("Файл", "file");
form_submit("Загрузить", "submit");
form_end();
$o = form();
return $o;
}
if ($act == "del") {
$im = db_object_get("images", $id);
@unlink("../{$im->link}");
}
$o = table_edit("images", "admin/images", $act, $id, "", "", "", "image_func");
return $o;
}
开发者ID:NazarK,项目名称:timedesk,代码行数:28,代码来源:images.php
示例2: wormhole_show_wormhole
function wormhole_show_wormhole($wormhole_id)
{
assert(!empty($wormhole_id));
global $_GALAXY;
if (!anomaly_is_wormhole($wormhole_id)) {
return;
}
$wormhole = anomaly_get_anomaly($wormhole_id);
$sector = sector_get_sector($wormhole['sector_id']);
$race = user_get_race($wormhole['user_id']);
$result = sql_query("SELECT * FROM w_wormhole WHERE id=" . $wormhole['id']);
$dst_wormhole = sql_fetchrow($result);
if ($race == "") {
$race = "-";
}
echo "<table border=1 width=500 align=center>\n";
echo " <tr><td align=center><b><i>Sector: " . $sector['name'] . " / Anomaly: " . $wormhole['name'] . "</i></b></td></tr>\n";
echo " <tr><td>\n";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>\n";
echo " <tr><td width=200>\n";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>\n";
echo " <tr><th>Anomaly View</th></tr>\n";
echo " <tr><td width=100%><center><img src=\"" . $_CONFIG['URL'] . $_GALAXY['image_dir'] . "/wormholes/" . $wormhole['image'] . ".jpg\" width=150 height=150></center></td></tr>\n";
echo " <tr><th> </th></tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " <td> </td>\n";
echo " <td nowrap valign=top>\n";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>\n";
echo " <tr><td nowrap width=40%><strong>Wormhole Name </strong></td><td nowrap width=1%><b>:</b></td>\n";
if ($wormhole['unknown'] == 1) {
form_start();
echo "<td nowrap>\n";
echo " <input type=hidden name=aid value=" . encrypt_get_vars($wormhole_id) . ">\n";
echo " <input type=hidden name=cmd value=" . encrypt_get_vars("claim") . ">\n";
echo " <input type=text size=15 maxlength=30 name=ne_name>\n";
echo " <input name=submit type=submit value=\"Claim\">\n";
echo "</td>\n";
form_end();
} else {
echo "<td nowrap>" . $wormhole['name'] . "</td>\n";
}
echo " </tr>\n";
echo " <tr><td colspan=3> </td></tr>\n";
echo " <tr><td nowrap width=40%><strong>Caretaker </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $race . "</td></tr>\n";
echo " <tr><td nowrap width=40%><strong>Radius </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $wormhole['radius'] . " km</td></tr>\n";
echo " <tr><td nowrap width=40%><strong>Distance to sun </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $wormhole['distance'] . " km (10<sup>6</sup>)</td></tr>\n";
echo " <tr><td colspan=3> </td></tr>\n";
echo " <tr><td nowrap width=40%><strong>Destination </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $dst_wormhole['distance'] . " / " . $dst_wormhole['angle'] . "</td></tr>\n";
echo " <tr><td nowrap width=40%><strong>Stability </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . wormhole_get_wormhole_stability($dst_wormhole['next_jump']) . " </td></tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br><br>\n";
}
开发者ID:jaytaph,项目名称:perihelion-oldcode,代码行数:59,代码来源:global_wormhole.php
示例3: starbase_show_starbase
function starbase_show_starbase($starbase_id)
{
assert(!empty($starbase_id));
global $_GALAXY;
if (!anomaly_is_starbase($starbase_id)) {
return;
}
$starbase = anomaly_get_anomaly($starbase_id);
$sector = sector_get_sector($starbase['sector_id']);
$race = user_get_race($starbase['user_id']);
if ($race == "") {
$race = "-";
}
echo "<table border=1 width=500 align=center>";
echo " <tr><td align=center><b><i>Starbase: " . $starbase['name'] . "</i></b></td></tr>";
echo " <tr><td>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><td width=200>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><th>Starbase View</th></tr>";
echo " <tr><td width=100%><center><img src=\"" . $_CONFIG['URL'] . $_GALAXY['image_dir'] . "/starbase/" . $starbase['image'] . ".jpg\" width=150 height=150></center></td></tr>";
echo " <tr><th> </th></tr>";
echo " </table>";
echo " </td>";
echo " <td> </td>";
echo " <td nowrap valign=top>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><td nowrap width=40%><strong>Starbase Name </strong></td><td nowrap width=1%><b>:</b></td>";
if ($starbase['unknown'] == 1) {
form_start();
echo "<td nowrap>";
echo " <input type=hidden name=aid value=" . encrypt_get_vars($starbase_id) . ">";
echo " <input type=hidden name=cmd value=" . encrypt_get_vars("claim") . ">";
echo " <input type=text size=15 maxlength=30 name=ne_name> ";
echo " <input name=submit type=submit value=\"Claim\">";
echo "</td>";
form_end();
} else {
echo "<td nowrap>" . $starbase['name'] . "</td>";
}
echo " </tr>";
echo " <tr><td colspan=3> </td></tr>";
echo " <tr><td nowrap width=40%><strong>Caretaker </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $race . "</td></tr>";
echo " <tr><td colspan=3> </td></tr>";
echo " <tr><td nowrap width=40%><strong>Attack </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $starbase['cur_attack'] . "</td></tr>";
echo " <tr><td nowrap width=40%><strong>Defense </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $starbase['cur_defense'] . "</td></tr>";
echo " <tr><td nowrap width=40%><strong>Strength </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $starbase['cur_strength'] . "</td></tr>";
echo " <tr><td colspan=3> </td></tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "<br><br>";
}
开发者ID:jaytaph,项目名称:perihelion-oldcode,代码行数:57,代码来源:global_starbase.php
示例4: blackhole_show_blackhole
function blackhole_show_blackhole($blackhole_id)
{
assert(is_numeric($blackhole_id));
global $_GALAXY;
if (!anomaly_is_blackhole($blackhole_id)) {
return;
}
$blackhole = anomaly_get_anomaly($blackhole_id);
$race = user_get_race($blackhole['user_id']);
$sector = sector_get_sector($blackhole['sector_id']);
if ($race == "") {
$race = "-";
}
echo "<table border=1 width=500 align=center>";
echo " <tr><td align=center><b><i>Sector: " . $sector['name'] . " / Anomaly: " . $blackhole['name'] . "</i></b></td></tr>";
echo " <tr><td>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><td width=200>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><th>Anomaly View</th></tr>";
echo " <tr><td width=100%><center><img src=\"" . $_CONFIG['URL'] . $_GALAXY['image_dir'] . "/blackholes/" . $blackhole['image'] . ".jpg\" width=150 height=150></center></td></tr>";
echo " <tr><th> </th></tr>";
echo " </table>";
echo " </td>";
echo " <td> </td>";
echo " <td nowrap valign=top>";
echo " <table border=0 cellpadding=0 cellspacing=0 width=100%>";
echo " <tr><td nowrap width=40%><strong>Blackhole Name </strong></td><td nowrap width=1%><b>:</b></td>";
if ($blackhole['unknown'] == 1) {
form_start();
echo "<td nowrap>";
echo " <input type=hidden name=aid value=" . encrypt_get_vars($blackhole_id) . ">";
echo " <input type=hidden name=cmd value=" . encrypt_get_vars("claim") . ">";
echo " <input type=text size=15 maxlength=30 name=ne_name> ";
echo " <input name=submit type=submit value=\"Claim\">";
echo "</td>";
form_end();
} else {
echo "<td nowrap>" . $blackhole['name'] . "</td>";
}
echo " </tr>";
echo " <tr><td colspan=3> </td></tr>";
echo " <tr><td nowrap width=40%><strong>Caretaker </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $race . "</td></tr>";
echo " <tr><td nowrap width=40%><strong>Radius </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $blackhole['radius'] . " km</td></tr>";
echo " <tr><td nowrap width=40%><strong>Distance to sun </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . $blackhole['distance'] . " km (10<sup>6</sup>)</td></tr>";
echo " <tr><td colspan=3> </td></tr>";
echo " <tr><td nowrap width=40%><strong>Fatalities </strong></td><td nowrap width=1%><b>:</b> </td><td nowrap>" . blackhole_get_fatalities($blackhole_id) . " ship(s)</td></tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo " </table>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "<br><br>";
}
开发者ID:jaytaph,项目名称:perihelion-oldcode,代码行数:56,代码来源:global_blackhole.php
示例5: page_admin_images
function page_admin_images($act = "", $id = "")
{
requires_admin();
use_layout("admin");
form_start("", "post", " enctype='multipart/form-data' ");
form_file("Файл", "file");
$caption = "Загрузить картинку";
if ($act == "edit") {
$caption = "Изменить картинку";
}
form_submit($caption, "submit");
form_end();
$upload = form();
if (form_file_uploaded("file")) {
$fname = $_FILES["file"]['name'];
$ext = strtolower(fileext($fname));
if (!($ext == "swf" || $ext == "jpg" || $ext == "gif" || $ext == "png" || $ext == "bmp" || $ext == "jpeg" || $ext == "pdf")) {
$o = "Данный тип файла не является картинкой";
return $o;
} else {
if ($act == "add") {
db_query("INSERT INTO images (link) VALUES ('')");
$id = db_last_id();
} else {
@unlink(db_result(db_query("SELECT link FROM images WHERE id=%d", $id)));
}
$fname = $id . "." . fileext($fname);
form_file_uploaded_move("file", "img/" . $fname);
db_query("UPDATE images SET link='img/{$fname}' WHERE id=%d", $id);
redir("admin/images/edit/{$id}");
}
}
if ($act == "add") {
$o = $upload;
return $o;
}
if ($act == "del") {
$im = db_object_get("images", $id);
@unlink("{$im->link}");
}
$o = table_edit("images", "admin/images", $act, $id, "", "", "", "image_func");
if ($act == 'edit') {
$im = db_object_get("images", $id);
$o .= "<img width=100px src={$im->link}><br>{$upload}";
}
return $o;
}
开发者ID:NazarK,项目名称:sqp,代码行数:47,代码来源:images.php
示例6: edit_description
function edit_description($anomaly_id)
{
assert(is_numeric($anomaly_id));
$anomaly = anomaly_get_anomaly($anomaly_id);
print_subtitle("Edit description for " . $anomaly['name']);
echo " <center>\n";
form_start();
echo " <input type=hidden name=aid value=" . encrypt_get_vars($anomaly_id) . ">\n";
echo " <input type=hidden name=cmd value=" . encrypt_get_vars("description2") . ">\n";
echo " <textarea name=ne_description maxlength=255 rows=10 cols=80>";
echo px2html4edit($anomaly['description']);
echo "</textarea>\n";
echo " <input name=submit type=submit value=\"Change Description\">\n";
form_end();
echo " </center>\n";
create_submenu(array("Back to planet view" => "anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($anomaly_id)));
}
开发者ID:jaytaph,项目名称:perihelion-oldcode,代码行数:17,代码来源:anomaly.php
示例7: page_start
function page_start($auto = 0)
{
$o = "";
$memo = db_result(db_query("SELECT memo FROM log WHERE active_check ORDER BY id desc LIMIT 1"));
form_start();
form_input("memo", "memo", $memo);
form_submit("submit", "submit");
$o .= form();
if (form_post("submit") || $auto) {
if ($auto) {
$_REQUEST['memo'] = $memo;
}
db_query("INSERT INTO log (time_time,active_check,memo) \r\n\t VALUES(%d,true,'%s')", time(), form_post("memo"));
$o .= "<br>submitted";
redir("report");
}
return $o;
}
开发者ID:NazarK,项目名称:timedesk,代码行数:18,代码来源:app.php
示例8: enforce_authentication
<?php
require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('New hint');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_hint');
form_textarea('Body');
$opts = db_query_fetch_all('
SELECT
ch.id,
ch.title,
ca.title AS category
FROM challenges AS ch
LEFT JOIN categories AS ca ON ca.id = ch.category
ORDER BY ca.title, ch.title');
form_select($opts, 'Challenge', 'id', array_get($_GET, 'id', 0), 'title', 'category');
form_input_checkbox('Visible');
form_hidden('action', 'new');
form_button_submit('Create hint');
form_end();
foot();
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:23,代码来源:new_hint.php
示例9: db_select_all
<th>Hint</th>
<th>Manage</th>
</tr>
</thead>
<tbody>
';
$hints = db_select_all('hints', array('id', 'added', 'body'), array('challenge' => $_GET['id']));
foreach ($hints as $hint) {
echo '
<tr>
<td>', date_time($hint['added']), '</td>
<td>', htmlspecialchars($hint['body']), '</td>
<td><a href="edit_hint.php?id=', htmlspecialchars(short_description($hint['id'], 100)), '" class="btn btn-xs btn-primary">Edit</a></td>
</tr>
';
}
echo '
</tbody>
</table>
<a href="new_hint.php?id=', htmlspecialchars($_GET['id']), '" class="btn btn-sm btn-warning">Add a new hint</a>
';
section_subhead('Delete challenge: ' . $challenge['title']);
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_challenge');
form_input_checkbox('Delete confirmation');
form_hidden('action', 'delete');
form_hidden('id', $_GET['id']);
message_inline_red('Warning! This will also delete all submissions, all hints and all files associated with challenge!');
form_button_submit('Delete challenge', 'danger');
form_end();
foot();
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:31,代码来源:edit_challenge.php
示例10: enforce_authentication
<?php
require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
validate_id($_GET['id']);
$category = db_select_one('categories', array('*'), array('id' => $_GET['id']));
head('Site management');
menu_management();
section_subhead('Edit category: ' . $category['title']);
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_category');
form_input_text('Title', $category['title']);
form_textarea('Description', $category['description']);
form_input_checkbox('Exposed', $category['exposed']);
form_input_text('Available from', date_time($category['available_from']));
form_input_text('Available until', date_time($category['available_until']));
form_hidden('action', 'edit');
form_hidden('id', $_GET['id']);
form_button_submit('Save changes');
form_end();
section_subhead('Delete category: ' . $category['title']);
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_category');
form_input_checkbox('Delete confirmation');
form_hidden('action', 'delete');
form_hidden('id', $_GET['id']);
message_inline_red('Warning! This will delete all challenges under this category, as well as all submissions, files, and hints related those challenges!');
form_button_submit('Delete category', 'danger');
form_end();
foot();
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:28,代码来源:edit_category.php
示例11: mactrack_site_edit
function mactrack_site_edit()
{
global $fields_mactrack_site_edit;
/* ================= input validation ================= */
get_filter_request_var('site_id');
/* ==================================================== */
display_output_messages();
if (!isempty_request_var('site_id')) {
$site = db_fetch_row('SELECT * FROM mac_track_sites WHERE site_id=' . get_request_var('site_id'));
$header_label = __('MacTrack Site [edit: %s]', $site['site_name']);
} else {
$header_label = __('MacTrack Site [new]');
}
form_start('mactrack_sites.php');
html_start_box($header_label, '100%', '', '3', 'center', '');
draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => inject_form_variables($fields_mactrack_site_edit, isset($site) ? $site : array())));
html_end_box();
form_save_button('mactrack_sites.php', 'return', 'site_id');
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:19,代码来源:mactrack_sites.php
示例12: template
function template()
{
$menu_items = array("remove" => "Remove", "duplicate" => "Duplicate");
$filter_array = array();
/* search field: filter (searches template name) */
if (isset_get_var("search_filter")) {
$filter_array["template_name"] = get_get_var("search_filter");
}
/* get a list of all data templates on this page */
$data_templates = api_data_template_list($filter_array);
/* get a list of data input types for display in the data sources list */
$data_input_types = api_data_source_input_type_list();
form_start("data_templates.php");
$box_id = "1";
html_start_box("<strong>" . _("Data Templates") . "</strong>", "data_templates.php?action=edit");
html_header_checkbox(array(_("Template Name"), _("Data Input Type"), _("Status")), $box_id);
$i = 0;
if (sizeof($data_templates) > 0) {
foreach ($data_templates as $data_template) {
?>
<tr class="item" id="box-<?php
echo $box_id;
?>
-row-<?php
echo $data_template["id"];
?>
" onClick="display_row_select('<?php
echo $box_id;
?>
',document.forms[0],'box-<?php
echo $box_id;
?>
-row-<?php
echo $data_template["id"];
?>
', 'box-<?php
echo $box_id;
?>
-chk-<?php
echo $data_template["id"];
?>
')" onMouseOver="display_row_hover('box-<?php
echo $box_id;
?>
-row-<?php
echo $data_template["id"];
?>
')" onMouseOut="display_row_clear('box-<?php
echo $box_id;
?>
-row-<?php
echo $data_template["id"];
?>
')">
<td class="title">
<a onClick="display_row_block('box-<?php
echo $box_id;
?>
-row-<?php
echo $data_template["id"];
?>
')" href="data_templates.php?action=edit&id=<?php
echo $data_template["id"];
?>
"><span id="box-<?php
echo $box_id;
?>
-text-<?php
echo $data_template["id"];
?>
"><?php
echo html_highlight_words(get_get_var("search_filter"), $data_template["template_name"]);
?>
</span></a>
</td>
<td>
<?php
echo $data_input_types[$data_template["data_input_type"]];
?>
</td>
<td>
<?php
if ($data_template["active"] == "1") {
echo _("Active");
} else {
echo _("Disabled");
}
?>
</td>
<td class="checkbox" align="center">
<input type='checkbox' name='box-<?php
echo $box_id;
?>
-chk-<?php
echo $data_template["id"];
?>
' id='box-<?php
echo $box_id;
?>
-chk-<?php
//.........这里部分代码省略.........
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:data_templates.php
示例13: prefer_ssl
<?php
require '../include/mellivora.inc.php';
prefer_ssl();
head('Two-factor authentication required');
section_head('Two-factor authentication required');
form_start('actions/two_factor_auth');
form_input_text('Code', false, array('autocomplete' => 'off', 'autofocus' => true));
form_hidden('action', 'authenticate');
form_button_submit('Authenticate');
form_end();
foot();
开发者ID:ZlhlmChZ,项目名称:source-code-mell,代码行数:12,代码来源:two_factor_auth.php
示例14: form_stop
form_stop("dodaj");
if (!empty($_POST['hala']) && !empty($_POST['nazwa_pk'])) {
dodaj_polke();
}
break;
case 'dodaj_hale':
form_start("index.php?action=dodaj_hale", "post");
$form = form_admin_doadaj_hale();
form_wyswietl($form);
form_spawdz($form);
form_stop("dodaj");
if (!empty($_POST['nazwa_hala'])) {
dodaj_hale();
}
break;
default:
break;
}
}
} else {
echo '<nav> </nav> <div id="tresc">';
form_start("index.php", "post");
$form = logowanie();
form_wyswietl($form);
form_stop("zaloguj");
}
// form_start("index.php?action=szukaj","post");
// $form=form_admin_doadaj_uzytkownika();
// form_wyswietl($form);
// form_stop("dodaj");
szablon_bottom();
开发者ID:symbolink,项目名称:aplikacje-internetowe,代码行数:31,代码来源:index.php
示例15: mactrack_snmp_edit
function mactrack_snmp_edit()
{
global $config, $fields_mactrack_snmp_edit;
include_once $config['base_path'] . '/plugins/mactrack/lib/mactrack_functions.php';
/* ================= input validation ================= */
get_filter_request_var('id');
get_filter_request_var('page');
/* ==================================================== */
/* clean up rule name */
if (isset_request_var('name')) {
set_request_var('name', sanitize_search_string(get_request_var('name')));
}
/* remember these search fields in session vars so we don't have to keep passing them around */
load_current_session_value('page', 'sess_mactrack_edit_current_page', '1');
load_current_session_value('rows', 'sess_default_rows', read_config_option('num_rows_table'));
/* display the mactrack snmp option set */
$snmp_group = array();
if (!isempty_request_var('id')) {
$snmp_group = db_fetch_row_prepared('SELECT * FROM mac_track_snmp where id = ?', array(get_request_var('id')));
$header_label = __('SNMP Option Set [edit: %s]', $snmp_group['name']);
} else {
$header_label = __('SNMP Option Set [new]');
}
form_start('mactrack_snmp.php', 'mactrack_snmp_group');
html_start_box($header_label, '100%', '', '3', 'center', '');
draw_edit_form(array('config' => array('no_form_tag' => true), 'fields' => inject_form_variables($fields_mactrack_snmp_edit, $snmp_group)));
html_end_box();
form_hidden_box('id', isset_request_var('id') ? get_request_var('id') : '0', '');
form_hidden_box('save_component_mactrack_snmp', '1', '');
if (!isempty_request_var('id')) {
$items = db_fetch_assoc_prepared('SELECT * FROM mac_track_snmp_items WHERE snmp_id= ? ORDER BY sequence', array(get_request_var('id')));
html_start_box(__('Mactrack SNMP Options'), '100%', '', '3', 'center', 'mactrack_snmp.php?action=item_edit&id=' . get_request_var('id'));
print "<tr class='tableHeader'>";
DrawMatrixHeaderItem(__('Item'), '', 1);
DrawMatrixHeaderItem(__('Version'), '', 1);
DrawMatrixHeaderItem(__('Community'), '', 1);
DrawMatrixHeaderItem(__('Port'), '', 1);
DrawMatrixHeaderItem(__('Timeout'), '', 1);
DrawMatrixHeaderItem(__('Retries'), '', 1);
DrawMatrixHeaderItem(__('Max OIDs'), '', 1);
DrawMatrixHeaderItem(__('Username'), '', 1);
DrawMatrixHeaderItem(__('Auth Proto'), '', 1);
DrawMatrixHeaderItem(__('Priv Proto'), '', 1);
DrawMatrixHeaderItem(__('Actions'), '', 1);
print '</tr>';
$i = 1;
if (sizeof($items)) {
foreach ($items as $item) {
form_alternate_row();
$form_data = '<td><a class="linkEditMain" href="' . htmlspecialchars('mactrack_snmp.php?action=item_edit&item_id=' . $item['id'] . '&id=' . $item['snmp_id']) . '">Item#' . $i . '</a></td>';
$form_data .= '<td>' . $item['snmp_version'] . '</td>';
$form_data .= '<td>' . ($item['snmp_version'] == 3 ? __('N/A') : $item['snmp_readstring']) . '</td>';
$form_data .= '<td>' . $item['snmp_port'] . '</td>';
$form_data .= '<td>' . $item['snmp_timeout'] . '</td>';
$form_data .= '<td>' . $item['snmp_retries'] . '</td>';
$form_data .= '<td>' . $item['max_oids'] . '</td>';
$form_data .= '<td>' . ($item['snmp_version'] == 3 ? $item['snmp_username'] : __('N/A')) . '</td>';
$form_data .= '<td>' . ($item['snmp_version'] == 3 ? $item['snmp_auth_protocol'] : __('N/A')) . '</td>';
$form_data .= '<td>' . ($item['snmp_version'] == 3 ? $item['snmp_priv_protocol'] : __('N/A')) . '</td>';
$form_data .= '<td class="right">' . ($i < sizeof($items) ? '<a class="remover fa fa-caret-down moveArrow" href="' . htmlspecialchars($config['url_path'] . 'plugins/mactrack/mactrack_snmp.php?action=item_movedown&item_id=' . $item["id"] . '&id=' . $item["snmp_id"]) . '"></a>' : '<span class="moveArrowNone"></span>') . ($i > 1 ? '<a class="remover fa fa-caret-up moveArrow" href="' . htmlspecialchars($config['url_path'] . 'plugins/mactrack/mactrack_snmp.php?action=item_moveup&item_id=' . $item["id"] . '&id=' . $item["snmp_id"]) . '"></a>' : '<span class="moveArrowNone"></span>');
$form_data .= '<a class="delete deleteMarker fa fa-remove" href="' . htmlspecialchars($config['url_path'] . 'plugins/mactrack/mactrack_snmp.php?action=item_remove&item_id=' . $item["id"] . '&id=' . $item["snmp_id"]) . '"></a>' . '</td></tr>';
print $form_data;
$i++;
}
} else {
print '<tr><td colspan="5"><em>' . __('No SNMP Items') . '</em></td></tr>';
}
html_end_box();
}
form_save_button('mactrack_snmp.php');
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:71,代码来源:mactrack_snmp.php
示例16: webseer_urls
//.........这里部分代码省略.........
</td>
<td>
<label for='associated'><?php
print __('Associated');
?>
</label>
</td>
<td>
<input type='button' value='<?php
print __('Go');
?>
' onClick='applyFilter()' title='<?php
print __('Set/Refresh Filters');
?>
'>
</td>
<td>
<input type='button' name='clear' value='<?php
print __('Clear');
?>
' onClick='clearFilter()' title='<?php
print __('Clear Filters');
?>
'>
</td>
</tr>
</table>
<input type='hidden' name='page' value='<?php
print get_request_var('page');
?>
'>
<input type='hidden' name='id' value='<?php
print get_request_var('id');
?>
'>
</form>
</td>
</tr>
<?php
html_end_box();
/* form the 'where' clause for our main sql query */
if (strlen(get_request_var('filter'))) {
$sql_where = "WHERE ((u.url LIKE '%" . get_request_var('filter') . "%') \n\t\t\tOR (u.display_name LIKE '%" . get_request_var('filter') . "%') \n\t\t\tOR (u.ip LIKE '%" . get_request_var('filter') . "%'))";
} else {
$sql_where = '';
}
if (get_request_var('associated') == 'false') {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' (pmh.type=2 OR pmh.type IS NULL)';
} else {
$sql_where .= (strlen($sql_where) ? ' AND ' : 'WHERE ') . ' pmh.type=2 AND pmh.schedule=' . get_request_var('id');
}
$total_rows = db_fetch_cell("SELECT\n\t\tCOUNT(*)\n\t\tFROM plugin_webseer_urls AS u\n\t\tLEFT JOIN plugin_maint_hosts AS pmh\n\t\tON u.id=pmh.host\n\t\t{$sql_where}");
$sql_query = "SELECT u.*, pmh.host AS associated, pmh.type AS maint_type\n\t\tFROM plugin_webseer_urls AS u\n\t\tLEFT JOIN plugin_maint_hosts AS pmh\n\t\tON u.id=pmh.host\n\t\t{$sql_where} \n\t\tLIMIT " . $rows * (get_request_var('page') - 1) . ',' . $rows;
$urls = db_fetch_assoc($sql_query);
$nav = html_nav_bar('notify_lists.php?action=edit&id=' . get_request_var('id'), MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 13, __('Lists'), 'page', 'main');
form_start('maint.php', 'chk');
print $nav;
html_start_box('', '100%', '', '3', 'center', '');
$display_text = array(__('Description'), __('ID'), __('Associated Schedules'), __('Enabled'), __('Hostname'), __('URL'));
html_header_checkbox($display_text);
if (sizeof($urls)) {
foreach ($urls as $url) {
form_alternate_row('line' . $url['id']);
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($url['display_name'])) : htmlspecialchars($url['display_name']), $url['id'], 250);
form_selectable_cell(round($url['id'], 2), $url['id']);
if ($url['associated'] != '' && $url['maint_type'] == '2') {
form_selectable_cell('<span class="deviceUp">' . __('Current Schedule') . '</span>', $url['id']);
} else {
if (sizeof($lists = db_fetch_assoc('SELECT name FROM plugin_maint_schedules INNER JOIN plugin_maint_hosts ON plugin_maint_schedules.id=plugin_maint_hosts.schedule WHERE type=2 AND host=' . $url['id']))) {
$names = '';
foreach ($lists['name'] as $name) {
$names .= (strlen($names) ? ', ' : '') . "<span class='deviceRecovering'>{$name}</span>";
}
form_selectable_cell($names, $url['id']);
} else {
form_selectable_cell('<span class="deviceUnknown">' . __('No Schedules') . '</span>', $url['id']);
}
}
form_selectable_cell($url['enabled'] == 'on' ? __('Enabled') : __('Disabled'), $url['id']);
if (empty($url['ip'])) {
$url['ip'] = __('USING DNS');
}
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", '<i>' . htmlspecialchars($url['ip'])) . '</i>' : '<i>' . htmlspecialchars($url['ip']) . '</i>', $url['id']);
form_selectable_cell(strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "<span class='filteredValue'>\\1</span>", htmlspecialchars($url['url'])) : htmlspecialchars($url['url']), $url['id']);
form_checkbox_cell($url['display_name'], $url['id']);
form_end_row();
}
} else {
print "<tr><td><em>" . __('No Associated WebSeer URL\'s Found') . "</em></td></tr>";
}
html_end_box(false);
if (sizeof($urls)) {
print $nav;
}
form_hidden_box('id', get_request_var('id'), '');
form_hidden_box('save_webseer', '1', '');
/* draw the dropdown containing a list of available actions for this form */
draw_actions_dropdown($assoc_actions);
form_end();
}
开发者ID:Cacti,项目名称:plugin_maint,代码行数:101,代码来源:maint.php
示例17: item_edit
function item_edit()
{
global $colors;
if (!empty($_GET["id"])) {
$graph_template_item = db_fetch_row("select * from graph_template_item where id=" . $_GET["id"]);
}
/* by default, select the LAST DS chosen to make everyone's lives easier */
$default = db_fetch_row("select data_template_item_id from graph_template_item where graph_template_id=" . $_GET["graph_template_id"] . " order by sequence DESC");
if (sizeof($default) > 0) {
$graph_template_item["data_template_item_id"] = $default["data_template_item_id"];
} else {
$graph_template_item["data_template_item_id"] = 0;
}
form_start("graph_templates_items.php", "form_graph_template");
/* ==================== Box: Graph Item ==================== */
html_start_box("<strong>" . _("Graph Item") . "</strong> [" . _("Graph Template: ") . db_fetch_cell("select template_name from graph_template where id=" . $_GET["graph_template_id"]) . "]", "98%", $colors["header_background"], "3", "center", "");
_graph_item_field__data_template_item_id("data_template_item_id", isset($graph_template_item["data_template_item_id"]) ? $graph_template_item["data_template_item_id"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
_graph_item_field__color("color", isset($graph_template_item["color"]) ? $graph_template_item["color"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
_graph_item_field__graph_item_type("graph_item_type", isset($graph_template_item["graph_item_type"]) ? $graph_template_item["graph_item_type"] : "", empty($_GET["id"]) ? 0 : $_GET["id"]);
_graph_item_field__consolidation_function("consolidation_function", isset($graph_template_item["consolidation_function"]) ? $graph_template_item["consolidation_function"] : "",
|
请发表评论