Esempio n. 1
0
            <?php 
FormHelpers::createHidden('page', 'contact');
?>
            <?php 
FormHelpers::createSubmit('New Contact');
?>
            <?php 
FormHelpers::endForm();
?>
        </li>
    </ul>
</div>
<div class="section">
    <h1>Contacts</h1>
    <?php 
foreach (GuiHelpers::getAllChannels() as $id => $info) {
    $contact = new Contact($id);
    ?>
    <div class="info">
        <strong><?php 
    p($info['name']);
    ?>
</strong>
        <div class="right"><a href="?page=contact&id=<?php 
    p($contact->getId());
    ?>
">Edit</a> - <a
        href="?page=contact-delete&id=<?php 
    p($contact->getId());
    ?>
">Delete</a></div>
Esempio n. 2
0
</div>
        </div>
    <div class="form-field"><center><?php 
    FormHelpers::createButton('Submit', 'onClick="document.general.submit()"');
    ?>
</center></div>
    <?php 
    FormHelpers::endForm();
    if ($contact->getId() != null) {
        ?>
    <h2>Notification Channels</h2>
    <strong>Description:</strong>
    <div class="type-descr">Additions, deletions, and modifications of channels will be saved automatically.</div>
    <?php 
        if ($contact->getId() != null) {
            $existing = GuiHelpers::getAllChannels($contact->getId());
            $existing = $existing[$contact->getId()]['channels'];
            foreach ($existing as $e) {
                $chandle = Channel::fetch(intval($e['id']));
                ?>
                    <div class="info">
                        <?php 
                p($chandle->getName());
                ?>
 
                        <div class="right">
                            <a href="?page=channel&id=<?php 
                p($e['id']);
                ?>
">Edit</a> -
                            <a href="?page=channel-delete&id=<?php 
Esempio n. 3
0
                    <p class="side-title">Total Log Entries:</p>
                    <p><?php 
p(GuiHelpers::getStatistic('log_count'));
?>
</p>
                    <p class="side-title">Last Offline:</p>
                    <p><?php 
p(GuiHelpers::formatDateLong(GuiHelpers::getStatistic('last_offline')));
?>
</li>
                </div>
                <div>
                    <p class="side-title">Version Check:</p>
                    <?php 
if (isset($_GET['update'])) {
    list($good, $info) = GuiHelpers::checkVersion();
    p($info);
} else {
    p('<p class="center"><strong><a href="?page=monitors&update=1">Check for
                            Updates</a></strong></p>');
}
?>
                </div>
                <div>
                    <p class="side-title">Support:</p>
                    <p class="center"><strong>Please consider donating to phpWatch!</strong></p>
                    <a href="http://sourceforge.net/donate/index.php?group_id=233530" class="plain" target="_new"><img
                    src="http://images.sourceforge.net/images/project-support.jpg" class="donate" alt="Support This Project"
                    /></a>
                    <p class="center"><a href="http://phpwatch.net" target="_new">phpWatch homepage</a></p>
                </div>
Esempio n. 4
0
     foreach ($contacts as $i => $c) {
         if ($i > 0) {
             p(', ');
         }
         p('<a href="?page=contact&id=' . $c['id'] . '">' . $c['name'] . '</a>');
     }
 } else {
     p('None');
 }
 ?>
 <li><strong>Last Query:</strong>
 <?php 
 if ($monitor->getStatus() == STATUS_UNPOLLED) {
     p('N/A');
 } else {
     p(GuiHelpers::formatDateLong($monitor->getLastQuery()));
 }
 ?>
 </li>
 <?php 
 list($total, $week, $day) = Statistics::get('monitor' . $monitor->getId());
 ?>
 <li>
     <strong>Uptime (Day):</strong> <?php 
 p($day['total'] > 0 ? round(100 * $day['online'] / $day['total'], 2) . '% (' . $day['online'] . ' of ' . $day['total'] . ')' : 'N/A');
 ?>
 </li>
 <li>
     <strong>Uptime (Week):</strong> <?php 
 p($week['total'] > 0 ? round(100 * $week['online'] / $week['total'], 2) . '% (' . $week['online'] . ' of ' . $week['total'] . ')' : 'N/A');
 ?>