示例#1
0
} else {
    if ($subpage['subpage'] == 'logs') {
        require_once 'admin_logs.php';
    } else {
        $inputs = JxBotUtil::inputs('input');
        if (trim($inputs['input']) != '') {
            JxBotConverse::resume_conversation('admin');
            $response = JxBotConverse::get_response($inputs['input']);
        } else {
            $response = JxBotConverse::get_greeting();
        }
        ?>


<?php 
        JxWidget::textfield(array('name' => 'input', 'label' => 'Administrator', 'max' => 150, 'autofocus' => true));
        ?>


<p><?php 
        JxWidget::button('Talk');
        ?>
</p>


<div class="left">
<img src="<?php 
        print JxBotConfig::bot_url();
        ?>
jxbot/core/gfx/robot-small.png" id="chat-robot">
</div>
示例#2
0
function page_edit($in_category_id)
{
    $inputs = JxBotUtil::inputs('input');
    $category = JxBotNLData::category_fetch($in_category_id);
    ?>

<input type="hidden" name="category" value="<?php 
    print $in_category_id;
    ?>
">


<h2>Edit Category</h2>


<h3>Context</h3>

<p><?php 
    JxWidget::textfield(array('name' => 'topic', 'label' => 'Topic', 'max' => 255, 'value' => $category['topic']));
    ?>
</p>

<p><?php 
    JxWidget::textfield(array('name' => 'that', 'label' => 'That', 'max' => 255, 'value' => $category['that']));
    ?>
</p>

<p><?php 
    JxWidget::button('Update Context', 'action', 'save-ctx');
    ?>
</p>


<h3>Patterns</h3>

<?php 
    $stmt = JxBotDB::$db->prepare('SELECT id,value FROM pattern WHERE category=?');
    $stmt->execute(array($in_category_id));
    $rows = $stmt->fetchAll(PDO::FETCH_NUM);
    JxWidget::grid(array(array('label' => 'ID', 'id' => 0, 'visible' => false, 'key' => true), array('label' => 'Pattern', 'id' => 1, 'encode' => true), array('label' => 'Delete', 'id' => ':delete', 'link' => '?page=database&action=del-pat&pat-id=$$')), $rows);
    ?>

<p><?php 
    JxWidget::textfield(array('name' => 'new-pat', 'label' => 'New Pattern', 'max' => 255, 'value' => $inputs['input']));
    ?>
</p>

<p><?php 
    JxWidget::button('Add Pattern', 'action', 'add-pat');
    ?>
</p>



<h3>Templates</h3>

<?php 
    $rows = JxBotNLData::fetch_templates($in_category_id);
    JxWidget::grid(array(array('label' => 'Template', 'id' => 1, 'link' => '?page=database&action=edit-tmpl&template=$$', 'encode' => true), array('label' => 'ID', 'id' => 0, 'visible' => false, 'key' => true), array('label' => 'Delete', 'id' => ':delete', 'link' => '?page=database&action=del-tmpl&template=$$')), $rows);
    ?>

<p><?php 
    JxWidget::memofield('new-tmpl', 'New Template', '', 5, true);
    ?>
</p>

<p><?php 
    JxWidget::button('Add Template', 'action', 'add-tmpl');
    ?>
</p>



<p><?php 
    JxWidget::button('Lookup Another', 'action', '');
    ?>
 <?php 
    JxWidget::button('Delete Category', 'action', 'del-cat');
    ?>
</p>


<?php 
}