示例#1
0
	width: 5em;
}
</style>


<div id="centre-content" style="float: left; max-width: 85%; margin-right: 2 em;">

<h2>Security Log</h2>


<?php 
$inputs = JxBotUtil::inputs('action');
if ($inputs['action'] == 'purge-log') {
    JxBotDB::$db->exec('TRUNCATE login');
}
JxWidget::hidden('subpage', 'logs');
$stmt = JxBotDB::$db->prepare('SELECT note,username,stamp FROM login ORDER BY id DESC');
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_NUM);
if (count($rows) == 0) {
    print '<p>No data to display.</p>';
} else {
    print '<div class="log">';
    foreach ($rows as $row) {
        print $row[0] . ' ' . $row[1];
        print '<br>';
    }
    print '</div>';
}
?>
</div>
示例#2
0
function list_items($in_set)
{
    $stmt = JxBotDB::$db->prepare('SELECT name FROM _set WHERE id=?');
    $stmt->execute(array($in_set));
    $row = $stmt->fetchAll(PDO::FETCH_NUM);
    print '<h2>' . $row[0][0] . '</h2>';
    JxWidget::hidden('subpage', 'sets');
    JxWidget::hidden('set', $in_set);
    $stmt = JxBotDB::$db->prepare('SELECT id,phrase FROM set_item WHERE id=? ORDER BY phrase');
    $stmt->execute(array($in_set));
    $items = $stmt->fetchAll(PDO::FETCH_NUM);
    JxWidget::grid(array(array('label' => 'Phrase', 'id' => 1, 'key' => true), array('label' => 'Delete', 'id' => ':delete', 'link' => '?page=database&subpage=sets&action=delete-item&item=$$')), $items);
    print '<p><input type="text" size="30" name="item-phrase"> <button type="submit" name="action" value="new-item">Add Item</button></p>';
}
示例#3
0
function page_edit_tmpl()
{
    $inputs = JxBotUtil::inputs('template');
    $template = JxBotNLData::template_fetch($inputs['template']);
    ?>

<?php 
    JxWidget::hidden('category', $template['category']);
    JxWidget::hidden('tmpl-id', $template['id']);
    ?>

<h2>Edit Template</h2>

<p><?php 
    JxWidget::memofield('template', 'Template', $template['template'], 5, true);
    ?>
</p>


<p><?php 
    JxWidget::button('Cancel', 'action', 'edit');
    ?>
 <?php 
    JxWidget::button('Save Template', 'action', 'save-tmpl');
    ?>
</p>

<?php 
}
示例#4
0
    for ($i = 0; $i < $row_count; $i++) {
        $prop = array_shift($properties);
        if ($prop === null) {
            break;
        }
        print '<tr>';
        print '<td style="width: 10em;">' . $prop[1] . '</td>';
        print '<td><input type="text" name="' . $prop[0] . '" size="20" value="' . $prop[2] . '" style="width:95%"></td>';
        print '<td style="width: 1.5em;"><a href="?del-name=' . $prop[0] . '&page=chat&subpage=defaults">';
        JxWidget::small_delete_icon();
        print '</a></td>';
        print '</tr>';
    }
    print '</table>';
}
JxWidget::hidden('subpage', 'defaults');
?>

<div class="col-left"><?php 
editable_section($bot_properties, $rows_per_col);
?>
</div>
<div class="col-right"><?php 
editable_section($bot_properties, $rows_per_col);
?>
</div>
<div class="clear"></div>

<p>

<div class="field"><label for="new-name">New Default: </label>
示例#5
0
    private static function page_manual()
    {
        $inputs = JxBotUtil::inputs('db_host,db_name,db_prefix,db_username,db_password,bot_tz,bot_name,admin_password');
        JxWidget::hidden($inputs, 'db_host,db_name,db_prefix,db_username,db_password,admin_password');
        ?>
<h1>Manual Configuration Required</h1>

<p>Sorry, JxBot does not have permission to write the configuration file.  You will need to create the file <strong>config.php</strong> in the <strong>jxbot</strong> folder of your installation.</p>

<p>Copy and paste the database configuration settings from this window your configuration file.</p>

<blockquote>
<?php 
        print nl2br(htmlentities(JxBotInstaller::get_configuration()));
        ?>
</blockquote>

<p>When you're done, you can continue the installation.</p>
 

<p class="right"><button type="submit" name="action" value="install">Install</button></p>

<?php 
    }
示例#6
0
function list_items($in_map)
{
    $stmt = JxBotDB::$db->prepare('SELECT name FROM _map WHERE id=?');
    $stmt->execute(array($in_map));
    $row = $stmt->fetchAll(PDO::FETCH_NUM);
    print '<h2>' . $row[0][0] . '</h2>';
    JxWidget::hidden('subpage', 'maps');
    JxWidget::hidden('map', $in_map);
    $stmt = JxBotDB::$db->prepare('SELECT id,s_from,s_to FROM map_item WHERE map=? ORDER BY s_from');
    $stmt->execute(array($in_map));
    $items = $stmt->fetchAll(PDO::FETCH_NUM);
    JxWidget::grid(array(array('label' => 'ID', 'id' => 0, 'key' => true, 'visible' => false), array('label' => 'From', 'id' => 1, 'whitespace' => 'preserve'), array('label' => 'To', 'id' => 2, 'whitespace' => 'preserve'), array('label' => 'Delete', 'id' => ':delete', 'link' => '?page=database&subpage=maps&action=delete-item&item=$$')), $items);
    print '<p><input type="text" size="30" name="item-from"> : <input type="text" size="30" name="item-to"> <button type="submit" name="action" value="new-item">Add Item</button></p>';
}