コード例 #1
0
ファイル: GuiHelpers.php プロジェクト: jalopezsuarez/phpwatch
 public static function getMonitors()
 {
     $monitors = array();
     $mrows = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', '');
     foreach ($mrows as $m) {
         $monitors[] = Monitor::fetch($m);
     }
     return $monitors;
 }
コード例 #2
0
 public static function checkAll()
 {
     $monitors = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', '');
     foreach ($monitors as $mrow) {
         $monitor = Monitor::fetch($mrow);
         $up = $monitor->poll();
         echo $monitor->getAlias(), $up;
         $monitor->saveToDb();
     }
 }
コード例 #3
0
ファイル: Channel.php プロジェクト: jalopezsuarez/phpwatch
 public function processDelete($data)
 {
     $this->customProcessDelete();
     $mons = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', 'WHERE ' . intval($this->id) . ' IN
         (notification_channels)');
     foreach ($mons as $mon) {
         $mhandle = Monitor::fetch($mon);
         $mhandle->deleteChannel($mhandle);
         $mhandle->saveToDb();
     }
     $GLOBALS['PW_DB']->executeDelete('channels', 'WHERE id=' . intval($this->id));
 }
コード例 #4
0
<?php

$monitor = Monitor::fetch(intval($_GET['id']));
if (FormHelpers::donePOST()) {
    $monitor->processDelete($_GET);
    ?>
<div class="message">
    The monitor has been deleted. <br />
    <a href="?page=monitors">Return to monitors</a>
</div>
        <?
    }
    else
    {
?>
<div class="form-field">
</div>
<?php 
    FormHelpers::startForm('POST', '?page=monitor-delete&id=' . $monitor->getId());
    FormHelpers::createHidden('confirmed', '1');
    ?>
<center>
    Are you sure you want to delete this monitor?<br />
    <?php 
    FormHelpers::createSubmit('Yes');
    ?>
</center>
<?php 
    FormHelpers::endForm();
}
コード例 #5
0
ファイル: monitors.php プロジェクト: jalopezsuarez/phpwatch
<?php

if (intval($_GET['query'])) {
    $m = Monitor::fetch(intval($_GET['query']));
    $m->poll();
    $m->saveToDb();
}
?>
<div class="menu">
    <ul class="page-menu">
        <li>
            <?php 
FormHelpers::startForm('GET', '?page=monitor');
FormHelpers::createHidden('page', 'monitor');
?>
            <?php 
$options = array();
foreach ($GLOBALS['monitor_types'] as $type) {
    $o = new $type();
    $options[] = FormHelpers::getOption($o->getName(), $type);
}
FormHelpers::createSelect('type', $options);
FormHelpers::createSubmit('New Monitor');
?>
            <?php 
FormHelpers::endForm();
?>
        </li>
    </ul>
        Display: <a href="?page=monitors">Expand All</a> - <a href="?page=monitors&expand=none">Collapse All</a>
</div>