예제 #1
0
파일: index.php 프로젝트: horrabin/opendb
 echo "\n<input type=\"hidden\" name=\"type\" value=\"" . $ADMIN_TYPE . "\">";
 $results = fetch_item_type_group_rs();
 if ($results) {
     echo "<h3>Item Type Groups</h3>";
     echo "<ul class=\"itemTypeGroupList\">";
     while ($item_type_group_r = db_fetch_assoc($results)) {
         $classattr = NULL;
         if (fetch_s_item_listing_conf_id($item_type_group_r['s_item_type_group'], NULL) !== FALSE) {
             $classattr = 'class="active"';
         }
         echo "\n<li {$classattr}><a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=edit&s_item_type_group=" . $item_type_group_r['s_item_type_group'] . "&s_item_type=*\">Edit " . $item_type_group_r['s_item_type_group'] . "</a></li>";
     }
     db_free_result($results);
     echo "</ul>";
 }
 $results = fetch_s_item_type_rs('s_item_type');
 if ($results) {
     echo "<h3>Item Types</h3>";
     echo "<ul class=\"itemTypeGroupList\">";
     while ($item_type_r = db_fetch_assoc($results)) {
         $classattr = NULL;
         if (fetch_s_item_listing_conf_id(NULL, $item_type_r['s_item_type']) !== FALSE) {
             $classattr = 'class="active"';
         }
         echo "\n<li {$classattr}><a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=edit&s_item_type_group=*&s_item_type=" . $item_type_r['s_item_type'] . "\">Edit " . $item_type_r['s_item_type'] . "</a></li>";
     }
     db_free_result($results);
     echo "</ul>";
 }
 echo "\n<h3>Default</h3>";
 echo "\n<ul class=\"itemTypeGroupList\">";
예제 #2
0
파일: index.php 프로젝트: horrabin/opendb
        echo format_help_block(array('img' => 'compulsory.gif', 'text' => get_opendb_lang_var('compulsory_field'), id => 'compulsory'));
        if (get_opendb_config_var('widgets', 'enable_javascript_validation') !== FALSE) {
            echo "\n<input type=\"button\" class=\"button\" value=\"Insert\" onclick=\"if(!checkForm(this.form)){return false;}else{this.form.submit();}\">";
        } else {
            echo "\n<input type=\"button\" class=\"button\" value=\"Insert\" onclick=\"this.form.submit();\">";
        }
        echo "\n</form>";
    }
}
// There are specific operations where this form should be displayed.
if (strlen($HTTP_VARS['op']) == 0 || $HTTP_VARS['op'] == 'delete_sitem_type_items' && ($HTTP_VARS['confirmed'] == 'false' || $HTTP_VARS['confirmed'] == 'true') || $HTTP_VARS['op'] == 'delete_type_confirm' && ($HTTP_VARS['confirmed'] == 'false' || $HTTP_VARS['confirmed'] == 'true') || $HTTP_VARS['op'] == 'edit_types' || $HTTP_VARS['op'] == 'update_types') {
    echo "<p>[<a href=\"{$PHP_SELF}?type={$ADMIN_TYPE}&op=new_type\">New Item Type</a>]</p>";
    if (is_not_empty_array($errors)) {
        echo format_error_block($errors);
    }
    $results = fetch_s_item_type_rs();
    if ($results) {
        echo "<form name=\"s_item_type\" action=\"{$PHP_SELF}\" method=\"POST\">" . "<input type=\"hidden\" name=\"type\" value=\"" . $ADMIN_TYPE . "\">" . "<input type=\"hidden\" name=\"op\" value=\"\">" . "<input type=\"hidden\" name=\"s_item_type\" value=\"\">";
        echo "<table>";
        echo "<tr class=\"navbar\">" . "<th>Order</th>" . "<th>Type</th>" . "<th>Description</th>" . "<th colspan=2>Image</th>" . "<th colspan=2></th>" . "</tr>";
        // value, display, img, checked_ind, order_no
        $row = 0;
        while ($item_type_r = db_fetch_assoc($results)) {
            display_s_item_type_row($item_type_r, $row);
            $row++;
        }
        db_free_result($results);
        echo "</table>";
        echo format_help_block('Image(s) must be in a <i>theme search path</i> directory.');
        echo "<input type=\"button\" class=\"button\" value=\"Refresh\" onclick=\"this.form['op'].value='edit_types'; this.form.submit();\">" . " <input type=\"button\" class=\"button\" value=\"Update\" onclick=\"this.form['op'].value='update_types'; this.form.submit();\">";
        echo "</form>";