Пример #1
0
<div class="menu">
    <ul class="page-menu">
        <li>
            <?php 
FormHelpers::startForm('GET', '?page=contact');
?>
            <?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());
Пример #2
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();
}
Пример #3
0
<?php

$contact = new Contact(intval($_GET['id']));
if (FormHelpers::donePOST()) {
    $contact->processDelete($_GET);
    ?>
<div class="message">
    The contact has been deleted. <br />
    <a href="?page=contacts">Return to contacts</a>
</div>
        <?php 
} else {
    ?>
<div class="form-field">
</div>
<?php 
    FormHelpers::startForm('POST', '?page=contact-delete&id=' . $contact->getId());
    FormHelpers::createHidden('confirmed', '1');
    ?>
<center>
    Are you sure you want to delete this contact? All associated channels will also be removed.<br />
    <?php 
    FormHelpers::createSubmit('Yes');
    ?>
</center>
<?php 
    FormHelpers::endForm();
}
Пример #4
0
$channel = Channel::fetch(intval($_GET['id']));
$owner = $channel->getOwner();
if (FormHelpers::donePOST()) {
    $channel->processDelete($_GET);
    ?>
<div class="message">
    The channel has been deleted. <br />
    <a href="?page=contact&id=<?php 
    p($owner);
    ?>
">Return to contact</a>
</div>
        <?php 
} else {
    ?>
<div class="form-field">
</div>
<?php 
    FormHelpers::startForm('POST', '?page=channel-delete&id=' . $channel->getId());
    FormHelpers::createHidden('confirmed', '1');
    ?>
<center>
    Are you sure you want to delete this channel?<br />
    <?php 
    FormHelpers::createSubmit('Yes');
    ?>
</center>
<?php 
    FormHelpers::endForm();
}
Пример #5
0
                p($e['id']);
                ?>
">Delete</a>
                        </div>
                        <div class="descr"><?php 
                p($chandle);
                ?>
</div>
                    </div>
                <?php 
            }
        }
        ?>
    <div class="form-field">
    <?php 
        FormHelpers::startForm('GET', '?page=channel', 'name="newchan"');
        FormHelpers::createHidden('page', 'channel');
        FormHelpers::createHidden('contact_id', $contact->getId());
        $options = array();
        foreach ($GLOBALS['channel_types'] as $type) {
            $o = new $type();
            $options[] = FormHelpers::getOption($o->getName(), $type);
        }
        FormHelpers::createSelect('type', $options);
        FormHelpers::createSubmit('Add Notification Channel');
        FormHelpers::endForm();
        ?>
    </div>
    <?php 
    }
    ?>
Пример #6
0
    p($c->getName());
    ?>
</div>
    <div class="form-field"><strong>Channel Type: </strong><?php 
    p($channel->getName());
    ?>
    <div class="form-field"><strong>Description: </strong><?php 
    p($channel->getDescription());
    ?>
</div>
    </div>

    <h2>Configuration</h2>
    <?php 
    if ($channel->getId() != null) {
        FormHelpers::startForm('POST', '?page=channel&id=' . $channel->getId());
    } else {
        FormHelpers::startForm('POST', '?page=channel&contact_id=' . $channel->getOwner() . '&type=' . $_GET['type']);
    }
    require_once PW2_PATH . '/frontend/forms/channels/' . get_class($channel) . '.php';
    ?>
    <div class="form-field"><center><?php 
    FormHelpers::createSubmit('Submit');
    ?>
</center></div>
    <?php 
    FormHelpers::endForm();
    ?>
</div>
<?php 
}
Пример #7
0
<?php 
    }
}
if ($show_form) {
    ?>
<div class="section">
    <h1><?php 
    p($monitor->getId() > 0 ? 'Edit' : 'Add');
    ?>
 Monitor</h1>
    <h2>Generic Settings</h2>
    <?php 
    if ($monitor->getId() != 0) {
        FormHelpers::startForm('POST', '?page=monitor&id=' . $monitor->getId());
    } else {
        FormHelpers::startForm('POST', '?page=monitor&type=' . $_GET['type']);
    }
    ?>
    <div class="form-field">
        <strong>Hostname:</strong>
        <div class="descr">Hostname or IP to monitor.</div>
        <?php 
    FormHelpers::createText('hostname', $monitor->getHostname(), 'size="30"');
    ?>
        <div class="error"><?php 
    FormHelpers::checkError('hostname', $errors);
    ?>
</div>
    </div>

    <div class="form-field">
Пример #8
0
<?php

FormHelpers::startForm('POST', './index.php');
FormHelpers::createHidden('page', 'config');
?>
<div class="section">
    <div class="invalid">This is a release of the 2.x.x branch of phpWatch which uses a database that is incompatible
    with those from 1.x.x.  Make sure the database specified below is entirely empty.</div>
    <h1>Database Information</h1>
    <div class="form-field">
        <strong>Hostname/IP:</strong>
        <div class="descr">Hostname or IP of database server.</div>
        <?php 
FormHelpers::createText('hostname', 'localhost');
?>
    </div>
    <div class="form-field">
        <strong>Database Name:</strong>
        <div class="descr">Name of database.</div>
        <?php 
FormHelpers::createText('db_name', '');
?>
    </div>
    <div class="form-field">
        <strong>Database User:</strong>
        <div class="descr">User with at least SELECT, INSERT, UPDATE, DELETE, and CREATE privilages.</div>
        <?php 
FormHelpers::createText('db_user', '');
?>
    </div>
    <div class="form-field">
Пример #9
0
<?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>