当前位置: 首页>>代码示例>>PHP>>正文


PHP format_field函数代码示例

本文整理汇总了PHP中format_field函数的典型用法代码示例。如果您正苦于以下问题:PHP format_field函数的具体用法?PHP format_field怎么用?PHP format_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了format_field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_borrower_form

function display_borrower_form($HTTP_VARS)
{
    echo "\n<form action=\"{$PHP_SELF}\" method=\"GET\">";
    echo "\n<input type=\"hidden\" name=\"op\" value=\"checkout\">";
    echo "\n<table class=\"borrowerForm\">";
    if (get_opendb_config_var('borrow', 'admin_quick_checkout_borrower_lov') !== TRUE) {
        echo get_input_field('borrower_id', NULL, get_opendb_lang_var('borrower'), "filtered(20,20,a-zA-Z0-9_.)", "Y", NULL, TRUE);
    } else {
        $results = fetch_user_rs(PERM_USER_BORROWER, INCLUDE_ROLE_PERMISSIONS, EXCLUDE_CURRENT_USER, EXCLUDE_DEACTIVATED_USER, 'fullname', 'ASC');
        if ($results) {
            echo format_field(get_opendb_lang_var('borrower'), custom_select('borrower_id', $results, '%fullname% (%user_id%)', 1, NULL, 'user_id'));
        } else {
            echo format_field(get_opendb_lang_var('borrower'), get_opendb_lang_var('no_records_found'));
        }
    }
    echo "</table>";
    echo "<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('submit') . "\">";
    echo "</form>";
}
开发者ID:horrabin,项目名称:opendb,代码行数:19,代码来源:quick_checkout.php

示例2: display_edit_site_plugin

function display_edit_site_plugin($record_r, $HTTP_VARS = NULL)
{
    if (is_array($record_r)) {
        echo get_input_field('site_type', NULL, 'Site Type', 'readonly', 'Y', $record_r['site_type']);
    } else {
        echo get_input_field('site_type', NULL, 'Site Type', 'text(10,10)', 'Y', $record_r['site_type']);
    }
    echo get_input_field('classname', NULL, 'Class Name', 'text(50,50)', 'Y', $record_r['classname']);
    echo get_input_field('title', NULL, 'Title', 'text(25,50)', 'Y', $record_r['title']);
    $field = get_input_field('image', NULL, 'Image', 'url(25,*,"gif,jpg,png",N)', 'N', $record_r['image'], FALSE);
    if (strlen($record_r['image']) > 0) {
        $image_src = "images/site/" . $record_r['image'];
    }
    if ($image_src !== FALSE && strlen($image_src) > 0 && file_exists($image_src)) {
        $field .= theme_image("images/site/" . $image_src, NULL, NULL);
    }
    echo format_field('Image', $field);
    echo get_input_field('description', NULL, 'Description', 'text(50,255)', 'Y', $record_r['description']);
    echo get_input_field('external_url', NULL, 'External URL', 'text(50,255)', 'Y', $record_r['external_url']);
    echo get_input_field('more_info_url', NULL, 'More Info URL', 'text(50,255)', 'N', $record_r['more_info_url']);
    echo get_input_field('items_per_page', NULL, 'Items Per Page', 'number(3)', 'N', $record_r['items_per_page']);
}
开发者ID:horrabin,项目名称:opendb,代码行数:22,代码来源:index.php

示例3: build_roles_select

function build_roles_select($attribute_type_r)
{
    $user_roles = array();
    $result = fetch_user_role_rs();
    $public = fetch_role_r(get_public_access_rolename());
    $user_roles[] = array('role_name' => $public['role_name'], 'description' => $public['description']);
    while ($role = db_fetch_assoc($result)) {
        $user_roles[] = $role;
    }
    $select = format_field("View Permission", custom_select('view_perm', $user_roles, '%description%', 1, $attribute_type_r['view_perm'], 'role_name'));
    db_free_result($result);
    return $select;
}
开发者ID:horrabin,项目名称:opendb,代码行数:13,代码来源:index.php

示例4: draw_list_file


