<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());
<?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(); }
">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 } ?> </div> <?php
<?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">
<h1>phpWatch Installer</h1> <p>Thank you for choosing <strong>phpWatch</strong> as your service monitoring solution. Before beginning the installation process, please assure that the following steps are compelete:</p> <ul> <li>The database for installation is emptied of tables from phpWatch 1.x.x or other applications.</li> <li>config.php is writable: <?php if (is_writable('../config.php')) { p('<div class="valid">Yes</div>'); } else { $errors = true; p('<div class="invalid">No</div>'); } ?> </li> </ul> <?php FormHelpers::startForm('POST', './index.php'); ?> <?php FormHelpers::createHidden('page', 'database'); ?> <center><?php FormHelpers::createSubmit('Continue', $errors ? 'disabled="disabled"' : null); ?> </center> <?php FormHelpers::endForm(); ?> </div>
<?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>
<h1>Failure</h1> The installation could not write to <tt>config.php</tt> in the root phpWatch directory. Please assure it exists and has read/write permissions. Refresh the page to retry. </div> <?php $errors = true; } } if (!$errors) { ?> <div class="section"> <h1>Success!</h1> The configuration file was written successfully. Click continue to import the database structure. </div> <div class="form-field"> <?php FormHelpers::startForm('POST', './index.php'); ?> <?php FormHelpers::createHidden('page', 'import'); ?> <center><?php FormHelpers::createSubmit('Continue'); ?> </center> <?php FormHelpers::endForm(); ?> </div> <?php }