private function leaveACommentDisabled()
    {
        ?>
<li class="leave-comment">

<div class="c1_6 col-md-1 hidden-xs">
<?php 
        if (Security::is_logged()) {
            $imagen = '';
            $db = new db();
            $db->query_assoc('select * from usuarios usr
	left join uploads upl on upl.id_upload = usr.imagen 
	where usr.id_usuario = "' . $_SESSION['id_usuario'] . '" 
	');
            if ($rec = $db->next()) {
                $imagen = $rec['archivo'];
            }
        } else {
            $imagen = '';
        }
        if ($imagen != '') {
            ?>
<div class="user-img"><img src="<?php 
            echo http_uploads() . '/' . $imagen;
            ?>
"></div><?php 
        } else {
            ?>
<div class="user-img no-pho"></div><?php 
        }
        ?>
</div>
<div class="c5_6 col-md-11 ">
<?php 
        if ($this->show_detail) {
            ?>
<table class="user-data">
	<tr>
		<td colspan="2">
		<div id="message-err-<?php 
            echo $this->id_obj;
            ?>
" class="fk-error-message"
			style="display: none"></div>
		</td>
	</tr>
	<tr>
		<td>Nombre(Requerido):</td>
		<td><input type="text" id="name-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="name-user-<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
	<tr>
		<td>Email(Requerido):</td>
		<td><input type="text" id="email-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="email-user<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
	<tr>
		<td>Sitio web:</td>
		<td><input type="text" id="web-user-<?php 
            echo $this->id_obj;
            ?>
"
			name="web-user<?php 
            echo $this->id_obj;
            ?>
" value="" /></td>
	</tr>
</table><?php 
        }
        ?>
<table class="txt-data">
	<tr>
		<td><textarea id="leave-comment-<?php 
        echo $this->id_obj;
        ?>
-disabled" class="form-control disabled" disabled="disabled"> </textarea></td>
	</tr>
</table>
<button type="button" class="btn btn-danger btn-xs" id="leave-comment-btn-<?php 
        echo $this->id_obj;
        ?>
-disabled"> Comentar <i class="fa fa-comment"></i></button>


</div>
<div class="clear"></div>







</li>
		<?php 
    }
Example #2
0
/**
 * @desc File field Object
 * */
function fk_file_field($id, $name, $value, $onclick = null, $cssExtra = '', $mode = 'edit')
{
    $html_fld = '';
    if ($mode == 'edit') {
        $html_fld .= '<input id="' . $id . '" name="' . $name . '" type="hidden" value="' . $value . '" class="' . $cssExtra . '" />';
        $html_fld .= '<br><iframe src="' . fk_link() . 'FkMaster/upolader/' . $id . '/" name="ifrmupl-' . $id . '" style="width:95%;height:30px;" frameborder="0"></iframe>';
    }
    $file_data = '';
    $ArUpl = new ActiveRecord('uploads');
    $totUpl = $ArUpl->find($value);
    if ($totUpl == 1) {
        if (strrpos($ArUpl->fields['tipo'], 'image') > -1) {
            //image
            $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank"><img src="' . http_uploads() . $ArUpl->fields['archivo'] . '" ></a>';
        } else {
            //Other file
            $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank">' . $ArUpl->fields['titulo'] . '</a>';
        }
    }
    $html_fld .= '<div id="ico-' . $id . '">' . $file_data . '</div>';
    return $html_fld;
}
Example #3
0
    /**
     *@package db_record
     *@method print_form_field()
     *@desc returns the list of html fields  automatically from a record
     *@since v0.1 beta
     * */
    public function print_form_field($field, $CssName = '', $ExtraAttributes = '', $encode_fields = FALSE, $access = TRUE, $read_only = FALSE, $code = '')
    {
        $html_fld = '';
        if ($encode_fields == TRUE) {
            $field_id_html = 'fkf_' . encode($field . $code);
            $field_name_html = encode($field . $code);
        } else {
            $field_id_html = $field . $code;
            $field_name_html = $field . $code;
        }
        $original_type = $this->form_fields[$field]['Type'];
        $type_x = explode("(", $original_type);
        if ($type_x > 1) {
            $type = $type_x[0];
        } else {
            $type = $original_type;
        }
        // Display Mode
        $mode_view_edit = $this->field_mode == 'view-edit' ? true : false;
        if ($read_only == true) {
            // read only
            $display_as = 'read-only';
        } else {
            if ($this->field_mode == 'view-edit') {
                $display_as = 'view-edit';
            } else {
                $display_as = 'edit';
            }
        }
        if ($this->useHtmlEntities_onField == true) {
            $this->fields[$field] = isset($this->fields[$field]) ? htmlentities($this->fields[$field]) : '';
        } else {
            $this->fields[$field] = isset($this->fields[$field]) ? $this->fields[$field] : '';
        }
        switch ($type) {
            case "varchar":
                // Class
                $Class = 'class="txt ' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><input style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . $this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= @$this->fields[$field] . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "money":
                // Class
                $Class = 'class="txt ' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})">$<input style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . $this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '';
                        $html_fld .= '<div class="input-prepend"><span class="add-on">$</span><input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' /></div>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= fk_money_format($this->fields[$field]) . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "file":
                // Class
                $Class = 'class="txt ' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><input style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . $this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<br><iframe src="' . fk_link() . 'FkMaster/upolader/' . $field_id_html . '/" name="ifrmupl-' . $field_id_html . '" style="width:95%;height:45px;" frameborder="0"></iframe>';
                        $file_data = '';
                        $ArUpl = new ActiveRecord('uploads');
                        $totUpl = $ArUpl->find(@$this->fields[$field]);
                        if ($totUpl == 1) {
                            if (strrpos($ArUpl->fields['tipo'], 'image') > -1) {
                                //image
                                $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank"><img src="' . http_uploads() . $ArUpl->fields['archivo'] . '" ></a>';
                            } else {
                                //Other file
                                $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank">' . $ArUpl->fields['titulo'] . '</a>';
                            }
                        }
                        $html_fld .= '<div id="ico-' . $field_id_html . '">' . $file_data . '</div>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $file_data = '';
                        $ArUpl = new ActiveRecord('uploads');
                        $totUpl = $ArUpl->find(@$this->fields[$field]);
                        if ($totUpl == 1) {
                            if (strrpos($ArUpl->fields['tipo'], 'image') > -1) {
                                //image
                                $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank"><img src="' . http_uploads() . $ArUpl->fields['archivo'] . '" ></a>';
                            } else {
                                //Other file
                                $file_data = '<a href="' . http_uploads() . $ArUpl->fields['archivo'] . '" target="_blank">' . $ArUpl->fields['titulo'] . '</a>';
                            }
                        }
                        $html_fld .= '<div id="ico-' . $this->id_field_name . '">' . $file_data . '</div>';
                    }
                }
                break;
            case "timestamp":
                // Class
                $Class = 'class="' . @$CssName . '"';
                $date_value = '';
                if (trim($this->fields[$field]) != '' && trim($this->fields[$field]) != '0000-00-00 00:00:00') {
                    $date_value = date(DATE_FORMAT . ' H:i:s', strtotime($this->fields[$field]));
                }
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= $this->fields[$field] . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . $date_value . '" ' . $Class . ' ' . @$ExtraAttributes . '/>';
                        $html_fld .= '<script language="javascript" type="text/javascript">	$(function() {		$("#' . $field_id_html . '").datetimepicker({dateFormat: "' . JS_DATE_FORMAT . '",timeFormat: "hh:mm:ss",changeMonth: true,changeYear: true});});</script>';
                    } elseif ($display_as == 'edit') {
                        //$date_value = $this->fields[$field];
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . $date_value . '" ' . $Class . ' ' . @$ExtraAttributes . '/>';
                        $html_fld .= '<script language="javascript" type="text/javascript">	$(function() {		$("#' . $field_id_html . '").datetimepicker({dateFormat: "' . JS_DATE_FORMAT . '",timeFormat: "hh:mm:ss",changeMonth: true,changeYear: true});});</script>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= $date_value . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . $date_value . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "date-select":
                //$Class = 'class="date '.@$CssName.'"';
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '1<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . @$Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<script language="javascript" type="text/javascript">$(function() {$( "#' . $field_id_html . '" ).datetimepicker({ dateFormat: "' . JS_DATE_FORMAT . '",showOn: "button",buttonImage: HTTP+"_HTML/img/calendar.gif", buttonImageOnly: true});	});	</script>';
                    } elseif ($display_as == 'edit') {
                        $date_value = '';
                        //if(trim($this->fields[$field])!=''){$date_value = date(DATE_FORMAT,strtotime($this->fields[$field]));}
                        $date_value = $this->fields[$field];
                        $Class = rtrim(str_replace('class="', '', $Class), '"');
                        $html_fld .= fk_date_field($field_id_html, $field_name_html, $date_value, $onclick = null, $cssExtra = $Class, $mode = 'edit');
                        //$html_fld .='2<input id="'.$field_id_html.'" name="'.$field_name_html.'" type="text" value="'.$date_value.'" '.@$Class.' '.@$ExtraAttributes.' />[<a href="javascript:void(0)" onclick="$(\'#'.$field_id_html.'\').val(\''.date(DATE_FORMAT).'\')">'.__('Hoy').'</a>]';
                        //$html_fld .='<script language="javascript" type="text/javascript">$(function(){$( "#'.$field_id_html.'" ).datetimepicker({ dateFormat: "'.JS_DATE_FORMAT.'",changeMonth: true,changeYear: true});	});	</script>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= getFormatedDate($this->fields[$field]) . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "date":
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . @$Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<script language="javascript" type="text/javascript">$(function() {$( "#' . $field_id_html . '" ).datetimepicker({ dateFormat: "' . JS_DATE_FORMAT . '",showOn: "button",buttonImage: HTTP+"_HTML/img/calendar.gif", buttonImageOnly: true});	});	</script>';
                    } elseif ($display_as == 'edit') {
                        $date_value = '';
                        if (trim($this->fields[$field]) != '') {
                            $date_value = date(DATE_FORMAT, strtotime($this->fields[$field]));
                        }
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . $date_value . '" ' . @$Class . ' ' . @$ExtraAttributes . ' />[<a href="javascript:void(0)" onclick="$(\'#' . $field_id_html . '\').val(\'' . date(DATE_FORMAT) . '\');$(\'#' . $field_id_html . '\').change();">' . __('Hoy') . '</a>]';
                        $html_fld .= '<script language="javascript" type="text/javascript">$(function(){$( "#' . $field_id_html . '" ).datetimepicker({ dateFormat: "' . JS_DATE_FORMAT . '",changeMonth: true,changeYear: true});	});	</script>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= getFormatedDate($this->fields[$field]) . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "text":
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><textarea style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '"  ' . $Class . ' ' . @$ExtraAttributes . ' >' . @$this->fields[$field] . '</textarea>';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . @$this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<textarea id="' . $field_id_html . '" name="' . $field_name_html . '"  ' . $Class . ' ' . @$ExtraAttributes . ' >' . @$this->fields[$field] . '</textarea>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= '<div id="tx-' . $field_id_html . '">' . nl2br(@$this->fields[$field]) . '</div><input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "textarea":
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><textarea style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '"  ' . $Class . ' ' . @$ExtraAttributes . ' >' . @$this->fields[$field] . '</textarea>';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . @$this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<textarea id="' . $field_id_html . '" name="' . $field_name_html . '"  ' . $Class . ' ' . @$ExtraAttributes . ' >' . @$this->fields[$field] . '</textarea>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= '<div id="tx-' . $field_id_html . '">' . nl2br(@$this->fields[$field]) . '</div><input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            case "tinyint":
                $chk[0] = '';
                $chk[1] = '';
                $chk_read_val = @$this->fields[$field] == 1 ? 'Si' : 'No';
                if (@$this->fields[$field] == 1 || @$this->fields[$field] == 0) {
                    $chk[@$this->fields[$field]] = 'CHECKED';
                }
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit' || $display_as == 'edit') {
                        $html_fld .= 'Si<input id="' . $field_id_html . '_1" name="' . $field_name_html . '" ' . $chk['1'] . ' type="radio" value="1" ' . $Class . ' ' . @$ExtraAttributes . '>
             No<input id="' . $field_id_html . '_0" name="' . $field_name_html . '" ' . $chk['0'] . ' type="radio" value="0" ' . $Class . ' ' . @$ExtraAttributes . '>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= $chk_read_val;
                    }
                }
                break;
            case "checkbox":
                $chk[0] = '';
                $chk[1] = '';
                $chk_read_val = @$this->fields[$field] == 1 ? 'Si' : 'No';
                $chk = '';
                if (@$this->fields[$field] == 1) {
                    $chk = 'checked="checked"';
                }
                $Class = 'class="' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit' || $display_as == 'edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . $this->fields[$field] . '" >';
                        $html_fld .= '<input id="' . $field_id_html . '_1" name="' . $field_name_html . '_1" ' . $chk . ' type="checkbox" value="1" onclick="if($(this).is(\':checked\')==true){$(\'#' . $field_id_html . '\').val(1);}else{$(\'#' . $field_id_html . '\').val(0);}" ' . $Class . ' ' . @$ExtraAttributes . '>';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= $chk_read_val;
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . $this->fields[$field] . '" >';
                    }
                }
                break;
                // Tipo Password
            // Tipo Password
            case "password":
                $Class = 'class="pass ' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="password" value="" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="password" value="" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= '********';
                    }
                }
                break;
            case "select":
                // Get Select Options from sql
                $Class = 'class="sel ' . @$CssName . '"';
                if ($access == TRUE) {
                    $option_selected = isset($this->form_fields[$field]['selected_option']) ? $this->form_fields[$field]['selected_option'] : @$this->fields[$field];
                    if ($display_as == 'view-edit') {
                        $options = fk_select_options($this->form_fields[$field]['sql_options'], $option_selected);
                        $html_fld .= '<select id="' . $field_id_html . '" name="' . $field_name_html . '" ' . $Class . ' ' . @$ExtraAttributes . ' ><option></option>' . $options . '</select>';
                    } elseif ($display_as == 'edit') {
                        $add_new_op = '';
                        $add_new_txt = '';
                        if (isset($this->form_fields[$field]['add_new'])) {
                            $add_new_op = '<option value="new">+ Nuevo</option>';
                            $add_new_txt .= '<input type="text" id="' . $field_id_html . '-txt" name="' . $field_name_html . '-txt" style="display:none" >';
                            $add_new_txt .= '<a href="javascript:void(0)" id="' . $field_id_html . '-cancel" style="display:none" onclick="fkSelect($(this),true);" >Cancelar</a>';
                        }
                        $options = fk_select_options($this->form_fields[$field]['sql_options'], $option_selected);
                        $html_fld .= '<select id="' . $field_id_html . '" name="' . $field_name_html . '" ' . $Class . ' ' . @$ExtraAttributes . ' onchange="fkSelect($(this),false);" ><option></option>' . $options . $add_new_op . '</select>';
                        $html_fld .= $add_new_txt;
                    } elseif ($display_as == 'read-only') {
                        if (isset($this->form_fields[$field]['sql_complex'])) {
                            // query complex version
                            $options = fk_select_complex_query($this->form_fields[$field]['sql_complex'], array($option_selected));
                        } else {
                            // Simple query version
                            $slq_elements = fk_get_query_elements($this->form_fields[$field]['sql_options']);
                            $table = $slq_elements['table'];
                            $val_fld_name = $slq_elements['fields'];
                            $options = fk_select_text($table, $val_fld_name, $option_selected);
                        }
                        $html_fld .= $options[1] . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" />';
                    }
                }
                break;
            case "hidden":
                $Class = 'class="hdn ' . @$CssName . '"';
                $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                break;
            case "search_field":
                // Class
                $Class = 'class="txt ' . @$CssName . '"';
                if ($access == TRUE) {
                    $option_selected = isset($this->form_fields[$field]['selected_option']) ? $this->form_fields[$field]['selected_option'] : @$this->fields[$field];
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><input style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . $this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $options = fk_select_complex_query($this->form_fields[$field]['sql_complex'], array($option_selected));
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '"  />';
                        $html_fld .= '<input id="' . $field_id_html . '-2" name="' . $field_name_html . '-2" type="text" value="' . @$options[1] . '" class="txt ' . $CssName . ' searchbox" ' . @$ExtraAttributes . ' onblur="appForm_PopupSrc({id:\'' . $field_id_html . '\',tbl:\'' . $this->table . '\'})" />
						<input type="button" id="' . $field_id_html . '-btn" value="&nbsp;" class="btn search2" onclick="appForm_PopupSrc({id:\'' . $field_id_html . '\',tbl:\'' . $this->table . '\',forceOpen:true})">
						<input type="button" id="' . $field_id_html . '-btn" class="btn empty" value="&nbsp;" onclick="appForm_ClearPopupSrc({id:\'' . $field_id_html . '\',tbl:\'' . $this->table . '\'});">
						';
                        $html_fld .= '<div id="srcfld-rs-' . $field_id_html . '"></div>';
                    } elseif ($display_as == 'read-only') {
                        $options = fk_select_complex_query($this->form_fields[$field]['sql_complex'], array($option_selected));
                        $html_fld .= @$options[1] . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
            default:
                $Class = 'class="txt ' . @$CssName . '"';
                if ($access == TRUE) {
                    if ($display_as == 'view-edit') {
                        $html_fld .= '<div class="fld" onclick="appForm_updfldTxt({id:\'' . $field_id_html . '\'})"><input style="display:none" id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                        $html_fld .= '<span id="val-' . $field_id_html . '">' . @$this->fields[$field] . '</span>&nbsp;<span class="ui-icon ui-icon-gear"></span></div>';
                        $html_fld .= '<input id="cur-v-' . $field_id_html . '" type="hidden" value="' . @$this->fields[$field] . '"  />';
                    } elseif ($display_as == 'edit') {
                        $html_fld .= '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="text" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    } elseif ($display_as == 'read-only') {
                        $html_fld .= @$this->fields[$field] . '<input id="' . $field_id_html . '" name="' . $field_name_html . '" type="hidden" value="' . @$this->fields[$field] . '" ' . $Class . ' ' . @$ExtraAttributes . ' />';
                    }
                }
                break;
        }
        return $html_fld;
    }