Esempio n. 1
0
/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage web
 * @copyright  (C) 2006-2015 Adam Armstrong
 *
 */
function show_status($config)
{
    // Show Status
    echo '    <div class="col-md-6 sortable">';
    echo '      <div class="widget widget-table">';
    echo '        <div class="widget-header"><i class="oicon-gear"></i><h3>Status</h3></div>';
    echo '        <div class="widget-content">';
    print_status($config['frontpage']['device_status']);
    echo '        </div>';
    echo '      </div>';
    echo '    </div>' . PHP_EOL;
}
Esempio n. 2
0
function show_status($config)
{
    echo generate_box_open(array('title' => 'Status Warnings and Notifications', 'url' => '/alerts/', 'header-border' => TRUE));
    print_status($config['frontpage']['device_status']);
    echo generate_box_close();
}
Esempio n. 3
0
    <?php 
print_status($gd_support && $gd_info['PNG Support']);
?>

  </li>
  <li>
    <strong>GIF Read Support:</strong>
    <?php 
print_status($gd_support && $gd_info['GIF Read Support']);
?>

  </li>
  <li>
    <strong>GIF Create Support:</strong>
    <?php 
print_status($gd_support && $gd_info['GIF Create Support']);
?>

  </li>
   <li>
    <strong>Directory /captcha/temp/</strong>
			<?php 