//.........这里部分代码省略.........
        foreach (explode("||", $list["search_options"]) as $sopt) {
            list($k, $v) = explode("::", $sopt);
            $search_fields[$k] = explode(";;", $v);
        }
    }
    // CHECK IF THERE ARE SUB-ROW
    if (isset($list["multilevel"])) {
        $subrow = 1;
        list($main, $ref, $def) = explode("||", $list["multilevel"]);
        if ($is_search != 1) {
            if (eregi("where", $list["sql_select"])) {
                $sql_where = " AND {$ref} = '{$def}' ";
                $sql_where2 = " AND {$ref} = '%ID%' ";
            } else {
                $sql_where = " WHERE {$ref} = '{$def}' ";
                $sql_where2 = " WHERE {$ref} = '%ID%' ";
            }
            $sql_ref = $list["sql_select"] . $sql_where2 . $sql_append1 . $sql_append2;
        } else {
            if (eregi("where", $list["sql_select"])) {
                $sql_where2 = " AND {$ref} = '%ID%' ";
            } else {
                $sql_where2 = " WHERE {$ref} = '%ID%' ";
            }
            $sql_ref = "SELECT * FROM {$module} WHERE %[PERM]% AND {$ref}='%ID%'" . $sql_append1;
        }
    }
    if (strlen($list[box_title]) > 0) {
        $output .= str_replace("%[TITLE]%", $list[box_title], $LIST_TEMPLATE[list_title]);
    }
    $titles = explode("||", $list["titles"]);
    $fields = explode("||", $list["fields"]);
    //REMEMBER aggiungere trigger error.
    if (count($titles) != count($fields)) {
        return "Error, field number";
    }
    $rs = @$DB->Execute(perm_sql_read($list[sql_select] . $sql_where . $sql_append1 . $sql_append2, $module));
    $rstot = @$DB->Execute(perm_sql_read($list[sql_select] . $sql_where . $sql_append1, $module));
    //List head
    $cnt = 0;
    if ($subrow == 1) {
        $titar[] = '  ';
    }
    foreach ($titles as $value) {
        $cur = "";
        list($val, $type) = explode("::", $value);
        list($vf, $tf) = explode("::", $fields[$cnt]);
        $titar[] = $value;
        $cnt++;
    }
    $odd = 0;
    $arcnt = 0;
    while (!$rs->EOF) {
        $row = $rs->FetchRow();
        $cnt = 0;
        $output2 = "";
        //Fix for search lists (check if a object is a subitem
        if ($subrow == 1 && $is_search == 1 && $row[$ref] != $def && !in_array($row[$ref], $done_id)) {
            $rstmp = @$DB->Execute(perm_sql_read("SELECT * FROM {$module} WHERE %[PERM]% AND id=" . $row[$ref], $module));
            $row = $rstmp->FetchRow();
            //Explode this row if search result is in a subrow
            if (!isset($_GET[$module . "_exp"])) {
                $_GET[$module . "_exp"] = $row[id];
            } else {
                $_GET[$module . "_exp"] .= "," . $row[id];
            }
        }
        if ($subrow == 1) {
            $output2 = draw_subrow($row["id"], $sql_ref, 1, $fields, $list["action"], $defexp, $module);
            if ($output2 == '') {
                $output2 = "";
                $resar[$arcnt][] = '  ';
            } else {
                $cnt = 1;
            }
        }
        if (is_array($done_id)) {
            if (in_array($row[id], $done_id)) {
                continue;
            } else {
                $done_id[] = $row[id];
            }
        } else {
            $done_id[] = $row[id];
        }
        foreach ($fields as $value) {
            $cur = format_field($value, $row, $list["action"]);
            if (isset($search_fields[$value])) {
                foreach ($search_fields[$value] as $searcht) {
                    $cur = $cur;
                }
            }
            $resar[$arcnt][] = quote_xml($cur);
        }
        $arcnt++;
    }
    $res[tit] = $titar;
    $res[res] = $resar;
    return $res;
}
开发者ID:HadoDokis,项目名称:knomos-plus,代码行数:101,代码来源:lists.php

示例5: query2result

    print "</tr>\n";
    /* output To: line */
    print "<tr>\n";
    print "<td align=left><strong>" . $AppUI->_('To') . "</strong></td>";
    $recipient = query2result("SELECT author FROM tickets WHERE ticket = '{$ticket_parent}'");
    print "<td align=left>" . format_field($recipient, "recipient") . "</td>\n";
    print "</tr>\n";
    /* output ticket */
    for ($loop = 0; $loop < count($fields["headings"]); $loop++) {
        print "<tr>\n";
        // do not translate if heading is "<br />"
        if ($fields["headings"][$loop] == "<br />") {
        } else {
            $fields["headings"][$loop] = $AppUI->_($fields["headings"][$loop]);
        }
        print "<td align=left><strong>" . $fields["headings"][$loop] . "</strong></td>";
        print "<td align=left>" . format_field($ticket_info[$fields["columns"][$loop]], $fields["types"][$loop]) . "</td>\n";
        print "</tr>\n";
    }
    /* output submit button */
    print '<tr><td><br /></td><td><font size=-1><input class=button type=submit value="' . $AppUI->_('Post Followup') . '"></font></td></tr>';
    /* output actions */
    print "<tr>\n";
    print "<td align=left valign=top><br /></td>";
    print "<td align=left valign=top>&nbsp;</td>\n";
    print "</tr>\n";
    /* end table */
    print "</table>\n";
    /* end form */
    print "</form>\n";
}
开发者ID:magsilva,项目名称:dotproject,代码行数:31,代码来源:followup.php

