本文整理汇总了PHP中print_message函数的典型用法代码示例。如果您正苦于以下问题:PHP print_message函数的具体用法?PHP print_message怎么用?PHP print_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: printView
function printView()
{
if ($this->_roster_view) {
$end_date = NULL;
if (!empty($_REQUEST['weeks'])) {
$end_date = date('Y-m-d', strtotime('+' . ((int) $_REQUEST['weeks'] * 7 + 1) . ' days'));
}
$this->_roster_view->printView(NULL, $end_date, FALSE, TRUE);
} else {
if (defined('PUBLIC_ROSTER_SECRET') && strlen(PUBLIC_ROSTER_SECRET) && array_get($_REQUEST, 'secret') != PUBLIC_ROSTER_SECRET) {
print_message("Please contact your church administrator to get the private URLs for viewing rosters");
exit;
} else {
?>
<ul>
<?php
$views = $GLOBALS['system']->getDBObjectData('roster_view', array('is_public' => TRUE), 'AND', 'name');
foreach ($views as $id => $detail) {
?>
<li><a href="<?php
echo build_url(array('roster_view' => $id));
?>
"><?php
echo ents($detail['name']);
?>
</a></li>
<?php
}
?>
</ul>
<?php
}
}
}
开发者ID:vanoudt,项目名称:jethro-pmm,代码行数:34,代码来源:view_2_display_roster.class.php
示例2: dbQuery
function dbQuery($sql, $parameters = array())
{
global $fullSql, $debug;
$fullSql = dbMakeQuery($sql, $parameters);
if ($debug) {
if ($GLOBALS['cli']) {
print_message("\nSQL[%y" . $fullSql . "%n] ", 'color');
} else {
print_sql($fullSql);
}
}
if ($GLOBALS['config']['profile_sql']) {
$time_start = microtime(true);
}
$result = mysql_query($fullSql);
// sets $this->result
if ($GLOBALS['config']['profile_sql']) {
$time_end = microtime(true);
#fwrite($this->logFile, date('Y-m-d H:i:s') . "\n" . $fullSql . "\n" . number_format($time_end - $time_start, 8) . " seconds\n\n");
$GLOBALS['sql_profile'][] = array('sql' => $fullSql, 'time' => number_format($time_end - $time_start, 8));
}
if ($result === false && error_reporting() & 1) {
// aye. this gets triggers on duplicate Contact insert
//trigger_error('QDB - Error in query: ' . $fullSql . ' : ' . mysql_error(), E_USER_WARNING);
}
return $result;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:27,代码来源:dbFacile.php
示例3: discover_new_device_ip
function discover_new_device_ip($host)
{
global $config;
if (match_network($config['autodiscovery']['ip_nets'], $host)) {
if (isPingable($host)) {
echo "Pingable ";
foreach ($config['snmp']['community'] as $community) {
$device = deviceArray($host, $community, "v2c", "161", "udp", NULL);
print_message("Trying community {$community} ...");
if (isSNMPable($device)) {
echo "SNMPable ";
$snmphost = snmp_get($device, "sysName.0", "-Oqv", "SNMPv2-MIB");
if (dbFetchCell("SELECT COUNT(device_id) FROM devices WHERE sysName = ?", array($snmphost)) == '0') {
$device_id = createHost($snmphost, $community, "v2c", "161", "udp");
$device = device_by_id_cache($device_id, 1);
array_push($GLOBALS['devices'], $device);
return $device_id;
} else {
echo "Already have host with sysName {$snmphost}\n";
}
}
}
}
}
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:25,代码来源:functions.inc.php
示例4: get_constituency_object
function get_constituency_object($constituency_name)
{
$cosntituency = factory::create('constituency');
$search = factory::create('search');
$results = $search->search('constituency', array(array("name", "=", $constituency_name)));
print_message($constituency_name);
if (count($results) == 1) {
$cosntituency = $results[0];
}
return $cosntituency;
}
开发者ID:schlos,项目名称:electionleaflets,代码行数:11,代码来源:load_uk_constituencies.php
示例5: printView
public function printView()
{
$this->_printParams();
if (!empty($_REQUEST['params_submitted'])) {
if (empty($this->cohortids)) {
print_message("Please choose a congregation or group", 'error');
} else {
if ($this->format == 'sequential') {
$this->_printResultsSequential();
} else {
$this->_printResultsTabular();
}
}
}
}
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:15,代码来源:view_6_attendance__2_display.class.php
示例6: dbQuery
function dbQuery($sql, $parameters = array())
{
global $fullSql;
$fullSql = dbMakeQuery($sql, $parameters);
if (OBS_DEBUG) {
// Pre query debug output
if (is_cli()) {
print_message(PHP_EOL . 'SQL[%y' . $fullSql . '%n]', 'console', FALSE);
} else {
print_sql($fullSql);
}
}
if (OBS_DEBUG || $GLOBALS['config']['profile_sql']) {
$time_start = microtime(true);
}
$result = mysql_query($fullSql);
// sets $this->result
if (OBS_DEBUG || $GLOBALS['config']['profile_sql']) {
$runtime = number_format(microtime(true) - $time_start, 8);
$debug_msg .= 'RUNTIME[' . ($runtime > 0.05 ? '%r' : '%g') . $runtime . 's%n]';
if ($GLOBALS['config']['profile_sql']) {
#fwrite($this->logFile, date('Y-m-d H:i:s') . "\n" . $fullSql . "\n" . number_format($time_end - $time_start, 8) . " seconds\n\n");
$GLOBALS['sql_profile'][] = array('sql' => $fullSql, 'time' => $runtime);
}
}
if (OBS_DEBUG) {
if ($result === FALSE && error_reporting() & 1) {
// aye. this gets triggers on duplicate Contact insert
//trigger_error('QDB - Error in query: ' . $fullSql . ' : ' . mysql_error(), E_USER_WARNING);
$error_msg = 'Error in query: (' . mysql_errno() . ') ' . mysql_error();
$debug_msg .= PHP_EOL . 'ERROR[%r' . $error_msg . '%n]';
}
if (is_cli()) {
if (OBS_DEBUG > 1) {
$rows = mysql_affected_rows();
$debug_msg = 'ROWS[' . ($rows < 1 ? '%r' : '%g') . $rows . '%n]' . PHP_EOL . $debug_msg;
}
// After query debug output for cli
print_message($debug_msg, 'console', FALSE);
} else {
print_error($error_msg);
}
}
return $result;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:45,代码来源:dbFacile.php
示例7: printView
function printView()
{
if (!empty($_REQUEST['go'])) {
if (!empty($_REQUEST['groupid'])) {
?>
<a class="pull-right" href="<?php
echo build_url(array('call' => 'contact_list', 'view' => NULL));
?>
">Download HTML file</a>
<?php
$this->printResults();
return;
} else {
print_message("You must choose an opt-in group", 'error');
}
}
$this->printForm();
}
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:18,代码来源:view_2_families__4_contact_list.class.php
示例8: search_whois
function search_whois($query)
{
if (eregi(".com\$", $query) || eregi(".net\$", $query) || eregi(".org\$", $query)) {
$server = $GLOBALS[whois_server1];
} else {
$server = $GLOBALS[whois_server2];
}
$fp = fsockopen($server, 43, &$errno, &$errstr);
if (!$fp) {
print_message("WHOIS 서버에 접속할수가 없습니다. 잠시후 다시 시도하세요");
return;
}
set_socket_blocking($fp, 1);
fputs($fp, "{$query}\n");
while ($buf = fgets($fp, 255)) {
$result .= $buf;
}
fclose($fp);
echo "\n<table cellspacing=0 width=600>\n<tr bgcolor=#eaeaea><td height=30><font size=3><b> 검색결과 - \n <a href=\"http://{$query}\" target=_new>{$query}</a></b></font></td></tr>\n<tr><td><br>\n\t<pre>{$result}</pre>\n </td>\n</tr>\n</table> \t\n";
}
开发者ID:puchon,项目名称:php4-book,代码行数:20,代码来源:whois.php
示例9: printView
function printView()
{
if ($this->stateMessage !== TRUE) {
print_message($this->stateMessage, 'failure');
return;
}
if (defined('MEMBER_DIRECTORY_HEADER')) {
echo MEMBER_DIRECTORY_HEADER;
}
require_once 'views/view_2_families__4_contact_list.class.php';
$GLOBALS['system']->includeDBClass('person');
$dummy = new Person();
$view = new View_Families__Contact_List();
$_REQUEST['groupid'] = MEMBER_DIRECTORY_GROUPID;
$_REQUEST['all_member_details'] = FALSE;
$_REQUEST['age_bracket'] = array(0);
$_REQUEST['include_address'] = 1;
$_REQUEST['congregationid'] = array($_REQUEST['congregationid']);
$view->processView();
$view->printResults(true);
}
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:21,代码来源:view_0_directory.class.php
示例10: printView
function printView()
{
if (!$this->canEdit()) {
print_message("Sorry, only adults are able to edit this family.", 'error');
return;
}
$ok = $this->family->acquireLock();
foreach ($this->persons as $p) {
$ok = $ok && $p->acquireLock();
}
if (!$ok) {
print_message("Your family cannot be edited right now. Please try later", 'error');
} else {
if (defined('MEMBER_REGO_HELP_EMAIL')) {
?>
<p><i>If you need to change names or other details which are not listed in this form, please contact <a href="mailto:<?php
echo ents(MEMBER_REGO_HELP_EMAIL);
?>
"><?php
echo ents(MEMBER_REGO_HELP_EMAIL);
?>
</a>.</i></p>
<?php
}
?>
<form method="post">
<h3>Family Details</h3>
<?php
$this->family->printForm('family', array('address_street', 'address_suburb', 'address_postcode', 'home_tel'));
foreach ($this->persons as $person) {
echo '<h3>' . $person->getValue('first_name') . ' ' . $person->getValue('last_name') . '</h3>';
$person->printForm('person_' . $person->id, array('gender', 'age_bracket', 'email', 'mobile_tel', 'work_tel'));
}
?>
<button class="btn" type="submit">Save</button>
<a class="btn" href="?">Cancel</a>
</form>
<?php
}
}
开发者ID:brightmore,项目名称:jethro-pmm,代码行数:40,代码来源:view_0_edit_me.class.php
示例11: print_html_body_begin
function print_html_body_begin($parameters=null){
global $config, $sess, $auth, $errors, $message;
if (!$parameters) $parameters=null;
// call user defined function at html body begin
if (isset($parameters['run_at_html_body_begin']) and function_exists($parameters['run_at_html_body_begin']))
$parameters['run_at_html_body_begin']($parameters);
//virtual(multidomain_get_file($config->html_prolog));
if (isset($parameters['title']) and $parameters['title']) echo $parameters['title'];
//virtual(multidomain_get_file($config->html_separator));
?>
<?if (isset($parameters['tab_collection']) and $parameters['tab_collection']) {
print_tabs($parameters['tab_collection'],
isset($parameters['path_to_pages'])?$parameters['path_to_pages']:null,
isset($parameters['selected_tab'])?$parameters['selected_tab']:null);
//count tabs
$num_of_tabs=0;
foreach($parameters['tab_collection'] as $tab)
if ($tab->enabled) $num_of_tabs++;
?>
<div id="swContent">
<!-- contenet of div must be sufficient wide in order to tabs displays in one line -->
<div style="height:1px; width:<?echo ($num_of_tabs*100)- 50;?>px;"> </div>
<?}?>
<?
print_errors($errors); // Display error
print_message($message);
if ($errors or $message) echo "<br />";
} //end function print_html_body_begin
开发者ID:BackupTheBerlios,项目名称:sipums,代码行数:39,代码来源:page.php
示例12: check_passwd
function check_passwd($db, $idx, $rn, $passwd)
{
/* 데이타 확인 */
$dbh = dbconnect();
$table_name = "bbs_" . $db;
$query = "select idx,replynum,passwd from {$table_name} where idx={$idx} and replynum={$rn}";
$sth = dbquery($dbh, $query);
if (!$sth) {
print_message(mysql_error());
}
list($c_idx, $c_replynum, $c_passwd) = dbselect($sth);
dbclose($dbh);
/* 존재하지 않을때 */
if (!$c_idx) {
return -1;
}
/* 비밀번호 확인 */
if ($passwd == $admin_passwd || $passwd == $c_passwd) {
return 1;
}
return 0;
}
开发者ID:puchon,项目名称:php4-book,代码行数:22,代码来源:bbs-lib.php
示例13: print_debug
}
}
print_debug("Timing housekeeping: deleted {$rows} entries (per-device)");
logfile("housekeeping.log", "Timing: deleted {$rows} entries older than " . format_unixtime($cutoff) . " (per-device)");
$rows = dbDelete('perf_times', $where);
if ($rows === FALSE) {
// Use LIMIT with big tables
print_debug("Performance table (per-run) is too big, using LIMIT for delete entries");
$rows = 0;
$i = 1000;
while ($i && $rows < $count_run) {
$iter = dbDelete('perf_times', $where . ' LIMIT 1000000');
if ($iter === FALSE) {
break;
}
$rows += $iter;
$i--;
}
}
print_debug("Timing housekeeping: deleted {$rows} entries (per-run)");
logfile("housekeeping.log", "Timing: deleted {$rows} entries older than " . format_unixtime($cutoff) . " (per-run)");
}
} else {
if ($prompt) {
print_message("No perfomance entries found older than " . format_unixtime($cutoff));
}
}
} else {
print_message("Timing housekeeping disabled in configuration or less than 24h.");
}
// EOF
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:timing.inc.php
示例14: _printParamsForm
function _printParamsForm()
{
$congs = $GLOBALS['system']->getDBObjectData('congregation', array('!meeting_time' => ''), 'OR', 'meeting_time');
if (empty($congs)) {
print_message("To edit services you must first go to admin > congregations and set the 'code name' for the relevant congregations", 'failure');
return;
}
?>
<form method="get" class="well well-small">
<input type="hidden" name="view" value="<?php
echo ents($_REQUEST['view']);
?>
" />
<?php
if ($GLOBALS['user_system']->havePerm(PERM_BULKSERVICE)) {
?>
<select name="editing">
<option value="0">View</option>
<option value="1" <?php
if ($this->_editing) {
echo 'selected="selected"';
}
?>
>Edit</option>
</select>
<b>the service program</b>
<?php
}
?>
<table>
<tr>
<td rowspan="3" class="nowrap" style="padding-right: 2ex">
<b>For congregations</b><br />
<?php
foreach ($congs as $id => $details) {
?>
<label class="checkbox">
<input type="checkbox" name="congregations[]"
<?php
if (in_array($id, $this->_congregations)) {
echo 'checked="checked" ';
}
?>
value="<?php
echo $id;
?>
" id="congregations_<?php
echo $id;
?>
" />
<?php
echo ents($details['name']);
?>
</label>
<?php
}
?>
</td>
<td><b>from</b> </td>
<td class="nowrap"><?php
print_widget('start_date', array('type' => 'date'), $this->_start_date);
?>
</td>
</tr>
<tr>
<td><b>to</b></td>
<td class="nowrap">
<?php
print_widget('end_date', array('type' => 'date'), $this->_end_date);
?>
<button type="submit" class="btn">Go</button>
</td>
</tr>
</table>
</form>
<?php
}
开发者ID:samrae,项目名称:jethro-pmm,代码行数:78,代码来源:view_8_services__1_service_program.class.php
示例15: FROM
// FIXME
$query = 'SELECT `device_id` FROM (SELECT @rownum :=0) r,
(
SELECT @rownum := @rownum +1 AS rownum, `device_id`
FROM `devices`
WHERE `disabled` = 0
ORDER BY `device_id` ASC
) temp
WHERE MOD(temp.rownum, ' . $options['i'] . ') = ?;';
$doing = $options['n'] . "/" . $options['i'];
$params[] = $options['n'];
//print_vars($query);
//print_vars($params);
}
if (!$where) {
print_message("%n\nUSAGE:\n{$scriptname} [-drqV] [-i instances] [-n number] [-m module] [-h device]\n\nEXAMPLE:\n-h <device id> | <device hostname wildcard> Poll single device\n-h odd Poll odd numbered devices (same as -i 2 -n 0)\n-h even Poll even numbered devices (same as -i 2 -n 1)\n-h all Poll all devices\n-h new Poll all devices that have not had a discovery run before\n\n-i <instances> -n <id/number> Poll as instance <id/number> of <instances>\n Instance numbers start at 0. 0-3 for -i 4\n Example:\n -i 4 -n 0\n -i 4 -n 1\n -i 4 -n 2\n -i 4 -n 3\n\nOPTIONS:\n -h Device hostname, id or key odd/even/all/new.\n -i Poll instances count.\n -n Instance id (number), must start from 0 and to be less than instances count.\n -q Quiet output.\n -M Show globally enabled/disabled modules and exit.\n -V Show version and exit.\n\nDEBUGGING OPTIONS:\n -r Do not create or update RRDs\n -d Enable debugging output.\n -dd More verbose debugging output.\n -m Specify module(s) (separated by commas) to be run.\n\n%rInvalid arguments!%n", 'color', FALSE);
exit;
}
if (isset($options['r'])) {
$config['norrd'] = TRUE;
}
$cache['maint'] = cache_alert_maintenance();
rrdtool_pipe_open($rrd_process, $rrd_pipes);
print_cli_heading("%WStarting polling run at " . date("Y-m-d H:i:s"), 0);
$polled_devices = 0;
if (!isset($query)) {
$query = "SELECT `device_id` FROM `devices` WHERE `disabled` = 0 {$where} ORDER BY `device_id` ASC";
}
foreach (dbFetch($query, $params) as $device) {
$device = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($device['device_id']));
poll_device($device, $options);
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:poller.php
示例16: print_debug
}
}
print_debug("{$uptime_msg} ({$uptime} seconds)");
if (is_numeric($uptime)) {
// Notify only if current uptime less than one month (eg if changed from sysUpTime to snmpEngineTime)
if ($uptime < $device['uptime'] && $uptime < 2628000) {
notify($device, "Device rebooted: " . $device['hostname'], "Device Rebooted : " . $device['hostname'] . " " . formatUptime($uptime) . " ago.");
log_event('Device rebooted after ' . formatUptime($device['uptime']), $device, 'reboot', $device['uptime']);
}
$uptime_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd";
if (!is_file($uptime_rrd)) {
rrdtool_create($uptime_rrd, "DS:uptime:GAUGE:600:0:U ");
}
rrdtool_update($uptime_rrd, "N:" . $uptime);
$graphs['uptime'] = TRUE;
print_message("Uptime: " . formatUptime($uptime));
$update_array['uptime'] = $uptime;
$cache['devices']['uptime'][$device['device_id']]['uptime'] = $uptime;
$cache['devices']['uptime'][$device['device_id']]['polled'] = $polled;
}
$poll_device['sysLocation'] = str_replace("\"", "", $poll_device['sysLocation']);
// Rewrite sysLocation if there is a mapping array (database too?)
if (!empty($poll_device['sysLocation'])) {
$poll_device['sysLocation'] = rewrite_location($poll_device['sysLocation']);
}
$poll_device['sysContact'] = str_replace("\"", "", $poll_device['sysContact']);
if ($poll_device['sysLocation'] == "not set") {
$poll_device['sysLocation'] = "";
}
if ($poll_device['sysContact'] == "not set") {
$poll_device['sysContact'] = "";
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:system.inc.php
示例17: detect_device_snmpauth
function detect_device_snmpauth($hostname, $snmp_port = 161, $snmp_transport = 'udp', $detect_ip_version = FALSE)
{
global $config;
// Additional checks for IP version
if ($detect_ip_version) {
$ip_version = get_ip_version($hostname);
if (!$ip_version) {
$ip = gethostbyname6($hostname);
$ip_version = get_ip_version($ip);
}
// Detect snmp transport
if (stripos($snmp_transport, 'tcp') !== FALSE) {
$snmp_transport = $ip_version == 4 ? 'tcp' : 'tcp6';
} else {
$snmp_transport = $ip_version == 4 ? 'udp' : 'udp6';
}
}
// Detect snmp port
if (!is_numeric($snmp_port) || $snmp_port < 1 || $snmp_port > 65535) {
$snmp_port = 161;
} else {
$snmp_port = (int) $snmp_port;
}
// Here set default snmp version order
$i = 1;
$snmp_version_order = array();
foreach (array('v2c', 'v3', 'v1') as $tmp_version) {
if ($config['snmp']['version'] == $tmp_version) {
$snmp_version_order[0] = $tmp_version;
} else {
$snmp_version_order[$i] = $tmp_version;
}
$i++;
}
ksort($snmp_version_order);
foreach ($snmp_version_order as $snmp_version) {
if ($snmp_version === 'v3') {
// Try each set of parameters from config
foreach ($config['snmp']['v3'] as $snmp_v3) {
$device = build_initial_device_array($hostname, NULL, $snmp_version, $snmp_port, $snmp_transport, $snmp_v3);
print_message("Trying v3 parameters " . $device['snmp_authname'] . "/" . $device['snmp_authlevel'] . " ... ");
if (isSNMPable($device)) {
return $device;
} else {
print_warning("证书无应答 " . $device['snmp_authname'] . "/" . $device['snmp_authlevel'] . " using {$snmp_version}.");
}
}
} else {
// if ($snmp_version === "v2c" || $snmp_version === "v1")
// Try each community from config
foreach ($config['snmp']['community'] as $snmp_community) {
$device = build_initial_device_array($hostname, $snmp_community, $snmp_version, $snmp_port, $snmp_transport);
print_message("尝试 {$snmp_version} community {$snmp_community} ...");
if (isSNMPable($device)) {
return $device;
} else {
print_warning("Community无应答 {$snmp_community} 使用 {$snmp_version}.");
}
}
}
}
return FALSE;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:63,代码来源:functions.inc.php
示例18: header
2001.06 by Jungjoon Oh
*/
require "db-lib.php";
require "poll-lib.php";
if (!is_admin($PHP_AUTH_USER, $PHP_AUTH_PW)) {
header("Location: {$URL['login']}?url={$URL['new']}");
exit;
}
if ($m == 'register') {
/* Query 생성 */
$query = "insert into poll_data " . "(question,sdate,status,answer_no," . "answer1,answer2,answer3,answer4,answer5," . "answer6,answer7,answer8,answer9,answer10) values " . "('{$question}',now(),'1',{$answer_no}," . "'{$answer1}','{$answer2}','{$answer3}','{$answer4}','{$answer5}'," . "'{$answer6}','{$answer7}','{$answer8}','{$answer9}','{$answer10}')";
$dbh = dbconnect();
$sth = dbquery($dbh, $query);
if (!$sth) {
$msg = "에러가 발생하였습니다.<br><br>\n" . mysql_error();
print_message($msg);
} else {
print_alert("등록이 완료되었습니다. ", "url|{$URL['list']}");
}
} else {
new_form();
}
exit;
function new_form()
{
global $URL;
print_header();
?>
<script language="JavaScript">
<!--
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:new.php
示例19: dbDelete
$updated += dbDelete('applications', '`device_id` = ? AND `app_type` NOT IN (' . implode(',', $replace) . ')', $param);
} else {
$updated += dbDelete('applications', '`device_id` = ?', array($param));
}
foreach (dbFetchRows('SELECT `app_type` FROM `applications` WHERE `device_id` = ?', array($device['device_id'])) as $row) {
$app_in_db[] = $row['app_type'];
}
foreach ($enabled as $app) {
if (!in_array($app, $app_in_db)) {
$updated += dbInsert(array('device_id' => $device['device_id'], 'app_type' => $app), 'applications');
}
}
if ($updated) {
print_message('Applications updated!');
} else {
print_message('No changes.');
}
}
//end if
// Show list of apps with checkboxes
echo '<div style="padding: 10px;">';
$apps_enabled = dbFetchRows('SELECT * from `applications` WHERE `device_id` = ? ORDER BY app_type', array($device['device_id']));
if (count($apps_enabled)) {
foreach ($apps_enabled as $application) {
$app_enabled[] = $application['app_type'];
}
}
echo "<div class='row'>\n <div class='col-md-4'>\n <form id='appedit' name='appedit' method='post' action='' role='form' class='form-horizontal'>\n <input type=hidden name=device value='" . $device['device_id'] . "'>\n <table class='table table-hover table-responsive'>\n <tr align=center>\n <th>Enable</th>\n <th>Application</th>\n </tr>\n ";
$row = 1;
foreach ($applications as $app) {
if (is_integer($row / 2)) {
开发者ID:n-st,项目名称:librenms,代码行数:31,代码来源:apps.inc.php
示例20: print_message
<?php
/**
* Observium Network Management and Monitoring System
* Copyright (C) 2006-2014, Adam Armstrong - http://www.observium.org
*
* @package observium
* @subpackage webui
* @author Adam Armstrong <[email protected]>
* @copyright (C) 2006-2014 Adam Armstrong
*
*/
print_message("This page allows you to disable or enable certain Graphs detected for a device.");
$graphs_db = array();
foreach (dbFetchRows("SELECT `graph`,`enabled` FROM `device_graphs` WHERE `device_id` = ?", array($device['device_id'])) as $entry) {
$graph = $entry['graph'];
$section = $config['graph_types']['device'][$graph]['section'];
$graphs_db[$graph] = (bool) $entry['enabled'];
// Another array sorted by sections
$graphs_sections[$section][$graph] = (bool) $entry['enabled'];
}
$graph = $_POST['toggle_graph'];
if ($graph && isset($graphs_db[$graph]) && !in_array($config['graph_types']['device'][$graph]['section'], array('poller', 'system'))) {
$value = (int) (!$graphs_db[$graph]);
// Toggle current 'enabled' value
$updated = dbUpdate(array('enabled' => $value), 'device_graphs', '`device_id` = ? AND `graph` = ?', array($device['device_id'], $graph));
if ($updated) {
print_success("Graph '{$graph}' " . ($value ? 'enabled' : 'disabled') . '.');
$graphs_sections[$config['graph_types']['device'][$graph]['section']][$graph] = (bool) $value;
}
}
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:graphs.inc.php
注:本文中的print_message函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论