$check_this_dir = '../temp';
if (is_writable($check_this_dir)) {
    echo '<span style="color: green">OK - Writable</span> ' . substr(sprintf('%o', fileperms($check_this_dir)), -4);
} else {
    if (!file_exists($check_this_dir)) {
        echo '<span style="color: red; font-weight: bold;">Directory not found, a <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">permissions</a> problem may have prevented this directory from being created.</span>';
        echo ' ' . 'Fixing the actual problem is recommended, but you can uncheck this setting on the plugin options page: "Use CAPTCHA without PHP session" and the captcha will work this way just fine (as long as PHP sessions are working).';
    } else {
        echo '<span style="color: red; font-weight: bold;">Directory Unwritable (<a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">fix permissions</a>)</span>.';
function show_status($config)
{
    // Show Status
    echo '<div class="row">' . PHP_EOL;
    echo '  <div class="col-md-12">' . PHP_EOL;
    echo '    <h3 class="bill">设备报警</h3>' . PHP_EOL;
    print_status($config['frontpage']['device_status']);
    echo '  </div>' . PHP_EOL;
    echo '</div>' . PHP_EOL;
}
Esempio n. 5
0
if ($result) {
    ?>
            <div class="alert alert-warning"><?php 
    echo $result;
    ?>
</div>
            <?php 
}
?>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Status</h3>
                </div>
                <div class="panel-body">
                    <?php 
echo print_status();
?>
                </div>
            </div>
            <div class="panel panel-primary">
                <div class="panel-body">
                    <?php 
if ($status) {
    ?>
                            <a href="index.php?action=stop" class="btn btn-danger btn-lg active" role="button">Stop</a>
                        <?php 
} else {
    ?>
                            <a href="index.php?action=start" class="btn btn-primary btn-lg active" role="button">Start</a>
                        <?php 
}
function show_status($config)
{
    // Show Status
    echo "<div class=\"row\">";
    echo "  <div class=\"col-md-12\">";
    echo "    <h3 class=\"bill\">设备报警</h3>";
    print_status($config['frontpage']['device_status']);
    echo "  </div>";
    echo "</div>";
}
Esempio n. 7
0
<?php

/*
 * index.php
 *
 * Displays the 50 most recent url updates.
 */
require_once dirname(__FILE__) . '/config.php';
// connect to database
$mysqli = new mysqli($dsn['hostspec'], $dsn['username'], $dsn['password'], $dsn['database']);
if ($mysqli->connect_errno) {
    print_status(STATUS_CONNECT_ERROR);
}
$sql = "SELECT      term,\n                    srs,\n                    url,\n                    name,\n                    email,\n                    updated_on\n        FROM        iei_urls\n        WHERE       1\n        ORDER BY    updated_on DESC\n        LIMIT       100";
$records = $mysqli->query($sql);
$numrows = $records->num_rows;
if (empty($numrows)) {
    die('No records found');
}
// display results in a table
echo "<table border='1'>";
$header = array('term', 'srs', 'url', 'name', 'email', 'updated_on');
echo '<thead><tr>';
foreach ($header as $head) {
    echo '<th>' . $head . '</th>';
}
echo '</tr></thead>';
echo '<tbody>';
while ($record = $records->fetch_assoc()) {
    echo '<tr>';
    foreach ($header as $head) {
Esempio n. 8
0
}
$api_check = $this->api_rate_limit_status($channel);
$api_ok = (string) $api_check->error == "OK";
if (!$api_ok && strpos((string) $api_check->error, "_TIME") !== false) {
    ?>
							<li class="fail">It looks like the Date/Time of your server is incorrect. According to your server the time in GMT is: <strong><?php 
    print gmdate('H:i  l (\\G\\M\\T)');
    ?>
</strong>. You can compare that to the actual time in GMT by using this <a href="https://www.google.co.uk/search?q=current+time+gmt">Google search</a><br />(it doesn't matter if it's a few minutes out).</li>
							<?php 
}
print_status($api_ok, "Your API settings work", "Your API settings return the following error: <em>" . $api_check->error . "</em> <a href='http://www.tourcms.com/support/api/mp/error_messages.php'>?</a>");
if ($api_ok) {
    $tour_search = $this->search_tours("", $channel);
    $has_tours = (int) $tour_search->total_tour_count > 0;
    print_status($has_tours, "Found <strong>" . $tour_search->total_tour_count . "</strong> tours", "No tours found");
}
?>
		</ul>

		<h2>Summary</h2>
		<ul>
		<?php 
$all_ok = $has_phpversion && $has_simplexml && $has_curl && $curl_ok && $api_ok;
print_status($all_ok, $has_tours ? "Everything looks OK" : "Server &amp; settings OK, <strong>you just need some Tours/Hotels</strong>", "Check the issues listed above");
?>
		</ul>
		<p>Problems? <a href="http://www.tourcms.com/company/contact.php">Contact TourCMS support</a><br />@<a href="http://twitter.com/TourCMS">TourCMS</a> on Twitter (page by @<a href="http://twitter.com/paulslugocki">paulslugocki</a>)</p>
	</body>
</html>
Esempio n. 9
0
/**
 * Checks the GET parameters and returns a cleaned parameter array that also 
 * indicates what the user is trying to do. 
 * 
 * @return array    Returns an array with the following keys: term, srs, name,
 *                  email, url (decoded), mode (MYUCLA_URL_VIEW, MYUCLA_URL_EDIT)
 */
function setup_script()
{
    $params = array();
    // first make sure that term/srs are valid and present
    if (!preg_match('/^[0-9]{2}[FWS1]$/', $_GET['term']) || !preg_match('/^[0-9]{9}$/', $_GET['srs'])) {
        // if trying to update a url, then give error
        if (isset($_GET['url'])) {
            die(print_status(STATUS_INVALID_COURSE));
        } else {
            // else just return blank
            die;
        }
    }
    $params['term'] = $_GET['term'];
    $params['srs'] = $_GET['srs'];
    if (isset($_GET['url'])) {
        // allow empty url so that you can clear the URL
        // user wants to update an url (don't do any real validate on url,
        // because the MyUCLA service doesn't seem to)
        $params['url'] = trim(urldecode($_GET['url']));
        // see if there is a name or email, but they aren't required
        $params['name'] = trim($_GET['name']);
        $params['email'] = trim($_GET['email']);
        // set correct mode
        $params['mode'] = MYUCLA_URL_EDIT;
    } else {
        // user wants to view url for a given term/srs
        $params['mode'] = MYUCLA_URL_VIEW;
    }
    return $params;
}
Esempio n. 10
0
function show_status($config)
{
    // Show Status
    echo "<div class=\"row-fluid\">";
    echo "    <div class=\"span12\">";
    echo "        <h3 class=\"bill\">Device Alerts</h3>";
    print_status($config['frontpage']['device_status']);
    echo "    </div>";
    echo "</div>";
}
Esempio n. 11
0
print_status($gd_support && $gd_info['PNG Support']);
?>
</li>
<li><strong>GIF Read Support:</strong>
<?php 
print_status($gd_support && $gd_info['GIF Read Support']);
?>
</li>
<li><strong>GIF Create Support:</strong>
<?php 
print_status($gd_support && $gd_info['GIF Create Support']);
?>
</li>
<li><strong>SQLite Support:</strong>
<?php 
print_status(function_exists('sqlite_open'));
?>
<br />
<?php 
if (function_exists('sqlite_open')) {
    ?>
SQLite is available.  If you choose to use it, Securimage can support users who do not accept cookies.
<?php 
} else {
    ?>
No SQLite support. Securimage will work but your visitors must accept cookies.
<?php 
}
?>
</li>
</ul>
/**
 * Display the most popular status
 */
function print_most_popular($statuses) {
  global $user;
  $pop_statuses = get_most_popular_multiple($statuses);
  echo "<h2>Most Popular Statuses</h2>";
  foreach ($pop_statuses as $status) {
  print_status($status);   
  }
}
Esempio n. 13
0
<br />
<?php 
if (extension_loaded('pdo_mysql')) {
    ?>
MySQL is available.  If you choose to use it, Securimage can support users who do not accept cookies by storing codes in MySQL.
<?php 
} else {
    ?>
No MySQL support. Securimage will work but your visitors must accept cookies.
<?php 
}
?>
</li>
<li><strong>PostgreSQL Support:</strong>
<?php 
print_status(extension_loaded('pdo_pgsql'));
?>
<br />
<?php 
if (extension_loaded('pdo_pgsql')) {
    ?>
PostgreSQL is available.
<?php 
} else {
    ?>
No PostgreSQL support.
<?php 
}
?>
</li>
</ul>
Esempio n. 14
0
                echo ' <a href="' . $row['ref_office']['link'] . '">Карта</a>';
            }
            echo '</td>';
            echo '</tr>';
        }
        echo '</table>';
    } else {
        echo $status;
    }
}
require 'Novaposhta.php';
$NP = new Novaposhta();
//Все офисы в Киеве
$kievOffices = $NP->getOfficesBy('city', "Киев");
echo '<h2>Все офисы в Киеве</h2>';
print_table($kievOffices);
//Все офисы в киевской области
$kievRegionOffices = $NP->getOfficesBy('region', "Киевск", true);
echo '<h2>Все офисы в киевской области</h2>';
print_table($kievRegionOffices);
//Ближайшие офисы
$address = 'Киев, Хрещатик';
$closestOffices = $NP->getClosestOffices($address);
echo '<h2>Ближайшие офисы к "' . $address . '"</h2>';
print_table($closestOffices);
//Статус доставки
$ttn = '12345678901234';
$deliveryStatus = $NP->getDeliveryStatus($ttn);
echo '<h2>Статус доставки с номером накладной №' . $ttn . '</h2>';
print_status($deliveryStatus);
Esempio n. 15
0
        ?>
