prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; } //return $newCss; ?> #hugeit-contact-wrapper { width:%; background:#; background: -webkit-linear-gradient(#, #); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(#, #); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(#, #); /* For Firefox 3.6 to 15 */ background: linear-gradient(#, #); /* Standard syntax */ } #hugeit-contact-wrapper > div { border:px solid #; }#hugeit-contact-wrapper > div > h3 { position:relative; display:block; clear:both !important; padding:5px 0px 10px 2% !important; font-size:px !important; line-height:px !important; color:# !important; margin: 10px 0 15px 0 !important;display:none; } #hugeit-contact-wrapper > div > h3 > input {border: 1px solid transparent !important; outline: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; background-color: transparent !important; font-size:px !important; line-height:px !important; color:#!important; outline: 0 !important; -webkit-transition: none !important; transition: none !important;} #hugeit-contact-wrapper label { font-size:px; color:#; font-family:; } #hugeit-contact-wrapper .hugeit-contact-column-block > div > label { display:block; width:38%; float:left; margin-right:2%; cursor: move; } #hugeit-contact-wrapper .hugeit-contact-column-block > div .field-block { display:inline-block; width:60%; /*min-width:150px;*/ } #hugeit-contact-wrapper label.error { color:#; } #hugeit-contact-wrapper label em.required-star{ color: #; } #hugeit-contact-wrapper .hugeit-contact-column-block > div .field-block ul li label span.sublable{vertical-align: super;} #hugeit-contact-wrapper .hugeit-contact-column-block > div > label.formsRightAlign{ text-align: right !important; } #hugeit-contact-wrapper .hugeit-contact-column-block > div > label.formsAboveAlign{ width:100% !important; float:none !important; padding-bottom: 5px !important; } #hugeit-contact-wrapper .hugeit-contact-column-block > div .formsAboveAlign { width:100% !important; } #hugeit-contact-wrapper .hugeit-contact-column-block > div > label.formsInsideAlign{ display:none !important; } #hugeit-contact-wrapper .hugeit-contact-column-block > div .formsInsideAlign { width:100% !important; } .input-text-block input,.input-text-block input:focus { height:px; background:#; background:none; border:px solid # !important; box-shadow:none !important ; border-radius:px; font-size:px; color:#; margin:0px !important; outline:none; }.textarea-block textarea { background:#; background:none; border:px solid #; border-radius:px; font-size:px; color:#; margin:0px !important; } .radio-block, .checkbox-block { position:relative; float:left; margin:0px 5px 0px 5px; display: block; } .radio-block input, .checkbox-block input { visibility:hidden; position:absolute; top:0px; left:0px; } .radio-block i { display:inline-block; float:left; width:20px; color:#; } .checkbox-block i { display:inline-block; float:left; width:20px; color:#; } #hugeit-contact-wrapper.big-radio .radio-block i ,#hugeit-contact-wrapper.big-checkbox .checkbox-block i {font-size:24px;} #hugeit-contact-wrapper.medium-radio .radio-block i ,#hugeit-contact-wrapper.medium-checkbox .checkbox-block i {font-size:20px;} #hugeit-contact-wrapper.small-radio .radio-block i ,#hugeit-contact-wrapper.small-checkbox .checkbox-block i {font-size:15px;} .radio-block i:hover { color:#; } .checkbox-block i:hover { color:#; } .radio-block i.active, .checkbox-block i.active {display:none;} .radio-block input:checked + i.active + i.passive, .checkbox-block input:checked + i.active + i.passive {display:none;} .radio-block input:checked + i.active, .radio-block input:checked + i.active:hover { display:inline-block; color:#; } .checkbox-block input:checked + i.active, .checkbox-block input:checked + i.active:hover { display:inline-block; color:#; } .selectbox-block { position:relative; height:px; } .selectbox-block select { position:relative; height:px; margin:px 0px 0px 1px !important; opacity:0; z-index:2; } .selectbox-block .textholder { position:absolute; height:px; width:90%; padding-right:10%; margin:0px !important; top;0px; left:0px; border:0px; color:#; background:none; border:px solid #; border-radius:px; color:#; font-size:px; background:#; background:none; } .selectbox-block i { position:absolute; top:px; right:10px; z-index:0; color:#; font-size:px; } .file-block { position:relative; cursor:pointer; } .file-block .textholder { position:relative; float:left; width:calc(60% - px) !important; height:px; margin:0px; border:px solid # !important; border-radius:px !important; font-size:px; color:#; background:#; background:none; padding:0px 40% 0px 5px !important; box-sizing: content-box; -moz-box-sizing: content-box; } .file-block .uploadbutton { position:absolute; top:0px; right:0px; width:38%; border-top:px solid # !important; border-bottom:px solid # !important; border-right:px solid # !important; border-top-right-radius:px !important; border-bottom-right-radius:px !important; height:px; padding:0px 1%; margin:0px; overflow: hidden; font-size:px; line-height:px; color:#; background:#; text-align:center; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; box-sizing:content-box; } .file-block:hover .uploadbutton { color:#; background:#; vertical-align: baseline; } .file-block .uploadbutton i { color:#; font-size:px; vertical-align: baseline; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; } .file-block:hover .uploadbutton { color:#; background:#; } .file-block:hover .uploadbutton i { color:#; } .file-block input[type="file"] { height:30px; width:100%; position:absolute; top:0px; left:0px; opacity:0; cursor:pointer; } .captcha-block div { margin-right:-1px; } .buttons-block { } .buttons-block button { height:auto; padding:px px px px; cursor:pointer; text-transform: none; clear:both; width:100%; padding-left:0px; padding-right:0px; margin:0px 0px 0px 0px !important; padding-left:0px; padding-right:0px; font-size:px; } .buttons-block button.submit { color:# !important; background-color:# !important; border:px solid # !important; border-radius:px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; margin:0px 0px 5px 0px !important; } .buttons-block button.submit:hover { color:# !important; background:# !important; } .buttons-block button.submit i { color:# !important; vertical-align: baseline !important; font-size:px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.submit:hover i { color:# !important; } .buttons-block button.reset { color:# !important; background-color:# !important; border:px solid # !important; border-radius:px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.reset:hover { color:# !important; background:# !important; } .buttons-block button.reset i { color:# !important; vertical-align: baseline !important; font-size:px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.reset:hover i { color:# !important; }
description != 'on'){echo 'disabled="disabled"';}?>/>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Textbox";} ?>

    Field type:
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Textarea";} ?>

  • name); $j=0; foreach($options as $option){ if($rowimages->hc_other_field==$j){ ?>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Selectbox";} ?>

  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; }?>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Checkbox";} ?>

  • prepare("SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = %s", $themeId); $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; }?>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Hidden Field";} ?>



  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; }?>

  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; }?>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Radiobox";} ?>

  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; }?>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Filebox";} ?>

  • name; ?>
  • Custom Text

    name, "titleimage".$rowimages->id); ?>
  • hc_input_show_default=='2')$capPos="left";?>
    hc_required=='dark'){echo 'style="display:none"';}else{echo 'style="float:'.$capPos.'"';}?> id="democaptchalight">
    hc_required=='light'){echo 'style="display:none"';}else{echo 'style="float:'.$capPos.'"';}?> id="democaptchadark">
  • ReCaptcha

  • hc_input_show_default=='formsRightAlign')$capPos="text-right";?>
  • Simple Captcha

  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; } ?>
  • Buttons

    hc_other_field != 'go_to_url'){ echo "style='display:none;'";}?>>
  • description != 'on'){echo 'disabled="disabled"';}?>/>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Email";} ?>

  • description != 'on'){echo 'disabled="disabled"';}?>/> description != 'on'){echo 'disabled="disabled"';}?>/>
  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Fullname";} ?>

  • hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Phone";} ?>

  • prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' "; $rows = $wpdb->get_results($query); $style_values = array(); foreach ($rows as $row) { $key = $row->name; $value = $row->value; $style_values[$key] = $value; } $linkName=$rowimages->hc_field_label; $linkUrl=$rowimages->description; $toReplace=' '.$linkName.' '; $license=$rowimages->hc_other_field; $license=preg_replace('/{link}/', $toReplace, $license); ?>
  • hc_field_label!=''){echo $rowimages->hc_field_label;}else{ echo "License";} ?>

  • prefix . "huge_it_contact_contacts_fields"; switch ($inputtype) { case 'text': $inserttexttype = $wpdb->prefix . "huge_it_contact_contacts_fields"; $wpdb->insert( $inserttexttype, array( 'name' => 'Placeholder', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Textbox', 'hc_other_field' => '', 'field_type' => 'text', 'hc_required' => '', 'ordering' => '0', 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID= absint($row8[0]->resId); $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_textBoxHtml($rowimages[0]), "outputFieldSettings" => hugeit_contact_textBoxSettingsHtml($rowimages[0]) )); break; case 'textarea': $wpdb->insert( $inserttexttype, array( 'name' => 'Placeholder', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Textarea', 'hc_other_field' => '80', 'field_type' => 'on', 'hc_required' => 'on', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_textareaHtml($rowimages[0]), "outputFieldSettings" =>hugeit_contact_textareaSettingsHtml($rowimages[0]) )); break; case 'selectbox': $wpdb->insert( $inserttexttype, array( 'name' => 'Option 1;;Option 2', 'hugeit_contact_id' => $formId, 'description' => '', 'conttype' => $inputtype, 'hc_field_label' => 'Selectbox', 'hc_other_field' => 'Option 2', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left' ), array('%s', '%d', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_selectboxHtml($rowimages[0]), "outputFieldSettings" =>hugeit_contact_selectboxSettingsHtml($rowimages[0]) )); break; case 'checkbox': $wpdb->insert( $inserttexttype, array( 'name' => 'On', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Checkbox', 'hc_other_field' => '', 'field_type' => '1', 'published' => 2, 'hc_input_show_default' => '1', 'hc_required' => 'on', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_checkboxHtml($rowimages[0],$themeId), "outputFieldSettings" =>hugeit_contact_checkboxSettingsHtml($rowimages[0]) )); break; case 'hidden_field': $wpdb->insert( $inserttexttype, array( 'name' => 'Hidden Field', 'hugeit_contact_id' => $formId, 'description' => 'Hidden Field', 'conttype' => $inputtype, 'hc_field_label' => 'Hidden Field', 'hc_other_field' => 'user_id', 'hc_required' => 'text', 'ordering' => 0, 'field_type' => '1', 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d','%s','%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_hiddenFieldHtml($rowimages[0],$themeId), "outputFieldSettings" =>hugeit_contact_hiddenFieldSettingsHtml($rowimages[0]) )); break; case 'page_break': $wpdb->insert( $inserttexttype, array( 'name' => 'Page Break', 'hugeit_contact_id' => $formId, 'description' => 'Page Break', 'conttype' => $inputtype, 'hc_field_label' => 'Page Break', 'hc_other_field' => 'page_break', 'hc_required' => 'text', 'ordering' => 0, 'field_type' => '1', 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d','%s','%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_pageBreakHtml($rowimages[0],$themeId), "outputFieldSettings" =>hugeit_contact_pageBreakSettingsHtml($rowimages[0]) )); break; case 'radio_box': $wpdb->insert( $inserttexttype, array( 'name' => 'option 1;;option 2', 'hugeit_contact_id' => $formId, 'description' => '2', 'conttype' => $inputtype, 'hc_field_label' => 'Radio Box', 'hc_other_field' => 'option 1', 'field_type' => '1', 'hc_required' => 'text', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_radioboxHtml($rowimages[0],$themeId), "outputFieldSettings" =>hugeit_contact_radioboxSettingsHtml($rowimages[0]) )); break; case 'file_box': $wpdb->insert( $inserttexttype, array( 'name' => '5', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Filebox', 'hc_other_field' => 'jpg, jpeg, gif, png, docx, xlsx, pdf', 'field_type' => '', 'hc_required' => '', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_fileboxHtml($rowimages[0],$themeId), "outputFieldSettings" =>hugeit_contact_fileboxSettingsHtml($rowimages[0]) )); break; case 'custom_text': $wpdb->insert( $inserttexttype, array( 'name' => 'Placeholder', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Label', 'hc_other_field' => '80', 'field_type' => 'on', 'hc_required' => 'on', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; echo json_encode(array( "outputField" => hugeit_contact_cutomtextHtml($rowimages[0]), "outputFieldSettings" =>hugeit_contact_cutomtextSettingsHtml($rowimages[0]), "customText" => "titleimage" . $fieldID )); break; case 'captcha': $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_general_options"; $rowspar = $wpdb->get_results($query); $paramssld = array(); foreach ($rowspar as $rowpar) { $key = $rowpar->name; $value = $rowpar->value; $paramssld[$key] = $value; } $capKeyPub=$paramssld['form_captcha_public_key']; $capKeyPriv=$paramssld['form_captcha_private_key']; if($capKeyPub != '' && $capKeyPriv != '') { $wpdb->insert( $inserttexttype, array( 'name' => 'image', 'hugeit_contact_id' => $formId, 'description' => '', 'conttype' => $inputtype, 'hc_field_label' => '', 'hc_other_field' => '', 'field_type' => '', 'hc_required' => 'light', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); $query = "SELECT * FROM " . $wpdb->prefix . "huge_it_contact_general_options"; $rowspar = $wpdb->get_results($query); $paramssld = array(); foreach ($rowspar as $rowpar) { $key = $rowpar->name; $value = $rowpar->value; $paramssld[$key] = $value; } $capKeyPub=$paramssld['form_captcha_public_key']; echo json_encode(array( "outputField" => hugeit_contact_captchaHtml($rowimages[0]), "outputFieldSettings" => hugeit_contact_captchaSettingsHtml($rowimages[0]), "captchaNum" => $capKeyPub )); } else { echo json_encode(array( "captchaNum" => $capKeyPub, "toRedirect"=>"admin.php?page=hugeit_forms_main_page&task=captcha_keys&id=".$formId."&TB_iframe=1" )); } break; case 'simple_captcha_box'://simple captcha to do $field_exists_in_the_form=$wpdb->prepare( "SELECT id FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE conttype='simple_captcha_box' AND hugeit_contact_id=%d", $formId ); $field_exists_in_the_form=$wpdb->query($field_exists_in_the_form); if( !$field_exists_in_the_form ){ $wpdb->insert( $inserttexttype, array( 'name' => 'Type the code on the image', 'hugeit_contact_id' => $formId, 'description' => 'default', 'conttype' => $inputtype, 'hc_field_label' => 'Simple Captcha', 'hc_other_field' => '{"digits":"5","color":"FF601C"}', 'field_type' => 'simple_captcha_box', 'hc_required' => '', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => 'formsLeftAlign', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row81=$wpdb->get_results($queryMax); $fieldID=$row81[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_simple_captcha_html($rowimages[0]), "outputFieldSettings"=>hugeit_contact_simple_captcha_settings_html($rowimages[0]) )); } else{ echo json_encode(array()); } break; case 'buttons': $query=$wpdb->prepare( "SELECT MAX(ordering) AS res FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($query); $resOfMax=$row8[0]->res; $resOfMax=$resOfMax+1; $query=$wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($query); $leftRightPos='left'; foreach ($row8 as $value) { if($value->hc_left_right=='right') { $leftRightPos='right'; } } $wpdb->insert( $inserttexttype, array( 'name' => 'text', 'hugeit_contact_id' => $formId, 'description' => 'Submit', 'conttype' => $inputtype, 'hc_field_label' => 'Reset', 'hc_other_field' => 'print_success_message', 'field_type' => '', 'hc_required' => '', 'ordering' => $resOfMax, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => $leftRightPos, ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_buttonsHtml($rowimages[0],$themeId), "outputFieldSettings" => hugeit_contact_buttonsSettingsHtml($rowimages[0]), "buttons" => 'button' )); break; case 'e_mail': $wpdb->insert( $inserttexttype, array( 'name' => 'Type Your Email', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'E-mail', 'hc_other_field' => '', 'field_type' => 'name', 'hc_required' => '', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d", $fieldID ); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_emailHtml($rowimages[0]), "outputFieldSettings" => hugeit_contact_emailSettingsHtml($rowimages[0]) )); break; case 'nameSurname': $wpdb->insert( $inserttexttype, array( 'name' => 'Name', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Full Name', 'hc_other_field' => 'Surname', 'field_type' => 'name', 'hc_required' => '', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_nameSurnameHtml($rowimages[0]), "outputFieldSettings"=>hugeit_contact_nameSurnameSettingsHtml($rowimages[0]) )); break; case 'phone': $wpdb->insert( $inserttexttype, array( 'name' => 'us', 'hugeit_contact_id' => $formId, 'description' => 'on', 'conttype' => $inputtype, 'hc_field_label' => 'Phone', 'hc_other_field' => 'e.g. +1 123 4567', 'field_type' => 'name', 'hc_required' => '', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_phoneHtml($rowimages[0]), "outputFieldSettings"=>hugeit_contact_phoneSettingsHtml($rowimages[0]) )); break; case 'license': $wpdb->insert( $inserttexttype, array( 'name' => 'License', 'hugeit_contact_id' => $formId, 'description' => 'http://huge-it.com', 'conttype' => $inputtype, 'hc_field_label' => 'Policy Agreement', 'hc_other_field' => 'I have read and agreed to the {link}', 'field_type' => 'name', 'hc_required' => 'left', 'ordering' => 0, 'published' => 2, 'hc_input_show_default' => '1', 'hc_left_right' => 'left', ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare( "SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d", $formId ); $row8=$wpdb->get_results($queryMax); $fieldID=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowimages=$wpdb->get_results($fieldQuery); echo json_encode(array( "outputField" => hugeit_contact_licenseHtml($rowimages[0],$themeId), "outputFieldSettings"=>hugeit_contact_licenseSettingsHtml($rowimages[0]) )); break; } } //REMOVE FIELDS if( isset($_POST['task']) && $_POST['task']=='removeFieldTask') { if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) { return false; } $formId = absint($_POST['formId']); $all = $_POST['formData']; parse_str("$all",$myArray); $fieldID = absint($_POST['fieldId']); $_POSTED= array_map('sanitize_text_field', $myArray); $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId); $rowim=$wpdb->get_results($query); if(isset($_POSTED["name"])){ if($_POSTED["name"] != ''){ $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field($_POSTED["name"]), $formId)); $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", sanitize_text_field($_POSTED["select_form_theme"]), $formId)); } } foreach ($rowim as $key=>$rowimages){ if(isset($_POSTED)&&isset($_POSTED["hc_left_right".$rowimages->id.""])){ if($_POSTED["hc_left_right".$rowimages->id.""]){ $id = absint($rowimages->id); if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) ) $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET field_type = %s WHERE id = %d", sanitize_text_field($_POSTED[ "field_type" . $rowimages->id . "" ]), $id ) ); if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_other_field = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_other_field" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET name = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "titleimage" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET description = %s WHERE id = %d", sanitize_text_field($_POSTED[ "im_description" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_required = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_required" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_field_label = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "imagess" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_left_right = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_left_right" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET ordering = %s WHERE id = %d", intval($_POSTED[ "hc_ordering" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED["hc_input_show_default".$rowimages->id.""]))$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts_fields SET hc_input_show_default = %s WHERE id = %d",sanitize_text_field($_POSTED["hc_input_show_default".$rowimages->id.""]),$id)); } } } $wpdb->delete( $wpdb->prefix."huge_it_contact_contacts_fields", array('id' => $fieldID), array('%d') ); echo json_encode(array( "removedField" => $fieldID )); } //DUBLICATE FIELDS if (isset($_POST['task']) && $_POST['task'] == 'dublicateFieldTask'){ if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) { return false; } $formId = absint($_POST['formId']); $themeId = absint($_POST['themeId']); $all=$_POST['formData']; parse_str("$all",$myArray); $fieldID = absint($_POST['fieldId']); $_POSTED = array_map('sanitize_text_field', $myArray); $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId); $rowim = $wpdb->get_results($query); if (isset($_POSTED["name"])){ if($_POSTED["name"] != '') { $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field($_POSTED["name"]), $formId)); $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", sanitize_text_field($_POSTED["select_form_theme"]), $formId)); } } foreach ( $rowim as $key => $rowimages ) { if ( isset( $_POSTED ) && isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) { if ( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) { $id = absint($rowimages->id); if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET field_type = %s WHERE id = %d", sanitize_text_field($_POSTED[ "field_type" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_other_field = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_other_field" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET name = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "titleimage" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET description = %s WHERE id = %d", sanitize_text_field($_POSTED[ "im_description" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_required = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_required" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_field_label = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "imagess" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_left_right = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_left_right" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET ordering = %s WHERE id = %d", intval($_POSTED[ "hc_ordering" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_input_show_default" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_input_show_default = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_input_show_default" . $rowimages->id . "" ]), $id ) ); } } } } ///ENDS SAVING $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID); $rowduble=$wpdb->get_row($query); $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC", $formId); $rowplusorder=$wpdb->get_results($query); foreach ( $rowplusorder as $key => $rowplusorders ) { if ( $rowplusorders->ordering > $rowduble->ordering ) { $rowplusorderspl = $rowplusorders->ordering + 1; $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET ordering = %d WHERE id = %d ", $rowplusorderspl, $rowplusorders->id ) ); } } $inserttexttype = $wpdb->prefix . "huge_it_contact_contacts_fields"; $rowdubleorder=$rowduble->ordering+1; $inputtype=$rowduble->conttype; $wpdb->insert( $inserttexttype, array( 'name' => $rowduble->name, 'hugeit_contact_id' => $rowduble->hugeit_contact_id, 'description' => $rowduble->description, 'conttype' => $rowduble->conttype, 'hc_field_label' => $rowduble->hc_field_label, 'hc_other_field' => $rowduble->hc_other_field, 'field_type' => $rowduble->field_type, 'hc_required' => $rowduble->hc_required, 'ordering' => $rowdubleorder, 'published' => $rowduble->published, 'hc_input_show_default' => $rowduble->hc_input_show_default, 'hc_left_right' => $rowduble->hc_left_right, ), array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s') ); $queryMax=$wpdb->prepare("SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId); $row8=$wpdb->get_results($queryMax); $fieldID2=$row8[0]->resId; $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID2); $rowimages=$wpdb->get_results($fieldQuery); switch ( $inputtype ) { case 'text': echo json_encode( array( "outputField" => hugeit_contact_textBoxHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_textBoxSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'textarea': echo json_encode( array( "outputField" => hugeit_contact_textareaHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_textareaSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'selectbox': echo json_encode( array( "outputField" => hugeit_contact_selectboxHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_selectboxSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'checkbox': echo json_encode( array( "outputField" => hugeit_contact_checkboxHtml( $rowimages[0], $themeId ), "outputFieldSettings" => hugeit_contact_checkboxSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'radio_box': echo json_encode( array( "outputField" => hugeit_contact_radioboxHtml( $rowimages[0], $themeId ), "outputFieldSettings" => hugeit_contact_radioboxSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'file_box': echo json_encode( array( "outputField" => hugeit_contact_fileboxHtml( $rowimages[0], $themeId ), "outputFieldSettings" => hugeit_contact_fileboxSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'custom_text': echo json_encode( array( "outputField" => hugeit_contact_cutomtextHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_cutomtextSettingsHtml( $rowimages[0] ), "customText" => "titleimage" . $fieldID . "", "beforeId" => $fieldID, ) ); break; case 'e_mail': echo json_encode( array( "outputField" => hugeit_contact_emailHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_emailSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'nameSurname': echo json_encode( array( "outputField" => hugeit_contact_nameSurnameHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_nameSurnameSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'phone': echo json_encode( array( "outputField" => hugeit_contact_phoneHtml( $rowimages[0] ), "outputFieldSettings" => hugeit_contact_phoneSettingsHtml( $rowimages[0] ), "beforeId" => $fieldID, ) ); break; case 'hidden_field': echo json_encode( array( "outputField" => hugeit_contact_hiddenFieldHtml( $rowimages[0], $themeId ), "outputFieldSettings" => hugeit_contact_hiddenFieldSettingsHtml($rowimages[0]), "beforeId" => $fieldID, ) ); break; case 'page_break': echo json_encode( array( "outputField" => hugeit_contact_pageBreakHtml( $rowimages[0], $themeId ), "outputFieldSettings" => hugeit_contact_pageBreakSettingsHtml($rowimages[0]), "beforeId" => $fieldID, ) ); break; } } //Save Form Action if ( isset( $_POST['task'] ) && $_POST['task'] == 'saveEntireForm' ) { if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) { return false; } $formId = sanitize_text_field($_POST['formId']); $_POSTED=$_POST['formData']; $query = $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "huge_it_contact_contacts_fields WHERE hugeit_contact_id = %d ORDER BY id ASC", $formId ); $rowim = $wpdb->get_results( $query ); if ( isset( $_POSTED ) ) { if (isset($_POSTED["name"])) { if ($_POSTED["name"] != '') { $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field(wp_unslash($_POSTED["name"])), $formId)); $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", sanitize_text_field($_POSTED["select_form_theme"]), $formId)); $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", sanitize_text_field($_POSTED["select_form_theme"]), $formId)); } } if (isset($_POSTED['hugeit_contact_show_title_for_form_' . $formId]) && in_array($_POSTED['hugeit_contact_show_title_for_form_' . $formId], array('yes', 'no', 'default'))) { update_option('hugeit_contact_show_title_for_form_' . $formId, $_POSTED['hugeit_contact_show_title_for_form_' . $formId]); } //Allowed html tags for wp_editor global $allowedposttags; $allowed_atts = array( 'align' => array(), 'type' => array(), 'style' => array(), 'src' => array(), 'alt' => array(), 'href' => array(), 'target' => array(), 'value' => array(), 'name' => array(), 'for' => array(), 'width' => array(), 'height' => array(), 'data' => array(), 'title' => array(), ); $allowedposttags['form'] = $allowed_atts; $allowedposttags['label'] = $allowed_atts; $allowedposttags['input'] = $allowed_atts; $allowedposttags['textarea'] = $allowed_atts; $allowedposttags['strong'] = $allowed_atts; $allowedposttags['small'] = $allowed_atts; $allowedposttags['table'] = $allowed_atts; $allowedposttags['span'] = $allowed_atts; $allowedposttags['abbr'] = $allowed_atts; $allowedposttags['code'] = $allowed_atts; $allowedposttags['pre'] = $allowed_atts; $allowedposttags['div'] = $allowed_atts; $allowedposttags['img'] = $allowed_atts; $allowedposttags['h1'] = $allowed_atts; $allowedposttags['h2'] = $allowed_atts; $allowedposttags['h3'] = $allowed_atts; $allowedposttags['h4'] = $allowed_atts; $allowedposttags['h5'] = $allowed_atts; $allowedposttags['h6'] = $allowed_atts; $allowedposttags['ol'] = $allowed_atts; $allowedposttags['ul'] = $allowed_atts; $allowedposttags['li'] = $allowed_atts; $allowedposttags['em'] = $allowed_atts; $allowedposttags['hr'] = $allowed_atts; $allowedposttags['br'] = $allowed_atts; $allowedposttags['tr'] = $allowed_atts; $allowedposttags['td'] = $allowed_atts; $allowedposttags['p'] = $allowed_atts; $allowedposttags['a'] = $allowed_atts; $allowedposttags['b'] = $allowed_atts; $allowedposttags['i'] = $allowed_atts; //Allowed html tags for wp_editor foreach ($rowim as $key => $rowimages) { $inputAllowedTypes = array('text', 'custom_text', 'textarea', 'selectbox', 'checkbox', 'radio_box', 'file_box', 'e_mail', 'buttons', 'captcha', 'simple_captcha_box','hidden_field','page_break'); $inputtype = $rowimages->conttype; if (in_array($inputtype, $inputAllowedTypes)) { $id = $rowimages->id; $hc_other_field = ''; if ( isset($_POSTED['hc_other_field' . $id]) ) { $hc_other_field = is_array($_POSTED['hc_other_field' . $id]) ? json_encode($_POSTED['hc_other_field' . $id]) : $_POSTED['hc_other_field' . $id]; } $row_updated = $wpdb->update( $wpdb->prefix . "huge_it_contact_contacts_fields", array( 'ordering' => isset($_POSTED['hc_ordering' . $id])? intval($_POSTED['hc_ordering' . $id]):0, 'hc_required' => isset($_POSTED['hc_required' . $id])? sanitize_text_field($_POSTED['hc_required' . $id]):'off', 'hc_input_show_default' => isset($_POSTED['hc_input_show_default' . $id])? sanitize_text_field($_POSTED['hc_input_show_default' . $id]):'', 'hc_left_right' => isset($_POSTED['hc_left_right' . $id]) ? sanitize_text_field($_POSTED['hc_left_right' . $id]) : 'left', 'hc_other_field' => $hc_other_field, 'name' => isset($_POSTED['titleimage' . $id]) ? wp_kses($_POSTED['titleimage' . $id],$allowedposttags) : '', 'description' => isset($_POSTED['im_description' . $id]) ? sanitize_text_field($_POSTED['im_description' . $id]) : '', 'hc_field_label' => isset($_POSTED['imagess' . $id])? sanitize_text_field(wp_unslash($_POSTED['imagess' . $id])):'', 'field_type' => isset($_POSTED['field_type' . $id]) ? sanitize_text_field($_POSTED['field_type' . $id]) : '', ), array('id' => $rowimages->id) ); } } echo json_encode(array("saveForm" => "success")); } } /* End Save Entire Form */ /* Change Theme */ if (isset($_POST['task'])&&$_POST['task']=='changeFormTheme') { if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) { return false; } $themeId = absint($_POST['themeId']); $formId = absint($_POST['formId']); $all = $_POST['formData']; parse_str("$all",$myArray); $_POSTED = array_map('sanitize_text_field', $myArray); $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId); $rowim=$wpdb->get_results($query); if ( isset( $_POSTED["name"] ) ) { if ( $_POSTED["name"] != '' ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field(wp_unslash($_POSTED["name"])), $formId ) ); $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", intval($themeId), $formId ) ); } } foreach ( $rowim as $key => $rowimages ) { if ( isset( $_POSTED ) && isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) { if ( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) { $id = absint($rowimages->id); if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET field_type = %s WHERE id = %d", sanitize_text_field($_POSTED[ "field_type" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_other_field = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_other_field" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET name = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "titleimage" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET description = %s WHERE id = %d", sanitize_text_field($_POSTED[ "im_description" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_required = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_required" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_field_label = %s WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "imagess" . $rowimages->id . "" ] )), $id ) ); } if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_left_right = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_left_right" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET ordering = %s WHERE id = %d", intval($_POSTED[ "hc_ordering" . $rowimages->id . "" ]), $id ) ); } if ( isset( $_POSTED[ "hc_input_show_default" . $rowimages->id . "" ] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET hc_input_show_default = %s WHERE id = %d", sanitize_text_field($_POSTED[ "hc_input_show_default" . $rowimages->id . "" ]), $id ) ); } } } } echo hugeit_contact_drawThemeNew($themeId); } /* Change Theme */