Esempio n. 1
0
    $theme_builtin_properties->border_guidelines_width = (int) $row['border_guidelines_width'];
    $theme_builtin_properties->border_guidelines_style = $row['border_guidelines_style'];
    $theme_builtin_properties->border_guidelines_color = $row['border_guidelines_color'];
    $theme_builtin_properties->border_section_width = (int) $row['border_section_width'];
    $theme_builtin_properties->border_section_style = $row['border_section_style'];
    $theme_builtin_properties->border_section_color = $row['border_section_color'];
    $theme_builtin_properties->form_shadow_style = $row['form_shadow_style'];
    $theme_builtin_properties->form_shadow_size = $row['form_shadow_size'];
    $theme_builtin_properties->form_shadow_brightness = $row['form_shadow_brightness'];
    $theme_builtin_properties->form_button_type = $row['form_button_type'];
    $theme_builtin_properties->form_button_text = $row['form_button_text'];
    $theme_builtin_properties->form_button_image = $row['form_button_image'];
    $theme_builtin_properties->advanced_css = $row['advanced_css'];
    $json_theme = json_encode($theme_builtin_properties);
    $jquery_data_code .= "\$('#li_builtin_{$row['theme_id']}').data('theme_builtin_properties',{$json_theme});\n";
    $font_link_markup = mf_theme_get_fonts_link($dbh, $theme_builtin_properties->theme_id);
    $json_font_link_markup = json_encode($font_link_markup);
    $jquery_data_code .= "\$('#li_builtin_{$row['theme_id']}').data('font_link',{$json_font_link_markup});\n";
    $jquery_data_code .= "\$('#li_builtin_{$row['theme_id']}').data('font_link_loaded',0);\n";
}
$header_data = <<<EOT
<link type="text/css" href="css/pagination_classic.css" rel="stylesheet" />
<link type="text/css" href="css/dropui.css" rel="stylesheet" />
<link type="text/css" href="css/et_view.css" rel="stylesheet" />
<link type="text/css" href="css/shadow.css" rel="stylesheet" />
<link type="text/css" href="css/jquery_minicolors.css" rel="stylesheet" />
<link type="text/css" href="js/jquery-ui/themes/base/jquery.ui.all.css" rel="stylesheet" />
{$font_css_markup}
EOT;
$current_nav_tab = 'edit_theme';
require 'includes/header.php';
Esempio n. 2
0
function mf_display_form_review($dbh, $form_id, $record_id, $from_page_num, $form_params = array())
{
    global $mf_lang;
    if (!empty($form_params['integration_method'])) {
        $integration_method = $form_params['integration_method'];
    } else {
        $integration_method = '';
    }
    if (!empty($form_params['machform_path'])) {
        $machform_path = $form_params['machform_path'];
    } else {
        $machform_path = '';
    }
    if (!empty($form_params['machform_data_path'])) {
        $machform_data_path = $form_params['machform_data_path'];
    } else {
        $machform_data_path = '';
    }
    $mf_settings = mf_get_settings($dbh);
    //get form properties data
    $query = "select \r\n\t\t\t\t\t\t  form_name,\r\n\t\t\t\t\t\t  form_has_css,\r\n\t\t\t\t\t\t  form_redirect,\r\n\t\t\t\t\t\t  form_review_primary_text,\r\n\t\t\t\t\t\t  form_review_secondary_text,\r\n\t\t\t\t\t\t  form_review_primary_img,\r\n\t\t\t\t\t\t  form_review_secondary_img,\r\n\t\t\t\t\t\t  form_review_use_image,\r\n\t\t\t\t\t\t  form_review_title,\r\n\t\t\t\t\t\t  form_review_description,\r\n\t\t\t\t\t\t  form_page_total,\r\n\t\t\t\t\t\t  form_lastpage_title,\r\n\t\t\t\t\t\t  form_pagination_type,\r\n\t\t\t\t\t\t  form_theme_id,\r\n\t\t\t\t\t\t  payment_show_total,\r\n\t\t\t\t\t\t  payment_total_location,\r\n\t\t\t\t\t\t  payment_enable_merchant,\r\n\t\t\t\t\t\t  payment_currency,\r\n\t\t\t\t\t\t  payment_price_type,\r\n\t\t\t\t\t\t  payment_price_amount\r\n\t\t\t\t     from \r\n\t\t\t\t     \t " . MF_TABLE_PREFIX . "forms \r\n\t\t\t\t    where \r\n\t\t\t\t    \t form_id=?";
    $params = array($form_id);
    $sth = mf_do_query($query, $params, $dbh);
    $row = mf_do_fetch_result($sth);
    $form_has_css = $row['form_has_css'];
    $form_redirect = $row['form_redirect'];
    $form_review_primary_text = $row['form_review_primary_text'];
    $form_review_secondary_text = $row['form_review_secondary_text'];
    $form_review_primary_img = $row['form_review_primary_img'];
    $form_review_secondary_img = $row['form_review_secondary_img'];
    $form_review_use_image = (int) $row['form_review_use_image'];
    $form_review_title = $row['form_review_title'];
    $form_review_description = $row['form_review_description'];
    $form_page_total = $row['form_page_total'];
    $form_lastpage_title = $row['form_lastpage_title'];
    $form_pagination_type = $row['form_pagination_type'];
    $form_name = htmlspecialchars($row['form_name'], ENT_QUOTES);
    $form_theme_id = $row['form_theme_id'];
    $payment_show_total = (int) $row['payment_show_total'];
    $payment_total_location = $row['payment_total_location'];
    $payment_enable_merchant = (int) $row['payment_enable_merchant'];
    if ($payment_enable_merchant < 1) {
        $payment_enable_merchant = 0;
    }
    $payment_currency = $row['payment_currency'];
    $payment_price_type = $row['payment_price_type'];
    $payment_price_amount = $row['payment_price_amount'];
    //prepare entry data for previewing
    $param['strip_download_link'] = true;
    $param['review_mode'] = true;
    $param['show_attach_image'] = true;
    $param['machform_data_path'] = $machform_data_path;
    $entry_details = mf_get_entry_details($dbh, $form_id, $record_id, $param);
    $entry_data = '<table id="machform_review_table" width="100%" border="0" cellspacing="0" cellpadding="0"><tbody>' . "\n";
    $toggle = false;
    foreach ($entry_details as $data) {
        if ($toggle) {
            $toggle = false;
            $row_style = 'class="alt"';
        } else {
            $toggle = true;
            $row_style = '';
        }
        if ($data['label'] == 'mf_page_break' && $data['value'] == 'mf_page_break') {
            $data['label'] = '&nbsp;';
            $data['value'] = '&nbsp;';
            $row_style = '';
        }
        $entry_data .= "<tr {$row_style}>\n";
        $entry_data .= "<td class=\"mf_review_label\" width=\"40%\">{$data['label']}</td>\n";
        $entry_data .= "<td class=\"mf_review_value\" width=\"60%\">" . nl2br($data['value']) . "</td>\n";
        $entry_data .= "</tr>\n";
    }
    $entry_data .= '</tbody></table>';
    //check for specific form css, if any, use it instead
    if ($form_has_css) {
        $css_dir = $mf_settings['data_dir'] . "/form_{$form_id}/css/";
    }
    if ($integration_method == 'iframe') {
        $embed_class = 'class="embed"';
    }
    //if the form has multiple pages
    //display the pagination header
    if ($form_page_total > 1) {
        //build pagination header based on the selected type. possible values:
        //steps - display multi steps progress
        //percentage - display progress bar with percentage
        //disabled - disabled
        $page_breaks_data = array();
        $page_title_array = array();
        //get page titles
        $query = "SELECT \r\n\t\t\t\t\t\t\telement_page_title\r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t" . MF_TABLE_PREFIX . "form_elements\r\n\t\t\t\t\t   WHERE\r\n\t\t\t\t\t\t\tform_id = ? and element_status = 1 and element_type = 'page_break'\r\n\t\t\t\t\tORDER BY \r\n\t\t\t\t\t   \t\telement_page_number asc";
        $params = array($form_id);
        $sth = mf_do_query($query, $params, $dbh);
        while ($row = mf_do_fetch_result($sth)) {
            $page_title_array[] = $row['element_page_title'];
        }
        if ($form_pagination_type == 'steps') {
            $page_titles_markup = '';
            $i = 1;
            foreach ($page_title_array as $page_title) {
                $page_titles_markup .= '<td align="center"><span id="page_num_' . $i . '" class="ap_tp_num">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text">' . $page_title . '</span></td><td align="center" class="ap_tp_arrow">&gt;</td>' . "\n";
                $i++;
            }
            //add the last page title into the pagination header markup
            $page_titles_markup .= '<td align="center"><span id="page_num_' . $i . '" class="ap_tp_num">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text">' . $form_lastpage_title . '</span></td>';
            $i++;
            $page_titles_markup .= '<td align="center" class="ap_tp_arrow">&gt;</td><td align="center"><span id="page_num_' . $i . '" class="ap_tp_num ap_tp_num_active">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text ap_tp_text_active">' . $form_review_title . '</span></td>';
            $pagination_header = <<<EOT
\t\t\t<ul>
\t\t\t<li id="pagination_header" class="li_pagination">
\t\t\t <table class="ap_table_pagination" width="100%" border="0" cellspacing="0" cellpadding="0">
\t\t\t  <tr> 
\t\t\t  \t{$page_titles_markup}
\t\t\t  </tr>
\t\t\t</table>
\t\t\t</li>
\t\t\t</ul>
EOT;
        } else {
            if ($form_pagination_type == 'percentage') {
                $page_total = count($page_title_array) + 2;
                $percent_value = 99;
                $page_number_title = sprintf($mf_lang['page_title'], $page_total, $page_total);
                $pagination_header = <<<EOT
\t\t\t<ul>
\t\t\t\t<li id="pagination_header" class="li_pagination" title="Click to edit">
\t\t\t    <h3 id="page_title_{$page_total}">{$page_number_title}</h3>
\t\t\t\t<div class="mf_progress_container">          
\t\t\t    \t<div id="mf_progress_percentage" class="mf_progress_value" style="width: {$percent_value}%"><span>{$percent_value}%</span></div>
\t\t\t\t</div>
\t\t\t\t</li>
\t\t\t</ul>
EOT;
            } else {
                $pagination_header = '';
            }
        }
    }
    //build the button markup (image or text)
    if (!empty($form_review_use_image)) {
        $button_markup = <<<EOT
<input id="review_submit" class="submit_img_primary" type="image" name="review_submit" alt="{$form_review_primary_text}" src="{$form_review_primary_img}" />
<input id="review_back" class="submit_img_secondary" type="image" name="review_back" alt="{$form_review_secondary_text}" src="{$form_review_secondary_img}" />
EOT;
    } else {
        $button_markup = <<<EOT
<input id="review_submit" class="button_text btn_primary" type="submit" name="review_submit" value="{$form_review_primary_text}" />
<input id="review_back" class="button_text btn_secondary" type="submit" name="review_back" value="{$form_review_secondary_text}" />
EOT;
    }
    //if this form is using custom theme
    if (!empty($form_theme_id)) {
        //get the field highlight color for the particular theme
        $query = "SELECT \r\n\t\t\t\t\t\t\thighlight_bg_type,\r\n\t\t\t\t\t\t\thighlight_bg_color,\r\n\t\t\t\t\t\t\tform_shadow_style,\r\n\t\t\t\t\t\t\tform_shadow_size,\r\n\t\t\t\t\t\t\tform_shadow_brightness,\r\n\t\t\t\t\t\t\tform_button_type,\r\n\t\t\t\t\t\t\tform_button_text,\r\n\t\t\t\t\t\t\tform_button_image,\r\n\t\t\t\t\t\t\ttheme_has_css  \r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t" . MF_TABLE_PREFIX . "form_themes \r\n\t\t\t\t\t   WHERE \r\n\t\t\t\t\t   \t\ttheme_id = ?";
        $params = array($form_theme_id);
        $sth = mf_do_query($query, $params, $dbh);
        $row = mf_do_fetch_result($sth);
        $form_shadow_style = $row['form_shadow_style'];
        $form_shadow_size = $row['form_shadow_size'];
        $form_shadow_brightness = $row['form_shadow_brightness'];
        $theme_has_css = (int) $row['theme_has_css'];
        //if the theme has css file, make sure to refer to that file
        //otherwise, generate the css dynamically
        if (!empty($theme_has_css)) {
            $theme_css_link = '<link rel="stylesheet" type="text/css" href="' . $machform_path . $mf_settings['data_dir'] . '/themes/theme_' . $form_theme_id . '.css" media="all" />';
        } else {
            $theme_css_link = '<link rel="stylesheet" type="text/css" href="' . $machform_path . 'css_theme.php?theme_id=' . $form_theme_id . '" media="all" />';
        }
        if ($row['highlight_bg_type'] == 'color') {
            $field_highlight_color = $row['highlight_bg_color'];
        } else {
            //if the field highlight is using pattern instead of color, set the color to empty string
            $field_highlight_color = '';
        }
        //get the css link for the fonts
        $font_css_markup = mf_theme_get_fonts_link($dbh, $form_theme_id);
        //get the form shadow classes
        if (!empty($form_shadow_style) && $form_shadow_style != 'disabled') {
            preg_match_all("/[A-Z]/", $form_shadow_style, $prefix_matches);
            //this regex simply get the capital characters of the shadow style name
            //example: RightPerspectiveShadow result to RPS and then being sliced to RP
            $form_shadow_prefix_code = substr(implode("", $prefix_matches[0]), 0, -1);
            $form_shadow_size_class = $form_shadow_prefix_code . ucfirst($form_shadow_size);
            $form_shadow_brightness_class = $form_shadow_prefix_code . ucfirst($form_shadow_brightness);
            if (empty($integration_method)) {
                //only display shadow if the form is not being embedded using any method
                $form_container_class = $form_shadow_style . ' ' . $form_shadow_size_class . ' ' . $form_shadow_brightness_class;
            }
        }
    } else {
        //if the form doesn't have any theme being applied
        $field_highlight_color = '#FFF7C0';
        if (empty($integration_method)) {
            $form_container_class = 'WarpShadow WLarge WNormal';
            //default shadow
        } else {
            $form_container_class = '';
            //dont show any shadow when the form being embedded
        }
    }
    //if the form has enabled merchant support and set the total payment to be displayed
    if (!empty($payment_enable_merchant) && !empty($payment_show_total)) {
        $currency_symbol = '&#36;';
        switch ($payment_currency) {
            case 'USD':
                $currency_symbol = '&#36;';
                break;
            case 'EUR':
                $currency_symbol = '&#8364;';
                break;
            case 'GBP':
                $currency_symbol = '&#163;';
                break;
            case 'AUD':
                $currency_symbol = 'A&#36;';
                break;
            case 'CAD':
                $currency_symbol = 'C&#36;';
                break;
            case 'JPY':
                $currency_symbol = '&#165;';
                break;
            case 'THB':
                $currency_symbol = '&#3647;';
                break;
            case 'HUF':
                $currency_symbol = '&#70;&#116;';
                break;
            case 'CHF':
                $currency_symbol = 'CHF';
                break;
            case 'CZK':
                $currency_symbol = '&#75;&#269;';
                break;
            case 'SEK':
                $currency_symbol = 'kr';
                break;
            case 'DKK':
                $currency_symbol = 'kr';
                break;
            case 'PHP':
                $currency_symbol = '&#36;';
                break;
            case 'MYR':
                $currency_symbol = 'RM';
                break;
            case 'PLN':
                $currency_symbol = '&#122;&#322;';
                break;
            case 'BRL':
                $currency_symbol = 'R&#36;';
                break;
            case 'HKD':
                $currency_symbol = 'HK&#36;';
                break;
            case 'MXN':
                $currency_symbol = 'Mex&#36;';
                break;
            case 'TWD':
                $currency_symbol = 'NT&#36;';
                break;
            case 'TRY':
                $currency_symbol = 'TL';
                break;
        }
        if ($payment_total_location == 'review' || $payment_total_location == 'all') {
            $session_id = session_id();
            if ($payment_price_type == 'variable') {
                $total_payment = (double) mf_get_payment_total($dbh, $form_id, $session_id, 0);
            } elseif ($payment_price_type == 'fixed') {
                $total_payment = $payment_price_amount;
            }
            $payment_total_markup = <<<EOT
\t\t\t\t<li class="total_payment mf_review">
\t\t\t\t\t<span>
\t\t\t\t\t\t<h3>{$currency_symbol}<var>{$total_payment}</var></h3>
\t\t\t\t\t\t<h5>{$mf_lang['payment_total']}</h5>
\t\t\t\t\t</span>
\t\t\t\t</li>
EOT;
        }
    }
    if (empty($mf_settings['disable_machform_link'])) {
        $powered_by_markup = 'Powered by MachForm';
    } else {
        $powered_by_markup = '';
    }
    $self_address = htmlentities($_SERVER['PHP_SELF']);
    //prevent XSS
    if ($integration_method == 'php') {
        $form_markup = <<<EOT
<link rel="stylesheet" type="text/css" href="data/form_default/css/view.css" media="all" />
{$theme_css_link}
{$font_css_markup}
<style>
html{
\tbackground: none repeat scroll 0 0 transparent;
}
</style>

<div id="main_body" class="integrated">
\t<div id="form_container">
\t\t<form id="form_{$form->id}" class="appnitro" method="post" action="{$self_address}">
\t\t    <div class="form_description">
\t\t\t\t<h2>{$form_review_title}</h2>
\t\t\t\t<p>{$form_review_description}</p>
\t\t\t</div>
\t\t\t{$pagination_header}
\t\t\t{$entry_data}
\t\t\t<ul>
\t\t\t{$payment_total_markup}
\t\t\t<li id="li_buttons" class="buttons">
\t\t\t    <input type="hidden" name="id" value="{$form_id}" />
\t\t\t    <input type="hidden" name="mf_page_from" value="{$from_page_num}" />
\t\t\t    {$button_markup}
\t\t\t</li>
\t\t\t</ul>
\t\t</form>\t\t
\t</div>
</div>
EOT;
    } else {
        if ($integration_method == 'iframe') {
            $auto_height_js = <<<EOT
<script type="text/javascript" src="{$machform_path}js/jquery.min.js"></script>
<script type="text/javascript" src="{$machform_path}js/jquery.ba-postmessage.min.js"></script>
<script type="text/javascript">
    \$(function(){
    \t\$.postMessage({mf_iframe_height: \$('body').outerHeight(true)}, '*', parent );
    });
</script>
EOT;
        }
        $form_markup = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html {$embed_class} xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{$form_name}</title>
<link rel="stylesheet" type="text/css" href="data/form_default/css/view.css" media="all" />
{$theme_css_link}
{$font_css_markup}
{$auto_height_js}
</head>
<body id="main_body">
\t
\t<img id="top" src="{$machform_path}images/top.png" alt="" />
\t<div id="form_container" class="{$form_container_class}">
\t
\t\t<h1><a>MachForm</a></h1>
\t\t<form id="form_{$form_id}" class="appnitro" method="post" action="{$self_address}">
\t\t    <div class="form_description">
\t\t\t\t<h2>{$form_review_title}</h2>
\t\t\t\t<p>{$form_review_description}</p>
\t\t\t</div>
\t\t\t{$pagination_header}
\t\t\t{$entry_data}
\t\t\t<ul>
\t\t\t{$payment_total_markup}
\t\t\t<li id="li_buttons" class="buttons">
\t\t\t    <input type="hidden" name="id" value="{$form_id}" />
\t\t\t    <input type="hidden" name="mf_page_from" value="{$from_page_num}" />
\t\t\t    {$button_markup}
\t\t\t</li>
\t\t\t</ul>
\t\t</form>\t\t
\t\t\t
\t</div>
\t<img id="bottom" src="{$machform_path}images/bottom.png" alt="" />
\t</body>
</html>
EOT;
    }
    return $form_markup;
}
function mf_display_form_payment($dbh, $form_id, $record_id, $form_params = array())
{
    global $mf_lang;
    if (!empty($form_params['integration_method'])) {
        $integration_method = $form_params['integration_method'];
    } else {
        $integration_method = '';
    }
    if (!empty($form_params['machform_path'])) {
        $machform_path = $form_params['machform_path'];
    } else {
        $machform_path = '';
    }
    if (!empty($form_params['machform_data_path'])) {
        $machform_data_path = $form_params['machform_data_path'];
    } else {
        $machform_data_path = '';
    }
    //check permission to access this page
    if ($_SESSION['mf_form_payment_access'][$form_id] !== true) {
        return "Your session has been expired. Please <a href='view.php?id={$form_id}'>click here</a> to start again.";
    }
    $mf_settings = mf_get_settings($dbh);
    //get form properties data
    $query = "select \r\n\t\t\t\t\t\t  form_name,\r\n\t\t\t\t\t\t  form_has_css,\r\n\t\t\t\t\t\t  form_redirect,\r\n\t\t\t\t\t\t  form_language,\r\n\t\t\t\t\t\t  form_review,\r\n\t\t\t\t\t\t  form_review_primary_text,\r\n\t\t\t\t\t\t  form_review_secondary_text,\r\n\t\t\t\t\t\t  form_review_primary_img,\r\n\t\t\t\t\t\t  form_review_secondary_img,\r\n\t\t\t\t\t\t  form_review_use_image,\r\n\t\t\t\t\t\t  form_review_title,\r\n\t\t\t\t\t\t  form_review_description,\r\n\t\t\t\t\t\t  form_resume_enable,\r\n\t\t\t\t\t\t  form_page_total,\r\n\t\t\t\t\t\t  form_lastpage_title,\r\n\t\t\t\t\t\t  form_pagination_type,\r\n\t\t\t\t\t\t  form_theme_id,\r\n\t\t\t\t\t\t  payment_show_total,\r\n\t\t\t\t\t\t  payment_total_location,\r\n\t\t\t\t\t\t  payment_enable_merchant,\r\n\t\t\t\t\t\t  payment_merchant_type,\r\n\t\t\t\t\t\t  payment_currency,\r\n\t\t\t\t\t\t  payment_price_type,\r\n\t\t\t\t\t\t  payment_price_name,\r\n\t\t\t\t\t\t  payment_price_amount,\r\n\t\t\t\t\t\t  payment_ask_billing,\r\n\t\t\t\t\t\t  payment_ask_shipping,\r\n\t\t\t\t\t\t  payment_stripe_live_public_key,\r\n\t\t\t\t\t\t  payment_stripe_test_public_key,\r\n\t\t\t\t\t\t  payment_stripe_enable_test_mode,\r\n\t\t\t\t\t\t  payment_enable_recurring,\r\n\t\t\t\t\t\t  payment_recurring_cycle,\r\n\t\t\t\t\t\t  payment_recurring_unit,\r\n\t\t\t\t\t\t  payment_enable_trial,\r\n\t\t\t\t\t\t  payment_trial_period,\r\n\t\t\t\t\t\t  payment_trial_unit,\r\n\t\t\t\t\t\t  payment_trial_amount,\r\n\t\t\t\t\t\t  payment_delay_notifications\r\n\t\t\t\t     from \r\n\t\t\t\t     \t " . MF_TABLE_PREFIX . "forms \r\n\t\t\t\t    where \r\n\t\t\t\t    \t form_id=?";
    $params = array($form_id);
    $sth = mf_do_query($query, $params, $dbh);
    $row = mf_do_fetch_result($sth);
    $form_language = $row['form_language'];
    if (!empty($form_language)) {
        mf_set_language($form_language);
    }
    $form_payment_title = $mf_lang['form_payment_title'];
    $form_payment_description = $mf_lang['form_payment_description'];
    $form_has_css = $row['form_has_css'];
    $form_redirect = $row['form_redirect'];
    $form_review = (int) $row['form_review'];
    $form_review_primary_text = $row['form_review_primary_text'];
    $form_review_secondary_text = $row['form_review_secondary_text'];
    $form_review_primary_img = $row['form_review_primary_img'];
    $form_review_secondary_img = $row['form_review_secondary_img'];
    $form_review_use_image = (int) $row['form_review_use_image'];
    $form_review_title = $row['form_review_title'];
    $form_review_description = $row['form_review_description'];
    $form_page_total = (int) $row['form_page_total'];
    $form_lastpage_title = $row['form_lastpage_title'];
    $form_pagination_type = $row['form_pagination_type'];
    $form_name = htmlspecialchars($row['form_name'], ENT_QUOTES);
    $form_theme_id = $row['form_theme_id'];
    $form_resume_enable = (int) $row['form_resume_enable'];
    $payment_show_total = (int) $row['payment_show_total'];
    $payment_total_location = $row['payment_total_location'];
    $payment_enable_merchant = (int) $row['payment_enable_merchant'];
    if ($payment_enable_merchant < 1) {
        $payment_enable_merchant = 0;
    }
    $payment_currency = $row['payment_currency'];
    $payment_price_type = $row['payment_price_type'];
    $payment_price_amount = $row['payment_price_amount'];
    $payment_price_name = htmlspecialchars($row['payment_price_name'], ENT_QUOTES);
    $payment_ask_billing = (int) $row['payment_ask_billing'];
    $payment_ask_shipping = (int) $row['payment_ask_shipping'];
    $payment_merchant_type = $row['payment_merchant_type'];
    $payment_stripe_enable_test_mode = (int) $row['payment_stripe_enable_test_mode'];
    $payment_stripe_live_public_key = trim($row['payment_stripe_live_public_key']);
    $payment_stripe_test_public_key = trim($row['payment_stripe_test_public_key']);
    $payment_enable_recurring = (int) $row['payment_enable_recurring'];
    $payment_recurring_cycle = (int) $row['payment_recurring_cycle'];
    $payment_recurring_unit = $row['payment_recurring_unit'];
    $payment_enable_trial = (int) $row['payment_enable_trial'];
    $payment_trial_period = (int) $row['payment_trial_period'];
    $payment_trial_unit = $row['payment_trial_unit'];
    $payment_trial_amount = (double) $row['payment_trial_amount'];
    $payment_delay_notifications = (int) $row['payment_delay_notifications'];
    //check for specific form css, if any, use it instead
    if ($form_has_css) {
        $css_dir = $mf_settings['data_dir'] . "/form_{$form_id}/css/";
    }
    if ($integration_method == 'iframe') {
        $embed_class = 'class="embed"';
    }
    //get total payment
    $currency_symbol = '&#36;';
    if ($payment_price_type == 'variable') {
        $total_payment_amount = (double) mf_get_payment_total($dbh, $form_id, $record_id, 0, 'live');
        $payment_items = mf_get_payment_items($dbh, $form_id, $record_id, 'live');
        //build the payment list markup
        $payment_list_items_markup = '';
        if (!empty($payment_items)) {
            foreach ($payment_items as $item) {
                if ($item['type'] == 'money') {
                    $payment_list_items_markup .= "<li>{$item['title']} <span>{$currency_symbol}{$item['amount']}</span></li>" . "\n";
                } else {
                    if ($item['type'] == 'checkbox') {
                        $payment_list_items_markup .= "<li>{$item['sub_title']} <span>{$currency_symbol}{$item['amount']}</span></li>" . "\n";
                    } else {
                        if ($item['type'] == 'select' || $item['type'] == 'radio') {
                            $payment_list_items_markup .= "<li>{$item['title']} <em>({$item['sub_title']})</em> <span>{$currency_symbol}{$item['amount']}</span></li>" . "\n";
                        }
                    }
                }
            }
        }
    } else {
        if ($payment_price_type == 'fixed') {
            $total_payment_amount = $payment_price_amount;
            $payment_list_items_markup = "<li>{$payment_price_name}</li>";
        }
    }
    //construct payment terms
    if (!empty($payment_enable_recurring)) {
        $payment_plurals = '';
        if ($payment_recurring_cycle > 1) {
            $payment_plurals = 's';
            $payment_recurring_cycle_markup = $payment_recurring_cycle . ' ';
        }
        if (!empty($payment_enable_trial)) {
            //recurring with trial period
            $payment_trial_price = $currency_symbol . $payment_trial_amount;
            if (empty($payment_trial_amount)) {
                $payment_trial_price = 'free';
            }
            $payment_trial_plurals = '';
            if ($payment_trial_period > 1) {
                $payment_trial_plurals = 's';
            }
            $payment_term_markup = <<<EOT
\t\t\t\t\t<li class="payment_summary_term">
\t\t\t\t\t\t<em>Trial period: {$payment_trial_period} {$payment_trial_unit}{$payment_trial_plurals} ({$payment_trial_price})</em><br>
\t\t\t\t\t\t<em>Then you will be charged {$currency_symbol}{$total_payment_amount} every {$payment_recurring_cycle_markup}{$payment_recurring_unit}{$payment_plurals}</em>
\t\t\t\t\t</li>
EOT;
        } else {
            $payment_term_markup = "<li class=\"payment_summary_term\"><em>You will be charged {$currency_symbol}{$total_payment_amount} every {$payment_recurring_cycle_markup}{$payment_recurring_unit}{$payment_plurals}</em></li>";
        }
    }
    //if the form has multiple pages
    //display the pagination header
    if ($form_page_total > 1) {
        //build pagination header based on the selected type. possible values:
        //steps - display multi steps progress
        //percentage - display progress bar with percentage
        //disabled - disabled
        $page_breaks_data = array();
        $page_title_array = array();
        //get page titles
        $query = "SELECT \r\n\t\t\t\t\t\t\telement_page_title\r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t" . MF_TABLE_PREFIX . "form_elements\r\n\t\t\t\t\t   WHERE\r\n\t\t\t\t\t\t\tform_id = ? and element_status = 1 and element_type = 'page_break'\r\n\t\t\t\t\tORDER BY \r\n\t\t\t\t\t   \t\telement_page_number asc";
        $params = array($form_id);
        $sth = mf_do_query($query, $params, $dbh);
        while ($row = mf_do_fetch_result($sth)) {
            $page_title_array[] = $row['element_page_title'];
        }
        if ($form_pagination_type == 'steps') {
            $page_titles_markup = '';
            $i = 1;
            foreach ($page_title_array as $page_title) {
                $page_titles_markup .= '<td align="center"><span id="page_num_' . $i . '" class="ap_tp_num">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text">' . $page_title . '</span></td><td align="center" class="ap_tp_arrow">&gt;</td>' . "\n";
                $i++;
            }
            //add the last page title into the pagination header markup
            $page_titles_markup .= '<td align="center"><span id="page_num_' . $i . '" class="ap_tp_num">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text">' . $form_lastpage_title . '</span></td>';
            if (!empty($form_review)) {
                $i++;
                $page_titles_markup .= '<td align="center" class="ap_tp_arrow">&gt;</td><td align="center"><span id="page_num_' . $i . '" class="ap_tp_num">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text">' . $form_review_title . '</span></td>';
            }
            $i++;
            $page_titles_markup .= '<td align="center" class="ap_tp_arrow">&gt;</td><td align="center"><span id="page_num_' . $i . '" class="ap_tp_num ap_tp_num_active">' . $i . '</span><span id="page_title_' . $i . '" class="ap_tp_text ap_tp_text_active">' . $mf_lang['form_payment_header_title'] . '</span></td>';
            $pagination_header = <<<EOT
\t\t\t<ul>
\t\t\t<li id="pagination_header" class="li_pagination">
\t\t\t <table class="ap_table_pagination" width="100%" border="0" cellspacing="0" cellpadding="0">
\t\t\t  <tr> 
\t\t\t  \t{$page_titles_markup}
\t\t\t  </tr>
\t\t\t</table>
\t\t\t</li>
\t\t\t</ul>
EOT;
        } else {
            if ($form_pagination_type == 'percentage') {
                $page_total = count($page_title_array) + 2;
                if (!empty($form_review)) {
                    $page_total++;
                }
                $percent_value = 99;
                $page_number_title = sprintf($mf_lang['page_title'], $page_total, $page_total);
                $pagination_header = <<<EOT
\t\t\t<ul>
\t\t\t\t<li id="pagination_header" class="li_pagination" title="Click to edit">
\t\t\t    <h3 id="page_title_{$page_total}">{$page_number_title}</h3>
\t\t\t\t<div class="mf_progress_container">          
\t\t\t    \t<div id="mf_progress_percentage" class="mf_progress_value" style="width: {$percent_value}%"><span>{$percent_value}%</span></div>
\t\t\t\t</div>
\t\t\t\t</li>
\t\t\t</ul>
EOT;
            } else {
                $pagination_header = '';
            }
        }
    }
    //build the button markup
    $button_markup = <<<EOT
<input id="btn_submit_payment" class="button_text btn_primary" type="submit" data-originallabel="{$mf_lang['payment_submit_button']}" value="{$mf_lang['payment_submit_button']}" />
EOT;
    //if this form is using custom theme
    if (!empty($form_theme_id)) {
        //get the field highlight color for the particular theme
        $query = "SELECT \r\n\t\t\t\t\t\t\thighlight_bg_type,\r\n\t\t\t\t\t\t\thighlight_bg_color,\r\n\t\t\t\t\t\t\tform_shadow_style,\r\n\t\t\t\t\t\t\tform_shadow_size,\r\n\t\t\t\t\t\t\tform_shadow_brightness,\r\n\t\t\t\t\t\t\tform_button_type,\r\n\t\t\t\t\t\t\tform_button_text,\r\n\t\t\t\t\t\t\tform_button_image,\r\n\t\t\t\t\t\t\ttheme_has_css  \r\n\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t" . MF_TABLE_PREFIX . "form_themes \r\n\t\t\t\t\t   WHERE \r\n\t\t\t\t\t   \t\ttheme_id = ?";
        $params = array($form_theme_id);
        $sth = mf_do_query($query, $params, $dbh);
        $row = mf_do_fetch_result($sth);
        $form_shadow_style = $row['form_shadow_style'];
        $form_shadow_size = $row['form_shadow_size'];
        $form_shadow_brightness = $row['form_shadow_brightness'];
        $theme_has_css = (int) $row['theme_has_css'];
        //if the theme has css file, make sure to refer to that file
        //otherwise, generate the css dynamically
        if (!empty($theme_has_css)) {
            $theme_css_link = '<link rel="stylesheet" type="text/css" href="' . $machform_path . $mf_settings['data_dir'] . '/themes/theme_' . $form_theme_id . '.css" media="all" />';
        } else {
            $theme_css_link = '<link rel="stylesheet" type="text/css" href="' . $machform_path . 'css_theme.php?theme_id=' . $form_theme_id . '" media="all" />';
        }
        if ($row['highlight_bg_type'] == 'color') {
            $field_highlight_color = $row['highlight_bg_color'];
        } else {
            //if the field highlight is using pattern instead of color, set the color to empty string
            $field_highlight_color = '';
        }
        //get the css link for the fonts
        $font_css_markup = mf_theme_get_fonts_link($dbh, $form_theme_id);
        //get the form shadow classes
        if (!empty($form_shadow_style) && $form_shadow_style != 'disabled') {
            preg_match_all("/[A-Z]/", $form_shadow_style, $prefix_matches);
            //this regex simply get the capital characters of the shadow style name
            //example: RightPerspectiveShadow result to RPS and then being sliced to RP
            $form_shadow_prefix_code = substr(implode("", $prefix_matches[0]), 0, -1);
            $form_shadow_size_class = $form_shadow_prefix_code . ucfirst($form_shadow_size);
            $form_shadow_brightness_class = $form_shadow_prefix_code . ucfirst($form_shadow_brightness);
            if (empty($integration_method)) {
                //only display shadow if the form is not being embedded using any method
                $form_container_class = $form_shadow_style . ' ' . $form_shadow_size_class . ' ' . $form_shadow_brightness_class;
            }
        }
    } else {
        //if the form doesn't have any theme being applied
        $field_highlight_color = '#FFF7C0';
        if (empty($integration_method)) {
            $form_container_class = 'WarpShadow WLarge WNormal';
            //default shadow
        } else {
            $form_container_class = '';
            //dont show any shadow when the form being embedded
        }
    }
    if (empty($mf_settings['disable_machform_link'])) {
        $powered_by_markup = 'Powered by <a href="http://www.appnitro.com" target="_blank">MachForm</a>';
    } else {
        $powered_by_markup = '';
    }
    $self_address = htmlentities($_SERVER['PHP_SELF']);
    //prevent XSS
    $country = mf_get_country_list();
    $country_markup = '<option value="" selected="selected"></option>' . "\n";
    foreach ($country as $data) {
        $country_markup .= "<option value=\"{$data['value']}\">{$data['label']}</option>\n";
    }
    $billing_address_markup = '';
    if (!empty($payment_ask_billing)) {
        $billing_address_markup = <<<EOT
\t\t\t\t<li id="li_billing_address" class="address">
\t\t\t\t\t<label class="description">Billing Address <span class="required">*</span></label>
\t\t\t\t\t<div>
\t\t\t\t\t\t<span id="li_billing_span_1">
\t\t\t\t\t\t\t<input id="billing_street" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="billing_street">{$mf_lang['address_street']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_billing_span_2" class="left state_list">
\t\t\t\t\t\t\t<input id="billing_city" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="billing_city">{$mf_lang['address_city']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_billing_span_3" class="right state_list">
\t\t\t\t\t\t\t<input id="billing_state" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="billing_state">{$mf_lang['address_state']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_billing_span_4" class="left">
\t\t\t\t\t\t\t<input id="billing_zipcode" class="element text large" maxlength="15" value="{$default_value_5}" type="text" />
\t\t\t\t\t\t\t<label for="billing_zipcode">{$mf_lang['address_zip']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t\t
\t\t\t\t\t\t<span id="li_billing_span_5" class="right">
\t\t\t\t\t\t\t<select class="element select large" id="billing_country"> 
\t\t\t\t\t\t\t\t{$country_markup}\t
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t<label for="billing_country">{$mf_lang['address_country']}</label>
\t\t\t\t\t    </span>
\t\t\t\t    </div><p id="billing_error_message" class="error" style="display: none"></p>
\t\t\t\t</li>
EOT;
    }
    $shipping_address_markup = '';
    if (!empty($payment_ask_shipping)) {
        $shipping_address_markup = <<<EOT
\t\t\t\t<li id="li_shipping_address" class="address">
\t\t\t\t\t<label class="description shipping_address_detail" style="display: none">Shipping Address <span class="required">*</span></label>
\t\t\t\t\t<div class="shipping_address_detail" style="display: none">
\t\t\t\t\t\t<span id="li_shipping_span_1">
\t\t\t\t\t\t\t<input id="shipping_street" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="shipping_street">{$mf_lang['address_street']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_shipping_span_2" class="left state_list">
\t\t\t\t\t\t\t<input id="shipping_city" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="shipping_city">{$mf_lang['address_city']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_shipping_span_3" class="right state_list">
\t\t\t\t\t\t\t<input id="shipping_state" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="shipping_state">{$mf_lang['address_state']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_shipping_span_4" class="left">
\t\t\t\t\t\t\t<input id="shipping_zipcode" class="element text large" maxlength="15" value="{$default_value_5}" type="text" />
\t\t\t\t\t\t\t<label for="shipping_zipcode">{$mf_lang['address_zip']}</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t\t
\t\t\t\t\t\t<span id="li_shipping_span_5" class="right">
\t\t\t\t\t\t\t<select class="element select large" id="shipping_country"> 
\t\t\t\t\t\t\t\t{$country_markup}\t
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t<label for="shipping_country">{$mf_lang['address_country']}</label>
\t\t\t\t\t    </span>
\t\t\t\t\t    <p id="shipping_error_message" class="error" style="display: none"></p>
\t\t\t\t    </div>
\t\t\t\t    <div>
\t\t\t\t\t    <input type="checkbox" value="1" checked="checked" class="checkbox" id="mf_same_shipping_address">
\t\t\t\t\t\t<label for="mf_same_shipping_address" class="choice">My shipping address is the same as my billing address</label>
\t\t\t\t\t</div>
\t\t\t\t</li>
EOT;
    }
    if ($payment_merchant_type == 'stripe') {
        if (!empty($payment_stripe_enable_test_mode)) {
            $stripe_public_key = $payment_stripe_test_public_key;
        } else {
            $stripe_public_key = $payment_stripe_live_public_key;
        }
        $stripe_js = <<<EOT
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
\tStripe.setPublishableKey('{$stripe_public_key}');
</script>
<script type="text/javascript" src="{$machform_path}js/payment_stripe.js"></script>
EOT;
    }
    $ssl_suffix = mf_get_ssl_suffix();
    $jquery_url = 'http' . $ssl_suffix . '://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js';
    $current_year = date("Y");
    $year_dropdown_markup = '';
    foreach (range($current_year, $current_year + 15) as $year) {
        $year_dropdown_markup .= "<option value=\"{$year}\">{$year}</option>" . "\n";
    }
    if ($integration_method == 'php') {
        $form_markup = <<<EOT
<link rel="stylesheet" type="text/css" href="{$machform_path}{$css_dir}view.css" media="all" />
<link rel="stylesheet" type="text/css" href="{$machform_path}view.mobile.css" media="all" />
{$theme_css_link}
{$font_css_markup}
<script type="text/javascript" src="{$jquery_url}"></script>
<script type="text/javascript" src="{$machform_path}js/jquery-ui/ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="{$machform_path}view.js"></script>
{$stripe_js}
<style>
html{
\tbackground: none repeat scroll 0 0 transparent;
}
</style>

<div id="main_body" class="integrated no_guidelines" data-machformpath="{$machform_path}">
\t<div id="form_container">
\t\t<form id="form_{$form_id}" class="appnitro" method="post" action="javascript:" data-highlightcolor="{$field_highlight_color}">
\t\t    <div class="form_description">
\t\t\t\t<h2>{$form_payment_title}</h2>
\t\t\t\t<p>{$form_payment_description}</p>
\t\t\t</div>
\t\t\t{$pagination_header}
\t\t\t
\t\t\t<ul class="payment_summary">
\t\t\t\t<li class="payment_summary_amount total_payment" data-basetotal="{$total_payment_amount}">
\t\t\t\t\t<span>
\t\t\t\t\t\t<h3>{$currency_symbol}<var>0</var></h3>
\t\t\t\t\t\t<h5>{$mf_lang['payment_total']}</h5>
\t\t\t\t\t</span>
\t\t\t\t</li>
\t\t\t\t<li class="payment_summary_list">
\t\t\t\t\t<ul class="payment_list_items">
\t\t\t\t\t\t{$payment_list_items_markup}
\t\t\t\t\t</ul>
\t\t\t\t</li>
\t\t\t\t{$payment_term_markup}
\t\t\t</ul>
\t\t\t<ul class="payment_detail_form">
\t\t\t\t<li id="error_message" style="display: none">
\t\t\t\t\t\t<h3 id="error_message_title">{$mf_lang['error_title']}</h3>
\t\t\t\t\t\t<p id="error_message_desc">{$mf_lang['error_desc']}</p>
\t\t\t\t</li>\t
\t\t\t\t<li id="li_accepted_cards">
\t\t\t\t\t<img src="{$machform_path}images/cards/visa.png" alt="Visa" title="Visa" />
\t\t\t\t\t<img src="{$machform_path}images/cards/mastercard.png" alt="MasterCard" title="MasterCard" />
\t\t\t\t\t<img src="{$machform_path}images/cards/amex.png" alt="American Express" title="American Express" />
\t\t\t\t\t<img src="{$machform_path}images/cards/jcb.png" alt="JCB" title="JCB" />
\t\t\t\t\t<img src="{$machform_path}images/cards/discover.png" alt="Discover" title="Discover" />
\t\t\t\t\t<img src="{$machform_path}images/cards/diners.png" alt="Diners Club" title="Diners Club" />
\t\t\t\t</li>
\t\t\t\t<li id="li_credit_card" class="credit_card">
\t\t\t\t\t<label class="description">Credit Card <span class="required">*</span></label>
\t\t\t\t\t<div>
\t\t\t\t\t\t<span id="li_cc_span_1" class="left">
\t\t\t\t\t\t\t<input id="cc_first_name" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_first_name">First Name</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_cc_span_2" class="right">
\t\t\t\t\t\t\t<input id="cc_last_name" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_last_name">Last Name</label>
\t\t\t\t\t\t</span>

\t\t\t\t\t\t<span id="li_cc_span_3" class="left">
\t\t\t\t\t\t\t<input id="cc_number" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_number">Credit Card Number</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_cc_span_4" class="right">
\t\t\t\t\t\t\t<input id="cc_cvv" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_cvv">CVV</label>
\t\t\t\t\t\t</span>

\t\t\t\t\t\t<span id="li_cc_span_5" style="text-align: right">
\t\t\t\t\t\t\t<img id="cc_secure_icon" src="{$machform_path}images/icons/lock.png" alt="Secure" title="Secure" /> 
\t\t\t\t\t\t\t<label for="cc_expiry_month" style="display: inline">Expiration: </label>
\t\t\t\t\t\t\t<select class="element select" id="cc_expiry_month">
\t\t\t\t\t\t\t\t<option value="01">01 - January</option>
\t\t\t\t\t\t\t\t<option value="02">02 - February</option>
\t\t\t\t\t\t\t\t<option value="03">03 - March</option>
\t\t\t\t\t\t\t\t<option value="04">04 - April</option>
\t\t\t\t\t\t\t\t<option value="05">05 - May</option>
\t\t\t\t\t\t\t\t<option value="06">06 - June</option>
\t\t\t\t\t\t\t\t<option value="07">07 - July</option>
\t\t\t\t\t\t\t\t<option value="08">08 - August</option>
\t\t\t\t\t\t\t\t<option value="09">09 - September</option>
\t\t\t\t\t\t\t\t<option value="10">10 - October</option>
\t\t\t\t\t\t\t\t<option value="11">11 - November</option>
\t\t\t\t\t\t\t\t<option value="12">12 - December</option>
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t<select class="element select" id="cc_expiry_year">
\t\t\t\t\t\t\t\t{$year_dropdown_markup}
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t</span>
\t\t\t\t\t</div><p id="credit_card_error_message" class="error" style="display: none"></p>
\t\t\t\t</li>
\t\t\t\t<li id="li_2" class="section_break">
\t\t\t\t</li>
\t\t\t\t{$billing_address_markup}
\t\t\t\t{$shipping_address_markup}
\t\t\t\t<li id="li_buttons" class="buttons">
\t\t\t\t\t<input type="hidden" id="form_id" value="{$form_id}" />
\t\t\t\t    {$button_markup}
\t\t\t\t    <img id="mf_payment_loader_img" style="display: none" src="{$machform_path}images/loader_small_grey.gif" />
\t\t\t\t</li>
\t\t\t</ul>
\t\t</form>\t\t
\t\t<form id="form_payment_redirect" method="post" action="{$self_address}">
\t\t\t<input type="hidden" id="form_id_redirect" name="form_id_redirect" value="{$form_id}" />
\t\t</form>\t\t
\t</div>
</div>
EOT;
    } else {
        if ($integration_method == 'iframe') {
            $auto_height_js = <<<EOT
<script type="text/javascript" src="{$machform_path}js/jquery.ba-postmessage.min.js"></script>
<script type="text/javascript">
    \$(function(){
    \t\$.postMessage({mf_iframe_height: \$('body').outerHeight(true)}, '*', parent );
    });
</script>
EOT;
        }
        $form_markup = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html {$embed_class} xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{$form_name}</title>
<link rel="stylesheet" type="text/css" href="{$machform_path}{$css_dir}view.css" media="all" />
<link rel="stylesheet" type="text/css" href="{$machform_path}view.mobile.css" media="all" />
{$theme_css_link}
{$font_css_markup}
<script type="text/javascript" src="{$jquery_url}"></script>
<script type="text/javascript" src="{$machform_path}js/jquery-ui/ui/jquery.effects.core.js"></script>
<script type="text/javascript" src="{$machform_path}view.js"></script>
{$stripe_js}
{$auto_height_js}
</head>
<body id="main_body" class="no_guidelines" data-machformpath="{$machform_path}">
\t
\t<img id="top" src="{$machform_path}images/top.png" alt="" />
\t<div id="form_container" class="{$form_container_class}">
\t
\t\t<h1><a>MachForm</a></h1>
\t\t<form id="form_{$form_id}" class="appnitro" method="post" action="javascript:" data-highlightcolor="{$field_highlight_color}">
\t\t    <div class="form_description">
\t\t\t\t<h2>{$form_payment_title}</h2>
\t\t\t\t<p>{$form_payment_description}</p>
\t\t\t</div>
\t\t\t{$pagination_header}
\t\t\t
\t\t\t<ul class="payment_summary">
\t\t\t\t<li class="payment_summary_amount total_payment" data-basetotal="{$total_payment_amount}">
\t\t\t\t\t<span>
\t\t\t\t\t\t<h3>{$currency_symbol}<var>0</var></h3>
\t\t\t\t\t\t<h5>{$mf_lang['payment_total']}</h5>
\t\t\t\t\t</span>
\t\t\t\t</li>
\t\t\t\t<li class="payment_summary_list">
\t\t\t\t\t<ul class="payment_list_items">
\t\t\t\t\t\t{$payment_list_items_markup}
\t\t\t\t\t</ul>
\t\t\t\t</li>
\t\t\t\t{$payment_term_markup}
\t\t\t</ul>
\t\t\t<ul class="payment_detail_form">
\t\t\t\t<li id="error_message" style="display: none">
\t\t\t\t\t\t<h3 id="error_message_title">{$mf_lang['error_title']}</h3>
\t\t\t\t\t\t<p id="error_message_desc">{$mf_lang['error_desc']}</p>
\t\t\t\t</li>\t
\t\t\t\t<li id="li_accepted_cards">
\t\t\t\t\t<img src="{$machform_path}images/cards/visa.png" alt="Visa" title="Visa" />
\t\t\t\t\t<img src="{$machform_path}images/cards/mastercard.png" alt="MasterCard" title="MasterCard" />
\t\t\t\t\t<img src="{$machform_path}images/cards/amex.png" alt="American Express" title="American Express" />
\t\t\t\t\t<img src="{$machform_path}images/cards/jcb.png" alt="JCB" title="JCB" />
\t\t\t\t\t<img src="{$machform_path}images/cards/discover.png" alt="Discover" title="Discover" />
\t\t\t\t\t<img src="{$machform_path}images/cards/diners.png" alt="Diners Club" title="Diners Club" />
\t\t\t\t</li>
\t\t\t\t<li id="li_credit_card" class="credit_card">
\t\t\t\t\t<label class="description">Credit Card <span class="required">*</span></label>
\t\t\t\t\t<div>
\t\t\t\t\t\t<span id="li_cc_span_1" class="left">
\t\t\t\t\t\t\t<input id="cc_first_name" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_first_name">First Name</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_cc_span_2" class="right">
\t\t\t\t\t\t\t<input id="cc_last_name" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_last_name">Last Name</label>
\t\t\t\t\t\t</span>

\t\t\t\t\t\t<span id="li_cc_span_3" class="left">
\t\t\t\t\t\t\t<input id="cc_number" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_number">Credit Card Number</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t
\t\t\t\t\t\t<span id="li_cc_span_4" class="right">
\t\t\t\t\t\t\t<input id="cc_cvv" class="element text large" value="" type="text" />
\t\t\t\t\t\t\t<label for="cc_cvv">CVV</label>
\t\t\t\t\t\t</span>

\t\t\t\t\t\t<span id="li_cc_span_5" style="text-align: right">
\t\t\t\t\t\t\t<img id="cc_secure_icon" src="{$machform_path}images/icons/lock.png" alt="Secure" title="Secure" /> 
\t\t\t\t\t\t\t<label for="cc_expiry_month" style="display: inline">Expiration: </label>
\t\t\t\t\t\t\t<select class="element select" id="cc_expiry_month">
\t\t\t\t\t\t\t\t<option value="01">01 - January</option>
\t\t\t\t\t\t\t\t<option value="02">02 - February</option>
\t\t\t\t\t\t\t\t<option value="03">03 - March</option>
\t\t\t\t\t\t\t\t<option value="04">04 - April</option>
\t\t\t\t\t\t\t\t<option value="05">05 - May</option>
\t\t\t\t\t\t\t\t<option value="06">06 - June</option>
\t\t\t\t\t\t\t\t<option value="07">07 - July</option>
\t\t\t\t\t\t\t\t<option value="08">08 - August</option>
\t\t\t\t\t\t\t\t<option value="09">09 - September</option>
\t\t\t\t\t\t\t\t<option value="10">10 - October</option>
\t\t\t\t\t\t\t\t<option value="11">11 - November</option>
\t\t\t\t\t\t\t\t<option value="12">12 - December</option>
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t<select class="element select" id="cc_expiry_year">
\t\t\t\t\t\t\t\t{$year_dropdown_markup}
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t</span>
\t\t\t\t\t</div><p id="credit_card_error_message" class="error" style="display: none"></p>
\t\t\t\t</li>
\t\t\t\t<li id="li_2" class="section_break">
\t\t\t\t</li>
\t\t\t\t{$billing_address_markup}
\t\t\t\t{$shipping_address_markup}
\t\t\t\t<li id="li_buttons" class="buttons">
\t\t\t\t\t<input type="hidden" id="form_id" value="{$form_id}" />
\t\t\t\t    {$button_markup}
\t\t\t\t    <img id="mf_payment_loader_img" style="display: none" src="{$machform_path}images/loader_small_grey.gif" />
\t\t\t\t</li>
\t\t\t</ul>
\t\t</form>\t\t
\t\t<form id="form_payment_redirect" method="post" action="{$self_address}">
\t\t\t<input type="hidden" id="form_id_redirect" name="form_id_redirect" value="{$form_id}" />
\t\t</form>\t
\t</div>
\t<img id="bottom" src="{$machform_path}images/bottom.png" alt="" />
\t</body>
</html>
EOT;
    }
    return $form_markup;
}