' . $contactform['css'] . ''; } echo $stcss = ''; function validator_js_call(){ echo $jscript = ''; } add_action('wp_footer',"validator_js_call",100); if (isset($submitformname)) { if ($submitformname == $contactform['name'] && $successmsg != "") { echo $jscript = ''; } } /* For Render Lead Status,Lead Type,Lead Rank */ $firstConfig = get_option("awp_contact_configdata"); $firstConfig = json_decode($firstConfig); $getConfig = get_option('awp_contactforms'); for ($i = 0; $i < count($getConfig); $i++) { if ($getConfig[$i]['name'] == $contactform['name']) { $formConfig = $getConfig[$i]['contact_config']; } } if (isset($submitformname)) { if ($submitformname == $contactform['name'] && $successmsg != "") { echo '
' . $successmsg . "
"; } } if (isset($captch_error) != "" && $submitformname == $contactform['name']) { echo '
' . $captch_error . "
"; } do_action('apptivo_business_contact_' . $contactform['name'] . '_before_form'); //Before submit form echo '
'; $form_sessionid = uniqid(); $_SESSION['nogdog'] = $form_sessionid; echo ''; echo '
'; foreach ($formfields as $field) { if (!is_array($field)) { continue; } $fieldid = $field['fieldid']; $showtext = $field['showtext']; $validation = $field['validation']; $required = $field['required']; $fieldtype = $field['type']; $options = $field['options']; $optionvalues = array(); if ($validation == "string") { $phone_validation = "_string"; } else { $phone_validation = ""; } if ($required) { $mandate_property = '"mandatory="true"'; $validateclass = " required"; } else { $mandate_property = ""; $validateclass = ""; } switch ($validation) { case "email": $validateclass .=" email"; break; case "url": $validateclass .=" url"; break; case "number": $validateclass .=" number"; break; } if($fieldid == 'captcha') { $captcha_class = 'captcha'; } else{ $captcha_class = ''; } echo '
'; if ($showtext != "") { if($fieldtype == "select" || $fieldtype == "radio" || $fieldtype == "checkbox"){ $shwcapt = ''; } else { $shwcapt = 'nne'; } echo ''; } echo '
'; if ($fieldtype == "select" || $fieldtype == "radio" || $fieldtype == "checkbox") { if (trim($options) != "") { $option_values = preg_split("[\n]", trim($options)); //Split the String line by line. $optionvalues = array(); if($fieldtype == "select"){ $optionvalues[] = "-- Select One --"; } foreach ($option_values as $values) : $optionvalues[] = trim($values); endforeach; } } if ($value_present) $postValue = $_REQUEST[$fieldid]; else $postValue = ""; switch ($fieldtype) { case "text": echo ''; break; case "textarea": echo ''; break; case "select": if ($fieldid == 'country') { echo ''; echo ''; echo ''; } elseif ($fieldid == 'leadStatus') { $configValues = $formConfig["awp_leadStatus_selected"]; echo ''; echo ''; echo ''; } elseif ($fieldid == 'leadType') { $configValues = $formConfig["awp_leadType_selected"]; if (!$required) { $notrequired = "Select One"; } if ($configValues == "0") { $validateclass = " required"; } echo ''; echo ''; echo ''; } elseif ($fieldid == 'leadRank') { $configValues = $formConfig["awp_leadRank_selected"]; echo ''; echo ''; echo ''; } else { echo ''; } break; case "radio": $i = 0; $opt = 0; echo '
'; foreach ($optionvalues as $optionvalue) { $selected = (trim($postValue) == trim($optionvalue)) ? 'checked="checked"' : ''; if (!empty($optionvalue) && strlen(trim($optionvalue)) != 0) { echo '
'; } $opt++; } echo '
'; break; case "checkbox": echo '
'; $i = 0; $opt = 0; foreach ($optionvalues as $optionvalue) { $selected = ""; if (!empty($postValue)) { foreach ($postValue as $value) { if (trim($value) == trim($optionvalue)) { $selected = 'checked="checked"'; } } } if (!empty($optionvalue) && strlen(trim($optionvalue)) != 0) { echo '
'; $i++; $opt++; } } echo '
'; break; case "captcha": awp_captcha($fieldid, $postValue, $validateclass); break; } echo '
' . '
'; } if ($contactform['subscribe_option'] == 'yes') : $subscribe_to_newsletter = ($contactform['subscribe_to_newsletter_displaytext'] != '') ? $contactform['subscribe_to_newsletter_displaytext'] : 'Subscribe to Newsletter'; echo '
'; endif; echo ''; if ($contactform['submit_button_type'] == "submit" && ($contactform['submit_button_val']) != "") { $button_value = 'value="' . $contactform['submit_button_val'] . '"'; } else { if (strlen(trim($contactform['submit_button_val'])) == 0) { $imgSrc = awp_image('submit_button'); } else { $imgSrc = $contactform['submit_button_val']; } $button_value = 'src="' . $imgSrc . '"'; } do_action('apptivo_business_contact_' . $contactform['name'] . '_before_submit_query'); //Before Submit Query echo '
'; echo '
'; echo'

 


'; do_action('apptivo_business_contact_' . $contactform['name'] . '_after_form'); //After submit Form ?>