示例6: query2hash

<?php 
/* start form */
/* get ticket */
$ticket_info = query2hash("SELECT * FROM tickets WHERE ticket = {$ticket}");
echo '<input type="hidden" name="orig_assignment" value="' . $ticket_info['assignment'] . '"/>';
echo '<input type="hidden" name="author" value="' . $ticket_info['author'] . '"/>';
echo '<input type="hidden" name="priority" value="' . $ticket_info['priority'] . '"/>';
echo '<input type="hidden" name="subject" value="' . $ticket_info['subject'] . '"/>';
/* output ticket */
for ($n = 0; $n < count($fields['headings']); $n++) {
    echo '<tr>';
    if ($fields['headings'][$n] !== '<br />') {
        $fields['headings'][$n] = $AppUI->_($fields['headings'][$n]) . ':';
    }
    echo '<td align="right" width="100"><b>' . $fields['headings'][$n] . '</b></td>';
    echo '<td align="left">' . format_field($ticket_info[$fields['columns'][$n]], $fields['types'][$n]) . '</td>';
    echo '</tr>';
}
$ticket_info["assignment"];
/* output attachment indicator */
$attach_count = query2result("SELECT attachment FROM tickets WHERE ticket = '{$ticket}'");
if ($attach_count == 1) {
    echo '<tr>';
    echo '<td align="left"><b>Attachments</b></td>';
    echo '<td align="left">This email had attachments which were removed.</td>';
    echo '</tr>';
} else {
    if ($attach_count == 2) {
        $result = do_query("SELECT file_id, file_name from files, tickets where ticket = '{$ticket}'\n\t\t\t\t\t\tand file_task = ticket and file_project = 0");
        if (number_rows($result)) {
            echo '<tr>';
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:view.php

示例7: query2hash

<?php 
/* start form */
/* get ticket */
$ticket_info = query2hash("SELECT * FROM tickets WHERE ticket = {$ticket}");
print "<input type=\"hidden\" name=\"orig_assignment\" value='" . $ticket_info["assignment"] . "' />\n";
print "<input type=\"hidden\" name=\"author\" value='" . $ticket_info["author"] . "' />\n";
print "<input type=\"hidden\" name=\"priority\" value='" . $ticket_info["priority"] . "' />\n";
print "<input type=\"hidden\" name=\"subject\" value='" . $ticket_info["subject"] . "' />\n";
/* output ticket */
for ($loop = 0; $loop < count($fields["headings"]); $loop++) {
    print "<tr>\n";
    if ($fields["headings"][$loop] !== "<br />") {
        $fields["headings"][$loop] = $AppUI->_($fields["headings"][$loop]);
    }
    print "<td align=\"right\">" . $fields["headings"][$loop] . "</td>";
    print "<td align=\"left\" class=\"hilite\">" . format_field($ticket_info[$fields["columns"][$loop]], $fields["types"][$loop]) . "</td>\n";
    print "</tr>\n";
}
$ticket_info["assignment"];
/* output attachment indicator */
$attach_count = query2result("SELECT attachment FROM tickets WHERE ticket = '{$ticket}'");
if ($attach_count == 1) {
    print "<tr>\n";
    print "<td align=\"left\"><strong>Attachments</strong></td>";
    print "<td align=\"left\">This email had attachments which were removed.</td>\n";
    print "</tr>\n";
} else {
    if ($attach_count == 2) {
        $result = do_query("SELECT file_id, file_name from files, tickets where ticket = '{$ticket}'\n  and file_task = ticket and file_project = 0");
        if (number_rows($result)) {
            print "<tr>\n";
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:view.php

示例8: fetch_user_r

 if (is_opendb_valid_session()) {
     if (is_user_granted_permission(PERM_VIEW_USER_PROFILE)) {
         $user_r = fetch_user_r($HTTP_VARS['uid']);
         if (is_array($user_r)) {
             $page_title = get_opendb_lang_var('user_profile_for_user_name', array('user_id' => $user_r['user_id'], 'fullname' => $user_r['fullname']));
             echo _theme_header($page_title);
             echo '<h2>' . $page_title . '</h2>';
             if ($user_r['active_ind'] != 'Y') {
                 echo "<p class=\"userDeactivatedNotice\">" . get_opendb_lang_var('user_deactivated') . "</p>";
             }
             echo "<table>";
             echo format_field(get_opendb_lang_var('userid'), $user_r['user_id']);
             echo format_field(get_opendb_lang_var('user_role'), $user_r['role_description']);
             echo format_field(get_opendb_lang_var('fullname'), $user_r['fullname']);
             if ($user_r['user_id'] === get_opendb_session_var('user_id') || is_user_granted_permission(PERM_ADMIN_USER_PROFILE)) {
                 echo format_field(get_opendb_lang_var('email'), $user_r['email_addr']);
             }
             echo "\n</table>";
             $address_header_displayed = FALSE;
             $addr_results = fetch_user_address_type_rs($user_r['user_id'], TRUE);
             if ($addr_results) {
                 while ($address_type_r = db_fetch_assoc($addr_results)) {
                     if (is_user_address_visible($HTTP_VARS, $address_type_r)) {
                         $attr_results = fetch_address_type_attribute_type_rs($address_type_r['s_address_type'], 'query', TRUE);
                         if ($attr_results) {
                             echo '<h3>' . $address_type_r['description'] . '</h3>';
                             echo "<table>";
                             while ($addr_attribute_type_r = db_fetch_assoc($attr_results)) {
                                 $value = NULL;
                                 if (is_lookup_attribute_type($addr_attribute_type_r['s_attribute_type'])) {
                                     $value = fetch_user_address_lookup_attribute_val($address_type_r['sequence_number'], $addr_attribute_type_r['s_attribute_type'], $addr_attribute_type_r['order_no']);
开发者ID:horrabin,项目名称:opendb,代码行数:31,代码来源:user_profile.php

示例9: format_field

                         $field .= ' SELECTED';
                     }
                     $field .= '>' . $plugin_r['description'] . "\n";
                 }
             }
             $field .= "</select>";
             echo format_field(get_opendb_lang_var('type'), $field);
             if (is_user_granted_permission(PERM_ADMIN_EXPORT)) {
                 echo format_field(get_opendb_lang_var('owner'), "\n<select name=\"owner_id\">" . "\n<option value=\"\">-------------- " . get_opendb_lang_var('all') . " --------------" . custom_select('owner_id', fetch_user_rs(PERM_USER_EXPORT), '%fullname% (%user_id%)', 'NA', ifempty($HTTP_VARS['owner_id'], get_opendb_session_var('user_id')), 'user_id') . "\n</select>");
             } else {
                 echo "<input type=\"hidden\" name=\"owner_id\" value=\"" . $HTTP_VARS['owner_id'] . "\">";
             }
             echo format_field(get_opendb_lang_var('item_type'), "<select name=\"s_item_type\">" . "\n<option value=\"\">-------------- " . get_opendb_lang_var('all') . " --------------" . custom_select('s_item_type', fetch_item_type_rs(), '%s_item_type% - %description%', 'NA', $HTTP_VARS['s_item_type'], 's_item_type') . "\n</select>");
             $lookup_results = fetch_status_type_rs(TRUE);
             if ($lookup_results && db_num_rows($lookup_results) > 1) {
                 echo format_field(get_opendb_lang_var('s_status_type'), checkbox_grid('s_status_type', $lookup_results, '%img%', 'VERTICAL', NULL));
                 // value
             }
             echo "</table>";
             echo "<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('submit') . "\">";
             echo "</form>";
             echo _theme_footer();
         }
     } else {
         //no guests or borrowers allowed!
         opendb_not_authorised_page(array(PERM_USER_EXPORT, PERM_ADMIN_EXPORT));
     }
 } else {
     // invalid login, so login instead.
     redirect_login($PHP_SELF, $HTTP_VARS);
 }
开发者ID:horrabin,项目名称:opendb,代码行数:31,代码来源:export.php

示例10: get_upload_form

function get_upload_form($HTTP_VARS)
{
    global $PHP_SELF;
    $buffer .= "\n<form name=\"main\" action=\"{$PHP_SELF}\" method=\"POST\" enctype=\"multipart/form-data\">";
    $buffer .= "\n<input type=\"hidden\" name=\"op\" value=\"upload\">";
    $buffer .= "\n<table>";
    if (is_user_granted_permission(PERM_ADMIN_IMPORT)) {
        $buffer .= format_field(get_opendb_lang_var('owner'), custom_select('owner_id', fetch_user_rs(PERM_USER_IMPORT), '%fullname% (%user_id%)', 1, ifempty($HTTP_VARS['owner_id'], get_opendb_session_var('user_id')), 'user_id'));
    } else {
        $buffer .= "\n<input type=\"hidden\" name=\"owner_id\" value=\"" . $HTTP_VARS['owner_id'] . "\">";
    }
    $buffer .= format_field(get_opendb_lang_var('item_type'), single_select('s_item_type', fetch_item_type_rs(TRUE), "%value% - %display%", NULL, $HTTP_VARS['s_item_type']));
    $buffer .= format_field(get_opendb_lang_var('file'), "<input type=\"file\" class=\"file\" size=\"25\" name=\"uploadfile\">");
    $buffer .= "\n</table>";
    $buffer .= "\n<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('submit') . "\">";
    $buffer .= "\n</form>";
    return $buffer;
}
开发者ID:horrabin,项目名称:opendb,代码行数:18,代码来源:import.php

示例11: query2result

        if ($CONFIG['index_link'] == 'latest') {
            $latest_value = query2result("SELECT ticket FROM tickets WHERE parent = '{$value}' ORDER BY ticket DESC LIMIT 1");
            if ($latest_value) {
                $value = $latest_value;
            }
        }
        $action = "location.href = 'index.php?m=ticketsmith&a=view&ticket={$value}'";
        echo '<tr class="' . ($nticks % 2 == 1 ? 'first' : 'second') . '" onclick="' . $action . '" style="cursor:pointer">';
        echo '<td align="center"><img src="images/view.gif"></td>';
        for ($n = 1; $n < count($fields['headings']); $n++) {
            echo '<td align=' . $fields['aligns'][$n] . '>';
            //translate some information, some not
            if ($fields['headings'][$n] == 'Status') {
                echo $AppUI->_(format_field($row[$fields['columns'][$n]], $fields['types'][$n], $row[$fields['columns'][0]]));
            } else {
                echo format_field($row[$fields['columns'][$n]], $fields['types'][$n], $row[$fields['columns'][0]]);
            }
            echo '</td>';
        }
        echo '</tr>';
        $nticks++;
    }
    echo '<script>Table("idTicketList").setNormalHover(2)</script>';
} else {
    echo '<tr class="second">';
    echo '<td align="center" colspan="100%">';
    echo $AppUI->_('There are no') . ' ';
    echo $type == 'All' ? '' : strtolower($AppUI->_($type)) . ' ';
    echo $AppUI->_('tickets');
    echo '</td>';
    echo '</tr>';
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:index.php

示例12: get_item_display_field

function get_item_display_field($item_r, $item_attribute_type_r, $value = NULL, $dowrap = TRUE, $prompt_mask = NULL)
{
    if ($item_attribute_type_r['display_type'] == 'hidden') {
        return '';
    } else {
        if ($item_attribute_type_r['display_type'] == 'fileviewer') {
            $format_mask = ifempty($item_attribute_type_r['display_type_arg1'], '%value%');
            $width = ifempty($item_attribute_type_r['display_type_arg2'], '400');
            $height = ifempty($item_attribute_type_r['display_type_arg3'], '300');
            $target = ifempty($item_attribute_type_r['display_type_arg4'], '_blank');
            if (is_array($value)) {
                $values = $value;
            } else {
                $values[] = $value;
            }
            if (count($values) > 0) {
                $display_value_r = array();
                while (list(, $value) = each($values)) {
                    $value = trim($value);
                    $value_format_mask = $format_mask;
                    if (strpos($value_format_mask, '%img%') !== FALSE) {
                        $file_type_r = fetch_file_type_r(fetch_file_type_for_extension(get_file_ext($value)));
                        if (strlen($file_type_r['image']) > 0 && ($image_src = theme_image_src($file_type_r['image'])) !== FALSE) {
                            $img = '<img src="' . $image_src . '" title="' . $value . '">';
                        } else {
                            $img = '';
                        }
                        $value_format_mask = str_replace('%img%', $img, $value_format_mask);
                    }
                    if (strpos($value_format_mask, '%value%') !== FALSE) {
                        $value_format_mask = str_replace('%value%', $value, $value_format_mask);
                    }
                    $file_r = file_cache_get_image_r($value, 'display');
                    $url = $file_r['fullsize']['url'];
                    $display_value_r[] = "<a href=\"" . $value . "\" onclick=\"fileviewer('{$url}' ,'" . ($width + 20) . "', '" . ($height + 25) . "', '" . $target . "'); return false;\" title=\"" . $item_attribute_type_r['prompt'] . "\" class=\"popuplink\">{$value_format_mask}</a>";
                }
                $field = format_multivalue_block($display_value_r, 'fileviewer');
                if ($dowrap) {
                    return format_field($item_attribute_type_r['prompt'], $field, $prompt_mask);
                } else {
                    return $field;
                }
            } else {
                return '';
            }
        } else {
            if ($item_attribute_type_r['display_type'] == 'datetime') {
                if (is_array($value)) {
                    $values = $value;
                } else {
                    $values[] = $value;
                }
                if (count($values) > 0) {
                    $display_value_r = array();
                    while (list(, $value) = each($values)) {
                        $value = trim($value);
                        $timestamp = get_timestamp_for_datetime($value, 'YYYYMMDDHH24MISS');
                        if ($timestamp !== FALSE) {
                            if (strlen($item_attribute_type_r['display_type_arg1']) == 0) {
                                $item_attribute_type_r['display_type_arg1'] = 'DD/MM/YYYY';
                            }
                            $datetime = get_localised_timestamp($item_attribute_type_r['display_type_arg1'], $timestamp);
                            if ($datetime !== FALSE) {
                                $display_value_r[] = $datetime;
                            } else {
                                $display_value_r[] = $value;
                            }
                        } else {
                            $display_value_r[] = $value;
                        }
                    }
                    $field = format_multivalue_block($display_value_r, 'datetime');
                    if ($dowrap) {
                        return format_field($item_attribute_type_r['prompt'], $field, $prompt_mask);
                    } else {
                        return $field;
                    }
                } else {
                    return '';
                }
            } else {
                if ($item_attribute_type_r['display_type'] == 'format_mins') {
                    if (is_array($value)) {
                        $values = $value;
                    } else {
                        $values[] = $value;
                    }
                    if (count($values) > 0) {
                        $display_value_r = array();
                        while (list(, $value) = each($values)) {
                            $value = trim($value);
                            if (is_numeric($value)) {
                                // Ensure we have a mask to work with.
                                $display_mask = $item_attribute_type_r['display_type_arg1'];
                                if (strlen($display_mask) == 0) {
                                    $display_mask = '%h %H %m %M';
                                }
                                $hrs = floor($value / 60);
                                // hours
                                $mins = $value % 60;
//.........这里部分代码省略.........
开发者ID:horrabin,项目名称:opendb,代码行数:101,代码来源:displayfields.php

示例13: install_check_php_settings

function install_check_php_settings()
{
    $buffer = "<h3>PHP Settings</h3>\n";
    $buffer .= "<table>";
    if (opendb_version_compare(phpversion(), "5.0.0", ">=")) {
        $buffer .= format_field("PHP Version", phpversion());
    } else {
        $buffer .= format_field("PHP Version", "<span class='error'>" . phpversion() . " (must be >= 5.0.0)</span>");
    }
    if (preg_match("/([0-9]+)M/", ini_get('memory_limit'), $matches)) {
        if (is_numeric($matches[1]) && $matches[1] >= 8) {
            $buffer .= format_field("Memory Limit", $matches[0]);
        } else {
            $buffer .= format_field("Memory Limit", "<span class='error'>" . $matches[0] . " (should be >= 8M)</span>");
        }
    }
    if (ini_get('safe_mode') == 0 || strtolower(ini_get('safe_mode')) == 'off') {
        $buffer .= format_field("Safe Mode", "off");
    } else {
        $buffer .= format_field("Safe Mode", "<span class='error'>on (item / http cache, file uploads, and potentially other parts of the system do not function well with safe mode enabled.)</span>");
    }
    $max_execution_time = ini_get('max_execution_time');
    if (is_numeric(ini_get('max_execution_time')) && (ini_get('max_execution_time') >= 600 || @set_time_limit('600') && ini_get('max_execution_time') >= 600)) {
        if ($max_execution_time < 600) {
            $max_execution_time = 600;
            // set_time_limit can be activated, so for display purposes, up it to the 600, which is what we use
        }
        $buffer .= format_field("Max Execution Time", $max_execution_time);
    } else {
        $buffer .= format_field("Max Execution Time", "<span class='error'>" . $max_execution_time . " (set_time_limit disabled - set_time_limit should be enabled or max_execution_time >= 600)</span>");
    }
    if (ini_get('register_globals') == 0 || strtolower(ini_get('register_globals')) == 'off') {
        $buffer .= format_field("Register Globals", "off");
    } else {
        $buffer .= format_field("Register Globals", "<span class='warn'>on (register globals is not required)</span>");
    }
    if (ini_get('file_uploads') == 1 || strtolower(ini_get('file_uploads')) == 'on') {
        $buffer .= format_field("File Uploads", "on");
    } else {
        $buffer .= format_field("File Uploads", "<span class='error'>off (import functionality will be disabled)</span>");
    }
    $buffer .= "</table>";
    return $buffer;
}
开发者ID:horrabin,项目名称:opendb,代码行数:44,代码来源:install.php

示例14: format_field

            $itemTypeBlock .= "</select>";
            echo format_field(get_opendb_lang_var('s_attribute_type'), $attrTypeSelect);
            echo format_field(get_opendb_lang_var('s_attribute_type_lookup'), "\n<select name=\"lookup_attribute_val\" id=\"search-lookupattributeval\" onChange=\"if(this.options[this.options.selectedIndex].value.length>0){this.form['attribute_val'].disabled=true;}else{this.form['attribute_val'].disabled=false;}\">" . "\n<option value=\"\">" . get_opendb_lang_var('use_the_value_field') . " ---->" . "\n</select>");
            echo format_field(get_opendb_lang_var('attribute_val'), "<input type=\"text\" class=\"text\" name=\"attribute_val\" id=\"search-attributeval\" size=\"50\" value=\"\">" . "\n<ul class=\"searchInputOptions\">" . "\n<li><input type=\"radio\" class=\"radio\" name=\"attr_match\" value=\"word\">" . get_opendb_lang_var('word_match') . "</li>" . "\n<li><input type=\"radio\" class=\"radio\" name=\"attr_match\" value=\"partial\" CHECKED>" . get_opendb_lang_var('partial_match') . "</li>" . "\n<li><input type=\"radio\" class=\"radio\" name=\"attr_match\" value=\"exact\">" . get_opendb_lang_var('exact_match') . "</li>" . "\n<li><input type=\"checkbox\" class=\"checkbox\" name=\"attr_case\" value=\"case_sensitive\">" . get_opendb_lang_var('case_sensitive') . "</li>" . "\n</ul>");
            if (strlen($HTTP_VARS['not_owner_id']) > 0) {
                echo "\n<input type=\"hidden\" name=\"not_owner_id\" value=\"" . $HTTP_VARS['not_owner_id'] . "\">";
            }
            echo format_field(get_opendb_lang_var('owner'), "\n<select name=\"owner_id\" id=\"search-owner\">" . "\n<option value=\"\">-------------- " . get_opendb_lang_var('all') . " --------------" . custom_select('owner_id', fetch_user_rs(PERM_ITEM_OWNER), '%fullname% (%user_id%)', 'NA', NULL, 'user_id') . "\n</select>");
            $lookup_results = fetch_status_type_rs(TRUE);
            if ($lookup_results && db_num_rows($lookup_results) > 1) {
                echo format_field(get_opendb_lang_var('s_status_type'), checkbox_grid('s_status_type', $lookup_results, '%img%', 'VERTICAL', array()));
                // value
            }
            echo format_field(get_opendb_lang_var('status_comment'), "\n<input type=\"text\" class=\"text\" name=\"status_comment\" id=\"search-statuscomment\" size=\"50\">" . "\n<ul class=\"searchInputOptions\">" . "\n<li><input type=\"radio\" class=\"radio\" name=\"status_comment_match\" value=\"word\">" . get_opendb_lang_var('word_match') . "</li>" . "\n<li><input type=\"radio\" class=\"radio\" name=\"status_comment_match\" value=\"partial\" CHECKED>" . get_opendb_lang_var('partial_match') . "</li>" . "\n<li><input type=\"radio\" class=\"radio\" name=\"status_comment_match\" value=\"exact\">" . get_opendb_lang_var('exact_match') . "</li>" . "\n<li><input type=\"checkbox\" class=\"checkbox\" name=\"status_comment_case\" value=\"case_sensitive\">" . get_opendb_lang_var('case_sensitive') . "</li>" . "\n</ul>");
            echo format_field(get_opendb_lang_var('updated'), "\n<select name=\"update_on_days\" id=\"search-updateondays\" onChange=\"if(this.options[this.options.selectedIndex].value.length>0){this.form['update_on'].disabled=true;}else{this.form['update_on'].disabled=false;}\">" . "\n<option value=\"\">" . get_opendb_lang_var('specify_datetime') . " ---->" . "\n<option value=\"1\">" . get_opendb_lang_var('one_day_ago') . "\n<option value=\"7\">" . get_opendb_lang_var('one_week_ago') . "\n<option value=\"28\">" . get_opendb_lang_var('one_month_ago') . "\n<option value=\"365\">" . get_opendb_lang_var('one_year_ago') . "\n</select>" . get_input_field("update_on", NULL, NULL, "datetime(" . get_opendb_config_var('search', 'datetime_mask') . ")", "N", NULL, FALSE));
            echo format_field(get_opendb_lang_var('order_by'), "\n<select name=\"order_by\"  id=\"search-orderby\">" . "\n<option value=\"title\" SELECTED>" . get_opendb_lang_var('title') . "\n<option value=\"owner_id\">" . get_opendb_lang_var('owner') . "\n<option value=\"category\">" . get_opendb_lang_var('category') . "\n<option value=\"s_item_type\">" . get_opendb_lang_var('item_type') . "\n<option value=\"s_status_type\">" . get_opendb_lang_var('s_status_type') . "\n<option value=\"update_on\">" . get_opendb_lang_var('update_date') . "\n</select>" . "\n<input type=\"radio\" class=\"radio\" name=\"sortorder\" value=\"ASC\" CHECKED>" . get_opendb_lang_var('asc') . "\n<input type=\"radio\" class=\"radio\" name=\"sortorder\" value=\"DESC\">" . get_opendb_lang_var('desc'));
            echo "</table>";
            echo "\n<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('search') . "\">";
            echo "</form>";
            echo _theme_footer();
        } else {
            opendb_not_authorised_page(PERM_VIEW_ADVANCED_SEARCH, $HTTP_VARS);
        }
    } else {
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
}
开发者ID:horrabin,项目名称:opendb,代码行数:31,代码来源:search.php

示例15: get_edit_item_instance_form

function get_edit_item_instance_form($op, $item_r, $status_type_r, $HTTP_VARS)
{
    $formContents = "<div class=\"tabContentHidden\" id=\"instance_info\">";
    $formContents .= get_related_item_search_script();
    $results = fetch_item_attribute_type_rs($item_r['s_item_type'], 'instance_field_types');
    if ($results) {
        $formContents .= "<h3>" . get_opendb_lang_var('instance_info') . "</h3>";
        $formContents .= "\n<table>";
        if (($op == 'edit' || $op == 'refresh') && $status_type_r['change_owner_ind'] == 'Y') {
            $formContents .= format_field(get_opendb_lang_var('owner'), "\n<select name=\"owner_id\">" . custom_select('owner_id', fetch_user_rs(PERM_ITEM_OWNER, INCLUDE_ROLE_PERMISSIONS, INCLUDE_CURRENT_USER, EXCLUDE_DEACTIVATED_USER, 'user_id', 'ASC'), '%fullname% (%user_id%)', 'NA', ifempty($HTTP_VARS['owner_id'], $item_r['owner_id']), 'user_id') . "\n</select>");
        }
        if ($op == 'newinstance' || $op == 'clone_item') {
            $item_r['s_status_type'] = NULL;
            $item_r['status_comment'] = NULL;
            $item_r['borrow_duration'] = NULL;
        }
        while ($item_attribute_type_r = db_fetch_assoc($results)) {
            if ($item_attribute_type_r['s_field_type'] == 'STATUSTYPE') {
                $status_type = ifempty(filter_item_input_field($item_attribute_type_r, $HTTP_VARS['s_status_type']), $item_r['s_status_type']);
                if ($op == 'new' || $op == 'site' || $op == 'newinstance' || $op == 'clone_item') {
                    $lookup_results = fetch_newitem_status_type_rs();
                } else {
                    // If item has borrowed records, then no s_status_type with borrow_ind == 'X' should be included.
                    $lookup_results = fetch_update_status_type_rs($status_type);
                }
                if ($lookup_results && db_num_rows($lookup_results) > 0) {
                    $formContents .= format_field($item_attribute_type_r['prompt'], radio_grid('s_status_type', $lookup_results, '%img%', 'VERTICAL', $status_type));
                    // value
                }
            } else {
                if ($item_attribute_type_r['s_field_type'] == 'STATUSCMNT') {
                    $status_comment = ifempty(filter_item_input_field($item_attribute_type_r, $HTTP_VARS['status_comment']), $item_r['status_comment']);
                    $formContents .= get_item_input_field('status_comment', $item_attribute_type_r, NULL, $status_comment);
                } else {
                    if ($item_attribute_type_r['s_field_type'] == 'DURATION') {
                        $borrow_duration = ifempty(filter_item_input_field($item_attribute_type_r, $HTTP_VARS['borrow_duration']), $item_r['borrow_duration']);
                        // The S_DURATION lookup list will most likely include an 'Undefined' option, that equates
                        // to an empty string.  So for Updates, we want to allow for a match, by forcing any NULL
                        // value to a empty string.  The reason why we do this, is because the Borrow Duration was
                        // probably set to 'Undefined', but because this equated to an empty string, the field was
                        // never updated.
                        if ($op != 'new' && $op != 'site') {
                            if ($borrow_duration === NULL) {
                                $borrow_duration = '';
                            }
                        }
                        $formContents .= get_item_input_field('borrow_duration', $item_attribute_type_r, NULL, $borrow_duration);
                    }
                }
            }
        }
        //while
        db_free_result($results);
        $formContents .= "\n</table>";
    }
    if (get_opendb_config_var('item_input', 'related_item_support') !== FALSE) {
        $formContents .= "<h3>" . get_opendb_lang_var('add_related_parent') . "</h3>";
        $formContents .= "\n<table>";
        $formContents .= format_field(get_opendb_lang_var('parent_item_filter'), '<input type="text" name="parent_item_filter" id="parent_item_filter">');
        $formContents .= format_field(get_opendb_lang_var('parent_item'), format_item_parents_select($HTTP_VARS, $item_r, '%parent_only%'));
        $formContents .= "\n</table>";
        $relatedItems = get_related_items_listing($item_r, $HTTP_VARS, RELATED_PARENTS_MODE);
        if ($relatedItems != NULL) {
            $formContents .= "<h3>" . get_opendb_lang_var('related_parent_item(s)') . "</h3>";
            $formContents .= $relatedItems;
        }
    }
    $formContents .= "</div>";
    return $formContents;
}
开发者ID:horrabin,项目名称:opendb,代码行数:70,代码来源:item_input.php


注:本文中的format_field函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。