array to string conversion in yii2

PHP Notice – yii\base\ErrorException

Array to string conversion

error shows to below line.

$row = Formdetail::findOneRow( “form_id = ‘{$form_id}’”, array( ) );

is there any idea to solve this…

Cant guess your problem, But to fetch the row , try like this


// $form_id is the variable you have to pass

$row = Formdetail::findOne(['form_id' => $form_id]);

else , Refer This link . it helps you

No that line also not working,

my code is in below.Error line is in bold text.

[code]

<?php

namespace app\modules\WebForm\components\helpers;

use \stdClass;

use app\modules\WebForm\models\Formdetail;

use app\modules\WebForm\models\FormElementOptions;

use app\modules\WebForm\models\FormElements;

use app\modules\WebForm\models\FormValues;

use app\modules\WebForm\models\WebformSettings;

/**

  • Form Display Helper

  • FormDisplayHelper returns the Form with elments dynamically built by the user or raw form

*/

class FormDisplayHelper

{

/**Main function  static  to display a form


 *There are few mode when displaying a form


 *1. New blank form (form populated with default values)


 *2. New form with error (displayed when 1 submitted and having error, form populated with user inputs)


 *3. Edit form (form populated with data from db)


 *4. Edit form with error (displayed when #3 submitted and having error)


 *


 * @access	public


 * @param	string


 * @param   array()


 * @param   int


 * @param   array()


 * @return	str


 */


public static function display_webform_form( &#036;image_url, &#036;webform_lang, &#036;form_id, &#036;form_params = array( ) )


{


    &#036;ul_class                    = '';


    &#036;pagination_header           = '';


    &#036;payment_total_markup_top    = '';


    &#036;custom_element              = '';


    &#036;payment_total_markup_bottom = '';


    &#036;form_resume_markup          = '';


    &#036;button_markup               = '';


    &#036;form_enc_type               = '';


    &#036;range_limit_markup          = '';


    &#036;button_secondary_markup     = '';


    &#036;page_number                 = ( isset( &#036;form_params[ 'page_number' ] ) ) ? &#036;form_params[ 'page_number' ] : '1';


    &#036;populated_values            = ( isset( &#036;form_params[ 'populated_values' ] ) ) ? &#036;form_params[ 'populated_values' ] : array( );


    &#036;error_elements              = ( isset( &#036;form_params[ 'error_elements' ] ) ) ? &#036;form_params[ 'error_elements' ] : array( );


    &#036;custom_error                = ( isset( &#036;form_params[ 'custom_error' ] ) ) ? &#036;form_params[ 'custom_error' ] : '';


    &#036;edit_id                     = ( isset( &#036;form_params[ 'edit_id' ] ) ) ? (int) &#036;form_params[ 'edit_id' ] : 0;


    &#036;integration_method          = ( isset( &#036;form_params[ 'integration_method' ] ) ) ? &#036;form_params[ 'integration_method' ] : ''; //valid values are empty string, 'iframe' or 'php','phone'


    &#036;machform_path               = ( &#33;empty( &#036;form_params[ 'machform_path' ] ) ) ? &#036;form_params[ 'machform_path' ] : '';


    &#036;machform_data_path          = ( &#33;empty( &#036;form_params[ 'machform_data_path' ] ) ) ? &#036;form_params[ 'machform_data_path' ] : '';


    //if there is custom error, don't show other errors


    if ( &#33;empty( &#036;custom_error ) ) {


        &#036;error_elements = array( );


    }


	


    //get form properties data


   [b][b]&#036;row = Formdetail::findOneRow(&quot;form_id ='{&#036;form_id}'&quot;,array());[/b][/b]


	


	


    //check for non-existent or currently drafted forms


    if ( empty( &#036;row ) || &#036;row-&gt;form_active &#33;= 1 ) {


        die( 'This is not valid form URL.' );


    }


    &#036;form = new stdClass();


    if ( count( &#036;row ) &gt; 0 ) {


        &#036;form-&gt;error_message           = '';


        &#036;form-&gt;id                      = &#036;form_id;


        &#036;form-&gt;name                    = &#036;row-&gt;form_name;


        &#036;form-&gt;description             = &#036;row-&gt;form_description;


        &#036;form-&gt;redirect                = &#036;row-&gt;form_redirect;


        &#036;form-&gt;success_message         = &#036;row-&gt;form_success_message;


        &#036;form-&gt;password                = &#036;row-&gt;form_password;


        &#036;form-&gt;frame_height            = &#036;row-&gt;form_frame_height;


        &#036;form-&gt;unique_ip               = &#036;row-&gt;form_unique_ip;


        &#036;form-&gt;has_css                 = &#036;row-&gt;form_has_css;


        &#036;form-&gt;active                  = &#036;row-&gt;form_active;


        &#036;form-&gt;captcha                 = &#036;row-&gt;form_captcha;


        &#036;form-&gt;captcha_type            = &#036;row-&gt;form_captcha_type;


        &#036;form-&gt;review                  = &#036;row-&gt;form_review;


        &#036;form-&gt;label_alignment         = &#036;row-&gt;form_label_alignment;


        &#036;form-&gt;page_total              = &#036;row-&gt;form_page_total;


        &#036;form-&gt;lastpage_title          = &#036;row-&gt;form_lastpage_title;


        &#036;form-&gt;submit_primary_text     = &#036;row-&gt;form_submit_primary_text;


        &#036;form-&gt;submit_secondary_text   = &#036;row-&gt;form_submit_secondary_text;


        &#036;form-&gt;submit_primary_img      = &#036;row-&gt;form_submit_primary_img;


        &#036;form-&gt;submit_secondary_img    = &#036;row-&gt;form_submit_secondary_img;


        &#036;form-&gt;submit_use_image        = (int) &#036;row-&gt;form_submit_use_image;


        &#036;form-&gt;pagination_type         = &#036;row-&gt;form_pagination_type;


        &#036;form-&gt;review_primary_text     = &#036;row-&gt;form_review_primary_text;


        &#036;form-&gt;review_secondary_text   = &#036;row-&gt;form_review_secondary_text;


        &#036;form-&gt;review_primary_img      = &#036;row-&gt;form_review_primary_img;


        &#036;form-&gt;review_secondary_img    = &#036;row-&gt;form_review_secondary_img;


        &#036;form-&gt;review_use_image        = (int) &#036;row-&gt;form_review_use_image;


        &#036;form-&gt;review_title            = &#036;row-&gt;form_review_title;


        &#036;form-&gt;review_description      = &#036;row-&gt;form_review_description;


        &#036;form-&gt;resume_enable           = &#036;row-&gt;form_resume_enable;


        &#036;form-&gt;theme_id                = (int) &#036;row-&gt;form_theme_id;


        &#036;form-&gt;payment_show_total      = (int) &#036;row-&gt;payment_show_total;


        &#036;form-&gt;payment_total_location  = &#036;row-&gt;payment_total_location;


        &#036;form-&gt;payment_enable_merchant = ( (int) &#036;row-&gt;payment_enable_merchant &lt; 1 ) ? '0' : (int) &#036;row-&gt;payment_enable_merchant;


        &#036;form-&gt;payment_currency        = &#036;row-&gt;payment_currency;


        &#036;form-&gt;payment_price_type      = &#036;row-&gt;payment_price_type;


        &#036;form-&gt;payment_price_amount    = &#036;row-&gt;payment_price_amount;


        &#036;form-&gt;limit_enable            = (int) &#036;row-&gt;form_limit_enable;


        &#036;form-&gt;limit                   = (int) &#036;row-&gt;form_limit;


        &#036;form-&gt;schedule_enable         = (int) &#036;row-&gt;form_schedule_enable;


        &#036;form-&gt;schedule_start_date     = &#036;row-&gt;form_schedule_start_date;


        &#036;form-&gt;schedule_end_date       = &#036;row-&gt;form_schedule_end_date;


        &#036;form-&gt;schedule_start_hour     = &#036;row-&gt;form_schedule_start_hour;


        &#036;form-&gt;schedule_end_hour       = &#036;row-&gt;form_schedule_end_hour;


        &#036;form-&gt;language                = ( &#33;empty( &#036;form-&gt;language ) ) ? LanguageHelper::set_language( trim( &#036;row-&gt;form_language ) ) : LanguageHelper::set_language();


        &#036;form-&gt;is_error                = empty( &#036;error_elements ) ? '0' : '1';


        if ( ( &#33;empty( &#036;edit_id ) ) )


            &#036;form-&gt;active = 1;


    }


    //get elements data


    //get element options first and store it into array


    &#036;form_element_options = FormElementsOptions::findAllRow( &quot;form_id = '{&#036;form_id}' and live=1 order by element_id asc,position asc&quot;, array( ) );


    &#036;options_lookup       = array( );


    if ( count( &#036;form_element_options ) &gt; 0 ) {


        foreach ( &#036;form_element_options as &#036;row ) {


            &#036;element_id                                                         = &#036;row-&gt;element_id;


            &#036;option_id                                                          = &#036;row-&gt;option_id;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'position' ]          = &#036;row-&gt;position;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'option' ]            = &#036;row-&gt;option;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'option_is_default' ] = &#036;row-&gt;option_is_default;


            if ( isset( &#036;element_prices_array[ &#036;element_id ][ &#036;option_id ] ) ) {


                &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'price_definition' ] = &#036;element_prices_array[ &#036;element_id ][ &#036;option_id ];


            }


        }


    }


    &#036;matrix_elements      = array( );


    //get elements data


    &#036;element              = array( );


    &#036;page_number_clause   = ( &#036;page_number === 0 ) ? '' : &quot;and element_page_number = '{&#036;page_number}'&quot;;


    &#036;form_elements        = FormElements::findAllRow( &quot;form_id = '{&#036;form_id}' and element_status='1' {&#036;page_number_clause} and element_type &lt;&gt; 'page_break' ORDER BY element_position asc&quot;, array( ) );


    &#036;j                    = 0;


    &#036;has_calendar         = false; //assume the form doesn't have calendar, so it won't load calendar.js


    &#036;has_advance_uploader = false;


    &#036;has_guidelines       = false;


    if ( count( &#036;form_elements ) &gt; 0 ) {


        foreach ( &#036;form_elements as &#036;row ) {


            &#036;element[ &#036;j ] = new stdClass();


            &#036;element_id    = &#036;row-&gt;element_id;


            &#036;element_type  = &#036;row-&gt;element_type;


            //lookup element options first


            if ( &#33;empty( &#036;options_lookup[ &#036;element_id ] ) ) {


                &#036;element_options = array( );


                &#036;i               = 0;


                foreach ( &#036;options_lookup[ &#036;element_id ] as &#036;option_id =&gt; &#036;data ) {


                    &#036;element_options[ &#036;i ]             = new stdClass();


                    &#036;element_options[ &#036;i ]-&gt;id         = &#036;option_id;


                    &#036;element_options[ &#036;i ]-&gt;option     = &#036;data[ 'option' ];


                    &#036;element_options[ &#036;i ]-&gt;is_default = &#036;data[ 'option_is_default' ];


                    &#036;element_options[ &#036;i ]-&gt;is_db_live = 1;


                    if ( isset( &#036;data[ 'price_definition' ] ) ) {


                        &#036;element_options[ &#036;i ]-&gt;price_definition = &#036;data[ 'price_definition' ];


                    }


                    &#036;i++;


                }


            }


            &#036;element[ &#036;j ]-&gt;title        = nl2br( &#036;row-&gt;element_title );


            &#036;element[ &#036;j ]-&gt;instructions = &#036;row-&gt;element_instructions;


            if ( &#33;empty( &#036;row-&gt;element_guidelines ) &amp;&amp; ( &#036;element_type &#33;= 'section' ) &amp;&amp; ( &#036;element_type &#33;= 'matrix' ) ) {


                &#036;has_guidelines = true;


            }


            &#036;element[ &#036;j ]-&gt;size                        = &#036;row-&gt;element_size;


            &#036;element[ &#036;j ]-&gt;is_required                 = &#036;row-&gt;element_is_required;


            &#036;element[ &#036;j ]-&gt;is_unique                   = &#036;row-&gt;element_is_unique;


            &#036;element[ &#036;j ]-&gt;is_private                  = &#036;row-&gt;element_is_private;


            &#036;element[ &#036;j ]-&gt;type                        = &#036;element_type;


            &#036;element[ &#036;j ]-&gt;position                    = &#036;row-&gt;element_position;


            &#036;element[ &#036;j ]-&gt;id                          = &#036;element_id;


            &#036;element[ &#036;j ]-&gt;is_db_live                  = 1;


            &#036;element[ &#036;j ]-&gt;form_id                     = &#036;form_id;


            &#036;element[ &#036;j ]-&gt;choice_has_other            = (int) &#036;row-&gt;element_choice_has_other;


            &#036;element[ &#036;j ]-&gt;choice_other_label          = &#036;row-&gt;element_choice_other_label;


            &#036;element[ &#036;j ]-&gt;choice_columns              = (int) &#036;row-&gt;element_choice_columns;


            &#036;element[ &#036;j ]-&gt;time_showsecond             = (int) &#036;row-&gt;element_time_showsecond;


            &#036;element[ &#036;j ]-&gt;time_24hour                 = (int) &#036;row-&gt;element_time_24hour;


            &#036;element[ &#036;j ]-&gt;address_hideline2           = (int) &#036;row-&gt;element_address_hideline2;


            &#036;element[ &#036;j ]-&gt;address_us_only             = (int) &#036;row-&gt;element_address_us_only;


            &#036;element[ &#036;j ]-&gt;date_enable_range           = (int) &#036;row-&gt;element_date_enable_range;


            &#036;element[ &#036;j ]-&gt;date_range_min              = &#036;row-&gt;element_date_range_min;


            &#036;element[ &#036;j ]-&gt;date_range_max              = &#036;row-&gt;element_date_range_max;


            &#036;element[ &#036;j ]-&gt;date_enable_selection_limit = (int) &#036;row-&gt;element_date_enable_selection_limit;


            &#036;element[ &#036;j ]-&gt;date_selection_max          = (int) &#036;row-&gt;element_date_selection_max;


            &#036;element[ &#036;j ]-&gt;date_disable_past_future    = (int) &#036;row-&gt;element_date_disable_past_future;


            &#036;element[ &#036;j ]-&gt;date_past_future            = &#036;row-&gt;element_date_past_future;


            &#036;element[ &#036;j ]-&gt;date_disable_weekend        = (int) &#036;row-&gt;element_date_disable_weekend;


            &#036;element[ &#036;j ]-&gt;date_disable_specific       = (int) &#036;row-&gt;element_date_disable_specific;


            &#036;element[ &#036;j ]-&gt;date_disabled_list          = &#036;row-&gt;element_date_disabled_list;


            &#036;element[ &#036;j ]-&gt;file_enable_type_limit      = (int) &#036;row-&gt;element_file_enable_type_limit;


            &#036;element[ &#036;j ]-&gt;file_block_or_allow         = &#036;row-&gt;element_file_block_or_allow;


            &#036;element[ &#036;j ]-&gt;file_type_list              = &#036;row-&gt;element_file_type_list;


            &#036;element[ &#036;j ]-&gt;file_as_attachment          = (int) &#036;row-&gt;element_file_as_attachment;


            &#036;element[ &#036;j ]-&gt;file_enable_advance         = (int) &#036;row-&gt;element_file_enable_advance;


            if ( &#33;empty( &#036;element[ &#036;j ]-&gt;file_enable_advance ) ) {


                &#036;has_advance_uploader          = true;


                &#036;element[ &#036;j ]-&gt;is_design_mode = false;


            }


            &#036;element[ &#036;j ]-&gt;file_auto_upload         = (int) &#036;row-&gt;element_file_auto_upload;


            &#036;element[ &#036;j ]-&gt;file_enable_multi_upload = (int) &#036;row-&gt;element_file_enable_multi_upload;


            &#036;element[ &#036;j ]-&gt;file_max_selection       = (int) &#036;row-&gt;element_file_max_selection;


            &#036;element[ &#036;j ]-&gt;file_enable_size_limit   = (int) &#036;row-&gt;element_file_enable_size_limit;


            &#036;element[ &#036;j ]-&gt;file_size_max            = (int) &#036;row-&gt;element_file_size_max;


            &#036;element[ &#036;j ]-&gt;matrix_allow_multiselect = (int) &#036;row-&gt;element_matrix_allow_multiselect;


            &#036;element[ &#036;j ]-&gt;matrix_parent_id         = (int) &#036;row-&gt;element_matrix_parent_id;


            &#036;element[ &#036;j ]-&gt;upload_dir               = ''; //&#036;mf_settings['upload_dir'];		


            &#036;element[ &#036;j ]-&gt;range_min                = &#036;row-&gt;element_range_min;


            &#036;element[ &#036;j ]-&gt;range_max                = &#036;row-&gt;element_range_max;


            &#036;element[ &#036;j ]-&gt;range_limit_by           = &#036;row-&gt;element_range_limit_by;


            &#036;element[ &#036;j ]-&gt;css_class                = &#036;row-&gt;element_css_class;


            &#036;element[ &#036;j ]-&gt;machform_path            = &#036;machform_path;


            &#036;element[ &#036;j ]-&gt;machform_data_path       = &#036;machform_data_path;


            //this data came from db or form submit


            //being used to display edit form or redisplay form with errors and previous inputs


            //this should be optimized in the future, only pass necessary data, not the whole array			


            &#036;element[ &#036;j ]-&gt;populated_value          = &#036;populated_values;


            //set prices for price-enabled field


            if ( &#036;element_type == 'money' &amp;&amp; isset( &#036;element_prices_array[ &#036;element_id ][ 0 ] ) ) {


                &#036;element[ &#036;j ]-&gt;price_definition = 0;


            }


            //if there is file upload type, set form enctype to multipart


            if ( &#036;element_type == 'file' ) {


                &#036;form_enc_type = 'enctype=&quot;multipart/form-data&quot;';


                //if this is multipage form


                if ( ( &#036;form-&gt;page_total &gt; 1 &amp;&amp; &#33;empty( &#036;populated_file_values ) ) ) {


                    //populate the default value for uploaded files, when validation error occured


                    //make sure to keep the file token if exist


                    if ( &#33;empty( &#036;populated_values[ 'element_' . &#036;element_id ][ 'file_token' ] ) ) {


                        &#036;populated_file_values[ 'element_' . &#036;element_id ][ 'file_token' ] = &#036;populated_values[ 'element_' . &#036;element_id ][ 'file_token' ];


                    }


                    &#036;element[ &#036;j ]-&gt;populated_value = &#036;populated_file_values;


                }


            }


            if ( &#33;empty( &#036;error_elements[ &#036;element[ &#036;j ]-&gt;id ] ) ) {


                &#036;element[ &#036;j ]-&gt;is_error      = 1;


                &#036;element[ &#036;j ]-&gt;error_message = &#036;error_elements[ &#036;element[ &#036;j ]-&gt;id ];


            }


            &#036;element[ &#036;j ]-&gt;default_value = htmlspecialchars( &#036;row-&gt;element_default_value );


            &#036;element[ &#036;j ]-&gt;constraint    = &#036;row-&gt;element_constraint;


            if ( &#33;empty( &#036;element_options ) ) {


                &#036;element[ &#036;j ]-&gt;options = &#036;element_options;


            } else {


                &#036;element[ &#036;j ]-&gt;options = '';


            }


            //if the element is a matrix field and not the parent, store the data into a lookup array for later use when rendering the markup


            if ( &#036;element_type == 'matrix' &amp;&amp; &#33;empty( &#036;row-&gt;element_matrix_parent_id ) ) {


                &#036;parent_id                                                = &#036;row-&gt;element_matrix_parent_id;


                &#036;el_position                                              = &#036;row-&gt;element_position;


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'title' ] = &#036;element[ &#036;j ]-&gt;title;


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'id' ]    = &#036;element[ &#036;j ]-&gt;id;


                &#036;matrix_child_option_id                                   = '';


                foreach ( &#036;element_options as &#036;value ) {


                    &#036;matrix_child_option_id .= &#036;value-&gt;id . ',';


                }


                &#036;matrix_child_option_id                                                = rtrim( &#036;matrix_child_option_id, ',' );


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'children_option_id' ] = &#036;matrix_child_option_id;


                //remove it from the main element array


                &#036;element[ &#036;j ]                                                         = array( );


                unset( &#036;element[ &#036;j ] );


                &#036;j--;


            }


            &#036;j++;


        }


    }


    //generate html markup for each element


    &#036;container_class    = '';


    &#036;all_element_markup = '';


    if ( count( &#036;element ) &gt; 0 ) {


        foreach ( &#036;element as &#036;element_data ) {


            if ( &#036;element_data-&gt;is_private &amp;&amp; empty( &#036;edit_id ) ) { //don't show private element on live forms


                continue;


            }


            //if this is matrix field, build the children data from &#036;matrix_elements array


            if ( &#036;element_data-&gt;type == 'matrix' ) {


                &#036;element_data-&gt;matrix_children = isset( &#036;matrix_elements[ &#036;element_data-&gt;id ] ) ? &#036;matrix_elements[ &#036;element_data-&gt;id ] : '';


            }


            &#036;all_element_markup .= call_user_func( 'ElementHelper::display_webform_' . &#036;element_data-&gt;type, &#036;image_url, &#036;webform_lang, &#036;element_data, true );


        }


    }


    if ( &#33;empty( &#036;custom_error ) ) {


        &#036;form-&gt;error_message = &lt;&lt;&lt;EOT


		&lt;li id=&quot;error_message&quot;&gt;


				&lt;h3 id=&quot;error_message_title&quot;&gt;{&#036;custom_error}&lt;/h3&gt;


		&lt;/li&gt;	

EOT;

    } elseif ( &#33;empty( &#036;error_elements ) ) {


        &#036;form-&gt;error_message = &lt;&lt;&lt;EOT


		&lt;li id=&quot;error_message&quot;&gt;


				&lt;h3 id=&quot;error_message_title&quot;&gt;{&#036;webform_lang['error_title']}&lt;/h3&gt;


				&lt;p id=&quot;error_message_desc&quot;&gt;{&#036;webform_lang['error_desc']}&lt;/p&gt;


		&lt;/li&gt;	

EOT;

    }


    &#036;field_highlight_color = '#FFF7C0';


    &#036;form_container_class  = empty( &#036;integration_method ) ? 'WarpShadow WLarge WNormal' : '';


    if ( empty( &#036;form-&gt;review ) ) {


        if ( &#036;form-&gt;submit_use_image == 0 ) {


            &#036;submit_button_markup = '&lt;input id=&quot;submit_form&quot; class=&quot;button_text&quot; type=&quot;submit&quot; name=&quot;submit_form&quot; value=&quot;' . &#036;form-&gt;submit_primary_text . '&quot; /&gt;';


        } else {


            &#036;submit_button_markup = '&lt;input id=&quot;submit_form&quot; class=&quot;button_text&quot; type=&quot;image&quot; name=&quot;submit_form&quot; src = &quot;' . &#036;form-&gt;submit_primary_img . '&quot; value=&quot;' . &#036;form-&gt;submit_primary_text . '&quot; /&gt;';


        }


    } else {


        &#036;submit_button_markup = '&lt;input id=&quot;submit_form&quot; class=&quot;button_text&quot; type=&quot;submit&quot; name=&quot;submit_form&quot; value=&quot;' . &#036;webform_lang[ 'continue_button' ] . '&quot; /&gt;';


    }


    //display edit_id if there is any, this is being called on edit_entry.php page


    if ( &#33;empty( &#036;edit_id ) ) {


        &#036;edit_markup          = &quot;&lt;input type=&#092;&quot;hidden&#092;&quot; name=&#092;&quot;edit_id&#092;&quot; value=&#092;&quot;{&#036;edit_id}&#092;&quot; /&gt;&#092;n&quot;;


        &#036;submit_button_markup = '&lt;input id=&quot;submit_form&quot; class=&quot;button_text&quot; type=&quot;submit&quot; name=&quot;submit_form&quot; value=&quot;Save Changes&quot; /&gt;';


    } else {


        &#036;edit_markup = '';


    }


    //check for specific form css, if any, use it instead


    if ( &#036;form-&gt;has_css ) {


        &#036;css_dir = &#036;mf_settings[ 'data_dir' ] . &quot;/form_{&#036;form_id}/css/&quot;;


    }


    if ( &#33;empty( &#036;form-&gt;password ) &amp;&amp; empty( &#036;_SESSION[ 'user_authenticated' ] ) ) { //if form require password and password hasn't set yet


        &#036;show_password_form = true;


    } elseif ( &#33;empty( &#036;form-&gt;password ) &amp;&amp; &#33;empty( &#036;_SESSION[ 'user_authenticated' ] ) &amp;&amp; &#036;_SESSION[ 'user_authenticated' ] &#33;= &#036;form_id ) { //if user authenticated but not for this form


        &#036;show_password_form = true;


    } else { //user authenticated for this form, or no password required


        &#036;show_password_form = false;


    }


    if ( &#036;show_password_form ) {


        &#036;submit_button_markup = '&lt;input id=&quot;submit_form&quot; class=&quot;button_text&quot; type=&quot;submit&quot; name=&quot;submit_form&quot; value=&quot;' . &#036;webform_lang[ 'submit_button' ] . '&quot; /&gt;';


    }


    //default markup for single page form submit button


    &#036;button_markup            = &lt;&lt;&lt;EOT


	&lt;li id=&quot;li_buttons&quot; class=&quot;buttons&quot;&gt;


		    &lt;input type=&quot;hidden&quot; name=&quot;form_id&quot; value=&quot;{&#036;form-&gt;id}&quot; /&gt;


		    {&#036;edit_markup}


		    &lt;input type=&quot;hidden&quot; name=&quot;submit_form&quot; value=&quot;1&quot; /&gt;


		    &lt;input type=&quot;hidden&quot; name=&quot;page_number&quot; value=&quot;{&#036;page_number}&quot; /&gt;


			{&#036;submit_button_markup}


	&lt;/li&gt;

EOT;

    //check for form limit rule


    &#036;form_has_maximum_entries = false;


    //check for automatic scheduling limit, if enabled


    if ( &#33;empty( &#036;form-&gt;schedule_enable ) ) {


        &#036;schedule_start_time = strtotime( &#036;form-&gt;schedule_start_date . ' ' . &#036;form-&gt;schedule_start_hour );


        &#036;schedule_end_time   = strtotime( &#036;form-&gt;schedule_end_date . ' ' . &#036;form-&gt;schedule_end_hour );


        &#036;current_time        = strtotime( date( &quot;Y-m-d H:i:s&quot; ) );


        if ( &#33;empty( &#036;schedule_start_time ) ) {


            if ( &#036;current_time &lt; &#036;schedule_start_time ) {


                &#036;form-&gt;active = 0;


            }


        }


        if ( &#33;empty( &#036;schedule_end_time ) ) {


            if ( &#036;current_time &gt; &#036;schedule_end_time ) {


                &#036;form-&gt;active = 0;


            }


        }


    }


    if ( empty( &#036;form-&gt;active ) || &#036;form_has_maximum_entries ) { //if form is not active, don't show the fields


        &#036;form_desc_div      = '';


        &#036;all_element_markup = '';


        &#036;button_markup      = '';


        &#036;ul_class           = 'class=&quot;password&quot;';


        if ( &#036;form_has_maximum_entries ) {


            &#036;inactive_message = &#036;webform_lang[ 'form_limited' ];


        } else {


            &#036;inactive_message = &#036;webform_lang[ 'form_inactive' ];


        }


        &#036;custom_element = &lt;&lt;&lt;EOT


		&lt;li&gt;


			&lt;h2&gt;{&#036;inactive_message}&lt;/h2&gt;


		&lt;/li&gt;

EOT;

    } else {


        if ( &#33;empty( &#036;form-&gt;name ) || &#33;empty( &#036;form-&gt;description ) ) {


            &#036;form-&gt;description = nl2br( &#036;form-&gt;description );


            &#036;form_desc_div     = &lt;&lt;&lt;EOT


	&lt;div class=&quot;form_description&quot;&gt;


		&lt;h2&gt;{&#036;form-&gt;name}&lt;/h2&gt;


		&lt;p&gt;{&#036;form-&gt;description}&lt;/p&gt;


	&lt;/div&gt;

EOT;

        }


    }


    if ( &#33;&#036;has_guidelines ) {


        &#036;container_class .= &quot; no_guidelines&quot;;


    }


    if ( &#036;integration_method == 'iframe' ) {


        &#036;html_class_tag = 'class=&quot;embed&quot;';


    }


    //if the form has multiple pages


    //display the pagination header


    if ( &#036;form-&gt;page_total &gt; 1 &amp;&amp; &#036;show_password_form === false ) {


        //build pagination header based on the selected type. possible values:


        //steps - display multi steps progress


        //percentage - display progress bar with percentage


        //disabled - disabled


        &#036;page_breaks_data = array( );


        &#036;page_title_array = array( );


        //get page titles


        &#036;form_elements    = null;


        &#036;form_elements    = FormElements::findAllRow( &quot;form_id = '{&#036;form_id}' and element_status = 1 and element_type = 'page_break' ORDER BY element_page_number asc&quot;, array( ) );


        if ( count( &#036;form_elements ) &gt; 0 ) {


            foreach ( &#036;form_elements as &#036;row ) {


                &#036;temp_page_number                                          = &#036;row[ 'element_page_number' ];


                &#036;page_breaks_data[ &#036;temp_page_number ][ 'use_image' ]      = &#036;row-&gt;element_submit_use_image;


                &#036;page_breaks_data[ &#036;temp_page_number ][ 'primary_text' ]   = &#036;row-&gt;element_submit_primary_text;


                &#036;page_breaks_data[ &#036;temp_page_number ][ 'secondary_text' ] = &#036;row-&gt;element_submit_secondary_text;


                &#036;page_breaks_data[ &#036;temp_page_number ][ 'primary_img' ]    = &#036;row-&gt;element_submit_primary_img;


                &#036;page_breaks_data[ &#036;temp_page_number ][ 'secondary_img' ]  = &#036;row-&gt;element_submit_secondary_img;


                &#036;page_title_array[ ]                                       = &#036;row-&gt;element_page_title;


            }


        }


        //add the last page buttons info into the array for easy lookup


        &#036;page_breaks_data[ &#036;form-&gt;page_total ][ 'use_image' ]      = &#036;form-&gt;submit_use_image;


        &#036;page_breaks_data[ &#036;form-&gt;page_total ][ 'primary_text' ]   = &#036;form-&gt;submit_primary_text;


        &#036;page_breaks_data[ &#036;form-&gt;page_total ][ 'secondary_text' ] = &#036;form-&gt;submit_secondary_text;


        &#036;page_breaks_data[ &#036;form-&gt;page_total ][ 'primary_img' ]    = &#036;form-&gt;submit_primary_img;


        &#036;page_breaks_data[ &#036;form-&gt;page_total ][ 'secondary_img' ]  = &#036;form-&gt;submit_secondary_img;


        if ( &#036;form-&gt;pagination_type == 'steps' ) {


            &#036;page_titles_markup = '';


            &#036;i                  = 1;


            foreach ( &#036;page_title_array as &#036;page_title ) {


                if ( &#036;i == &#036;page_number ) {


                    &#036;ap_tp_num_active  = ' ap_tp_num_active';


                    &#036;ap_tp_text_active = ' ap_tp_text_active';


                } else {


                    &#036;ap_tp_num_active  = '';


                    &#036;ap_tp_text_active = '';


                }


                &#036;page_titles_markup .= '&lt;td align=&quot;center&quot;&gt;&lt;span id=&quot;page_num_' . &#036;i . '&quot; class=&quot;ap_tp_num' . &#036;ap_tp_num_active . '&quot;&gt;' . &#036;i . '&lt;/span&gt;&lt;span id=&quot;page_title_' . &#036;i . '&quot; class=&quot;ap_tp_text' . &#036;ap_tp_text_active . '&quot;&gt;' . &#036;page_title . '&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;ap_tp_arrow&quot;&gt;&amp;gt;&lt;/td&gt;' . &quot;&#092;n&quot;;


                &#036;i++;


            }


            //add the last page title into the pagination header markup


            if ( &#036;i == &#036;page_number ) {


                &#036;ap_tp_num_active  = ' ap_tp_num_active';


                &#036;ap_tp_text_active = ' ap_tp_text_active';


            } else {


                &#036;ap_tp_num_active  = '';


                &#036;ap_tp_text_active = '';


            }


            &#036;page_titles_markup .= '&lt;td align=&quot;center&quot;&gt;&lt;span id=&quot;page_num_' . &#036;i . '&quot; class=&quot;ap_tp_num' . &#036;ap_tp_num_active . '&quot;&gt;' . &#036;i . '&lt;/span&gt;&lt;span id=&quot;page_title_' . &#036;i . '&quot; class=&quot;ap_tp_text' . &#036;ap_tp_text_active . '&quot;&gt;' . &#036;form-&gt;lastpage_title . '&lt;/span&gt;&lt;/td&gt;';


            //if form review enabled, we need to add the pagination header


            if ( &#33;empty( &#036;form-&gt;review ) ) {


                &#036;i++;


                &#036;page_titles_markup .= '&lt;td align=&quot;center&quot; class=&quot;ap_tp_arrow&quot;&gt;&amp;gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;span id=&quot;page_num_' . &#036;i . '&quot; class=&quot;ap_tp_num&quot;&gt;' . &#036;i . '&lt;/span&gt;&lt;span id=&quot;page_title_' . &#036;i . '&quot; class=&quot;ap_tp_text&quot;&gt;' . &#036;form-&gt;review_title . '&lt;/span&gt;&lt;/td&gt;';


            }


            &#036;pagination_header = &lt;&lt;&lt;EOT


		&lt;li id=&quot;pagination_header&quot; class=&quot;li_pagination&quot;&gt;


		 &lt;table class=&quot;ap_table_pagination&quot; width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


		  &lt;tr&gt; 


		  	{&#036;page_titles_markup}


		  &lt;/tr&gt;


		&lt;/table&gt;


		&lt;/li&gt;

EOT;

        } else if ( &#036;form-&gt;pagination_type == 'percentage' ) {


            &#036;page_total = count( &#036;page_title_array ) + 1;


            if ( &#33;empty( &#036;form-&gt;review ) ) {


                &#036;page_total++;


            }


            &#036;percent_value = round( ( &#036;page_number / &#036;page_total ) * 100 );


            if ( &#036;percent_value == 100 ) { //it's not make sense to display 100% when the form is not really submitted yet


                &#036;percent_value = 99;


            }


            if ( &#33;empty( &#036;form-&gt;review ) ) {


                if ( ( &#036;page_total - 1 ) == &#036;page_number ) { //if this is last page of the form


                    &#036;current_page_title = &#036;form-&gt;lastpage_title;


                } else {


                    &#036;current_page_title = &#036;page_title_array[ &#036;page_number - 1 ];


                }


            } else {


                if ( &#036;page_total == &#036;page_number ) { //if this is last page of the form


                    &#036;current_page_title = &#036;form-&gt;lastpage_title;


                } else {


                    &#036;current_page_title = &#036;page_title_array[ &#036;page_number - 1 ];


                }


            }


            &#036;page_number_title = sprintf( &#036;webform_lang[ 'page_title' ], &#036;page_number, &#036;page_total );


            &#036;pagination_header = &lt;&lt;&lt;EOT


		&lt;li id=&quot;pagination_header&quot; class=&quot;li_pagination&quot; title=&quot;Click to edit&quot;&gt;


		    &lt;h3 id=&quot;page_title_{&#036;page_number}&quot;&gt;{&#036;page_number_title} - {&#036;current_page_title}&lt;/h3&gt;


			&lt;div class=&quot;mf_progress_container&quot;&gt;          


		    	&lt;div id=&quot;mf_progress_percentage&quot; class=&quot;mf_progress_value&quot; style=&quot;width: {&#036;percent_value}%&quot;&gt;&lt;span&gt;{&#036;percent_value}%&lt;/span&gt;&lt;/div&gt;


			&lt;/div&gt;


		&lt;/li&gt;

EOT;

        } else {


            &#036;pagination_header = '';


        }


        //build the submit buttons markup


        if ( empty( &#036;edit_id ) ) {


            if ( empty( &#036;page_breaks_data[ &#036;page_number ][ 'use_image' ] ) ) { //if using text buttons as submit


                if ( &#036;page_number &gt; 1 ) {


                    &#036;button_secondary_markup = '&lt;input class=&quot;button_text btn_secondary&quot; type=&quot;submit&quot; id=&quot;submit_secondary&quot; name=&quot;submit_secondary&quot; value=&quot;' . &#036;page_breaks_data[ &#036;page_number ][ 'secondary_text' ] . '&quot; /&gt;';


                }


                &#036;button_markup = &lt;&lt;&lt;EOT


		&lt;li id=&quot;li_buttons&quot; class=&quot;buttons&quot;&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;form_id&quot; value=&quot;{&#036;form-&gt;id}&quot; /&gt;


			    {&#036;edit_markup}


			    &lt;input type=&quot;hidden&quot; name=&quot;submit_form&quot; value=&quot;1&quot; /&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;page_number&quot; value=&quot;{&#036;page_number}&quot; /&gt;


				&lt;input class=&quot;button_text btn_primary&quot; type=&quot;submit&quot; id=&quot;submit_primary&quot; name=&quot;submit_primary&quot; value=&quot;{&#036;page_breaks_data[&#036;page_number]['primary_text']}&quot; /&gt;


				{&#036;button_secondary_markup}


		&lt;/li&gt;

EOT;

            } else { //if using images as submit


                if ( &#036;page_number &gt; 1 ) {


                    &#036;button_secondary_markup = '&lt;input class=&quot;submit_img_secondary&quot; type=&quot;image&quot; alt=&quot;Previous&quot; id=&quot;submit_secondary&quot; name=&quot;submit_secondary&quot; src=&quot;' . &#036;page_breaks_data[ &#036;page_number ][ 'secondary_img' ] . '&quot; /&gt;';


                }


                &#036;button_markup = &lt;&lt;&lt;EOT


		&lt;li id=&quot;li_buttons&quot; class=&quot;buttons&quot;&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;form_id&quot; value=&quot;{&#036;form-&gt;id}&quot; /&gt;


			    {&#036;edit_markup}


			    &lt;input type=&quot;hidden&quot; name=&quot;submit_form&quot; value=&quot;1&quot; /&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;page_number&quot; value=&quot;{&#036;page_number}&quot; /&gt;


			 	&lt;input class=&quot;submit_img_primary&quot; type=&quot;image&quot; alt=&quot;Continue&quot; id=&quot;submit_primary&quot; name=&quot;submit_primary&quot; src=&quot;{&#036;page_breaks_data[&#036;page_number]['primary_img']}&quot; /&gt;


				{&#036;button_secondary_markup}


		&lt;/li&gt;

EOT;

            }


        } else { //if there is edit_id, then this is edit_entry page, display a standard button


            &#036;button_markup = &lt;&lt;&lt;EOT


		&lt;li id=&quot;li_buttons&quot; class=&quot;buttons&quot;&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;form_id&quot; value=&quot;{&#036;form-&gt;id}&quot; /&gt;


			    {&#036;edit_markup}


			    &lt;input type=&quot;hidden&quot; name=&quot;submit_form&quot; value=&quot;1&quot; /&gt;


			    &lt;input type=&quot;hidden&quot; name=&quot;page_number&quot; value=&quot;{&#036;page_number}&quot; /&gt;


				&lt;input class=&quot;button_text btn_primary&quot; type=&quot;submit&quot; id=&quot;submit_primary&quot; name=&quot;submit_primary&quot; value=&quot;Save Changes&quot; /&gt;


		&lt;/li&gt;

EOT;

        }


    }


    //if the form has resume enabled and this is multi page form (single page form doesn't have resume option)


    if ( &#33;empty( &#036;form-&gt;resume_enable ) &amp;&amp; &#036;form-&gt;page_total &gt; 1 ) {


        if ( &#33;empty( &#036;error_elements[ 'element_resume_email' ] ) ) {


            &#036;li_resume_email_style   = '';


            &#036;li_resume_error_message = &quot;&lt;p class=&#092;&quot;error&#092;&quot;&gt;{&#036;error_elements['element_resume_email']}&lt;/p&gt;&quot;;


            &#036;li_resume_class         = 'class=&quot;error&quot;';


            &#036;li_resume_checked       = 'checked=&quot;checked&quot;';


            &#036;li_resume_button_status = 1;


        } else {


            &#036;li_resume_email_style   = 'style=&quot;display: none&quot;';


            &#036;li_resume_error_message = '';


            &#036;li_resume_class         = '';


            &#036;li_resume_checked       = '';


            &#036;li_resume_button_status = 0;


        }


        &#036;form_resume_markup = &lt;&lt;&lt;EOT


		&lt;li id=&quot;li_resume_checkbox&quot;&gt;


		&lt;div&gt;


			&lt;span&gt;&lt;input type=&quot;checkbox&quot; value=&quot;1&quot; class=&quot;element checkbox&quot; name=&quot;element_resume_checkbox&quot; id=&quot;element_resume_checkbox&quot; {&#036;li_resume_checked}&gt;


				&lt;label for=&quot;element_resume_checkbox&quot; class=&quot;om_choice&quot;&gt;{&#036;webform_lang['resume_checkbox_title']}&lt;/label&gt;


			&lt;/span&gt;


		&lt;/div&gt; 


		&lt;/li&gt;


		&lt;li id=&quot;li_resume_email&quot; {&#036;li_resume_class} {&#036;li_resume_email_style} data-resumebutton=&quot;{&#036;li_resume_button_status}&quot; data-resumelabel=&quot;{&#036;webform_lang['resume_submit_button_text']}&quot;&gt;


			&lt;label for=&quot;element_resume_email&quot; class=&quot;description&quot;&gt;{&#036;webform_lang['resume_email_input_label']}&lt;/label&gt;


			&lt;div&gt;


				&lt;input type=&quot;text&quot; value=&quot;{&#036;populated_values['element_resume_email']}&quot; class=&quot;element text om_medium&quot; name=&quot;element_resume_email&quot; id=&quot;element_resume_email&quot;&gt; 


			&lt;/div&gt;&lt;p id=&quot;guide_resume_email&quot; class=&quot;guidelines&quot;&gt;&lt;small&gt;{&#036;webform_lang['resume_guideline']}&lt;/small&gt;&lt;/p&gt; {&#036;li_resume_error_message}


		&lt;/li&gt;

EOT;

    }


    //if the form has enabled merchant support and set the total payment to be displayed


    if ( &#33;empty( &#036;form-&gt;payment_enable_merchant ) &amp;&amp; &#33;empty( &#036;form-&gt;payment_show_total ) ) {


        &#036;currency_symbol = '&#036;';


        switch ( &#036;form-&gt;payment_currency ) {


            case 'USD':


                &#036;currency_symbol = '&#036;';


                break;


            case 'EUR':


                &#036;currency_symbol = '€';


                break;


            case 'GBP':


                &#036;currency_symbol = '£';


                break;


            case 'AUD':


                &#036;currency_symbol = 'A&#036;';


                break;


            case 'CAD':


                &#036;currency_symbol = 'C&#036;';


                break;


            case 'JPY':


                &#036;currency_symbol = '¥';


                break;


            case 'THB':


                &#036;currency_symbol = '฿';


                break;


            case 'HUF':


                &#036;currency_symbol = 'Ft';


                break;


            case 'CHF':


                &#036;currency_symbol = 'CHF';


                break;


            case 'CZK':


                &#036;currency_symbol = 'Kč';


                break;


            case 'SEK':


                &#036;currency_symbol = 'kr';


                break;


            case 'DKK':


                &#036;currency_symbol = 'kr';


                break;


            case 'PHP':


                &#036;currency_symbol = '&#036;';


                break;


            case 'MYR':


                &#036;currency_symbol = 'RM';


                break;


            case 'PLN':


                &#036;currency_symbol = 'zł';


                break;


            case 'BRL':


                &#036;currency_symbol = 'R&#036;';


                break;


            case 'HKD':


                &#036;currency_symbol = 'HK&#036;';


                break;


            case 'MXN':


                &#036;currency_symbol = 'Mex&#036;';


                break;


            case 'TWD':


                &#036;currency_symbol = 'NT&#036;';


                break;


            case 'TRY':


                &#036;currency_symbol = 'TL';


                break;


        }


        if ( &#036;form-&gt;payment_price_type == 'variable' ) {


            //if this is multipage form, we need to get the total selected price from other pages


            if ( &#036;form-&gt;page_total &gt; 1 ) {


                &#036;other_page_total_payment  = (double) mf_get_payment_total( &#036;dbh, &#036;form_id, &#036;session_id, &#036;page_number );


                &#036;other_page_total_data_tag = 'data-basetotal=&quot;' . &#036;other_page_total_payment . '&quot;';


            } else {


                &#036;other_page_total_data_tag = 'data-basetotal=&quot;0&quot;';


            }


        } elseif ( &#036;form-&gt;payment_price_type == 'fixed' ) {


            &#036;other_page_total_data_tag = 'data-basetotal=&quot;' . &#036;form-&gt;payment_price_amount . '&quot;';


        }


        &#036;payment_total_markup = &lt;&lt;&lt;EOT


		&lt;li class=&quot;total_payment&quot; {&#036;other_page_total_data_tag}&gt;


			&lt;span&gt;


				&lt;h3&gt;{&#036;currency_symbol}&lt;var&gt;0&lt;/var&gt;&lt;/h3&gt;


				&lt;h5&gt;{&#036;webform_lang['payment_total']}&lt;/h5&gt;


			&lt;/span&gt;


		&lt;/li&gt;

EOT;

        if ( &#036;form-&gt;payment_total_location == 'top' ) {


            &#036;payment_total_markup_top = &#036;payment_total_markup;


        } else if ( &#036;form-&gt;payment_total_location == 'bottom' ) {


            &#036;payment_total_markup_bottom = &#036;payment_total_markup;


        } else if ( &#036;form-&gt;payment_total_location == 'top-bottom' || &#036;form-&gt;payment_total_location == 'all' ) {


            &#036;payment_total_markup_top    = &#036;payment_total_markup;


            &#036;payment_total_markup_bottom = &#036;payment_total_markup;


        }


    }


    if ( empty( &#036;mf_settings[ 'disable_machform_link' ] ) ) {


        &#036;powered_by_markup = '';


    } else {


        &#036;powered_by_markup = '';


    }


    //if advanced form code being used, display the form without body container


    if ( &#036;integration_method == 'phone' ) {


        &#036;form_markup = &lt;&lt;&lt;EOT

<div id="main_body" class="{$container_class}">

<div class="ios">

<div class="view om_form">

<div id="form_container">

	&lt;h1&gt;&lt;a&gt;{&#036;form-&gt;name}&lt;/a&gt;&lt;/h1&gt;


	&lt;form id=&quot;form_{&#036;form-&gt;id}&quot; class=&quot;appnitro {&#036;form-&gt;label_alignment}&quot; {&#036;form_enc_type} method=&quot;post&quot; data-highlightcolor=&quot;{&#036;field_highlight_color}&quot; action=&quot;&quot;&gt;


		{&#036;form_desc_div}						


		&lt;ul {&#036;ul_class}&gt;


		{&#036;pagination_header}


		{&#036;payment_total_markup_top}


		{&#036;form-&gt;error_message}


		{&#036;all_element_markup}


		{&#036;custom_element}


		{&#036;payment_total_markup_bottom}


		{&#036;form_resume_markup}


		{&#036;button_markup}


		&lt;input type=&quot;hidden&quot; name=&quot;latitude&quot; /&gt;


		&lt;input type=&quot;hidden&quot; name=&quot;longitude&quot; /&gt;


		&lt;/ul&gt;


	&lt;/form&gt;	

</div></div></div>

</div>

EOT;

    } else {


        &#036;form_markup = &lt;&lt;&lt;EOT

<div class="phone ios">

	&lt;div class=&quot;mobform&quot; id=&quot;mobform&quot;&gt;                  


	&lt;div class=&quot;view om_form&quot;&gt;














&lt;div id=&quot;form_container&quot; class=&quot;{&#036;form_container_class}&quot;&gt;











	&lt;h1&gt;&lt;a&gt;{&#036;form-&gt;name}&lt;/a&gt;&lt;/h1&gt;


	&lt;form id=&quot;form_{&#036;form-&gt;id}&quot; class=&quot;appnitro {&#036;form-&gt;label_alignment}&quot; {&#036;form_enc_type} method=&quot;post&quot; data-highlightcolor=&quot;{&#036;field_highlight_color}&quot; action=&quot;#main_body&quot;&gt;


		{&#036;form_desc_div}						


		&lt;ul {&#036;ul_class}&gt;


		{&#036;pagination_header}


		{&#036;payment_total_markup_top}


		{&#036;form-&gt;error_message}


		{&#036;all_element_markup}


		{&#036;custom_element}


		{&#036;payment_total_markup_bottom}


		{&#036;form_resume_markup}


		{&#036;button_markup}


		&lt;input type=&quot;hidden&quot; name=&quot;latitude&quot; /&gt;


		&lt;input type=&quot;hidden&quot; name=&quot;longitude&quot; /&gt;


		&lt;/ul&gt;


	&lt;/form&gt;	


	


		&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/div&gt;

EOT;

    }


    return &#036;form_markup;


}


/**display the form within the form builder page


 *


 * @access	public


 * @param	string


 * @param   array()


 * @param   int


 * @return	str


 */


public static function display_webform_raw_form( &#036;image_url, &#036;webform_lang, &#036;form_id )


{


    &#036;pagination_header = '';


    &#036;pagination_footer = '';


 	&#036;row               = FormDetail::findOneRow( &quot;form_id = '{&#036;form_id}'&quot;, array( ) );





	//var_dump(&#036;row);


	//exit();


    


	if ( count( &#036;row ) &gt; 0 ) {


        &#036;form                        = new stdClass();


        &#036;form-&gt;id                    = &#036;form_id;


        &#036;form-&gt;name                  = &#036;row-&gt;form_name;


        &#036;form-&gt;description           = &#036;row-&gt;form_description;


        &#036;form-&gt;label_alignment       = &#036;row-&gt;form_label_alignment;


        &#036;form-&gt;page_total            = &#036;row-&gt;form_page_total;


        &#036;form-&gt;lastpage_title        = &#036;row-&gt;form_lastpage_title;


        &#036;form-&gt;submit_primary_text   = &#036;row-&gt;form_submit_primary_text;


        &#036;form-&gt;submit_secondary_text = &#036;row-&gt;form_submit_secondary_text;


        &#036;form-&gt;submit_primary_img    = &#036;row-&gt;form_submit_primary_img;


        &#036;form-&gt;submit_secondary_img  = &#036;row-&gt;form_submit_secondary_img;


        &#036;form-&gt;submit_use_image      = (int) &#036;row-&gt;form_submit_use_image;


        &#036;form-&gt;pagination_type       = &#036;row-&gt;form_pagination_type;


    }


    &#036;matrix_elements = array( );


    //get elements data


    //get element options first and store it into array


    &#036;element_options = FormElementOptions::findAllRow( &quot;form_id = '{&#036;form_id}' and live = 1 order by 	element_id asc, position asc&quot;, array( ) );


    if ( count( &#036;element_options ) &gt; 0 ) {


        foreach ( &#036;element_options as &#036;frm_ele_opt ) {


            &#036;element_id                                                         = &#036;frm_ele_opt-&gt;element_id;


            &#036;option_id                                                          = &#036;frm_ele_opt-&gt;option_id;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'position' ]          = &#036;frm_ele_opt-&gt;position;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'option' ]            = &#036;frm_ele_opt-&gt;option;


            &#036;options_lookup[ &#036;element_id ][ &#036;option_id ][ 'option_is_default' ] = &#036;frm_ele_opt-&gt;option_is_default;


        }


    }


    //get elements data


    &#036;element          = array( );


    &#036;frm_elements     = FormElements::findAllRow( &quot;form_id = '{&#036;form_id}' and element_status='1'	order by element_position asc&quot;, array( ) );


    //&#036;sth = mysql_query(&#036;query);


    &#036;j                = 0;


    &#036;has_calendar     = false;


    &#036;has_guidelines   = false;


    &#036;page_title_array = array( );


    if ( count( &#036;frm_elements ) &gt; 0 ) {


        foreach ( &#036;frm_elements as &#036;element_row ) {


            &#036;element_id      = &#036;element_row-&gt;element_id;


            //lookup element options first


            &#036;element_options = array( );


            if ( &#33;empty( &#036;options_lookup[ &#036;element_id ] ) ) {


                &#036;i = 0;


                foreach ( &#036;options_lookup[ &#036;element_id ] as &#036;option_id =&gt; &#036;data ) {


                    &#036;element_options[ &#036;i ]             = new stdClass();


                    &#036;element_options[ &#036;i ]-&gt;id         = &#036;option_id;


                    &#036;element_options[ &#036;i ]-&gt;option     = &#036;data[ 'option' ];


                    &#036;element_options[ &#036;i ]-&gt;is_default = &#036;data[ 'option_is_default' ];


                    &#036;element_options[ &#036;i ]-&gt;is_db_live = 1;


                    &#036;i++;


                }


            }


            //populate elements


            &#036;element[ &#036;j ]               = new stdClass();


            &#036;element[ &#036;j ]-&gt;title        = nl2br( &#036;element_row-&gt;element_title );


            &#036;element[ &#036;j ]-&gt;instructions = &#036;element_row-&gt;element_instructions;


            if ( &#33;empty( &#036;element_row-&gt;element_instructions ) &amp;&amp; ( &#036;element_row-&gt;element_type &#33;= 'section' ) &amp;&amp; ( &#036;element_row-&gt;element_type &#33;= 'matrix' ) ) {


                &#036;has_guidelines = true;


            }


            &#036;element[ &#036;j ]-&gt;size                        = &#036;element_row-&gt;element_size;


            &#036;element[ &#036;j ]-&gt;default_value               = htmlspecialchars( &#036;element_row-&gt;element_default_value );


            &#036;element[ &#036;j ]-&gt;is_required                 = &#036;element_row-&gt;element_is_required;


            &#036;element[ &#036;j ]-&gt;is_unique                   = &#036;element_row-&gt;element_is_unique;


            &#036;element[ &#036;j ]-&gt;is_private                  = &#036;element_row-&gt;element_is_private;


            &#036;element[ &#036;j ]-&gt;type                        = &#036;element_row-&gt;element_type;


            &#036;element[ &#036;j ]-&gt;position                    = &#036;element_row-&gt;element_position;


            &#036;element[ &#036;j ]-&gt;id                          = &#036;element_row-&gt;element_id;


            &#036;element[ &#036;j ]-&gt;is_db_live                  = 1;


            &#036;element[ &#036;j ]-&gt;is_design_mode              = true;


            &#036;element[ &#036;j ]-&gt;choice_has_other            = (int) &#036;element_row-&gt;element_choice_has_other;


            &#036;element[ &#036;j ]-&gt;choice_other_label          = &#036;element_row-&gt;element_choice_other_label;


            &#036;element[ &#036;j ]-&gt;choice_columns              = (int) &#036;element_row-&gt;element_choice_columns;


            &#036;element[ &#036;j ]-&gt;time_showsecond             = (int) &#036;element_row-&gt;element_time_showsecond;


            &#036;element[ &#036;j ]-&gt;time_24hour                 = (int) &#036;element_row-&gt;element_time_24hour;


            &#036;element[ &#036;j ]-&gt;address_hideline2           = (int) &#036;element_row-&gt;element_address_hideline2;


            &#036;element[ &#036;j ]-&gt;address_us_only             = (int) &#036;element_row-&gt;element_address_us_only;


            &#036;element[ &#036;j ]-&gt;date_enable_range           = (int) &#036;element_row-&gt;element_date_enable_range;


            &#036;element[ &#036;j ]-&gt;date_range_min              = &#036;element_row-&gt;element_date_range_min;


            &#036;element[ &#036;j ]-&gt;date_range_max              = &#036;element_row-&gt;element_date_range_max;


            &#036;element[ &#036;j ]-&gt;date_enable_selection_limit = (int) &#036;element_row-&gt;element_date_enable_selection_limit;


            &#036;element[ &#036;j ]-&gt;date_selection_max          = (int) &#036;element_row-&gt;element_date_selection_max;


            &#036;element[ &#036;j ]-&gt;date_disable_past_future    = (int) &#036;element_row-&gt;element_date_disable_past_future;


            &#036;element[ &#036;j ]-&gt;date_past_future            = &#036;element_row-&gt;element_date_past_future;


            &#036;element[ &#036;j ]-&gt;date_disable_weekend        = (int) &#036;element_row-&gt;element_date_disable_weekend;


            &#036;element[ &#036;j ]-&gt;date_disable_specific       = (int) &#036;element_row-&gt;element_date_disable_specific;


            &#036;element[ &#036;j ]-&gt;date_disabled_list          = &#036;element_row-&gt;element_date_disabled_list;


            &#036;element[ &#036;j ]-&gt;file_enable_type_limit      = (int) &#036;element_row-&gt;element_file_enable_type_limit;


            &#036;element[ &#036;j ]-&gt;file_block_or_allow         = &#036;element_row-&gt;element_file_block_or_allow;


            &#036;element[ &#036;j ]-&gt;file_type_list              = &#036;element_row-&gt;element_file_type_list;


            &#036;element[ &#036;j ]-&gt;file_as_attachment          = (int) &#036;element_row-&gt;element_file_as_attachment;


            &#036;element[ &#036;j ]-&gt;file_enable_advance         = (int) &#036;element_row-&gt;element_file_enable_advance;


            &#036;element[ &#036;j ]-&gt;file_auto_upload            = (int) &#036;element_row-&gt;element_file_auto_upload;


            &#036;element[ &#036;j ]-&gt;file_enable_multi_upload    = (int) &#036;element_row-&gt;element_file_enable_multi_upload;


            &#036;element[ &#036;j ]-&gt;file_max_selection          = (int) &#036;element_row-&gt;element_file_max_selection;


            &#036;element[ &#036;j ]-&gt;file_enable_size_limit      = (int) &#036;element_row-&gt;element_file_enable_size_limit;


            &#036;element[ &#036;j ]-&gt;file_size_max               = (int) &#036;element_row-&gt;element_file_size_max;


            &#036;element[ &#036;j ]-&gt;submit_use_image            = (int) &#036;element_row-&gt;element_submit_use_image;


            &#036;element[ &#036;j ]-&gt;submit_primary_text         = &#036;element_row-&gt;element_submit_primary_text;


            &#036;element[ &#036;j ]-&gt;submit_secondary_text       = &#036;element_row-&gt;element_submit_secondary_text;


            &#036;element[ &#036;j ]-&gt;submit_primary_img          = &#036;element_row-&gt;element_submit_primary_img;


            &#036;element[ &#036;j ]-&gt;submit_secondary_img        = &#036;element_row-&gt;element_submit_secondary_img;


            &#036;element[ &#036;j ]-&gt;page_title                  = &#036;element_row-&gt;element_page_title;


            &#036;element[ &#036;j ]-&gt;page_number                 = (int) &#036;element_row-&gt;element_page_number;


            &#036;element[ &#036;j ]-&gt;page_total                  = &#036;form-&gt;page_total;


            &#036;element[ &#036;j ]-&gt;matrix_allow_multiselect    = (int) &#036;element_row-&gt;element_matrix_allow_multiselect;


            &#036;element[ &#036;j ]-&gt;matrix_parent_id            = (int) &#036;element_row-&gt;element_matrix_parent_id;


            &#036;element[ &#036;j ]-&gt;range_min                   = &#036;element_row-&gt;element_range_min;


            &#036;element[ &#036;j ]-&gt;range_max                   = &#036;element_row-&gt;element_range_max;


            &#036;element[ &#036;j ]-&gt;range_limit_by              = &#036;element_row-&gt;element_range_limit_by;


            &#036;element[ &#036;j ]-&gt;constraint                  = &#036;element_row-&gt;element_constraint;


            if ( &#33;empty( &#036;element_options ) ) {


                &#036;element[ &#036;j ]-&gt;options = &#036;element_options;


            } else {


                &#036;element[ &#036;j ]-&gt;options = '';


            }


            if ( &#036;element_row-&gt;element_type == 'page_break' ) {


                &#036;page_title_array[ ] = &#036;element_row-&gt;element_page_title;


            }


            //if the element is a matrix field and not the parent, store the data into a lookup array for later use when rendering the markup


            if ( &#036;element_row-&gt;element_type == 'matrix' &amp;&amp; &#33;empty( &#036;element_row-&gt;element_matrix_parent_id ) ) {


                &#036;parent_id                                                = &#036;element_row-&gt;element_matrix_parent_id;


                &#036;el_position                                              = &#036;element_row-&gt;element_position;


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'title' ] = &#036;element[ &#036;j ]-&gt;title;


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'id' ]    = &#036;element[ &#036;j ]-&gt;id;


                &#036;matrix_child_option_id                                   = '';


                foreach ( &#036;element_options as &#036;value ) {


                    &#036;matrix_child_option_id .= &#036;value-&gt;id . ',';


                }


                &#036;matrix_child_option_id                                                = rtrim( &#036;matrix_child_option_id, ',' );


                &#036;matrix_elements[ &#036;parent_id ][ &#036;el_position ][ 'children_option_id' ] = &#036;matrix_child_option_id;


                //remove it from the main element array


                &#036;element[ &#036;j ]                                                         = array( );


                unset( &#036;element[ &#036;j ] );


                &#036;j--;


            }


            &#036;j++;


        }


    }


    //generate html markup for each element


    &#036;all_element_markup = '';


    foreach ( &#036;element as &#036;element_data ) {


        //if this is matrix field, build the children data from &#036;matrix_elements array


        if ( &#036;element_data-&gt;type == 'matrix' ) {


            &#036;element_data-&gt;matrix_children = &#036;matrix_elements[ &#036;element_data-&gt;id ];


        }


        &#036;element_prop_name = &quot;ElementHelper::display_webform_&quot; . &#036;element_data-&gt;type;


        //&#036;all_element_markup .= call_user_func( &#036;element_prop_name, &#036;image_url, &#036;webform_lang, &#036;element_data, &quot;Edit&quot; );


    }


    if ( empty( &#036;all_element_markup ) ) {


        &#036;all_element_markup = '&lt;li id=&quot;li_dummy&quot;&gt;&amp;nbsp;&lt;/li&gt;';


    }


    if ( &#33;empty( &#036;form-&gt;name ) || &#33;empty( &#036;form-&gt;description ) ) {


        &#036;form-&gt;description = nl2br( &#036;form-&gt;description );


        &#036;form_desc_div     = &lt;&lt;&lt;EOT


	&lt;div id=&quot;form_header&quot; class=&quot;form_description&quot;&gt;


		&lt;h2 id=&quot;form_header_title&quot;&gt;{&#036;form-&gt;name}&lt;/h2&gt;


		&lt;p id=&quot;form_header_desc&quot;&gt;{&#036;form-&gt;description}&lt;/p&gt;


	&lt;/div&gt;

EOT;

    } else {


        &#036;form_desc_div = &lt;&lt;&lt;EOT


	&lt;div id=&quot;form_header&quot; class=&quot;form_description&quot;&gt;


		&lt;h2 id=&quot;form_header_title&quot;&gt;&lt;i&gt;This form has no title&lt;/i&gt;&lt;/h2&gt;


		&lt;p id=&quot;form_header_desc&quot;&gt;&lt;/p&gt;


	&lt;/div&gt;

EOT;

    }


    if ( &#036;has_guidelines ) {


        &#036;container_class = &quot;integrated&quot;;


    } else {


        &#036;container_class = &quot;integrated no_guidelines&quot;;


    }


    //if the form has multiple pages


    //display the pagination header


    &#036;display_pagination = '';


    if ( &#036;form-&gt;page_total &gt; 1 ) {


        &#036;display_pagination = &quot;display:none;&quot;;


        //build pagination header based on the selected type. possible values:


        //steps - display multi steps progress


        //percentage - display progress bar with percentage


        //disabled - disabled


        if ( &#036;form-&gt;pagination_type == 'steps' ) {


            &#036;page_titles_markup = '';


            &#036;i                  = 1;


            foreach ( &#036;page_title_array as &#036;page_title ) {


                if ( &#036;i == 1 ) {


                    &#036;ap_tp_num_active  = ' ap_tp_num_active';


                    &#036;ap_tp_text_active = ' ap_tp_text_active';


                } else {


                    &#036;ap_tp_num_active  = '';


                    &#036;ap_tp_text_active = '';


                }


                &#036;page_titles_markup .= '&lt;td align=&quot;center&quot;&gt;&lt;span id=&quot;page_num_' . &#036;i . '&quot; class=&quot;ap_tp_num' . &#036;ap_tp_num_active . '&quot;&gt;' . &#036;i . '&lt;/span&gt;&lt;span id=&quot;page_title_' . &#036;i . '&quot; class=&quot;ap_tp_text' . &#036;ap_tp_text_active . '&quot;&gt;' . &#036;page_title . '&lt;/span&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;ap_tp_arrow&quot;&gt;&amp;gt;&lt;/td&gt;' . &quot;&#092;n&quot;;


                &#036;i++;


            }


            //add the last page title into the pagination header markup


            &#036;page_titles_markup .= '&lt;td align=&quot;center&quot;&gt;&lt;span id=&quot;page_num_' . &#036;i . '&quot; class=&quot;ap_tp_num&quot;&gt;' . &#036;i . '&lt;/span&gt;&lt;span id=&quot;page_title_' . &#036;i . '&quot; class=&quot;ap_tp_text&quot;&gt;' . &#036;form-&gt;lastpage_title . '&lt;/span&gt;&lt;/td&gt;';


            &#036;pagination_header = &lt;&lt;&lt;EOT


		&lt;li id=&quot;pagination_header&quot; class=&quot;li_pagination&quot; title=&quot;Click to edit&quot;&gt;


		 &lt;table class=&quot;ap_table_pagination&quot; width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


		  &lt;tr&gt; 


		  	{&#036;page_titles_markup}


		  &lt;/tr&gt;


		&lt;/table&gt;


		&lt;/li&gt;

EOT;

        } else if ( &#036;form-&gt;pagination_type == 'percentage' ) {


            &#036;page_total        = count( &#036;page_title_array ) + 1;


            &#036;percent_value     = round( ( 1 / &#036;page_total ) * 100 );


            &#036;pagination_header = &lt;&lt;&lt;EOT


		&lt;li id=&quot;pagination_header&quot; class=&quot;li_pagination&quot; title=&quot;Click to edit&quot;&gt;


		    &lt;h3 id=&quot;page_title_1&quot;&gt;Page 1 of {&#036;page_total} - {&#036;page_title_array[0]}&lt;/h3&gt;


			&lt;div class=&quot;mf_progress_container&quot;&gt;          


		    	&lt;div id=&quot;mf_progress_percentage&quot; class=&quot;mf_progress_value&quot; style=&quot;width: {&#036;percent_value}%&quot;&gt;&lt;span&gt;{&#036;percent_value}%&lt;/span&gt;&lt;/div&gt;


			&lt;/div&gt;


		&lt;/li&gt;

EOT;

        } else {


            &#036;pagination_header = &lt;&lt;&lt;EOT


		&lt;li id=&quot;pagination_header&quot; class=&quot;li_pagination&quot; title=&quot;Click to edit&quot;&gt;


		    &lt;h3 class=&quot;no_header&quot;&gt;Pagination Header Disabled&lt;/h3&gt;


		&lt;/li&gt;

EOT;

        }


        if ( &#036;form-&gt;submit_use_image == 1 ) {


            &#036;btn_class   = ' hide';


            &#036;image_class = '';


        } else {


            &#036;btn_class   = '';


            &#036;image_class = ' hide';


        }


        &#036;pagination_footer = &lt;&lt;&lt;EOT


	&lt;li title=&quot;Click to edit&quot; class=&quot;page_break synched&quot; id=&quot;li_lastpage&quot;&gt;


		&lt;div&gt;


			&lt;table width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; class=&quot;ap_table_pagination&quot;&gt;


				&lt;tbody&gt;&lt;tr&gt;


					&lt;td align=&quot;left&quot; style=&quot;vertical-align: bottom;&quot;&gt;


						&lt;input type=&quot;submit&quot; class=&quot;btn_primary btn_submit{&#036;btn_class}&quot; name=&quot;btn_submit_lastpage&quot; id=&quot;btn_submit_lastpage&quot; value=&quot;{&#036;form-&gt;submit_primary_text}&quot; disabled=&quot;disabled&quot;&gt;


						&lt;input type=&quot;submit&quot; class=&quot;btn_secondary btn_submit{&#036;btn_class}&quot; name=&quot;btn_prev_lastpage&quot; id=&quot;btn_prev_lastpage&quot; value=&quot;{&#036;form-&gt;submit_secondary_text}&quot; disabled=&quot;disabled&quot;&gt;


						&lt;input type=&quot;image&quot; src=&quot;{&#036;form-&gt;submit_primary_img}&quot; class=&quot;img_primary img_submit{&#036;image_class}&quot; alt=&quot;Submit&quot; name=&quot;img_submit_lastpage&quot; id=&quot;img_submit_lastpage&quot; value=&quot;Submit&quot; disabled=&quot;disabled&quot;&gt;


						&lt;input type=&quot;image&quot; src=&quot;{&#036;form-&gt;submit_secondary_img}&quot; class=&quot;img_secondary img_submit{&#036;image_class}&quot; alt=&quot;Previous&quot; name=&quot;img_prev_lastpage&quot; id=&quot;img_prev_lastpage&quot; value=&quot;Previous&quot; disabled=&quot;disabled&quot;&gt;


					&lt;/td&gt; 


					&lt;td width=&quot;75px&quot; align=&quot;center&quot; style=&quot;vertical-align: top;&quot;&gt;


						&lt;span class=&quot;ap_tp_text&quot; name=&quot;pagetotal_lastpage&quot; id=&quot;pagetotal_lastpage&quot;&gt; {&#036;form-&gt;page_total} / {&#036;form-&gt;page_total}&lt;/span&gt;


					&lt;/td&gt;


				&lt;/tr&gt;


			&lt;/tbody&gt;&lt;/table&gt;


		&lt;/div&gt;


	&lt;/li&gt;

EOT;

    }


    &#036;no_field_display = '';


    if ( count( &#036;element ) &lt;= 0 ) {


        &#036;no_field_display .= '&lt;div id=&quot;no_fields_notice&quot; class=&quot;notice&quot;&gt;';


        &#036;no_field_display .= '&lt;h2&gt; &lt;b&gt; No Fields&#33;&lt;/b&gt; You should add a field.&lt;/h2&gt;';


        &#036;no_field_display .= '&lt;p&gt;&lt;span style=&quot;color: #529214; font-weight: bold;&quot;&gt;Click the buttons&lt;/span&gt; on the left sidebar or &lt;span style=&quot;color: #529214; font-weight: bold;&quot;&gt;Drag it here&lt;/span&gt; to add new field.&lt;/p&gt;';


        &#036;no_field_display .= '&lt;/div&gt;';


    }


    &#036;form_markup = &lt;&lt;&lt;EOT


	


&lt;div id=&quot;form_container&quot;&gt;


	


		


	&lt;form id=&quot;form_builder_preview&quot; class=&quot;appnitro {&#036;form-&gt;label_alignment}&quot; method=&quot;post&quot; action=&quot;#main_body&quot;&gt;


	  	{&#036;form_desc_div}


	    {&#036;no_field_display}


		&lt;ul  id=&quot;form_builder_sortable&quot; title=&quot;Click field to edit. Drag to reorder.&quot;&gt;


		{&#036;pagination_header}


		{&#036;all_element_markup}


		{&#036;pagination_footer}


		&lt;/ul&gt;


	&lt;/form&gt;	


&lt;/div&gt;


&lt;div title=&quot;Click to edit&quot; class=&quot;page_break synched&quot; id=&quot;li_default_lastpage&quot; style=&quot;background: none repeat scroll 0 0 #F0F0F0;border-bottom: 1px solid #FFFFFF;clear: both;margin: 0;padding: 6px 1% 9px;position: relative;{&#036;display_pagination}&quot; &gt;


	&lt;span class=&quot;om_handle&quot;&gt;&lt;/span&gt;


	


	


		&lt;div id=&quot;form_element_lastpage&quot;&gt;


			&lt;table width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; class=&quot;ap_table_pagination&quot;&gt;


				&lt;tbody&gt;&lt;tr&gt;


					&lt;td align=&quot;left&quot; style=&quot;vertical-align: bottom&quot;&gt;


						&lt;input type=&quot;submit&quot; class=&quot;btn_primary btn_submit&quot; name=&quot;btn_submit_default_lastpage&quot; id=&quot;btn_submit_0&quot; value=&quot;Submit&quot; disabled=&quot;disabled&quot;&gt;


						&lt;input type=&quot;image&quot; class=&quot;img_primary img_submit&quot; name=&quot;img_submit_default_lastpage&quot; id=&quot;img_submit_0&quot; value=&quot;Continue&quot; alt=&quot;Continue&quot; src=&quot;/formbuilder//images/empty.gif&quot; disabled=&quot;disabled&quot;&gt;


					&lt;/td&gt; 


					


				&lt;/tr&gt;


			&lt;/tbody&gt;&lt;/table&gt;


			


		&lt;/div&gt;


		


		&lt;/div&gt;  

EOT;

    return &#036;form_markup;


}

}

?>[code]

Hi!

Please don’t expect ANYONE to read this unformatted MASS of code.

Learn to use code blocks to format your code:




// use the below this line without the // at beginning.

// [code]your well formattet php code [ /code]


// Then your code looks like this: 

public function example(){

  $test "Just a Test to show code formatting in the yii forum!";

  return $test;

}



Regards

Thanks for your suggestion…