本文整理汇总了PHP中get_field_names函数的典型用法代码示例。如果您正苦于以下问题:PHP get_field_names函数的具体用法?PHP get_field_names怎么用?PHP get_field_names使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_field_names函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: define
define( 'PRINT_ALL_BUG_OPTIONS_INC_ALLOW', true );
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'print_all_bug_options_inc.php' );
form_security_validate( 'print_all_bug_options_update' );
auth_ensure_user_authenticated();
$f_user_id = gpc_get_int( 'user_id' );
$f_redirect_url = gpc_get_string( 'redirect_url' );
# the check for the protected state is already done in the form, there is
# no need to duplicate it here.
# get the fields list
$t_field_name_arr = get_field_names();
$field_name_count = count($t_field_name_arr);
# check the checkboxes
for ($i=0 ; $i <$field_name_count ; $i++) {
$t_name='print_'.utf8_strtolower(str_replace(' ','_',$t_field_name_arr[$i]));
$t_flag = gpc_get( $t_name, null );
if ( $t_flag === null ) {
$t_prefs_arr[$i] = 0;
} else {
$t_prefs_arr[$i] = 1;
}
}
# get user id
开发者ID:rombert,项目名称:mantisbt,代码行数:30,代码来源:print_all_bug_options_update.php
示例2: get_newid
}
if (!$pos) {
$pos = 0;
}
if (!$id) {
$id = get_newid("referenz");
}
for ($x = 0; $x < 6; $x++) {
if (${"f_pic_title_".$x}) {
$pic_tits[$x] = ${"f_pic_title_".$x};
} else {
$pic_tits[$x] = "---";
}
}
$pic_titstr = implode("#",$pic_tits);
$fields = implode(",",get_field_names("referenz"));
$vals = "'".$id."','".addslashes($f_name)."','".addslashes($f_txt)."','".addslashes($pic_titstr)."','".$picstr."','".$pos."'";
replace_data("referenz",$fields,$vals);
echo "<script language=\"javascript\">self.location.href='list.php'</script>";
exit;
}
}
if ($init == "do") {
$data = get_row("referenz","id,name,txt,img_titles,imgs,pos","id=".$id);
$f_name = $data['name'];
$f_txt = $data['txt'];
$pos = $data['pos'];
if ($data['img_titles']) {
$pic_tits = explode("#",$data['img_titles']);
for ($x = 0; $x < count($pic_tits); $x++) {
开发者ID:bernhardkircher,项目名称:installation-kircher-old,代码行数:31,代码来源:edit.php
示例3: edit_printing_prefs
/**
* Edit Printing preferences
* @param int $p_user_id user id
* @param bool $p_error_if_protected error if account protected
* @param string $p_redirect_url redirect url
*/
function edit_printing_prefs($p_user_id = null, $p_error_if_protected = true, $p_redirect_url = '')
{
if (null === $p_user_id) {
$p_user_id = auth_get_current_user_id();
}
$c_user_id = db_prepare_int($p_user_id);
# protected account check
if ($p_error_if_protected) {
user_ensure_unprotected($p_user_id);
}
$t_user_print_pref_table = db_get_table('user_print_pref');
if (is_blank($p_redirect_url)) {
$p_redirect_url = 'print_all_bug_page.php';
}
# get the fields list
$t_field_name_arr = get_field_names();
$field_name_count = count($t_field_name_arr);
# Grab the data
$query = "SELECT print_pref\n\t\t\tFROM {$t_user_print_pref_table}\n\t\t\tWHERE user_id=" . db_param();
$result = db_query_bound($query, array($c_user_id));
## OOPS, No entry in the database yet. Lets make one
if (0 == db_num_rows($result)) {
# create a default array, same size than $t_field_name
for ($i = 0; $i < $field_name_count; $i++) {
$t_default_arr[$i] = 1;
}
$t_default = implode('', $t_default_arr);
# all fields are added by default
$query = "INSERT\n\t\t\t\tINTO {$t_user_print_pref_table}\n\t\t\t\t(user_id, print_pref)\n\t\t\t\tVALUES\n\t\t\t\t(" . db_param() . "," . db_param() . ")";
$result = db_query_bound($query, array($c_user_id, $t_default));
# Rerun select query
$query = "SELECT print_pref\n\t\t\t\tFROM {$t_user_print_pref_table}\n\t\t\t\tWHERE user_id=" . db_param();
$result = db_query_bound($query, array($c_user_id));
}
# putting the query result into an array with the same size as $t_fields_arr
$row = db_fetch_array($result);
$t_prefs = $row['print_pref'];
# Account Preferences Form BEGIN
$t_index_count = 0;
?>
<br />
<div>
<form method="post" action="print_all_bug_options_update.php">
<?php
echo form_security_field('print_all_bug_options_update');
?>
<input type="hidden" name="user_id" value="<?php
echo $p_user_id;
?>
" />
<input type="hidden" name="redirect_url" value="<?php
echo string_attribute($p_redirect_url);
?>
" />
<table class="width75" cellspacing="1">
<tr>
<td class="form-title">
<?php
echo lang_get('printing_preferences_title');
?>
</td>
<td class="right">
</td>
</tr>
<?php
# display the checkboxes
for ($i = 0; $i < $field_name_count; $i++) {
echo '<tr>';
?>
<th class="category">
<?php
echo lang_get($t_field_name_arr[$i]);
?>
</th>
<td>
<input type="checkbox" name="<?php
echo 'print_' . $t_field_name_arr[$i];
?>
"
<?php
if (isset($t_prefs[$i]) && $t_prefs[$i] == 1) {
echo 'checked="checked"';
}
?>
/>
</td>
</tr>
<?php
}
?>
//.........这里部分代码省略.........
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:101,代码来源:print_all_bug_options_inc.php
示例4: fb
<?php
require_once '../php/firephp/fb.php';
require_once '../functions/db_lib.php';
$table_name = null;
if (isset($_REQUEST['table_name']) && $_REQUEST['table_name'] != '') {
$table_name = $_REQUEST['table_name'];
}
fb($table_name, '$table_name');
$field_names = get_field_names($table_name);
fb($field_names, '$field_names');
header('content-type:application/json');
echo json_encode($field_names);
开发者ID:khutchinson,项目名称:scoutmap,代码行数:13,代码来源:get_field_list.php
注:本文中的get_field_names函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论