<br />Found LAME binary at <em><?php 
        echo $lame_path;
        ?>
</em>
    <?php 
    } else {
        print_status(false);
        ?>
<br />LAME was found at <em><?php 
        echo $lame_path;
        ?>
</em>, but is not executable.<?php 
    }
} else {
    print_status(false);
    ?>
<br />LAME was not found, audio will work in WAV format, but not MP3.  See <a href="https://www.phpcaptcha.org/documentation/html5-audio/" target="_blank">Securimage HTML5 audio</a> documentation for info.
<?php 
}
?>
</ul>

<?php 
if ($gd_support && function_exists('imageftbbox')) {
    if ($GLOBALS['session_start_error'] != null) {
        ?>
There is a warning, but otherwise you meet the requirements for using Securimage.
<?php 
    } else {
        ?>
Esempio n. 16
0
    $pw = mysql_real_escape_string($_GET['pw']);
    $sql = "SELECT play,play2,opponent from rps_game WHERE login='******' AND pw='{$pw}'";
    // echo($sql."\n");
    $result = mysql_query($sql);
    $row = FALSE;
    if ($result !== FALSE) {
        $row = mysql_fetch_row($result);
    }
    // print_r($row);
    if ($row !== FALSE) {
        echo "Your play=" . $row[0] . " ";
        if (isset($row[1])) {
            echo $row[2] . " played=" . $row[1] . "\n";
            $play = $row[0];
            $play2 = $row[1];
            print_status($play, $play2);
        } else {
            echo "You are waiting for someone to play you\n";
        }
    }
}
$sql = "SELECT login FROM rps_game WHERE play2 IS NULL";
// echo($sql."\n");
$result = mysql_query($sql);
$row = FALSE;
echo "\n================\nPlayers ready to play:\n";
if ($result !== FALSE) {
    while ($row = mysql_fetch_array($result)) {
        echo $row[0] . "\n";
    }
}