本文整理汇总了PHP中print_message函数的典型用法代码示例。如果您正苦于以下问题:PHP print_message函数的具体用法?PHP print_message怎么用?PHP print_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
}
}
示例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;
}
示例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";
}
}
}
}
}
}
示例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;
}
示例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();
}
}
}
}
示例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;
}
示例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();
}
示例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";
}
示例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);
}
示例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
}
}
示例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
示例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;
}
示例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
示例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
}
示例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);