Advertisement
Guest User

Untitled

a guest
Jan 31st, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 179.25 KB | None | 0 0
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) exit;
  3. global $wpdb;
  4. //Draw the form
  5. function hugeit_contact_drawThemeNew($themeId) { ob_start();
  6. global $wpdb;
  7. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  8. $rows = $wpdb->get_results($query);
  9. $style_values = array();
  10. foreach ($rows as $row) {
  11. $key = $row->name;
  12. $value = $row->value;
  13. $style_values[$key] = $value;
  14. }
  15.  
  16. //return $newCss;
  17. ?>
  18. #<?php echo $style_values["form_button_submit_icon_style"]."_".$style_values['form_button_submit_has_icon']; ?>{} #<?php echo $style_values["form_button_reset_icon_style"]."_".$style_values['form_button_reset_has_icon']; ?>{} #hugeit-contact-wrapper { width:<?php echo $style_values["form_wrapper_width"]; ?>%; <?php $color = explode(",", $style_values["form_wrapper_background_color"]); if($style_values["form_wrapper_background_type"]=="color"){?> background:#<?php echo $color[0]; ?>; <?php } elseif($style_values["form_wrapper_background_type"]=="gradient"){ ?> background: -webkit-linear-gradient(#<?php echo $color[0]; ?>, #<?php echo $color[1]; ?>); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(#<?php echo $color[0]; ?>, #<?php echo $color[1]; ?>); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(#<?php echo $color[0]; ?>, #<?php echo $color[1]; ?>); /* For Firefox 3.6 to 15 */ background: linear-gradient(#<?php echo $color[0]; ?>, #<?php echo $color[1]; ?>); /* Standard syntax */ <?php } ?> } #hugeit-contact-wrapper > div { border:<?php echo $style_values["form_border_size"]; ?>px solid #<?php echo $style_values["form_border_color"]; ?>; }#hugeit-contact-wrapper > div > h3 { <?php if($style_values["form_show_title"]=="on"):?>position:relative; display:block; clear:both !important; padding:5px 0px 10px 2% !important; font-size:<?php echo $style_values["form_title_size"]; ?>px !important; line-height:<?php echo $style_values["form_title_size"]; ?>px !important; color:#<?php echo $style_values["form_title_color"]; ?> !important; margin: 10px 0 15px 0 !important;<?php else:?>display:none;<?php endif;?> } #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:<?php echo $style_values['form_title_size']; ?>px !important; line-height:<?php echo $style_values['form_title_size']; ?>px !important; color:#<?php echo $style_values['form_title_color']; ?>!important; outline: 0 !important; -webkit-transition: none !important; transition: none !important;} #hugeit-contact-wrapper label { font-size:<?php echo $style_values["form_label_size"]; ?>px; color:#<?php echo $style_values["form_label_color"]; ?>; font-family:<?php echo $style_values["form_label_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:#<?php echo $style_values["form_label_error_color"]; ?>; } #hugeit-contact-wrapper label em.required-star{ color: #<?php echo $style_values["form_label_required_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,.simple-captcha-block input[type=text],.simple-captcha-block input[type=text]:focus { height:<?php echo $style_values["form_input_text_font_size"]*2; ?>px; <?php if($style_values["form_input_text_has_background"]=="on"){?> background:#<?php echo $style_values["form_input_text_background_color"]; ?>; <?php }else { ?> background:none; <?php } ?> border:<?php echo $style_values["form_input_text_border_size"]; ?>px solid #<?php echo $style_values["form_input_text_border_color"]; ?> !important; box-shadow:none !important ; border-radius:<?php echo $style_values["form_input_text_border_radius"]; ?>px; font-size:<?php echo $style_values["form_input_text_font_size"]; ?>px; color:#<?php echo $style_values["form_input_text_font_color"]; ?>; margin:0px !important; outline:none; }.textarea-block textarea { <?php if($style_values["form_textarea_has_background"]=="on"){?> background:#<?php echo $style_values["form_textarea_background_color"]; ?>; <?php }else { ?> background:none; <?php } ?> border:<?php echo $style_values["form_textarea_border_size"]; ?>px solid #<?php echo $style_values["form_textarea_border_color"]; ?>; border-radius:<?php echo $style_values["form_textarea_border_radius"]; ?>px; font-size:<?php echo $style_values["form_textarea_font_size"]; ?>px; color:#<?php echo $style_values["form_textarea_font_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:#<?php echo $style_values["form_radio_color"]; ?>; } .checkbox-block i { display:inline-block; float:left; width:20px; color:#<?php echo $style_values["form_checkbox_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:#<?php echo $style_values["form_radio_hover_color"]; ?>; } .checkbox-block i:hover { color:#<?php echo $style_values["form_checkbox_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:#<?php echo $style_values["form_radio_active_color"]; ?>; } .checkbox-block input:checked + i.active, .checkbox-block input:checked + i.active:hover { display:inline-block; color:#<?php echo $style_values["form_checkbox_active_color"]; ?>; } .selectbox-block { position:relative; height:<?php echo $style_values["form_selectbox_font_size"]*2+$style_values["form_selectbox_border_size"]; ?>px; } .selectbox-block select { position:relative; height:<?php echo $style_values["form_selectbox_font_size"]*2-$style_values["form_selectbox_border_size"]*2; ?>px; margin:<?php echo $style_values["form_selectbox_border_size"]; ?>px 0px 0px 1px !important; opacity:0; z-index:2; } .selectbox-block .textholder { position:absolute; height:<?php echo $style_values["form_selectbox_font_size"]*2; ?>px; width:90%; padding-right:10%; margin:0px !important; top;0px; left:0px; border:0px; color:#<?php echo $style_values["form_selectbox_font_color"]; ?>; background:none; border:<?php echo $style_values["form_selectbox_border_size"]; ?>px solid #<?php echo $style_values["form_selectbox_border_color"]; ?>; border-radius:<?php echo $style_values["form_selectbox_border_radius"]; ?>px; color:#<?php echo $style_values["form_selectbox_font_color"]; ?>; font-size:<?php echo $style_values["form_selectbox_font_size"]; ?>px; <?php if($style_values["form_selectbox_has_background"]=="on"){?> background:#<?php echo $style_values["form_selectbox_background_color"]; ?>; <?php }else { ?> background:none; <?php } ?> } .selectbox-block i { position:absolute; top:<?php echo $style_values["form_selectbox_font_size"]/2+$style_values["form_selectbox_border_size"]/4; ?>px; right:10px; z-index:0; color:#<?php echo $style_values["form_selectbox_arrow_color"]; ?>; font-size:<?php echo $style_values["form_selectbox_font_size"]; ?>px; } .file-block { position:relative; cursor:pointer; } .file-block .textholder { position:relative; float:left; width:calc(60% - <?php echo $style_values["form_file_border_size"]*2 + 5; ?>px) !important; height:<?php echo $style_values["form_file_font_size"]*2; ?>px; margin:0px; border:<?php echo $style_values["form_file_border_size"]; ?>px solid #<?php echo $style_values["form_file_border_color"]; ?> !important; border-radius:<?php echo $style_values["form_file_border_radius"]; ?>px !important; font-size:<?php echo $style_values["form_file_font_size"]; ?>px; color:#<?php echo $style_values["form_file_font_color"]; ?>; <?php if($style_values["form_file_has_background"]=="on"){?> background:#<?php echo $style_values["form_file_background"]; ?>; <?php }else { ?> background:none; <?php } ?> 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:<?php echo $style_values["form_file_border_size"]; ?>px solid #<?php echo $style_values["form_file_border_color"]; ?> !important; border-bottom:<?php echo $style_values["form_file_border_size"]; ?>px solid #<?php echo $style_values["form_file_border_color"]; ?> !important; border-right:<?php echo $style_values["form_file_border_size"]; ?>px solid #<?php echo $style_values["form_file_border_color"]; ?> !important; border-top-right-radius:<?php echo $style_values["form_file_border_radius"]; ?>px !important; border-bottom-right-radius:<?php echo $style_values["form_file_border_radius"]; ?>px !important; <?php $fileheight=$style_values["form_file_font_size"]*2; ?> height:<?php echo $fileheight; ?>px; padding:0px 1%; margin:0px; overflow: hidden; font-size:<?php echo $style_values["form_file_font_size"]; ?>px; line-height:<?php echo $style_values["form_file_font_size"]*2; ?>px; color:#<?php echo $style_values["form_file_button_text_color"]; ?>; background:#<?php echo $style_values["form_file_button_background_color"]; ?>; text-align:center; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; box-sizing:content-box; } .file-block:hover .uploadbutton { color:#<?php echo $style_values["form_file_button_text_color"]; ?>; background:#<?php echo $style_values["form_file_button_background_color"]; ?>; vertical-align: baseline; } .file-block .uploadbutton i { color:#<?php echo $style_values["form_file_icon_color"]; ?>; font-size:<?php echo $style_values["form_file_font_size"]; ?>px; vertical-align: baseline; -webkit-transition: all 0.5s ease; transition: all 0.5s ease; } .file-block:hover .uploadbutton { color:#<?php echo $style_values["form_file_button_text_hover_color"]; ?>; background:#<?php echo $style_values["form_file_button_background_hover_color"]; ?>; } .file-block:hover .uploadbutton i { color:#<?php echo $style_values["form_file_icon_hover_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 { <?php if($style_values["form_button_position"]=="left"){echo "text-align:left;";} else if ($style_values["form_button_position"]=="right"){echo "text-align:right;";} else {echo "text-align:center;";} ?> } .buttons-block button { height:auto; padding:<?php echo $style_values["form_button_padding"]; ?>px <?php echo $style_values["form_button_padding"]*2; ?>px <?php echo $style_values["form_button_padding"]; ?>px <?php echo $style_values["form_button_padding"]*2; ?>px; cursor:pointer; text-transform: none; <?php if($style_values["form_button_fullwidth"]=="on"){ ?> clear:both; width:100%; padding-left:0px; padding-right:0px; margin:0px 0px 0px 0px !important; padding-left:0px; padding-right:0px; <?php } ?> font-size:<?php echo $style_values["form_button_font_size"]; ?>px; } .buttons-block button.submit { color:#<?php echo $style_values["form_button_submit_font_color"]; ?> !important; background-color:#<?php echo $style_values["form_button_submit_background"]; ?> !important; border:<?php echo $style_values["form_button_submit_border_size"]; ?>px solid #<?php echo $style_values["form_button_submit_border_color"]; ?> !important; border-radius:<?php echo $style_values["form_button_submit_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:#<?php echo $style_values["form_button_submit_font_hover_color"]; ?> !important; background:#<?php echo $style_values["form_button_submit_hover_background"]; ?> !important; } .buttons-block button.submit i { color:#<?php echo $style_values["form_button_submit_icon_color"]; ?> !important; vertical-align: baseline !important; font-size:<?php echo $style_values["form_button_font_size"]; ?>px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.submit:hover i { color:#<?php echo $style_values["form_button_submit_icon_hover_color"]; ?> !important; } .buttons-block button.reset { color:#<?php echo $style_values["form_button_reset_font_color"]; ?> !important; background-color:#<?php echo $style_values["form_button_reset_background"]; ?> !important; border:<?php echo $style_values["form_button_reset_border_size"]; ?>px solid #<?php echo $style_values["form_button_reset_border_color"]; ?> !important; border-radius:<?php echo $style_values["form_button_reset_border_radius"]; ?>px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.reset:hover { color:#<?php echo $style_values["form_button_reset_font_hover_color"]; ?> !important; background:#<?php echo $style_values["form_button_reset_hover_background"]; ?> !important; } .buttons-block button.reset i { color:#<?php echo $style_values["form_button_reset_icon_color"]; ?> !important; vertical-align: baseline !important; font-size:<?php echo $style_values["form_button_font_size"]; ?>px !important; -webkit-transition: all 0.5s ease !important; transition: all 0.5s ease !important; } .buttons-block button.reset:hover i { color:#<?php echo $style_values["form_button_reset_icon_hover_color"]; ?> !important; }
  19.  
  20. <?php
  21. return ob_get_clean();
  22. }
  23. //1 Textbox // Left Column
  24. function hugeit_contact_textBoxHtml($rowimages) { ob_start(); ?>
  25. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  26. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?> </label>
  27. <div class="field-block input-text-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsInsideAlign')echo $rowimages->hc_input_show_default;?>">
  28. <?php if($rowimages->hc_input_show_default=='formsInsideAlign' && $rowimages->hc_required == 'on') $placeholder = $rowimages->name.' *';
  29. else $placeholder = $rowimages->name;?>
  30. <input id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" type="text" placeholder="<?php echo $placeholder;?>" class="<?php if($rowimages->hc_required == 'on'){echo 'required';}?>" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?>/>
  31. </div>
  32. <span class="hugeit-error-message"></span>
  33. <span class="hugeOverlay"></span>
  34. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  35. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  36. </div>
  37. <?php
  38. return ob_get_clean();
  39. }
  40. //Text box Right Column
  41. function hugeit_contact_textBoxSettingsHtml($rowimages){ ob_start(); ?>
  42. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  43. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Textbox"/>
  44. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  45. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Textbox";} ?></h4>
  46. <div class="fields-options">
  47. <div class="left">
  48. <div>
  49. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  50. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  51. </label>
  52. </div>
  53. <div>
  54. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  55. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  56. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  57. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  58. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  59. <option <?php if($rowimages->hc_input_show_default == 'formsInsideAlign'){ echo 'selected="selected"'; } ?> value="formsInsideAlign"><?php _e('Inside Placeholder','hugeit_contact');?></option>
  60. </select>
  61. </label>
  62. </div>
  63. <div>
  64. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  65. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  66. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  67. </label>
  68. <label class="input-block"><?php _e('Field Is Active','hugeit_contact');?>:
  69. <input type="hidden" name="im_description<?php echo absint($rowimages->id); ?>" value=""/>
  70. <input class="fieldisactive" class="isactive" type="checkbox" <?php if($rowimages->description == 'on'){ echo 'checked="checked"';} ?> name="im_description<?php echo absint($rowimages->id); ?>" value="on" />
  71. </label>
  72. </div>
  73. <!--Mask On-->
  74. <label class="input-block"><?php _e('Mask On','hugeit_contact'); ?>
  75. <input type="checkbox" <?php if($rowimages->field_type == 'number') echo "disabled";?> class="hg-mask-on-check" <?php if(trim($rowimages->mask_on)!='' && $rowimages->field_type == 'text') echo "checked='checked'"; ?>>
  76. <label class="hg-mask-on <?php if(trim($rowimages->mask_on)=='' || $rowimages->field_type == 'number') echo "readonlyHgMask" ?>" >
  77. <input type="text" name="mask_on<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->mask_on; ?>" class="mask_on" placeholder="Mask Pattern (ex. (99)-999-99-9) " /><br>
  78. <b>a</b><em>- (A-Z,a-z)</em> <br>
  79. <b>9</b><em>- (0-9)</em><br>
  80. <b>*</b><em>- (A-Z,a-z,0-9)</em>
  81. </label>
  82. </label>
  83. <!--Mask On-->
  84. </div>
  85. <div class="left">
  86. <div>
  87. <label class="input-block"><?php _e('Value If Empty','hugeit_contact');?>:
  88. <input class="placeholder text_area" type="text" name="titleimage<?php echo absint($rowimages->id); ?>" id="titleimage<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->name); ?>" value="<?php echo esc_html($rowimages->name); ?>">
  89. </label>
  90. </div>
  91. <div>
  92. <div class="input-block textbox_file_type">
  93. <div><?php _e('Field type','hugeit_contact');?>:</div>
  94. <label><input type="radio" <?php if($rowimages->field_type == 'text'){ echo 'checked="checked"';} ?> name="field_type<?php echo absint($rowimages->id); ?>" value="text" ><?php _e('Simple Text','hugeit_contact');?></label>
  95. <label><input type="radio" <?php if($rowimages->field_type == 'number'){ echo 'checked="checked"';} ?> name="field_type<?php echo absint($rowimages->id); ?>" value="number" ><?php _e('Number','hugeit_contact');?></label>
  96. </div>
  97. <div>
  98. <!-- Default Value -->
  99. <label class="input-block"><?php _e('Default Value','hugeit_contact'); ?>
  100. <input class="hg-def-value" type="text" name="def_value<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->def_value; ?>" <?php if(trim($rowimages->mask_on)!='') echo "readonly='readonly'"; ?> />
  101. </label>
  102. <!-- Default Value -->
  103. </div>
  104.  
  105. </div>
  106. </div>
  107. <div class="field-top-options-block">
  108. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  109. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  110. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  111. </div>
  112. </div>
  113.  
  114. <div class="clear"></div>
  115. </li>
  116. <?php
  117. return ob_get_clean();
  118. }
  119.  
  120. //2 Textarea //
  121. function hugeit_contact_textareaHtml($rowimages) { ob_start(); ?>
  122. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  123. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?></label>
  124. <div class="field-block textarea-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsInsideAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  125. <?php if($rowimages->hc_input_show_default=='formsInsideAlign' && $rowimages->hc_required == 'on') $placeholder = $rowimages->name.' *';
  126. else $placeholder = $rowimages->name;?>
  127. <textarea style="height:<?php echo $rowimages->hc_other_field;?>px;resize:<?php if($rowimages->field_type=='on'){echo 'vertical';}else{ echo 'none';}?>;" id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?> placeholder="<?php echo esc_html($placeholder); ?>"></textarea>
  128. </div>
  129. <span class="hugeit-error-message"></span>
  130. <span class="hugeOverlay"></span>
  131. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  132. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  133. </div>
  134. <?php
  135. return ob_get_clean();
  136. }
  137.  
  138. function hugeit_contact_textareaSettingsHtml($rowimages) { ob_start(); ?>
  139. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  140. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Textarea"/>
  141. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  142. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Textarea";} ?></h4>
  143. <div class="fields-options">
  144. <div class="left">
  145. <div>
  146. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  147. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  148. </label>
  149. </div>
  150. <div>
  151. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  152. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  153. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  154. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  155. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  156. <option <?php if($rowimages->hc_input_show_default == 'formsInsideAlign'){ echo 'selected="selected"'; } ?> value="formsInsideAlign"><?php _e('Inside Placeholder','hugeit_contact');?></option>
  157. </select>
  158. </label>
  159. </div>
  160. <div>
  161. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  162. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  163. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  164. </label>
  165. </div>
  166. <div>
  167. <label class="input-block"><?php _e('Field Is Active','hugeit_contact');?>:
  168. <input type="hidden" name="im_description<?php echo absint($rowimages->id); ?>" value=""/>
  169. <input class="fieldisactive" type="checkbox" <?php if($rowimages->description == 'on'){ echo 'checked="checked"';} ?> name="im_description<?php echo absint($rowimages->id); ?>" value="on" />
  170. </label>
  171. </div>
  172.  
  173. <div>
  174. <!-- Default Value -->
  175. <label class="input-block"><?php _e('Default Value','hugeit_contact'); ?>
  176. <input type="text" name="def_value<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->def_value; ?>" class="def_value" />
  177. </label>
  178. <!-- Default Value -->
  179. </div>
  180.  
  181. </div>
  182. <div class="left">
  183. <div>
  184. <label class="input-block"><?php _e('Value If Empty','hugeit_contact');?>:
  185. <input class="placeholder" type="text" id="titleimage<?php echo absint($rowimages->id); ?>" name="titleimage<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->name); ?>" value="<?php echo esc_html($rowimages->name); ?>" />
  186. </label>
  187. </div>
  188. <div>
  189. <label class="input-block"><?php _e('Field Height Size','hugeit_contact');?>:
  190. <input class="textarea-size" type="number" class="small" name="hc_other_field<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>" />px
  191. </label>
  192. </div>
  193. <div>
  194. <label class="input-block"><?php _e('Field Resize Is Available','hugeit_contact');?>:
  195. <input type="hidden" name="field_type<?php echo absint($rowimages->id); ?>" value=""/>
  196. <input class="textarea-resize" type="checkbox" <?php if($rowimages->field_type == 'on'){ echo 'checked="checked"';} ?> name="field_type<?php echo absint($rowimages->id); ?>" value="on" />
  197. </label>
  198. </div>
  199. </div>
  200. <div class="field-top-options-block">
  201. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  202. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  203. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  204. </div>
  205. </div>
  206. <div class="clear"></div>
  207. </li>
  208. <?php
  209. return ob_get_clean();
  210. }
  211. //3 Selectbox //
  212. function hugeit_contact_selectboxHtml($rowimages) { ob_start(); ?>
  213. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  214. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?></label>
  215. <div class="field-block selectbox-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign' || $rowimages->hc_input_show_default=='formsInsideAlign')echo esc_html($rowimages->hc_input_show_default);?>" >
  216. <?php $options=explode(';;',$rowimages->name);?>
  217.  
  218. <?php if($rowimages->def_value && $rowimages->def_value!=''){
  219. $optionValue = $rowimages->def_value;
  220. if($rowimages->hc_required && $rowimages->hc_input_show_default=='formsInsideAlign') $optionValue .= ' *';
  221. } else {
  222. $selectedOptionIndex = $rowimages->hc_other_field;
  223. if( is_numeric($selectedOptionIndex) && isset($options[$selectedOptionIndex]) ) $optionValue = $options[$selectedOptionIndex];
  224. else if(in_array($selectedOptionIndex,$options)) $optionValue = $selectedOptionIndex;
  225. else $optionValue = $options[0];
  226.  
  227. } ?>
  228.  
  229. <input type="text" disabled="disabled" class="textholder" value="<?php echo esc_html($optionValue); ?>" />
  230. <select id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" >
  231. <?php
  232. foreach($options as $opt_key => $option){
  233. ?>
  234. <option <?php if($rowimages->def_value =='' && ($optionValue==$opt_key || $optionValue == $option)){
  235. echo 'selected="selected"';
  236. } ?>><?php echo esc_html($option); ?></option>
  237. <?php } ?>
  238. </select>
  239. <i class="hugeicons-chevron-down"></i>
  240. </div>
  241. <span class="hugeit-error-message"></span>
  242. <span class="hugeOverlay"></span>
  243. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  244. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  245. </div>
  246. <?php
  247. return ob_get_clean();
  248. }
  249.  
  250. function hugeit_contact_selectboxSettingsHtml($rowimages) { ob_start(); ?>
  251. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  252. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Selectbox"/>
  253. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  254. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Selectbox";} ?></h4>
  255. <div class="fields-options">
  256. <div class="left">
  257. <div>
  258. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  259. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  260. </label>
  261. </div>
  262. <div>
  263. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  264. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  265. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  266. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  267. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  268. <option <?php if($rowimages->hc_input_show_default == 'formsInsideAlign'){ echo 'selected="selected"'; } ?> value="formsInsideAlign"><?php _e('Inside Placeholder','hugeit_contact');?></option>
  269. </select>
  270. </label>
  271. </div>
  272. <div>
  273. <label class="input-block" for="form_label_position"><?php _e('Placeholder Option','hugeit_contact');?>:
  274. <input class="placeholder-option selectbox" type="text" name="def_value<?php echo absint($rowimages->id); ?>" id="def_value<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->def_value); ?>">
  275. </label>
  276. </div>
  277. <div>
  278. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  279. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  280. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on"/>
  281. </label>
  282. </div>
  283. </div>
  284. <div class="left secondBlock">
  285. <label class="input-block">Field Options:
  286. <ul rel="<?php echo absint($rowimages->id); ?>" class="field-multiple-option-list selectbox">
  287. <?php
  288. $options=explode(';;',$rowimages->name);
  289. foreach($options as $opt_key=>$option){
  290. ?>
  291. <li>
  292. <input id="" class="field-multiple-option" type="text" name="fieldoption<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($option); ?>" />
  293. <div class="set-active <?php if($rowimages->def_value == '' && ( trim($rowimages->hc_other_field) == $opt_key || trim($rowimages->hc_other_field)==$option) ){echo 'checked';} ?>" >
  294. <input type="radio" <?php if($rowimages->def_value=='' && ($rowimages->hc_other_field == $opt_key || trim($rowimages->hc_other_field)==$option)){echo 'checked="checked"';} ?> />
  295. </div>
  296. <a href="#remove" class="remove-field-option"><?php _e('remove','hugeit_contact');?></a>
  297. </li>
  298. <?php } ?>
  299.  
  300. <li>
  301. <input class="field-multiple-option-all-values" name="titleimage<?php echo absint($rowimages->id); ?>" type="hidden" value="<?php echo esc_html($rowimages->name); ?>" />
  302. <input class="add-new-name" type="text" id="titleimage" value="" />
  303. <a href="#" class="add-new">+</a>
  304. </li>
  305. </ul>
  306. <input type="hidden" class="field-multiple-option-active-field" name="hc_other_field<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>" />
  307. </label>
  308. </div>
  309. <div class="field-top-options-block">
  310. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  311. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  312. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  313.  
  314. </div>
  315. </div>
  316. <div class="clear"></div>
  317. </li>
  318. <?php
  319. return ob_get_clean();
  320. }
  321. //4 Checkbox //
  322. function hugeit_contact_checkboxHtml($rowimages,$themeId) { ob_start();
  323. global $wpdb;
  324. $themeId = sanitize_text_field($themeId);
  325. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  326. $rows = $wpdb->get_results($query);
  327. $style_values = array();
  328. foreach ($rows as $row) {
  329. $key = $row->name;
  330. $value = $row->value;
  331. $style_values[$key] = $value;
  332. }?>
  333. <div class="hugeit-field-block hugeit-check-field" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  334. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?></label>
  335. <div class="field-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  336. <ul id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" class="hugeit-checkbox-list">
  337. <?php
  338. $options=explode(';;',$rowimages->name);
  339. $actives=explode(';;',$rowimages->hc_other_field);
  340. $i=0;
  341. $j=0;
  342. foreach($options as $key=>$option){?>
  343. <li style="width:<?php if($rowimages->field_type!=0){echo 100/intval($rowimages->field_type);}?>%;">
  344. <label class="secondary-label">
  345. <div class="checkbox-block big">
  346. <input <?php if(isset($actives[$j])&&$actives[$j]==''.$key.''){echo 'checked="checked"';$j++;} ?> type="checkbox" value="" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?>/>
  347. <?php if($style_values['form_checkbox_type']=='circle'){ ?>
  348. <i class="hugeicons-dot-circle-o active"></i>
  349. <i class="hugeicons-circle-o passive"></i>
  350. <?php }else{ ?>
  351. <i class="hugeicons-check-square active"></i>
  352. <i class="hugeicons-square-o passive"></i>
  353. <?php }?>
  354. </div>
  355. <span class="sublable"><?php echo esc_html($option); ?></span>
  356. </label>
  357. </li>
  358. <?php $i++; } ?>
  359. </ul>
  360. </div>
  361. <span class="hugeit-error-message"></span>
  362. <span class="hugeOverlay"></span>
  363. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  364. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  365. </div>
  366. <?php
  367. return ob_get_clean();
  368. }
  369.  
  370. function hugeit_contact_checkboxSettingsHtml($rowimages) { ob_start(); ?>
  371. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  372. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Checkbox"/>
  373. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  374. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Checkbox";} ?></h4>
  375. <div class="fields-options">
  376. <div class="left">
  377. <div>
  378. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  379. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  380. </label>
  381. </div>
  382. <div>
  383. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  384. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  385. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  386. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  387. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  388. </select>
  389. </label>
  390. </div>
  391. <div>
  392. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  393. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  394. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  395. </label>
  396. </div>
  397. <div>
  398. <label class="input-block"><?php _e('Field(s) Is/Are Active','hugeit_contact');?>:
  399. <input type="hidden" name="im_description<?php echo absint($rowimages->id); ?>" value=""/>
  400. <input class="fieldisactive" type="checkbox" <?php if($rowimages->description == 'on'){ echo 'checked="checked"';} ?> name="im_description<?php echo absint($rowimages->id); ?>" value="on" />
  401. </label>
  402. </div>
  403. <div>
  404. <label class="input-block">Columns Count:
  405. <input type="number" class="small field-columns-count" name="field_type<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->field_type); ?>" />
  406. </label>
  407. </div>
  408. </div>
  409. <div class="left secondBlock">
  410. <div>
  411. <label class="input-block"><?php _e('Field Options','hugeit_contact');?>:
  412. <ul rel="<?php echo absint($rowimages->id); ?>" class="field-multiple-option-list checkbox">
  413. <?php
  414. $options=explode(';;',$rowimages->name);
  415. $actives=explode(';;',$rowimages->hc_other_field);
  416. $i=0;
  417. $j=0;
  418. foreach($options as $key=>$option){
  419. ?>
  420. <li>
  421. <input id="" class="field-multiple-option" type="text" value="<?php echo esc_html($option); ?>" />
  422. <div class="set-active <?php if(isset($actives[$j])&&$actives[$j]==''.$key.''){echo 'checked';$j++;} ?>" >
  423. <input type="hidden" class="field-multiple-option-active-field" name="hc_other_field<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>" />
  424. <input type="radio" <?php if(trim($rowimages->hc_other_field)==$i){echo 'checked="checked"';} ?> name="options_active_<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($i); ?>" />
  425. </div>
  426. <a href="#remove" class="remove-field-option"><?php _e('remove','hugeit_contact');?></a>
  427. </li>
  428. <?php $i++; } ?>
  429. <li>
  430. <input class="field-multiple-option-all-values" type="hidden" name="titleimage<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->name); ?>" />
  431. <input class="add-new-name" type="text" id="titleimage<?php echo absint($rowimages->id); ?>" value="" />
  432. <a href="#" class="add-new">+</a>
  433. </li>
  434. </ul>
  435. </label>
  436. </div>
  437. </div>
  438. <div class="field-top-options-block">
  439. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  440. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  441. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  442. </div>
  443. </div>
  444. <div class="clear"></div>
  445. </li>
  446. <?php
  447. return ob_get_clean();
  448. }
  449.  
  450. function hugeit_contact_hiddenFieldHtml($rowimages,$themeId) { ob_start();
  451. global $wpdb;
  452. $themeId = sanitize_text_field($themeId);
  453. $query = $wpdb->prepare("SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = %s", $themeId);
  454. $rows = $wpdb->get_results($query);
  455. $style_values = array();
  456. foreach ($rows as $row) {
  457. $key = $row->name;
  458. $value = $row->value;
  459. $style_values[$key] = $value;
  460. }?>
  461. <div class="hugeit-field-block hugeit-check-field" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>" style="background-color: rgba(211, 211, 211, 0.45) !important; font-weight: bold !important; border-radius: 3px !important;">
  462. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>">
  463. <?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Hidden Field";} ?>
  464. </label>
  465.  
  466. <div class="field-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  467. </div>
  468.  
  469. <span class="hugeit-error-message"></span>
  470. <span class="hugeOverlay"></span>
  471. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  472. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  473. </div>
  474. <?php
  475. return ob_get_clean();
  476. }
  477.  
  478. function hugeit_contact_hiddenFieldSettingsHtml($rowimages) { ob_start(); ?>
  479. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  480. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  481. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  482. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Hidden Field";} ?></h4>
  483. <div class="fields-options">
  484.  
  485. <div class="left">
  486. <div>
  487. <?php _e('Default Value: ','hugeit_contact');?><br>
  488. <div class="input-block">
  489. <input type="hidden" name="imagess<?php echo absint($rowimages->id); ?>" value="Hidden Field">
  490. <label for="user_id"><input type="radio" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="user_id" value="user_id" <?php if($rowimages->hc_other_field=="user_id"){echo 'checked="checked"';} ?> ><?php _e('User ID','hugeit_contact');?></label>
  491. <br>
  492. <label for="user_login"><input type="radio" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="user_login" value="user_login" <?php if($rowimages->hc_other_field=="user_login"){echo 'checked="checked"';} ?> ><?php _e('Username','hugeit_contact');?></label>
  493. <br>
  494. <label for="user_email"><input type="radio" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="user_email" value="user_email" <?php if($rowimages->hc_other_field=="user_email"){echo 'checked="checked"';} ?>><?php _e('User Email','hugeit_contact');?></label>
  495. <br>
  496. <label for="user_ip"><input type="radio" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="user_ip" value="ip_address" <?php if($rowimages->hc_other_field=="ip_address"){echo 'checked="checked"';} ?>><?php _e('IP Address','hugeit_contact');?></label>
  497. </div>
  498. </div>
  499. </div>
  500.  
  501. <div class="field-top-options-block">
  502. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  503. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  504. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  505. </div>
  506. </div>
  507. <div class="clear"></div>
  508. </li>
  509. <?php
  510. return ob_get_clean();
  511. }
  512. function hugeit_contact_pageBreakHtml($rowimages,$themeId) { ob_start();
  513. global $wpdb;
  514. $themeId = sanitize_text_field($themeId);
  515. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  516. $rows = $wpdb->get_results($query);
  517. $style_values = array();
  518. foreach ($rows as $row) {
  519. $key = $row->name;
  520. $value = $row->value;
  521. $style_values[$key] = $value;
  522. }?>
  523. <div class="hugeit-field-block hugeit-check-field" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>" style="text-align: center!important;font-weight: bold!important;">
  524. <hr>
  525. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" style="width:100%!important;">
  526. <?php echo esc_textarea("Page Break"); ?>
  527. </label>
  528. <div class="field-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  529. </div>
  530.  
  531. <span class="hugeit-error-message"></span>
  532. <span class="hugeOverlay"></span>
  533. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  534. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  535. </div>
  536. <?php
  537. return ob_get_clean();
  538. }
  539. function hugeit_contact_pageBreakSettingsHtml($rowimages) { ob_start(); ?>
  540. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  541. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  542. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  543. <h4><?php echo esc_textarea("Page Break"); ?></h4>
  544. <div class="fields-options">
  545.  
  546. <div class="left">
  547. </div>
  548.  
  549. <div class="field-top-options-block">
  550. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  551. </div>
  552. </div>
  553. <div class="clear"></div>
  554. </li>
  555. <?php
  556. return ob_get_clean();
  557. }
  558. //5 Radiobox //
  559. function hugeit_contact_radioboxHtml($rowimages, $themeId) { ob_start();
  560. $themeId = sanitize_text_field($themeId);
  561. global $wpdb;
  562. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  563. $rows = $wpdb->get_results($query);
  564. $style_values = array();
  565. foreach ($rows as $row) {
  566. $key = $row->name;
  567. $value = $row->value;
  568. $style_values[$key] = $value;
  569. }?>
  570. <div class="hugeit-field-block hugeit-radio-field" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  571. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';}?></label>
  572. <div class="field-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  573. <ul id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>">
  574. <?php
  575. $options=explode(';;',$rowimages->name);
  576. $i=0;
  577. foreach($options as $option){
  578. ?>
  579. <li style="width:<?php if($rowimages->description!=0){echo 100/$rowimages->description;}?>%;">
  580. <label class="secondary-label">
  581. <div class="radio-block big">
  582. <input <?php if(trim($rowimages->hc_other_field)==$i){echo 'checked="checked"';} ?> type="radio" name="preview_radio_<?php echo absint($rowimages->id); ?>" >
  583.  
  584. <?php if($style_values['form_radio_type']=='circle'){ ?>
  585. <i class="hugeicons-dot-circle-o active"></i>
  586. <i class="hugeicons-circle-o passive"></i>
  587. <?php }else{ ?>
  588. <i class="hugeicons-check-square active"></i>
  589. <i class="hugeicons-square-o passive"></i>
  590. <?php }?>
  591. </div>
  592. <span class="sublable"><?php echo esc_html($option); ?></span>
  593. </label>
  594. </li>
  595. <?php $i++; } ?>
  596. </ul>
  597. </div>
  598. <span class="hugeit-error-message"></span>
  599. <span class="hugeOverlay"></span>
  600. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  601. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  602. </div>
  603. <?php
  604. return ob_get_clean();
  605. }
  606.  
  607. function hugeit_contact_radioboxSettingsHtml($rowimages) { ob_start(); ?>
  608. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  609. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Radiobox"/>
  610. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  611. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Radiobox";} ?></h4>
  612. <div class="fields-options">
  613. <div class="left">
  614. <div>
  615. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  616. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  617. </label>
  618. </div>
  619. <div>
  620. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  621. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  622. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  623. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  624. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  625. </select>
  626. </label>
  627. </div>
  628. <div>
  629. <label class="input-block">Columns Count:
  630. <input type="number" class="small field-columns-count" type="text" name="im_description<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->description); ?>" />
  631. </label>
  632. </div>
  633. </div>
  634. <div class="left secondBlock">
  635. <div>
  636. <label class="input-block"><?php _e('Field Options','hugeit_contact');?>:
  637. <ul rel="<?php echo absint($rowimages->id); ?>" class="field-multiple-option-list radio">
  638. <?php
  639. $options=explode(';;',$rowimages->name);
  640. $i=0;
  641. foreach($options as $option){
  642. ?>
  643. <li>
  644. <input id="" class="field-multiple-option" type="text" name="fieldoption<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($option); ?>" />
  645. <div class="set-active <?php if(trim($rowimages->hc_other_field)==$i){echo 'checked';} ?>" >
  646. <input type="hidden" class="field-multiple-option-active-field" name="hc_other_field<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>" />
  647. <input type="radio" <?php if(trim($rowimages->hc_other_field)==$i){echo 'checked="checked"';} ?> />
  648. </div>
  649. <a href="#remove" class="remove-field-option"><?php _e('remove','hugeit_contact');?></a>
  650. </li>
  651. <?php $i++; } ?>
  652. <li>
  653. <input class="field-multiple-option-all-values" type="hidden" name="titleimage<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->name); ?>" />
  654. <input class="add-new-name" type="text" value="" />
  655. <a href="#" class="add-new">+</a>
  656. </li>
  657. </ul>
  658. </label>
  659. </div>
  660. </div>
  661. <div class="field-top-options-block">
  662. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  663. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  664. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  665. </div>
  666. </div>
  667. <div class="clear"></div>
  668. </li>
  669. <?php
  670. return ob_get_clean();
  671. }
  672. //6 Filebox //
  673. function hugeit_contact_fileboxHtml($rowimages,$themeId) { ob_start();
  674. $themeId = sanitize_text_field($themeId);
  675. global $wpdb;
  676. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  677. $rows = $wpdb->get_results($query);
  678. $style_values = array();
  679. foreach ($rows as $row) {
  680. $key = $row->name;
  681. $value = $row->value;
  682. $style_values[$key] = $value;
  683. }?>
  684. <script>
  685. jQuery(document).ready(function(){
  686. function mbToBytes(mb){
  687. return Math.round(mb * 1048576 * 100000) / 100000;
  688. }
  689. var byteRes=mbToBytes(<?php echo $rowimages->name;?>);
  690. jQuery(".hugeit-contact-column-block input[name='MAX_FILE_SIZE']").attr('value',byteRes);
  691. });
  692. </script>
  693. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  694. <label class="<?php if($rowimages->hc_input_show_default!='1')echo $rowimages->hc_input_show_default;?>" for="hugeit_preview_textbox_<?php echo htmlspecialchars($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?></label>
  695. <div class="field-block file-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsInsideAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  696. <input type="text" class="textholder" placeholder="<?php if($rowimages->hc_input_show_default=='formsInsideAlign') echo esc_html($rowimages->hc_field_label);?>"/>
  697. <span class="uploadbutton">
  698. <?php if($style_values['form_file_has_icon']=='on'):?>
  699. <?php if($style_values['form_file_icon_position']=="left"){?><i class="<?php echo esc_html($style_values['form_file_icon_style']); ?>"></i><?php } ?>
  700. <?php endif;?>
  701. <?php echo esc_html($style_values['form_file_button_text']);?>
  702. <?php if($style_values['form_file_has_icon']=='on'):?>
  703. <?php if($style_values['form_file_icon_position']=="right"){?><i class="<?php echo esc_html($style_values['form_file_icon_style']); ?>"></i><?php }?>
  704. <?php endif;?>
  705. </span>
  706. <input type="hidden" name="MAX_FILE_SIZE" value="" />
  707. <input id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" type="file" name="userfile"/>
  708. </div>
  709. <span class="hugeit-error-message"></span>
  710. <span class="hugeOverlay"></span>
  711. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  712. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  713. </div>
  714. <?php
  715. return ob_get_clean();
  716. }
  717.  
  718. function hugeit_contact_fileboxSettingsHtml($rowimages) { ob_start(); ?>
  719. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  720. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Filebox"/>
  721. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  722. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Filebox";} ?></h4>
  723. <div class="fields-options">
  724. <div class="left">
  725. <div>
  726. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  727. <input class="label" type="text" name="imagess<?php echo htmlspecialchars($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  728. </label>
  729. </div>
  730. <div>
  731. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  732. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  733. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  734. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  735. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  736. <option <?php if($rowimages->hc_input_show_default == 'formsInsideAlign'){ echo 'selected="selected"'; } ?> value="formsInsideAlign"><?php _e('Inside Placeholder','hugeit_contact');?></option>
  737. </select>
  738. </label>
  739. </div>
  740. <div>
  741. <label class="input-block"><?php _e('Allowed files','hugeit_contact');?>:
  742. <textarea class="text_area" type="hidden" name="hc_other_field<?php echo absint($rowimages->id); ?>" rows="3" cols="45" name="text"><?php echo esc_html($rowimages->hc_other_field); ?></textarea>
  743. </label>
  744. </div>
  745. </div>
  746. <div class="left">
  747. <div>
  748. <label class="input-block"><?php _e('Field Maximum Size(MB)','hugeit_contact');?>:
  749. <input class="text_area" type="number" name="titleimage<?php echo absint($rowimages->id); ?>" id="titleimage<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->name); ?>">
  750. </label>
  751. </div>
  752. <div>
  753. <label class="input-block"><?php _e('Upload File Directory','hugeit_contact');?>:
  754. <input class="text_area" type="text" name="field_type<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->field_type); ?>" >
  755. </label>
  756. </div>
  757. <div>
  758. <label><?php _e('Field Is Required','hugeit_contact');?>:
  759. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  760. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on"/>
  761. </label>
  762. </div>
  763. </div>
  764. <div class="field-top-options-block">
  765. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  766. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  767. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  768. </div>
  769. </div>
  770. <div class="clear"></div>
  771. </li>
  772. <?php
  773. return ob_get_clean();
  774. }
  775. //7 Custom Text //
  776. function hugeit_contact_cutomtextHtml($rowimages) { ob_start(); ?>
  777. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  778. <div class="custom_text_content"><?php echo $rowimages->name; ?></div>
  779. <span class="hugeOverlay"></span>
  780. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  781. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  782. </div>
  783. <?php
  784. return ob_get_clean();
  785. }
  786.  
  787. function hugeit_contact_cutomtextSettingsHtml($rowimages) { ob_start(); ?>
  788. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>" data-fieldType="custom_text">
  789. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  790. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  791. <h4><?php _e('Custom Text','hugeit_contact');?></h4>
  792. <div class="fields-options">
  793. <div class="left tinymce_custom_text">
  794. <?php wp_editor($rowimages->name, "titleimage".$rowimages->id); ?>
  795. </div>
  796. <div class="field-top-options-block">
  797. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  798. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  799. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  800. </div>
  801. </div>
  802. <div class="clear"></div>
  803. </li>
  804. <script>
  805. function editorchange(value){
  806. var fieldid=jQuery('.fields-list li.open').attr('id');
  807. var previewfield=jQuery('.hugeit-contact-column-block > div[rel="'+fieldid+'"]');
  808. previewfield.find('.custom_text_content').html(value);
  809. }
  810. jQuery('#fields-list-block').on('keyup','#wp-titleimage'+<?php echo absint($rowimages->id); ?>+'-wrap',function(){
  811.  
  812. var value=jQuery('#titleimage'+<?php echo absint($rowimages->id); ?>).val();
  813. jQuery(this).attr('value',value);
  814. editorchange(value);
  815. });
  816. </script>
  817. <?php
  818. return ob_get_clean();
  819. }
  820. //8 ReCaptcha //
  821. function hugeit_contact_captchaHtml($rowimages) { ob_start(); ?>
  822. <div class="hugeit-field-block captcha-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  823. <?php $capPos='right';if($rowimages->hc_input_show_default=='2')$capPos="left";?>
  824. <div <?php if($rowimages->hc_required=='dark'){echo 'style="display:none"';}else{echo 'style="float:'.$capPos.'"';}?> id="democaptchalight"></div>
  825. <div <?php if($rowimages->hc_required=='light'){echo 'style="display:none"';}else{echo 'style="float:'.$capPos.'"';}?> id="democaptchadark"></div>
  826. <span class="hugeOverlay"></span>
  827. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  828. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  829. </div>
  830. <?php
  831. return ob_get_clean();
  832. }
  833.  
  834. function hugeit_contact_captchaSettingsHtml($rowimages) { ob_start(); ?>
  835. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>" data-fieldType="captcha">
  836. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  837. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  838. <h4>ReCaptcha</h4>
  839. <div class="fields-options">
  840. <div class="left">
  841. <label class="input-block"><?php _e('ReCaptcha Type','hugeit_contact');?>
  842. <select name="titleimage<?php echo absint($rowimages->id); ?>">
  843. <option <?php if($rowimages->name == 'image'){ echo 'selected="selected"'; } ?> value="image"><?php _e('Image','hugeit_contact');?></option>
  844. <option <?php if($rowimages->name == 'audio'){ echo 'selected="selected"'; } ?> value="audio"><?php _e('Audio','hugeit_contact');?></option>
  845. </select>
  846. </label>
  847. <label class="input-block"><?php _e('ReCaptcha Position','hugeit_contact');?>
  848. <select class="captcha_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  849. <option <?php if($rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="1">Right</option>
  850. <option <?php if($rowimages->hc_input_show_default == '2'){ echo 'selected="selected"'; } ?> value="2">Left</option>
  851. </select>
  852. </label>
  853. </div>
  854. <div class="left">
  855. <label class="input-block"><?php _e('ReCaptcha Theme','hugeit_contact');?>
  856. <select class="hugeit_contact_captcha_theme" name="hc_required<?php echo absint($rowimages->id); ?>">
  857. <option <?php if($rowimages->hc_required == 'dark'){ echo 'selected="selected"'; } ?> value="dark">Dark</option>
  858. <option <?php if($rowimages->hc_required == 'light'){ echo 'selected="selected"'; } ?> value="light">Light</option>
  859. </select>
  860. </label>
  861. </div>
  862. <div class="field-top-options-block">
  863. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  864. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  865. </div>
  866. </div>
  867. <div class="clear"></div>
  868. </li>
  869. <?php
  870. return ob_get_clean();
  871. }
  872.  
  873. //8.1 Simple Captcha //
  874. //Simple Captcha DEMO HTML(Right Column)
  875. function hugeit_contact_simple_captcha_html($rowimages,$formid) { ob_start(); ?>
  876. <?php $capPos='text-left';if($rowimages->hc_input_show_default=='formsRightAlign')$capPos="text-right";?>
  877. <?php $hc_other_field = json_decode($rowimages->hc_other_field);?>
  878. <div class="hugeit-field-block simple-captcha-block <?php echo esc_html($capPos);?>" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  879. <label class="formsAboveAlign">
  880. <img src="<?php echo hugeit_contact_create_new_captcha($rowimages->id,'admin');?>">
  881. <span class="hugeit_captcha_refresh_button" data-captcha-id="<?php echo absint($rowimages->id);?>" data-digits="<?php echo isset($hc_other_field->digits)?esc_html($hc_other_field->digits):5;?>" data-form-id="<?php echo esc_html($formid); ?>">
  882. <img src="<?php echo plugin_dir_url(__FILE__);?>../images/refresh-icon.png" width="32px">
  883. </span>
  884. </label>
  885. <div class="field-block">
  886. <input type="text" name="simple_captcha" placeholder="<?php echo esc_html($rowimages->name);?>">
  887. </div>
  888.  
  889. <span class="hugeOverlay"></span>
  890. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  891. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  892.  
  893. </div>
  894. <?php
  895. return ob_get_clean();
  896. }
  897.  
  898. // Simple Captcha Field HTML(Left Column)
  899. function hugeit_contact_simple_captcha_settings_html($rowimages) { ob_start(); ?>
  900. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>" data-fieldType="simple_captcha_box">
  901. <h4>Simple Captcha</h4>
  902. <div class="fields-options">
  903. <div class="left">
  904. <label class="input-block"><?php _e('Simple Captcha Digits','hugeit_contact');?>(3-7)
  905. <?php $hc_other_field=json_decode($rowimages->hc_other_field);?>
  906. <input type="number" min="3" max="7" name="hc_other_field<?php echo absint($rowimages->id); ?>[digits]" value="<?php echo (isset($hc_other_field->digits))?$hc_other_field->digits:5;?>">
  907. </label>
  908. <label class="input-block"><?php _e('Simple Captcha Position','hugeit_contact');?>
  909. <select id="form_label_position" class="simple_captcha_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  910. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' ){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  911. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  912. </select>
  913. </label>
  914. </div>
  915. <div class="left">
  916. <label class="input-block"><?php _e('Input Placeholder','hugeit_contact');?>
  917. <input class='placeholder' type="text" name="titleimage<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->name);?>">
  918. </label>
  919. <label class="input-block"><?php _e('Color Settings','hugeit_contact');?>
  920. <br>
  921. <label><input type="radio" <?php if($rowimages->description == 'default') echo 'checked';?> name="im_description<?php echo absint($rowimages->id); ?>" value="default" class="default-custom"><?php _e('Default','hugeit_contact');?></label>
  922. <label><input type="radio" <?php if($rowimages->description == 'custom') echo 'checked';?> name="im_description<?php echo absint($rowimages->id); ?>" value="custom" class="default-custom"><?php _e('Custom','hugeit_contact');?></label>
  923.  
  924. <input <?php if($rowimages->description == 'default') echo 'disabled';?> class='custom-option color' type="text" style="margin-top:10px; width:90%;" value="<?php echo (isset($hc_other_field->color))?$hc_other_field->color:'FF601C';?>" name="hc_other_field<?php echo absint($rowimages->id); ?>[color]">
  925.  
  926. </label>
  927.  
  928. </div>
  929.  
  930. <span class="hugeOverlay"></span>
  931. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  932. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  933.  
  934. <div class="field-top-options-block">
  935. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  936. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  937. </div>
  938. </div>
  939. <div class="clear"></div>
  940. </li>
  941. <?php
  942. return ob_get_clean();
  943. }
  944.  
  945.  
  946.  
  947.  
  948. //9 Buttons //
  949. function hugeit_contact_buttonsHtml($rowimages,$themeId) { ob_start();
  950. $themeId = sanitize_text_field($themeId);
  951. global $wpdb;
  952. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  953. $rows = $wpdb->get_results($query);
  954. $style_values = array();
  955. foreach ($rows as $row) {
  956. $key = $row->name;
  957. $value = $row->value;
  958. $style_values[$key] = $value;
  959. }
  960. ?>
  961. <div class="hugeit-field-block buttons-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  962. <button type="submit" class="submit" id="hugeit_preview_button__submit_<?php echo absint($rowimages->id);?>" value="Submit">
  963.  
  964. <?php if($style_values['form_button_icons_position']=="left" and $style_values['form_button_submit_has_icon']=="on"){
  965. ?><i class="<?php echo esc_html($style_values['form_button_submit_icon_style']); ?>"></i><?php
  966. }?>
  967.  
  968. <?php echo esc_html($rowimages->description); ?>
  969.  
  970. <?php if($style_values['form_button_icons_position']=="right" and $style_values['form_button_submit_has_icon']=="on"){
  971. ?><i class="<?php echo esc_html($style_values['form_button_submit_icon_style']); ?>"></i><?php
  972. }?>
  973.  
  974. </button>
  975. <button type="reset" class="reset" <?php if($rowimages->hc_required!='checked') echo 'style="display: none;"'?> id="hugeit_preview_button_reset_<?php echo absint($rowimages->id);?>" value="Reset">
  976. <?php if($style_values['form_button_icons_position']=="left" and $style_values['form_button_reset_has_icon']=="on"){?><i class="<?php echo esc_html($style_values['form_button_reset_icon_style']); ?>"></i><?php }?>
  977. <?php echo esc_html($rowimages->hc_field_label); ?>
  978. <?php if($style_values['form_button_icons_position']=="right" and $style_values['form_button_reset_has_icon']=="on"){?><i class="<?php echo esc_html($style_values['form_button_reset_icon_style']); ?>"></i><?php }?>
  979. </button>
  980. <span class="hugeOverlay"></span>
  981. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  982. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  983. </div>
  984. <?php
  985. return ob_get_clean();
  986. }
  987.  
  988. function hugeit_contact_buttonsSettingsHtml($rowimages) { ob_start(); ?>
  989. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>" data-fieldType="buttons">
  990. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  991. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  992. <h4><?php _e('Buttons','hugeit_contact');?></h4>
  993. <div class="fields-options">
  994. <div class="left">
  995. <div>
  996. <label class="input-block"><?php _e('Submit Button Text','hugeit_contact');?>:
  997. <input class="submitbutton" type="text" name="im_description<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->description); ?>" />
  998. </label>
  999. </div>
  1000. <div>
  1001. <label class="input-block">
  1002. <?php _e('Actions After Submission','hugeit_contact');?>:
  1003. <select id="form_checkbox_size" name="hc_other_field<?php echo absint($rowimages->id); ?>">
  1004. <option <?php if($rowimages->hc_other_field == 'go_to_url'){ echo 'selected="selected"'; } ?> value="go_to_url"><?php _e('Go To Url','hugeit_contact');?></option>
  1005. <option <?php if($rowimages->hc_other_field == 'print_success_message'){ echo 'selected="selected"'; } ?> value="print_success_message"><?php _e('Print Success Message','hugeit_contact');?></option>
  1006. <option <?php if($rowimages->hc_other_field == 'refresh_page'){ echo 'selected="selected"'; } ?> value="refresh_page"><?php _e('Refresh Page','hugeit_contact');?></option>
  1007. </select>
  1008. </label>
  1009. </div>
  1010. <div id="go_to_url_field" <?php if($rowimages->hc_other_field != 'go_to_url'){ echo "style='display:none;'";}?>>
  1011. <label class="input-block">
  1012. <?php _e('Go To This Url','hugeit_contact');?>:
  1013. <input class="" type="text" name="field_type<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->field_type); ?>" />
  1014. </label>
  1015. </div>
  1016. </div>
  1017. <div class="left">
  1018. <div>
  1019. <label class="input-block">
  1020. <?php _e('Reset Button Text','hugeit_contact');?>:
  1021. <input class="resetbutton" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  1022. </label>
  1023. </div>
  1024. <div>
  1025. <label>
  1026. <?php _e('Show Reset Button','hugeit_contact');?>
  1027. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  1028. <input class="showresetbutton" class="required" type="checkbox" <?php if($rowimages->hc_required == 'checked'){ echo 'checked';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="checked"/>
  1029. </label>
  1030. </div>
  1031. </div>
  1032. <div class="field-top-options-block">
  1033. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  1034. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  1035. </div>
  1036. </div>
  1037. <div class="clear"></div>
  1038. </li>
  1039. <?php
  1040. return ob_get_clean();
  1041. }
  1042. //10 Email //
  1043. function hugeit_contact_emailHtml($rowimages) { ob_start(); ?>
  1044. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  1045. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?> </label>
  1046. <div class="field-block input-text-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsInsideAlign')echo esc_html($rowimages->hc_input_show_default);?>">
  1047.  
  1048. <?php if($rowimages->hc_input_show_default=='formsInsideAlign' && $rowimages->hc_required == 'on') $placeholder = $rowimages->name.' *';
  1049. else $placeholder = $rowimages->name;?>
  1050.  
  1051. <input id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" type="email" placeholder="<?php echo esc_html($placeholder);?>" class="<?php if($rowimages->hc_required == 'on'){echo 'required';}?>" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?>/>
  1052. </div>
  1053. <span class="hugeit-error-message"></span>
  1054. <span class="hugeOverlay"></span>
  1055. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  1056. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  1057. </div>
  1058. <?php
  1059. return ob_get_clean();
  1060. }
  1061.  
  1062. function hugeit_contact_emailSettingsHtml($rowimages) { ob_start(); ?>
  1063. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  1064. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="Email"/>
  1065. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  1066. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Email";} ?></h4>
  1067. <div class="fields-options">
  1068. <div class="left">
  1069. <div>
  1070. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  1071. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  1072. </label>
  1073. </div>
  1074. <div>
  1075. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  1076. <select id="form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  1077. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  1078. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  1079. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  1080. <option <?php if($rowimages->hc_input_show_default == 'formsInsideAlign'){ echo 'selected="selected"'; } ?> value="formsInsideAlign"><?php _e('Inside Placeholder','hugeit_contact');?></option>
  1081. </select>
  1082. </label>
  1083. </div>
  1084. <div>
  1085. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  1086. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  1087. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  1088. </label>
  1089. <label class="input-block"><?php _e('Field Is Active','hugeit_contact');?>:
  1090. <input type="hidden" name="im_description<?php echo absint($rowimages->id); ?>" value=""/>
  1091. <input class="fieldisactive" class="isactive" type="checkbox" <?php if($rowimages->description == 'on'){ echo 'checked="checked"';} ?> name="im_description<?php echo absint($rowimages->id); ?>" value="on" />
  1092. </label>
  1093. </div>
  1094. </div>
  1095. <div class="left">
  1096. <div>
  1097. <label class="input-block"><?php _e('Value If Empty','hugeit_contact');?>:
  1098. <input class="placeholder" class="placeholder" class="text_area" type="text" name="titleimage<?php echo absint($rowimages->id); ?>" id="titleimage<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->name); ?>" value="<?php echo esc_html($rowimages->name); ?>">
  1099. </label>
  1100. </div>
  1101. <div>
  1102. <!-- Default Value -->
  1103. <label class="input-block"><?php _e('Default Value','hugeit_contact'); ?>
  1104. <input type="text" name="def_value<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->def_value; ?>" class="def_value" />
  1105. </label>
  1106. <!-- Default Value -->
  1107. </div>
  1108. </div>
  1109. <div class="field-top-options-block">
  1110. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  1111. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  1112. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  1113. </div>
  1114. </div>
  1115. <div class="clear"></div>
  1116. </li>
  1117. <?php
  1118. return ob_get_clean();
  1119. }
  1120.  
  1121. //Ready to Go Fields
  1122.  
  1123. //11 Name
  1124. function hugeit_contact_nameSurnameHtml($rowimages) { ob_start(); ?>
  1125. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  1126. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?> </label>
  1127. <div class="field-block input-name-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsLabelHide')echo esc_html($rowimages->hc_input_show_default);?>">
  1128. <input id="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>" type="text" placeholder="<?php echo esc_html($rowimages->name); ?>" class="pl_name <?php if($rowimages->hc_required == 'on'){echo 'required';}?>" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?>/>
  1129. <input id="hugeit_preview_textbox_1<?php echo absint($rowimages->id);?>" type="text" placeholder="<?php echo esc_html($rowimages->hc_other_field); ?>" class="pl_surname <?php if($rowimages->hc_required == 'on'){echo 'required';}?>" <?php if($rowimages->description != 'on'){echo 'disabled="disabled"';}?>/>
  1130. </div>
  1131. <span class="hugeit-error-message"></span>
  1132. <span class="hugeOverlay"></span>
  1133. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  1134. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  1135. </div>
  1136. <?php
  1137. return ob_get_clean();
  1138. }
  1139.  
  1140. function hugeit_contact_nameSurnameSettingsHtml($rowimages){ob_start(); ?>
  1141. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  1142. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="nameSurname"/>
  1143. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  1144. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Fullname";} ?></h4>
  1145. <div class="fields-options">
  1146. <div class="left">
  1147. <div>
  1148. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  1149. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  1150. </label>
  1151. </div>
  1152. <div>
  1153. <label class="input-block"><?php _e('Name Placeholder','hugeit_contact');?>:
  1154. <input class="placeholderName" class="text_area" type="text" name="titleimage<?php echo absint($rowimages->id); ?>" id="titleimage<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->name); ?>" value="<?php echo esc_html($rowimages->name); ?>">
  1155. </label>
  1156. </div>
  1157. <div>
  1158. <label class="input-block"><?php _e('Fields Are Required','hugeit_contact');?>:
  1159. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  1160. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  1161. </label>
  1162. <label class="input-block"><?php _e('Field Is Active','hugeit_contact');?>:
  1163. <input type="hidden" name="im_description<?php echo absint($rowimages->id); ?>" value=""/>
  1164. <input class="fieldisactive" class="isactive" type="checkbox" <?php if($rowimages->description == 'on'){ echo 'checked="checked"';} ?> name="im_description<?php echo absint($rowimages->id); ?>" value="on" />
  1165. </label>
  1166. </div>
  1167. </div>
  1168. <div class="left">
  1169. <div>
  1170. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  1171. <select id="ready_form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  1172. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  1173. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  1174. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  1175. <option <?php if($rowimages->hc_input_show_default == 'formsLabelHide'){ echo 'selected="selected"'; } ?> value="formsLabelHide">Hide Label</option>
  1176. </select>
  1177. </label>
  1178. </div>
  1179. <div>
  1180. <label class="input-block"><?php _e('Surname Placeholder','hugeit_contact');?>:
  1181. <input class="placeholderSur" class="text_area" type="text" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="hc_other_field<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->hc_other_field); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>">
  1182. </label>
  1183. </div>
  1184. </div>
  1185. <div class="field-top-options-block">
  1186. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  1187. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  1188. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  1189. </div>
  1190. </div>
  1191. <div class="clear"></div>
  1192. </li>
  1193. <?php
  1194. return ob_get_clean();
  1195. }
  1196.  
  1197. //12 Phone
  1198. function hugeit_contact_phoneHtml($rowimages) { ob_start(); ?>
  1199. <div class="hugeit-field-block" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  1200. <label class="<?php if($rowimages->hc_input_show_default!='1')echo esc_html($rowimages->hc_input_show_default);?>" for="hugeit_preview_textbox_<?php echo absint($rowimages->id);?>"><?php echo esc_html($rowimages->hc_field_label); if($rowimages->hc_required == 'on'){ echo '<em class="required-star">*</em>';} ?> </label>
  1201. <div class="field-block ready-phone-block <?php if($rowimages->hc_input_show_default=='formsAboveAlign'||$rowimages->hc_input_show_default=='formsInsideAlign')echo
  1202. esc_html($rowimages->hc_input_show_default);?>">
  1203. <?php if($rowimages->hc_input_show_default=='formsInsideAlign' && $rowimages->hc_required == 'on') $placeholder = $rowimages->hc_other_field.' *';
  1204. else $placeholder = $rowimages->hc_other_field;?>
  1205. <input type="tel" class="readyPhone" id="formsPhone<?php echo absint($rowimages->id); ?>" placeholder="<?php echo esc_html($placeholder); ?>">
  1206. </div>
  1207. <span class="hugeit-error-message"></span>
  1208. <span class="hugeOverlay"></span>
  1209. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>">
  1210. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" />
  1211. </div>
  1212. <script>
  1213. jQuery(document).ready(function(){
  1214. jQuery('#formsPhone<?php echo absint($rowimages->id); ?>').ForceNumericOnly();
  1215. jQuery('#formsPhone<?php echo absint($rowimages->id); ?>').intlTelInput({autoFormat: true,nationalMode:false,numberType: "MOBILE",autoHideDialCode: true,preferredCountries: [ "<?php echo $rowimages->name; ?>" ]});
  1216. });
  1217. </script>
  1218. <?php
  1219. return ob_get_clean();
  1220. }
  1221.  
  1222. function hugeit_contact_phoneSettingsHtml($rowimages){ob_start(); ?>
  1223. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>">
  1224. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_left_right); ?>" fileType="nameSurname"/>
  1225. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->ordering); ?>" />
  1226. <h4><?php if($rowimages->hc_field_label!=''){echo esc_html($rowimages->hc_field_label);}else{ echo "Phone";} ?></h4>
  1227. <div class="fields-options">
  1228. <div class="left">
  1229. <div>
  1230. <label class="input-block"><?php _e('Field Label','hugeit_contact');?>:
  1231. <input class="label" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo esc_html($rowimages->hc_field_label); ?>" />
  1232. </label>
  1233. </div>
  1234. <div>
  1235. <label class="input-block" for="form_label_position"><?php _e('Label Position','hugeit_contact');?>:
  1236. <select id="ready_form_label_position" name="hc_input_show_default<?php echo absint($rowimages->id); ?>">
  1237. <option <?php if($rowimages->hc_input_show_default == 'formsLeftAlign' || $rowimages->hc_input_show_default == '1'){ echo 'selected="selected"'; } ?> value="formsLeftAlign"><?php _e('Left Align','hugeit_contact');?></option>
  1238. <option <?php if($rowimages->hc_input_show_default == 'formsRightAlign'){ echo 'selected="selected"'; } ?> value="formsRightAlign"><?php _e('Right Align','hugeit_contact');?></option>
  1239. <option <?php if($rowimages->hc_input_show_default == 'formsAboveAlign'){ echo 'selected="selected"'; } ?> value="formsAboveAlign"><?php _e('Above Field','hugeit_contact');?></option>
  1240. </select>
  1241. </label>
  1242. </div>
  1243. <div>
  1244. <label class="input-block"><?php _e('Field Is Required','hugeit_contact');?>:
  1245. <input type="hidden" name="hc_required<?php echo absint($rowimages->id); ?>" value=""/>
  1246. <input class="required" type="checkbox" <?php if($rowimages->hc_required == 'on'){ echo 'checked="checked"';} ?> name="hc_required<?php echo absint($rowimages->id); ?>" value="on" />
  1247. </label>
  1248. </div>
  1249. </div>
  1250. <div class="left">
  1251. <div>
  1252. <label class="input-block"><?php _e('Placeholder','hugeit_contact');?>:
  1253. <input class="placeholder" class="placeholder" class="text_area" type="text" name="hc_other_field<?php echo absint($rowimages->id); ?>" id="hc_other_field<?php echo absint($rowimages->id); ?>" oldvalue="<?php echo esc_html($rowimages->hc_other_field); ?>" value="<?php echo esc_html($rowimages->hc_other_field); ?>">
  1254. </label>
  1255. </div>
  1256. <div>
  1257. <label class="input-block" for="form_phone"><?php _e('Default Country','hugeit_contact');?>:
  1258. <select id="form_phone" class="country-list" name="titleimage<?php echo absint($rowimages->id); ?>">
  1259. <option <?php selected( "af", $rowimages->name , true ); ?> value="af">Afghanistan (‫افغانستان‬‎)</option>
  1260. <option <?php selected( "al", $rowimages->name , true ); ?> value="al">Albania (Shqipëri)</option>
  1261. <option <?php selected( "dz", $rowimages->name , true ); ?> value="dz">Algeria (‫الجزائر‬‎)</option>
  1262. <option <?php selected( "as", $rowimages->name , true ); ?> value="as">American Samoa</option>
  1263. <option <?php selected( "ad", $rowimages->name , true ); ?> value="ad">Andorra</option>
  1264. <option <?php selected( "ao", $rowimages->name , true ); ?> value="ao">Angola</option>
  1265. <option <?php selected( "ai", $rowimages->name , true ); ?> value="ai">Anguilla</option>
  1266. <option <?php selected( "ag", $rowimages->name , true ); ?> value="ag">Antigua and Barbuda</option>
  1267. <option <?php selected( "ar", $rowimages->name , true ); ?> value="ar">Argentina</option>
  1268. <option <?php selected( "am", $rowimages->name , true ); ?> value="am">Armenia (Հայաստան)</option>
  1269. <option <?php selected( "aw", $rowimages->name , true ); ?> value="aw">Aruba</option>
  1270. <option <?php selected( "au", $rowimages->name , true ); ?> value="au">Australia</option>
  1271. <option <?php selected( "at", $rowimages->name , true ); ?> value="at">Austria (Österreich)</option>
  1272. <option <?php selected( "az", $rowimages->name , true ); ?> value="az">Azerbaijan (Azərbaycan)</option>
  1273. <option <?php selected( "bs", $rowimages->name , true ); ?> value="bs">Bahamas</option>
  1274. <option <?php selected( "bh", $rowimages->name , true ); ?> value="bh">Bahrain (‫البحرين‬‎)</option>
  1275. <option <?php selected( "bd", $rowimages->name , true ); ?> value="bd">Bangladesh (বাংলাদেশ)</option>
  1276. <option <?php selected( "bb", $rowimages->name , true ); ?> value="bb">Barbados</option>
  1277. <option <?php selected( "by", $rowimages->name , true ); ?> value="by">Belarus (Беларусь)</option>
  1278. <option <?php selected( "be", $rowimages->name , true ); ?> value="be">Belgium (België)</option>
  1279. <option <?php selected( "bz", $rowimages->name , true ); ?> value="bz">Belize</option>
  1280. <option <?php selected( "bj", $rowimages->name , true ); ?> value="bj">Benin (Bénin)</option>
  1281. <option <?php selected( "bm", $rowimages->name , true ); ?> value="bm">Bermuda</option>
  1282. <option <?php selected( "bt", $rowimages->name , true ); ?> value="bt">Bhutan (འབྲུག)</option>
  1283. <option <?php selected( "bo", $rowimages->name , true ); ?> value="bo">Bolivia</option>
  1284. <option <?php selected( "ba", $rowimages->name , true ); ?> value="ba">Bosnia and Herzegovina (Босна и Херцеговина)</option>
  1285. <option <?php selected( "bw", $rowimages->name , true ); ?> value="bw">Botswana</option>
  1286. <option <?php selected( "br", $rowimages->name , true ); ?> value="br">Brazil (Brasil)</option>
  1287. <option <?php selected( "io", $rowimages->name , true ); ?> value="io">British Indian Ocean Territory</option>
  1288. <option <?php selected( "vg", $rowimages->name , true ); ?> value="vg">British Virgin Islands</option>
  1289. <option <?php selected( "bn", $rowimages->name , true ); ?> value="bn">Brunei</option>
  1290. <option <?php selected( "bg", $rowimages->name , true ); ?> value="bg">Bulgaria (България)</option>
  1291. <option <?php selected( "bf", $rowimages->name , true ); ?> value="bf">Burkina Faso</option>
  1292. <option <?php selected( "bi", $rowimages->name , true ); ?> value="bi">Burundi (Uburundi)</option>
  1293. <option <?php selected( "kh", $rowimages->name , true ); ?> value="kh">Cambodia (កម្ពុជា)</option>
  1294. <option <?php selected( "cm", $rowimages->name , true ); ?> value="cm">Cameroon (Cameroun)</option>
  1295. <option <?php selected( "ca", $rowimages->name , true ); ?> value="ca">Canada</option>
  1296. <option <?php selected( "cv", $rowimages->name , true ); ?> value="cv">Cape Verde (Kabu Verdi)</option>
  1297. <option <?php selected( "bq", $rowimages->name , true ); ?> value="bq">Caribbean Netherlands</option>
  1298. <option <?php selected( "ky", $rowimages->name , true ); ?> value="ky">Cayman Islands</option>
  1299. <option <?php selected( "cf", $rowimages->name , true ); ?> value="cf">Central African Republic (République centrafricaine)</option>
  1300. <option <?php selected( "td", $rowimages->name , true ); ?> value="td">Chad (Tchad)</option>
  1301. <option <?php selected( "cl", $rowimages->name , true ); ?> value="cl">Chile</option>
  1302. <option <?php selected( "cn", $rowimages->name , true ); ?> value="cn">China (中国)</option>
  1303. <option <?php selected( "cx", $rowimages->name , true ); ?> value="cx">Christmas Island</option>
  1304. <option <?php selected( "cc", $rowimages->name , true ); ?> value="cc">Cocos (Keeling) Islands</option>
  1305. <option <?php selected( "co", $rowimages->name , true ); ?> value="co">Colombia</option>
  1306. <option <?php selected( "km", $rowimages->name , true ); ?> value="km">Comoros (‫جزر القمر‬‎)</option>
  1307. <option <?php selected( "cd", $rowimages->name , true ); ?> value="cd">Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)</option>
  1308. <option <?php selected( "cg", $rowimages->name , true ); ?> value="cg">Congo (Republic) (Congo-Brazzaville)</option>
  1309. <option <?php selected( "ck", $rowimages->name , true ); ?> value="ck">Cook Islands</option>
  1310. <option <?php selected( "cr", $rowimages->name , true ); ?> value="cr">Costa Rica</option>
  1311. <option <?php selected( "ci", $rowimages->name , true ); ?> value="ci">Côte d’Ivoire</option>
  1312. <option <?php selected( "hr", $rowimages->name , true ); ?> value="hr">Croatia (Hrvatska)</option>
  1313. <option <?php selected( "cu", $rowimages->name , true ); ?> value="cu">Cuba</option>
  1314. <option <?php selected( "cw", $rowimages->name , true ); ?> value="cw">Curaçao</option>
  1315. <option <?php selected( "cy", $rowimages->name , true ); ?> value="cy">Cyprus (Κύπρος)</option>
  1316. <option <?php selected( "cz", $rowimages->name , true ); ?> value="cz">Czech Republic (Česká republika)</option>
  1317. <option <?php selected( "dk", $rowimages->name , true ); ?> value="dk">Denmark (Danmark)</option>
  1318. <option <?php selected( "dj", $rowimages->name , true ); ?> value="dj">Djibouti</option>
  1319. <option <?php selected( "dm", $rowimages->name , true ); ?> value="dm">Dominica</option>
  1320. <option <?php selected( "do", $rowimages->name , true ); ?> value="do">Dominican Republic (República Dominicana)</option>
  1321. <option <?php selected( "ec", $rowimages->name , true ); ?> value="ec">Ecuador</option>
  1322. <option <?php selected( "eg", $rowimages->name , true ); ?> value="eg">Egypt (‫مصر‬‎)</option>
  1323. <option <?php selected( "sv", $rowimages->name , true ); ?> value="sv">El Salvador</option>
  1324. <option <?php selected( "gq", $rowimages->name , true ); ?> value="gq">Equatorial Guinea (Guinea Ecuatorial)</option>
  1325. <option <?php selected( "er", $rowimages->name , true ); ?> value="er">Eritrea</option>
  1326. <option <?php selected( "ee", $rowimages->name , true ); ?> value="ee">Estonia (Eesti)</option>
  1327. <option <?php selected( "et", $rowimages->name , true ); ?> value="et">Ethiopia</option>
  1328. <option <?php selected( "fk", $rowimages->name , true ); ?> value="fk">Falkland Islands (Islas Malvinas)</option>
  1329. <option <?php selected( "fo", $rowimages->name , true ); ?> value="fo">Faroe Islands (Føroyar)</option>
  1330. <option <?php selected( "fj", $rowimages->name , true ); ?> value="fj">Fiji</option>
  1331. <option <?php selected( "fi", $rowimages->name , true ); ?> value="fi">Finland (Suomi)</option>
  1332. <option <?php selected( "fr", $rowimages->name , true ); ?> value="fr">France</option>
  1333. <option <?php selected( "gf", $rowimages->name , true ); ?> value="gf">French Guiana (Guyane française)</option>
  1334. <option <?php selected( "pf", $rowimages->name , true ); ?> value="pf">French Polynesia (Polynésie française)</option>
  1335. <option <?php selected( "ga", $rowimages->name , true ); ?> value="ga">Gabon</option>
  1336. <option <?php selected( "gm", $rowimages->name , true ); ?> value="gm">Gambia</option>
  1337. <option <?php selected( "ge", $rowimages->name , true ); ?> value="ge">Georgia (საქართველო)</option>
  1338. <option <?php selected( "de", $rowimages->name , true ); ?> value="de">Germany (Deutschland)</option>
  1339. <option <?php selected( "gh", $rowimages->name , true ); ?> value="gh">Ghana (Gaana)</option>
  1340. <option <?php selected( "gi", $rowimages->name , true ); ?> value="gi">Gibraltar</option>
  1341. <option <?php selected( "gr", $rowimages->name , true ); ?> value="gr">Greece (Ελλάδα)</option>
  1342. <option <?php selected( "gl", $rowimages->name , true ); ?> value="gl">Greenland (Kalaallit Nunaat)</option>
  1343. <option <?php selected( "gd", $rowimages->name , true ); ?> value="gd">Grenada</option>
  1344. <option <?php selected( "gp", $rowimages->name , true ); ?> value="gp">Guadeloupe</option>
  1345. <option <?php selected( "gu", $rowimages->name , true ); ?> value="gu">Guam</option>
  1346. <option <?php selected( "gt", $rowimages->name , true ); ?> value="gt">Guatemala</option>
  1347. <option <?php selected( "gg", $rowimages->name , true ); ?> value="gg">Guernsey</option>
  1348. <option <?php selected( "gn", $rowimages->name , true ); ?> value="gn">Guinea (Guinée)</option>
  1349. <option <?php selected( "gw", $rowimages->name , true ); ?> value="gw">Guinea-Bissau (Guiné Bissau)</option>
  1350. <option <?php selected( "gy", $rowimages->name , true ); ?> value="gy">Guyana</option>
  1351. <option <?php selected( "ht", $rowimages->name , true ); ?> value="ht">Haiti</option>
  1352. <option <?php selected( "hn", $rowimages->name , true ); ?> value="hn">Honduras</option>
  1353. <option <?php selected( "hk", $rowimages->name , true ); ?> value="hk">Hong Kong (香港)</option>
  1354. <option <?php selected( "hu", $rowimages->name , true ); ?> value="hu">Hungary (Magyarország)</option>
  1355. <option <?php selected( "is", $rowimages->name , true ); ?> value="is">Iceland (Ísland)</option>
  1356. <option <?php selected( "in", $rowimages->name , true ); ?> value="in">India (भारत)</option>
  1357. <option <?php selected( "id", $rowimages->name , true ); ?> value="id">Indonesia</option>
  1358. <option <?php selected( "ir", $rowimages->name , true ); ?> value="ir">Iran (‫ایران‬‎)</option>
  1359. <option <?php selected( "iq", $rowimages->name , true ); ?> value="iq">Iraq (‫العراق‬‎)</option>
  1360. <option <?php selected( "ie", $rowimages->name , true ); ?> value="ie">Ireland</option>
  1361. <option <?php selected( "im", $rowimages->name , true ); ?> value="im">Isle of Man</option>
  1362. <option <?php selected( "il", $rowimages->name , true ); ?> value="il">Israel (‫ישראל‬‎)</option>
  1363. <option <?php selected( "it", $rowimages->name , true ); ?> value="it">Italy (Italia)</option>
  1364. <option <?php selected( "jm", $rowimages->name , true ); ?> value="jm">Jamaica</option>
  1365. <option <?php selected( "jp", $rowimages->name , true ); ?> value="jp">Japan (日本)</option>
  1366. <option <?php selected( "je", $rowimages->name , true ); ?> value="je">Jersey</option>
  1367. <option <?php selected( "jo", $rowimages->name , true ); ?> value="jo">Jordan (‫الأردن‬‎)</option>
  1368. <option <?php selected( "kz", $rowimages->name , true ); ?> value="kz">Kazakhstan (Казахстан)</option>
  1369. <option <?php selected( "ke", $rowimages->name , true ); ?> value="ke">Kenya</option>
  1370. <option <?php selected( "ki", $rowimages->name , true ); ?> value="ki">Kiribati</option>
  1371. <option <?php selected( "kw", $rowimages->name , true ); ?> value="kw">Kuwait (‫الكويت‬‎)</option>
  1372. <option <?php selected( "kg", $rowimages->name , true ); ?> value="kg">Kyrgyzstan (Кыргызстан)</option>
  1373. <option <?php selected( "la", $rowimages->name , true ); ?> value="la">Laos (ລາວ)</option>
  1374. <option <?php selected( "lv", $rowimages->name , true ); ?> value="lv">Latvia (Latvija)</option>
  1375. <option <?php selected( "lb", $rowimages->name , true ); ?> value="lb">Lebanon (‫لبنان‬‎)</option>
  1376. <option <?php selected( "ls", $rowimages->name , true ); ?> value="ls">Lesotho</option>
  1377. <option <?php selected( "lr", $rowimages->name , true ); ?> value="lr">Liberia</option>
  1378. <option <?php selected( "ly", $rowimages->name , true ); ?> value="ly">Libya (‫ليبيا‬‎)</option>
  1379. <option <?php selected( "li", $rowimages->name , true ); ?> value="li">Liechtenstein</option>
  1380. <option <?php selected( "lt", $rowimages->name , true ); ?> value="lt">Lithuania (Lietuva)</option>
  1381. <option <?php selected( "lu", $rowimages->name , true ); ?> value="lu">Luxembourg</option>
  1382. <option <?php selected( "mo", $rowimages->name , true ); ?> value="mo">Macau (澳門)</option>
  1383. <option <?php selected( "mk", $rowimages->name , true ); ?> value="mk">Macedonia (FYROM) (Македонија)</option>
  1384. <option <?php selected( "mg", $rowimages->name , true ); ?> value="mg">Madagascar (Madagasikara)</option>
  1385. <option <?php selected( "mw", $rowimages->name , true ); ?> value="mw">Malawi</option>
  1386. <option <?php selected( "my", $rowimages->name , true ); ?> value="my">Malaysia</option>
  1387. <option <?php selected( "mv", $rowimages->name , true ); ?> value="mv">Maldives</option>
  1388. <option <?php selected( "ml", $rowimages->name , true ); ?> value="ml">Mali</option>
  1389. <option <?php selected( "mt", $rowimages->name , true ); ?> value="mt">Malta</option>
  1390. <option <?php selected( "mh", $rowimages->name , true ); ?> value="mh">Marshall Islands</option>
  1391. <option <?php selected( "mq", $rowimages->name , true ); ?> value="mq">Martinique</option>
  1392. <option <?php selected( "mr", $rowimages->name , true ); ?> value="mr">Mauritania (‫موريتانيا‬‎)</option>
  1393. <option <?php selected( "mu", $rowimages->name , true ); ?> value="mu">Mauritius (Moris)</option>
  1394. <option <?php selected( "yt", $rowimages->name , true ); ?> value="yt">Mayotte</option>
  1395. <option <?php selected( "mx", $rowimages->name , true ); ?> value="mx">Mexico (México)</option>
  1396. <option <?php selected( "fm", $rowimages->name , true ); ?> value="fm">Micronesia</option>
  1397. <option <?php selected( "md", $rowimages->name , true ); ?> value="md">Moldova (Republica Moldova)</option>
  1398. <option <?php selected( "mc", $rowimages->name , true ); ?> value="mc">Monaco</option>
  1399. <option <?php selected( "mn", $rowimages->name , true ); ?> value="mn">Mongolia (Монгол)</option>
  1400. <option <?php selected( "me", $rowimages->name , true ); ?> value="me">Montenegro (Crna Gora)</option>
  1401. <option <?php selected( "ms", $rowimages->name , true ); ?> value="ms">Montserrat</option>
  1402. <option <?php selected( "ma", $rowimages->name , true ); ?> value="ma">Morocco (‫المغرب‬‎)</option>
  1403. <option <?php selected( "mz", $rowimages->name , true ); ?> value="mz">Mozambique (Moçambique)</option>
  1404. <option <?php selected( "mm", $rowimages->name , true ); ?> value="mm">Myanmar (Burma) (မြန်မာ)</option>
  1405. <option <?php selected( "na", $rowimages->name , true ); ?> value="na">Namibia (Namibië)</option>
  1406. <option <?php selected( "nr", $rowimages->name , true ); ?> value="nr">Nauru</option>
  1407. <option <?php selected( "np", $rowimages->name , true ); ?> value="np">Nepal (नेपाल)</option>
  1408. <option <?php selected( "nl", $rowimages->name , true ); ?> value="nl">Netherlands (Nederland)</option>
  1409. <option <?php selected( "nc", $rowimages->name , true ); ?> value="nc">New Caledonia (Nouvelle-Calédonie)</option>
  1410. <option <?php selected( "nz", $rowimages->name , true ); ?> value="nz">New Zealand</option>
  1411. <option <?php selected( "ni", $rowimages->name , true ); ?> value="ni">Nicaragua</option>
  1412. <option <?php selected( "ne", $rowimages->name , true ); ?> value="ne">Niger (Nijar)</option>
  1413. <option <?php selected( "ng", $rowimages->name , true ); ?> value="ng">Nigeria</option>
  1414. <option <?php selected( "nu", $rowimages->name , true ); ?> value="nu">Niue</option>
  1415. <option <?php selected( "nf", $rowimages->name , true ); ?> value="nf">Norfolk Island</option>
  1416. <option <?php selected( "kp", $rowimages->name , true ); ?> value="kp">North Korea (조선 민주주의 인민 공화국)</option>
  1417. <option <?php selected( "mp", $rowimages->name , true ); ?> value="mp">Northern Mariana Islands</option>
  1418. <option <?php selected( "no", $rowimages->name , true ); ?> value="no">Norway (Norge)</option>
  1419. <option <?php selected( "om", $rowimages->name , true ); ?> value="om">Oman (‫عُمان‬‎)</option>
  1420. <option <?php selected( "pk", $rowimages->name , true ); ?> value="pk">Pakistan (‫پاکستان‬‎)</option>
  1421. <option <?php selected( "pw", $rowimages->name , true ); ?> value="pw">Palau</option>
  1422. <option <?php selected( "ps", $rowimages->name , true ); ?> value="ps">Palestine (‫فلسطين‬‎)</option>
  1423. <option <?php selected( "pa", $rowimages->name , true ); ?> value="pa">Panama (Panamá)</option>
  1424. <option <?php selected( "pg", $rowimages->name , true ); ?> value="pg">Papua New Guinea</option>
  1425. <option <?php selected( "py", $rowimages->name , true ); ?> value="py">Paraguay</option>
  1426. <option <?php selected( "pe", $rowimages->name , true ); ?> value="pe">Peru (Perú)</option>
  1427. <option <?php selected( "ph", $rowimages->name , true ); ?> value="ph">Philippines</option>
  1428. <option <?php selected( "pl", $rowimages->name , true ); ?> value="pl">Poland (Polska)</option>
  1429. <option <?php selected( "pt", $rowimages->name , true ); ?> value="pt">Portugal</option>
  1430. <option <?php selected( "pr", $rowimages->name , true ); ?> value="pr">Puerto Rico</option>
  1431. <option <?php selected( "qa", $rowimages->name , true ); ?> value="qa">Qatar (‫قطر‬‎)</option>
  1432. <option <?php selected( "re", $rowimages->name , true ); ?> value="re">Réunion (La Réunion)</option>
  1433. <option <?php selected( "ro", $rowimages->name , true ); ?> value="ro">Romania (România)</option>
  1434. <option <?php selected( "ru", $rowimages->name , true ); ?> value="ru">Russia (Россия)</option>
  1435. <option <?php selected( "rw", $rowimages->name , true ); ?> value="rw">Rwanda</option>
  1436. <option <?php selected( "bl", $rowimages->name , true ); ?> value="bl">Saint Barthélemy (Saint-Barthélemy)</option>
  1437. <option <?php selected( "sh", $rowimages->name , true ); ?> value="sh">Saint Helena</option>
  1438. <option <?php selected( "kn", $rowimages->name , true ); ?> value="kn">Saint Kitts and Nevis</option>
  1439. <option <?php selected( "lc", $rowimages->name , true ); ?> value="lc">Saint Lucia</option>
  1440. <option <?php selected( "mf", $rowimages->name , true ); ?> value="mf">Saint Martin (Saint-Martin (partie française))</option>
  1441. <option <?php selected( "pm", $rowimages->name , true ); ?> value="pm">Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)</option>
  1442. <option <?php selected( "vc", $rowimages->name , true ); ?> value="vc">Saint Vincent and the Grenadines</option>
  1443. <option <?php selected( "ws", $rowimages->name , true ); ?> value="ws">Samoa</option>
  1444. <option <?php selected( "sm", $rowimages->name , true ); ?> value="sm">San Marino</option>
  1445. <option <?php selected( "st", $rowimages->name , true ); ?> value="st">São Tomé and Príncipe (São Tomé e Príncipe)</option>
  1446. <option <?php selected( "sa", $rowimages->name , true ); ?> value="sa">Saudi Arabia (‫المملكة العربية السعودية‬‎)</option>
  1447. <option <?php selected( "sn", $rowimages->name , true ); ?> value="sn">Senegal (Sénégal)</option>
  1448. <option <?php selected( "rs", $rowimages->name , true ); ?> value="rs">Serbia (Србија)</option>
  1449. <option <?php selected( "sc", $rowimages->name , true ); ?> value="sc">Seychelles</option>
  1450. <option <?php selected( "sl", $rowimages->name , true ); ?> value="sl">Sierra Leone</option>
  1451. <option <?php selected( "sg", $rowimages->name , true ); ?> value="sg">Singapore</option>
  1452. <option <?php selected( "sx", $rowimages->name , true ); ?> value="sx">Sint Maarten</option>
  1453. <option <?php selected( "sk", $rowimages->name , true ); ?> value="sk">Slovakia (Slovensko)</option>
  1454. <option <?php selected( "si", $rowimages->name , true ); ?> value="si">Slovenia (Slovenija)</option>
  1455. <option <?php selected( "sb", $rowimages->name , true ); ?> value="sb">Solomon Islands</option>
  1456. <option <?php selected( "so", $rowimages->name , true ); ?> value="so">Somalia (Soomaaliya)</option>
  1457. <option <?php selected( "za", $rowimages->name , true ); ?> value="za">South Africa</option>
  1458. <option <?php selected( "kr", $rowimages->name , true ); ?> value="kr">South Korea (대한민국)</option>
  1459. <option <?php selected( "ss", $rowimages->name , true ); ?> value="ss">South Sudan (‫جنوب السودان‬‎)</option>
  1460. <option <?php selected( "es", $rowimages->name , true ); ?> value="es">Spain (España)</option>
  1461. <option <?php selected( "lk", $rowimages->name , true ); ?> value="lk">Sri Lanka (ශ්‍රී ලංකාව)</option>
  1462. <option <?php selected( "sd", $rowimages->name , true ); ?> value="sd">Sudan (‫السودان‬‎)</option>
  1463. <option <?php selected( "sr", $rowimages->name , true ); ?> value="sr">Suriname</option>
  1464. <option <?php selected( "sj", $rowimages->name , true ); ?> value="sj">Svalbard and Jan Mayen</option>
  1465. <option <?php selected( "sz", $rowimages->name , true ); ?> value="sz">Swaziland</option>
  1466. <option <?php selected( "se", $rowimages->name , true ); ?> value="se">Sweden (Sverige)</option>
  1467. <option <?php selected( "ch", $rowimages->name , true ); ?> value="ch">Switzerland (Schweiz)</option>
  1468. <option <?php selected( "sy", $rowimages->name , true ); ?> value="sy">Syria (‫سوريا‬‎)</option>
  1469. <option <?php selected( "tw", $rowimages->name , true ); ?> value="tw">Taiwan (台灣)</option>
  1470. <option <?php selected( "tj", $rowimages->name , true ); ?> value="tj">Tajikistan</option>
  1471. <option <?php selected( "tz", $rowimages->name , true ); ?> value="tz">Tanzania</option>
  1472. <option <?php selected( "th", $rowimages->name , true ); ?> value="th">Thailand (ไทย)</option>
  1473. <option <?php selected( "tl", $rowimages->name , true ); ?> value="tl">Timor-Leste</option>
  1474. <option <?php selected( "tg", $rowimages->name , true ); ?> value="tg">Togo</option>
  1475. <option <?php selected( "tk", $rowimages->name , true ); ?> value="tk">Tokelau</option>
  1476. <option <?php selected( "to", $rowimages->name , true ); ?> value="to">Tonga</option>
  1477. <option <?php selected( "tt", $rowimages->name , true ); ?> value="tt">Trinidad and Tobago</option>
  1478. <option <?php selected( "tn", $rowimages->name , true ); ?> value="tn">Tunisia (‫تونس‬‎)</option>
  1479. <option <?php selected( "tr", $rowimages->name , true ); ?> value="tr">Turkey (Türkiye)</option>
  1480. <option <?php selected( "tm", $rowimages->name , true ); ?> value="tm">Turkmenistan</option>
  1481. <option <?php selected( "tc", $rowimages->name , true ); ?> value="tc">Turks and Caicos Islands</option>
  1482. <option <?php selected( "tv", $rowimages->name , true ); ?> value="tv">Tuvalu</option>
  1483. <option <?php selected( "vi", $rowimages->name , true ); ?> value="vi">U.S. Virgin Islands</option>
  1484. <option <?php selected( "ug", $rowimages->name , true ); ?> value="ug">Uganda</option>
  1485. <option <?php selected( "ua", $rowimages->name , true ); ?> value="ua">Ukraine (Україна)</option>
  1486. <option <?php selected( "ae", $rowimages->name , true ); ?> value="ae">United Arab Emirates (‫الإمارات العربية المتحدة‬‎)</option>
  1487. <option <?php selected( "gb", $rowimages->name , true ); ?> value="gb">United Kingdom</option>
  1488. <option <?php selected( "us", $rowimages->name , true ); ?> value="us">United States</option>
  1489. <option <?php selected( "uy", $rowimages->name , true ); ?> value="uy">Uruguay</option>
  1490. <option <?php selected( "uz", $rowimages->name , true ); ?> value="uz">Uzbekistan (Oʻzbekiston)</option>
  1491. <option <?php selected( "vu", $rowimages->name , true ); ?> value="vu">Vanuatu</option>
  1492. <option <?php selected( "va", $rowimages->name , true ); ?> value="va">Vatican City (Città del Vaticano)</option>
  1493. <option <?php selected( "ve", $rowimages->name , true ); ?> value="ve">Venezuela</option>
  1494. <option <?php selected( "vn", $rowimages->name , true ); ?> value="vn">Vietnam (Việt Nam)</option>
  1495. <option <?php selected( "wf", $rowimages->name , true ); ?> value="wf">Wallis and Futuna</option>
  1496. <option <?php selected( "eh", $rowimages->name , true ); ?> value="eh">Western Sahara (‫الصحراء الغربية‬‎)</option>
  1497. <option <?php selected( "ye", $rowimages->name , true ); ?> value="ye">Yemen (‫اليمن‬‎)</option>
  1498. <option <?php selected( "zm", $rowimages->name , true ); ?> value="zm">Zambia</option>
  1499. <option <?php selected( "zw", $rowimages->name , true ); ?> value="zw">Zimbabwe</option>
  1500. <option <?php selected( "ax", $rowimages->name , true ); ?> value="ax">Åland Islands</option>
  1501. </select>
  1502. </label>
  1503. </div>
  1504. </div>
  1505. <div class="field-top-options-block">
  1506. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  1507. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  1508. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  1509. </div>
  1510. </div>
  1511. <div class="clear"></div>
  1512. </li>
  1513. <?php
  1514. return ob_get_clean();
  1515. }
  1516.  
  1517. //13 License
  1518. function hugeit_contact_licenseHtml($rowimages,$themeId) { ob_start();
  1519. $themeId = sanitize_text_field($themeId);
  1520. global $wpdb;
  1521. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_style_fields where options_name = '".$themeId."' ";
  1522. $rows = $wpdb->get_results($query);
  1523. $style_values = array();
  1524. foreach ($rows as $row) {
  1525. $key = $row->name;
  1526. $value = $row->value;
  1527. $style_values[$key] = $value;
  1528. }
  1529. $linkName=$rowimages->hc_field_label;
  1530. $linkUrl=$rowimages->description;
  1531. $toReplace=' <a target="_blank" href="'.$linkUrl.'">'.$linkName.'</a> ';
  1532. $license=$rowimages->hc_other_field;
  1533. $license=preg_replace('/{link}/', $toReplace, $license);
  1534. ?>
  1535. <div class="hugeit-field-block hugeit-check-field" rel="huge-contact-field-<?php echo absint($rowimages->id); ?>">
  1536. <div class="field-block license-block" style="text-align:<?php echo $rowimages->hc_required; ?>;">
  1537. <label class="secondary-label">
  1538. <div class="checkbox-block big">
  1539. <input type="checkbox" value=""/>
  1540. <?php if($style_values['form_checkbox_type']=='circle'){ ?>
  1541. <i class="hugeicons-dot-circle-o active"></i>
  1542. <i class="hugeicons-circle-o passive"></i>
  1543. <?php }else{ ?>
  1544. <i class="hugeicons-check-square active"></i>
  1545. <i class="hugeicons-square-o passive"></i>
  1546. <?php }?>
  1547. </div>
  1548. <span class="sublable"><?php echo $license; ?></span>
  1549. </label>
  1550. </div>
  1551. <span class="hugeit-error-message"></span>
  1552. <span class="hugeOverlay"></span>
  1553. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->ordering; ?>">
  1554. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->hc_left_right; ?>" />
  1555. </div>
  1556. <?php
  1557. return ob_get_clean();
  1558. }
  1559.  
  1560. function hugeit_contact_licenseSettingsHtml($rowimages){ob_start(); ?>
  1561. <li id="huge-contact-field-<?php echo absint($rowimages->id); ?>" data-fieldNum="<?php echo absint($rowimages->id); ?>" data-fieldType="license">
  1562. <input type="hidden" class="left-right-position" name="hc_left_right<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->hc_left_right; ?>" fileType="license"/>
  1563. <input type="hidden" class="ordering" name="hc_ordering<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->ordering; ?>" />
  1564. <h4><?php if($rowimages->hc_field_label!=''){echo $rowimages->hc_field_label;}else{ echo "License";} ?></h4>
  1565. <div class="fields-options">
  1566. <div class="left">
  1567. <div>
  1568. <label class="input-block"><?php _e('Link Name','hugeit_contact');?>:
  1569. <input class="linkName" type="text" name="imagess<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->hc_field_label; ?>" />
  1570. </label>
  1571. </div>
  1572. <div>
  1573. <label class="input-block"><?php _e('Link URL','hugeit_contact');?>:
  1574. <input class="linkUrl" type="text" name="im_description<?php echo absint($rowimages->id); ?>" value="<?php echo $rowimages->description; ?>" />
  1575. </label>
  1576. </div>
  1577. <div>
  1578. <label class="input-block" for="form_label_position"><?php _e('Field Align','hugeit_contact');?>:
  1579. <select id="ready_form_label_position" class="fieldPos" name="hc_required<?php echo absint($rowimages->id); ?>">
  1580. <option <?php if($rowimages->hc_required == 'left'){ echo 'selected="selected"'; } ?> value="left"><?php _e('Left','hugeit_contact');?></option>
  1581. <option <?php if($rowimages->hc_required == 'right'){ echo 'selected="selected"'; } ?> value="right"><?php _e('Right','hugeit_contact');?></option>
  1582. </select>
  1583. </label>
  1584. </div>
  1585. </div>
  1586. <div class="left">
  1587. <div>
  1588. <label class="input-block"><?php _e('Field Content','hugeit_contact');?>:
  1589. <textarea class="fieldContent" type="text" name="hc_other_field<?php echo absint($rowimages->id); ?>" value=""><?php echo $rowimages->hc_other_field; ?></textarea>
  1590. </label>
  1591. </div>
  1592. </div>
  1593. <div class="field-top-options-block">
  1594. <a class="remove-field" href="#"><span><p><?php _e('Remove Field','hugeit_contact');?></p></span></a>
  1595. <a class="copy-field" href="#"><span><p><?php _e('Duplicate Field','hugeit_contact');?></p></span></a>
  1596. <a class="open-close" href="#"><span><p><?php _e('Edit Field','hugeit_contact');?></p></span></a>
  1597. </div>
  1598. </div>
  1599. <div class="clear"></div>
  1600. </li>
  1601. <?php
  1602. return ob_get_clean();
  1603. }
  1604. //ADD FIELDS
  1605. if (isset($_POST['task']) && $_POST['task']=='addFieldsTask') {
  1606.  
  1607. if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) {
  1608. return false;
  1609. }
  1610.  
  1611. $formId= absint($_POST['formId']);
  1612. $inputtype= sanitize_text_field($_POST['inputType']);
  1613. $themeId= sanitize_text_field($_POST['themeId']);
  1614. $inserttexttype = $wpdb->prefix . "huge_it_contact_contacts_fields";
  1615. switch ($inputtype) {
  1616. case 'text':
  1617. $inserttexttype = $wpdb->prefix . "huge_it_contact_contacts_fields";
  1618.  
  1619. $wpdb->insert(
  1620. $inserttexttype,
  1621. array(
  1622. 'name' => 'Placeholder',
  1623. 'hugeit_contact_id' => $formId,
  1624. 'description' => 'on',
  1625. 'conttype' => $inputtype,
  1626. 'hc_field_label' => 'Textbox',
  1627. 'hc_other_field' => '',
  1628. 'field_type' => 'text',
  1629. 'hc_required' => '',
  1630. 'ordering' => '0',
  1631. 'published' => 2,
  1632. 'hc_input_show_default' => '1',
  1633. 'hc_left_right' => 'left',
  1634. ),
  1635. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1636. );
  1637.  
  1638. $queryMax=$wpdb->prepare(
  1639. "SELECT MAX(id) AS resId
  1640. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1641. WHERE hugeit_contact_id=%d",
  1642. $formId
  1643. );
  1644. $row8=$wpdb->get_results($queryMax);
  1645. $fieldID= absint($row8[0]->resId);
  1646. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1647. $rowimages=$wpdb->get_results($fieldQuery);
  1648. echo json_encode(array(
  1649. "outputField" => hugeit_contact_textBoxHtml($rowimages[0]),
  1650. "outputFieldSettings" => hugeit_contact_textBoxSettingsHtml($rowimages[0])
  1651. ));
  1652.  
  1653. break;
  1654.  
  1655. case 'textarea':
  1656.  
  1657. $wpdb->insert(
  1658. $inserttexttype,
  1659. array(
  1660. 'name' => 'Placeholder',
  1661. 'hugeit_contact_id' => $formId,
  1662. 'description' => 'on',
  1663. 'conttype' => $inputtype,
  1664. 'hc_field_label' => 'Textarea',
  1665. 'hc_other_field' => '80',
  1666. 'field_type' => 'on',
  1667. 'hc_required' => 'on',
  1668. 'ordering' => 0,
  1669. 'published' => 2,
  1670. 'hc_input_show_default' => '1',
  1671. 'hc_left_right' => 'left',
  1672. ),
  1673. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1674. );
  1675.  
  1676. $queryMax=$wpdb->prepare(
  1677. "SELECT MAX(id) AS resId
  1678. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1679. WHERE hugeit_contact_id=%d",$formId
  1680. );
  1681. $row8=$wpdb->get_results($queryMax);
  1682. $fieldID=$row8[0]->resId;
  1683. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1684. $rowimages=$wpdb->get_results($fieldQuery);
  1685. echo json_encode(array(
  1686. "outputField" => hugeit_contact_textareaHtml($rowimages[0]),
  1687. "outputFieldSettings" =>hugeit_contact_textareaSettingsHtml($rowimages[0])
  1688. ));
  1689. break;
  1690.  
  1691. case 'selectbox':
  1692. $wpdb->insert(
  1693. $inserttexttype,
  1694. array(
  1695. 'name' => 'Option 1;;Option 2',
  1696. 'hugeit_contact_id' => $formId,
  1697. 'description' => '',
  1698. 'conttype' => $inputtype,
  1699. 'hc_field_label' => 'Selectbox',
  1700. 'hc_other_field' => 'Option 1',
  1701. 'ordering' => 0,
  1702. 'published' => 2,
  1703. 'hc_input_show_default' => '1',
  1704. 'hc_left_right' => 'left'
  1705. ),
  1706. array('%s', '%d', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1707. );
  1708.  
  1709. $queryMax=$wpdb->prepare(
  1710. "SELECT MAX(id) AS resId
  1711. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1712. WHERE hugeit_contact_id=%d",
  1713. $formId
  1714. );
  1715. $row8=$wpdb->get_results($queryMax);
  1716. $fieldID=$row8[0]->resId;
  1717. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1718. $rowimages=$wpdb->get_results($fieldQuery);
  1719. echo json_encode(array(
  1720. "outputField" => hugeit_contact_selectboxHtml($rowimages[0]),
  1721. "outputFieldSettings" =>hugeit_contact_selectboxSettingsHtml($rowimages[0])
  1722. ));
  1723. break;
  1724.  
  1725. case 'checkbox':
  1726.  
  1727. $wpdb->insert(
  1728. $inserttexttype,
  1729. array(
  1730. 'name' => 'On',
  1731. 'hugeit_contact_id' => $formId,
  1732. 'description' => 'on',
  1733. 'conttype' => $inputtype,
  1734. 'hc_field_label' => 'Checkbox',
  1735. 'hc_other_field' => '',
  1736. 'field_type' => '1',
  1737. 'published' => 2,
  1738. 'hc_input_show_default' => '1',
  1739. 'hc_required' => 'on',
  1740. 'hc_left_right' => 'left',
  1741. ),
  1742. array('%s', '%d', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1743. );
  1744.  
  1745. $queryMax=$wpdb->prepare(
  1746. "SELECT MAX(id) AS resId
  1747. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1748. WHERE hugeit_contact_id=%d",
  1749. $formId
  1750. );
  1751. $row8=$wpdb->get_results($queryMax);
  1752. $fieldID=$row8[0]->resId;
  1753. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1754. $rowimages=$wpdb->get_results($fieldQuery);
  1755. echo json_encode(array(
  1756. "outputField" => hugeit_contact_checkboxHtml($rowimages[0],$themeId),
  1757. "outputFieldSettings" =>hugeit_contact_checkboxSettingsHtml($rowimages[0])
  1758. ));
  1759. break;
  1760.  
  1761. case 'hidden_field':
  1762.  
  1763. $wpdb->insert(
  1764. $inserttexttype,
  1765. array(
  1766. 'name' => 'Hidden Field',
  1767. 'hugeit_contact_id' => $formId,
  1768. 'description' => 'Hidden Field',
  1769. 'conttype' => $inputtype,
  1770. 'hc_field_label' => 'Hidden Field',
  1771. 'hc_other_field' => 'user_id',
  1772. 'hc_required' => 'text',
  1773. 'ordering' => 0,
  1774. 'field_type' => '1',
  1775. 'published' => 2,
  1776. 'hc_input_show_default' => '1',
  1777. 'hc_left_right' => 'left',
  1778. ),
  1779. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d','%s','%s')
  1780. );
  1781.  
  1782. $queryMax=$wpdb->prepare(
  1783. "SELECT MAX(id) AS resId
  1784. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1785. WHERE hugeit_contact_id=%d",
  1786. $formId
  1787. );
  1788. $row8=$wpdb->get_results($queryMax);
  1789. $fieldID=$row8[0]->resId;
  1790. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1791. $rowimages=$wpdb->get_results($fieldQuery);
  1792. echo json_encode(array(
  1793. "outputField" => hugeit_contact_hiddenFieldHtml($rowimages[0],$themeId),
  1794. "outputFieldSettings" =>hugeit_contact_hiddenFieldSettingsHtml($rowimages[0])
  1795. ));
  1796. break;
  1797.  
  1798. case 'page_break':
  1799.  
  1800. $wpdb->insert(
  1801. $inserttexttype,
  1802. array(
  1803. 'name' => 'Page Break',
  1804. 'hugeit_contact_id' => $formId,
  1805. 'description' => 'Page Break',
  1806. 'conttype' => $inputtype,
  1807. 'hc_field_label' => 'Page Break',
  1808. 'hc_other_field' => 'page_break',
  1809. 'hc_required' => 'text',
  1810. 'ordering' => 0,
  1811. 'field_type' => '1',
  1812. 'published' => 2,
  1813. 'hc_input_show_default' => '1',
  1814. 'hc_left_right' => 'left',
  1815. ),
  1816. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d','%s','%s')
  1817. );
  1818.  
  1819. $queryMax=$wpdb->prepare(
  1820. "SELECT MAX(id) AS resId
  1821. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1822. WHERE hugeit_contact_id=%d",
  1823. $formId
  1824. );
  1825. $row8=$wpdb->get_results($queryMax);
  1826. $fieldID=$row8[0]->resId;
  1827. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1828. $rowimages=$wpdb->get_results($fieldQuery);
  1829. echo json_encode(array(
  1830. "outputField" => hugeit_contact_pageBreakHtml($rowimages[0],$themeId),
  1831. "outputFieldSettings" =>hugeit_contact_pageBreakSettingsHtml($rowimages[0])
  1832. ));
  1833. break;
  1834.  
  1835. case 'radio_box':
  1836.  
  1837. $wpdb->insert(
  1838. $inserttexttype,
  1839. array(
  1840. 'name' => 'option 1;;option 2',
  1841. 'hugeit_contact_id' => $formId,
  1842. 'description' => '2',
  1843. 'conttype' => $inputtype,
  1844. 'hc_field_label' => 'Radio Box',
  1845. 'hc_other_field' => 'option 1',
  1846. 'field_type' => '1',
  1847. 'hc_required' => 'text',
  1848. 'ordering' => 0,
  1849. 'published' => 2,
  1850. 'hc_input_show_default' => '1',
  1851. 'hc_left_right' => 'left',
  1852. ),
  1853. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1854. );
  1855.  
  1856. $queryMax=$wpdb->prepare(
  1857. "SELECT MAX(id) AS resId
  1858. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1859. WHERE hugeit_contact_id=%d",$formId
  1860. );
  1861. $row8=$wpdb->get_results($queryMax);
  1862. $fieldID=$row8[0]->resId;
  1863. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1864. $rowimages=$wpdb->get_results($fieldQuery);
  1865. echo json_encode(array(
  1866. "outputField" => hugeit_contact_radioboxHtml($rowimages[0],$themeId),
  1867. "outputFieldSettings" =>hugeit_contact_radioboxSettingsHtml($rowimages[0])
  1868. ));
  1869. break;
  1870.  
  1871. case 'file_box':
  1872. $wpdb->insert(
  1873. $inserttexttype,
  1874. array(
  1875. 'name' => '5',
  1876. 'hugeit_contact_id' => $formId,
  1877. 'description' => 'on',
  1878. 'conttype' => $inputtype,
  1879. 'hc_field_label' => 'Filebox',
  1880. 'hc_other_field' => 'jpg, jpeg, gif, png, docx, xlsx, pdf',
  1881. 'field_type' => '',
  1882. 'hc_required' => '',
  1883. 'ordering' => 0,
  1884. 'published' => 2,
  1885. 'hc_input_show_default' => '1',
  1886. 'hc_left_right' => 'left',
  1887. ),
  1888. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1889. );
  1890.  
  1891. $queryMax=$wpdb->prepare(
  1892. "SELECT MAX(id) AS resId
  1893. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1894. WHERE hugeit_contact_id=%d",$formId
  1895. );
  1896. $row8=$wpdb->get_results($queryMax);
  1897. $fieldID=$row8[0]->resId;
  1898. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1899. $rowimages=$wpdb->get_results($fieldQuery);
  1900. echo json_encode(array(
  1901. "outputField" => hugeit_contact_fileboxHtml($rowimages[0],$themeId),
  1902. "outputFieldSettings" =>hugeit_contact_fileboxSettingsHtml($rowimages[0])
  1903. ));
  1904. break;
  1905.  
  1906. case 'custom_text':
  1907. $wpdb->insert(
  1908. $inserttexttype,
  1909. array(
  1910. 'name' => 'Placeholder',
  1911. 'hugeit_contact_id' => $formId,
  1912. 'description' => 'on',
  1913. 'conttype' => $inputtype,
  1914. 'hc_field_label' => 'Label',
  1915. 'hc_other_field' => '80',
  1916. 'field_type' => 'on',
  1917. 'hc_required' => 'on',
  1918. 'ordering' => 0,
  1919. 'published' => 2,
  1920. 'hc_input_show_default' => '1',
  1921. 'hc_left_right' => 'left',
  1922. ),
  1923. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1924. );
  1925.  
  1926. $queryMax=$wpdb->prepare(
  1927. "SELECT MAX(id) AS resId
  1928. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1929. WHERE hugeit_contact_id=%d",$formId
  1930. );
  1931. $row8=$wpdb->get_results($queryMax);
  1932. $fieldID=$row8[0]->resId;
  1933. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1934. $rowimages=$wpdb->get_results($fieldQuery);
  1935. $queryMax=$wpdb->prepare(
  1936. "SELECT MAX(id) AS resId
  1937. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1938. WHERE hugeit_contact_id=%d",$formId
  1939. );
  1940. $row8=$wpdb->get_results($queryMax);
  1941. $fieldID=$row8[0]->resId;
  1942. echo json_encode(array( "outputField" => hugeit_contact_cutomtextHtml($rowimages[0]),
  1943. "outputFieldSettings" =>hugeit_contact_cutomtextSettingsHtml($rowimages[0]),
  1944. "customText" => "titleimage" . $fieldID
  1945. ));
  1946. break;
  1947.  
  1948. case 'captcha':
  1949. $query = "SELECT * from " . $wpdb->prefix . "huge_it_contact_general_options";
  1950. $rowspar = $wpdb->get_results($query);
  1951. $paramssld = array();
  1952. foreach ($rowspar as $rowpar) {
  1953. $key = $rowpar->name;
  1954. $value = $rowpar->value;
  1955. $paramssld[$key] = $value;
  1956. }
  1957. $capKeyPub=$paramssld['form_captcha_public_key'];
  1958. $capKeyPriv=$paramssld['form_captcha_private_key'];
  1959. if($capKeyPub != '' && $capKeyPriv != '') {
  1960.  
  1961. $wpdb->insert(
  1962. $inserttexttype,
  1963. array(
  1964. 'name' => 'image',
  1965. 'hugeit_contact_id' => $formId,
  1966. 'description' => '',
  1967. 'conttype' => $inputtype,
  1968. 'hc_field_label' => '',
  1969. 'hc_other_field' => '',
  1970. 'field_type' => '',
  1971. 'hc_required' => 'light',
  1972. 'ordering' => 0,
  1973. 'published' => 2,
  1974. 'hc_input_show_default' => '1',
  1975. 'hc_left_right' => 'left',
  1976. ),
  1977. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  1978. );
  1979.  
  1980. $queryMax=$wpdb->prepare(
  1981. "SELECT MAX(id) AS resId
  1982. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  1983. WHERE hugeit_contact_id=%d",$formId
  1984. );
  1985. $row8=$wpdb->get_results($queryMax);
  1986. $fieldID=$row8[0]->resId;
  1987. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  1988. $rowimages=$wpdb->get_results($fieldQuery);
  1989. $query = "SELECT * FROM " . $wpdb->prefix . "huge_it_contact_general_options";
  1990. $rowspar = $wpdb->get_results($query);
  1991. $paramssld = array();
  1992. foreach ($rowspar as $rowpar) {
  1993. $key = $rowpar->name;
  1994. $value = $rowpar->value;
  1995. $paramssld[$key] = $value;
  1996. }
  1997. $capKeyPub=$paramssld['form_captcha_public_key'];
  1998. echo json_encode(array(
  1999. "outputField" => hugeit_contact_captchaHtml($rowimages[0]),
  2000. "outputFieldSettings" => hugeit_contact_captchaSettingsHtml($rowimages[0]),
  2001. "captchaNum" => $capKeyPub
  2002. ));
  2003. } else {
  2004. echo json_encode(array(
  2005. "captchaNum" => $capKeyPub,
  2006. "toRedirect"=>"admin.php?page=hugeit_forms_main_page&task=captcha_keys&id=".$formId."&TB_iframe=1"
  2007. ));
  2008. }
  2009. break;
  2010. case 'simple_captcha_box'://simple captcha to do
  2011. $field_exists_in_the_form=$wpdb->prepare(
  2012. "SELECT id
  2013. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2014. WHERE conttype='simple_captcha_box' AND hugeit_contact_id=%d",
  2015. $formId
  2016. );
  2017. $field_exists_in_the_form=$wpdb->query($field_exists_in_the_form);
  2018. if( !$field_exists_in_the_form ){
  2019. $wpdb->insert(
  2020. $inserttexttype,
  2021. array(
  2022. 'name' => 'Type the code on the image',
  2023. 'hugeit_contact_id' => $formId,
  2024. 'description' => 'default',
  2025. 'conttype' => $inputtype,
  2026. 'hc_field_label' => 'Simple Captcha',
  2027. 'hc_other_field' => '{"digits":"5","color":"FF601C"}',
  2028. 'field_type' => 'simple_captcha_box',
  2029. 'hc_required' => '',
  2030. 'ordering' => 0,
  2031. 'published' => 2,
  2032. 'hc_input_show_default' => 'formsLeftAlign',
  2033. 'hc_left_right' => 'left',
  2034. ),
  2035. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2036. );
  2037.  
  2038. $queryMax=$wpdb->prepare(
  2039. "SELECT MAX(id) AS resId
  2040. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2041. WHERE hugeit_contact_id=%d",
  2042. $formId
  2043. );
  2044. $row81=$wpdb->get_results($queryMax);
  2045. $fieldID=$row81[0]->resId;
  2046. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2047. $rowimages=$wpdb->get_results($fieldQuery);
  2048. echo json_encode(array(
  2049. "outputField" => hugeit_contact_simple_captcha_html($rowimages[0]),
  2050. "outputFieldSettings"=>hugeit_contact_simple_captcha_settings_html($rowimages[0])
  2051. ));
  2052. }
  2053. else{
  2054. echo json_encode(array());
  2055. }
  2056. break;
  2057. case 'buttons':
  2058. $query=$wpdb->prepare(
  2059. "SELECT MAX(ordering) AS res
  2060. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2061. WHERE hugeit_contact_id=%d",
  2062. $formId
  2063. );
  2064. $row8=$wpdb->get_results($query);
  2065. $resOfMax=$row8[0]->res;
  2066. $resOfMax=$resOfMax+1;
  2067. $query=$wpdb->prepare(
  2068. "SELECT *
  2069. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2070. WHERE hugeit_contact_id=%d",
  2071. $formId
  2072. );
  2073. $row8=$wpdb->get_results($query);
  2074. $leftRightPos='left';
  2075. foreach ($row8 as $value) {
  2076. if($value->hc_left_right=='right') {
  2077. $leftRightPos='right';
  2078. }
  2079. }
  2080.  
  2081. $wpdb->insert(
  2082. $inserttexttype,
  2083. array(
  2084. 'name' => 'text',
  2085. 'hugeit_contact_id' => $formId,
  2086. 'description' => 'Submit',
  2087. 'conttype' => $inputtype,
  2088. 'hc_field_label' => 'Reset',
  2089. 'hc_other_field' => 'print_success_message',
  2090. 'field_type' => '',
  2091. 'hc_required' => '',
  2092. 'ordering' => $resOfMax,
  2093. 'published' => 2,
  2094. 'hc_input_show_default' => '1',
  2095. 'hc_left_right' => $leftRightPos,
  2096. ),
  2097. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2098. );
  2099.  
  2100. $queryMax=$wpdb->prepare(
  2101. "SELECT MAX(id) AS resId
  2102. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2103. WHERE hugeit_contact_id=%d",
  2104. $formId
  2105. );
  2106. $row8=$wpdb->get_results($queryMax);
  2107. $fieldID=$row8[0]->resId;
  2108. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2109. $rowimages=$wpdb->get_results($fieldQuery);
  2110. echo json_encode(array(
  2111. "outputField" => hugeit_contact_buttonsHtml($rowimages[0],$themeId),
  2112. "outputFieldSettings" => hugeit_contact_buttonsSettingsHtml($rowimages[0]),
  2113. "buttons" => 'button'
  2114. ));
  2115. break;
  2116.  
  2117. case 'e_mail':
  2118.  
  2119. $wpdb->insert(
  2120. $inserttexttype,
  2121. array(
  2122. 'name' => 'Type Your Email',
  2123. 'hugeit_contact_id' => $formId,
  2124. 'description' => 'on',
  2125. 'conttype' => $inputtype,
  2126. 'hc_field_label' => 'E-mail',
  2127. 'hc_other_field' => '',
  2128. 'field_type' => 'name',
  2129. 'hc_required' => '',
  2130. 'ordering' => 0,
  2131. 'published' => 2,
  2132. 'hc_input_show_default' => '1',
  2133. 'hc_left_right' => 'left',
  2134. ),
  2135. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2136. );
  2137.  
  2138. $queryMax=$wpdb->prepare(
  2139. "SELECT MAX(id) AS resId
  2140. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2141. WHERE hugeit_contact_id=%d",
  2142. $formId
  2143. );
  2144. $row8=$wpdb->get_results($queryMax);
  2145. $fieldID=$row8[0]->resId;
  2146. $fieldQuery=$wpdb->prepare(
  2147. "SELECT *
  2148. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2149. WHERE id=%d",
  2150. $fieldID
  2151. );
  2152. $rowimages=$wpdb->get_results($fieldQuery);
  2153. echo json_encode(array(
  2154. "outputField" => hugeit_contact_emailHtml($rowimages[0]),
  2155. "outputFieldSettings" => hugeit_contact_emailSettingsHtml($rowimages[0])
  2156. ));
  2157. break;
  2158.  
  2159. case 'nameSurname':
  2160.  
  2161. $wpdb->insert(
  2162. $inserttexttype,
  2163. array(
  2164. 'name' => 'Name',
  2165. 'hugeit_contact_id' => $formId,
  2166. 'description' => 'on',
  2167. 'conttype' => $inputtype,
  2168. 'hc_field_label' => 'Full Name',
  2169. 'hc_other_field' => 'Surname',
  2170. 'field_type' => 'name',
  2171. 'hc_required' => '',
  2172. 'ordering' => 0,
  2173. 'published' => 2,
  2174. 'hc_input_show_default' => '1',
  2175. 'hc_left_right' => 'left',
  2176. ),
  2177. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2178. );
  2179.  
  2180. $queryMax=$wpdb->prepare(
  2181. "SELECT MAX(id) AS resId
  2182. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2183. WHERE hugeit_contact_id=%d",
  2184. $formId
  2185. );
  2186. $row8=$wpdb->get_results($queryMax);
  2187. $fieldID=$row8[0]->resId;
  2188. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2189. $rowimages=$wpdb->get_results($fieldQuery);
  2190. echo json_encode(array(
  2191. "outputField" => hugeit_contact_nameSurnameHtml($rowimages[0]),
  2192. "outputFieldSettings"=>hugeit_contact_nameSurnameSettingsHtml($rowimages[0])
  2193. ));
  2194. break;
  2195.  
  2196. case 'phone':
  2197.  
  2198. $wpdb->insert(
  2199. $inserttexttype,
  2200. array(
  2201. 'name' => 'us',
  2202. 'hugeit_contact_id' => $formId,
  2203. 'description' => 'on',
  2204. 'conttype' => $inputtype,
  2205. 'hc_field_label' => 'Phone',
  2206. 'hc_other_field' => 'e.g. +1 123 4567',
  2207. 'field_type' => 'name',
  2208. 'hc_required' => '',
  2209. 'ordering' => 0,
  2210. 'published' => 2,
  2211. 'hc_input_show_default' => '1',
  2212. 'hc_left_right' => 'left',
  2213. ),
  2214. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2215. );
  2216.  
  2217. $queryMax=$wpdb->prepare(
  2218. "SELECT MAX(id) AS resId
  2219. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2220. WHERE hugeit_contact_id=%d",
  2221. $formId
  2222. );
  2223. $row8=$wpdb->get_results($queryMax);
  2224. $fieldID=$row8[0]->resId;
  2225. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2226. $rowimages=$wpdb->get_results($fieldQuery);
  2227. echo json_encode(array(
  2228. "outputField" => hugeit_contact_phoneHtml($rowimages[0]),
  2229. "outputFieldSettings"=>hugeit_contact_phoneSettingsHtml($rowimages[0])
  2230. ));
  2231. break;
  2232.  
  2233. case 'license':
  2234.  
  2235. $wpdb->insert(
  2236. $inserttexttype,
  2237. array(
  2238. 'name' => 'License',
  2239. 'hugeit_contact_id' => $formId,
  2240. 'description' => 'http://huge-it.com',
  2241. 'conttype' => $inputtype,
  2242. 'hc_field_label' => 'Policy Agreement',
  2243. 'hc_other_field' => 'I have read and agreed to the {link}',
  2244. 'field_type' => 'name',
  2245. 'hc_required' => 'left',
  2246. 'ordering' => 0,
  2247. 'published' => 2,
  2248. 'hc_input_show_default' => '1',
  2249. 'hc_left_right' => 'left',
  2250. ),
  2251. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s')
  2252. );
  2253.  
  2254. $queryMax=$wpdb->prepare(
  2255. "SELECT MAX(id) AS resId
  2256. FROM ".$wpdb->prefix."huge_it_contact_contacts_fields
  2257. WHERE hugeit_contact_id=%d",
  2258. $formId
  2259. );
  2260. $row8=$wpdb->get_results($queryMax);
  2261. $fieldID=$row8[0]->resId;
  2262. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2263. $rowimages=$wpdb->get_results($fieldQuery);
  2264. echo json_encode(array(
  2265. "outputField" => hugeit_contact_licenseHtml($rowimages[0],$themeId),
  2266. "outputFieldSettings"=>hugeit_contact_licenseSettingsHtml($rowimages[0])
  2267. ));
  2268. break;
  2269.  
  2270. }
  2271.  
  2272. }
  2273. //REMOVE FIELDS
  2274. if( isset($_POST['task']) && $_POST['task']=='removeFieldTask') {
  2275. if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) {
  2276. return false;
  2277. }
  2278.  
  2279. $formId = absint($_POST['formId']);
  2280. $all = $_POST['formData'];
  2281. parse_str("$all",$myArray);
  2282. $fieldID = absint($_POST['fieldId']);
  2283. $_POSTED= array_map('sanitize_text_field', $myArray);
  2284. $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId);
  2285. $rowim=$wpdb->get_results($query);
  2286. if(isset($_POSTED["name"])){
  2287. if($_POSTED["name"] != ''){
  2288. $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field($_POSTED["name"]), $formId));
  2289. $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));
  2290. }
  2291. }
  2292. foreach ($rowim as $key=>$rowimages){
  2293. if(isset($_POSTED)&&isset($_POSTED["hc_left_right".$rowimages->id.""])){
  2294. if($_POSTED["hc_left_right".$rowimages->id.""]){
  2295. $id = absint($rowimages->id);
  2296. if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) )
  2297. $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 ) );
  2298. if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) {
  2299. $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 ) );
  2300. }
  2301. if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) {
  2302. $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 ) );
  2303. }
  2304. if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) {
  2305. $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 ) );
  2306. }
  2307. if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) {
  2308. $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 ) );
  2309. }
  2310. if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) {
  2311. $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 ) );
  2312. }
  2313. if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) {
  2314. $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 ) );
  2315. }
  2316. if ( isset( $_POSTED[ "def_value" . $rowimages->id . "" ] ) ) {
  2317. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET def_value = %s WHERE id = %d", sanitize_text_field($_POSTED[ "def_value" . $rowimages->id . "" ]), $id ) );
  2318. }
  2319. if ( isset( $_POSTED[ "mask_on" . $rowimages->id . "" ] ) ) {
  2320. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET mask_on = %s WHERE id = %d", sanitize_text_field($_POSTED[ "mask_on" . $rowimages->id . "" ]), $id ) );
  2321. }
  2322. if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) {
  2323. $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 ) );
  2324. }
  2325. 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));
  2326. }
  2327. }
  2328. }
  2329. $wpdb->delete(
  2330. $wpdb->prefix."huge_it_contact_contacts_fields",
  2331. array('id' => $fieldID),
  2332. array('%d')
  2333. );
  2334.  
  2335. echo json_encode(array(
  2336. "removedField" => $fieldID
  2337. ));
  2338. }
  2339. //DUBLICATE FIELDS
  2340. if (isset($_POST['task']) && $_POST['task'] == 'dublicateFieldTask'){
  2341. if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) {
  2342. return false;
  2343. }
  2344. $formId = absint($_POST['formId']);
  2345. $themeId = absint($_POST['themeId']);
  2346. $all=$_POST['formData'];
  2347. parse_str("$all",$myArray);
  2348. $fieldID = absint($_POST['fieldId']);
  2349. $_POSTED = array_map('sanitize_text_field', $myArray);
  2350. $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId);
  2351. $rowim = $wpdb->get_results($query);
  2352. if (isset($_POSTED["name"])){
  2353. if($_POSTED["name"] != '') {
  2354. $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_it_contact_contacts SET name = %s WHERE id = %d ", sanitize_text_field($_POSTED["name"]), $formId));
  2355. $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));
  2356. }
  2357. }
  2358. foreach ( $rowim as $key => $rowimages ) {
  2359. if ( isset( $_POSTED ) && isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) {
  2360. if ( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) {
  2361. $id = absint($rowimages->id);
  2362. if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) ) {
  2363. $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 ) );
  2364. }
  2365. if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) {
  2366. $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 ) );
  2367. }
  2368. if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) {
  2369. $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 ) );
  2370. }
  2371. if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) {
  2372. $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 ) );
  2373. }
  2374. if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) {
  2375. $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 ) );
  2376. }
  2377. if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) {
  2378. $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 ) );
  2379. }
  2380. if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) {
  2381. $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 ) );
  2382. }
  2383. if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) {
  2384. $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 ) );
  2385. }
  2386. if ( isset( $_POSTED[ "def_value" . $rowimages->id . "" ] ) && $_POSTED[ "def_value" . $rowimages->id . "" ] ) {
  2387. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET def_value = %s WHERE id = %d", sanitize_text_field($_POSTED[ "def_value" . $rowimages->id . "" ]), $id ) );
  2388. }
  2389. if ( isset( $_POSTED[ "mask_on" . $rowimages->id . "" ] ) && $_POSTED[ "mask_on" . $rowimages->id . "" ]) {
  2390. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET mask_on = %s WHERE id = %d", sanitize_text_field($_POSTED[ "mask_on" . $rowimages->id . "" ]), $id ) );
  2391. }
  2392. if ( isset( $_POSTED[ "hc_input_show_default" . $rowimages->id . "" ] ) ) {
  2393. $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 ) );
  2394. }
  2395. }
  2396. }
  2397. }
  2398. ///ENDS SAVING
  2399. $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID);
  2400. $rowduble=$wpdb->get_row($query);
  2401. $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC", $formId);
  2402. $rowplusorder=$wpdb->get_results($query);
  2403.  
  2404. foreach ( $rowplusorder as $key => $rowplusorders ) {
  2405. if ( $rowplusorders->ordering > $rowduble->ordering ) {
  2406. $rowplusorderspl = $rowplusorders->ordering + 1;
  2407. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields SET ordering = %d WHERE id = %d ", $rowplusorderspl, $rowplusorders->id ) );
  2408. }
  2409. }
  2410.  
  2411. $inserttexttype = $wpdb->prefix . "huge_it_contact_contacts_fields";
  2412. $rowdubleorder=$rowduble->ordering+1;
  2413. $inputtype=$rowduble->conttype;
  2414.  
  2415. $wpdb->insert(
  2416. $inserttexttype,
  2417. array(
  2418. 'name' => $rowduble->name,
  2419. 'hugeit_contact_id' => $rowduble->hugeit_contact_id,
  2420. 'description' => $rowduble->description,
  2421. 'conttype' => $rowduble->conttype,
  2422. 'hc_field_label' => $rowduble->hc_field_label,
  2423. 'hc_other_field' => $rowduble->hc_other_field,
  2424. 'field_type' => $rowduble->field_type,
  2425. 'hc_required' => $rowduble->hc_required,
  2426. 'ordering' => $rowdubleorder,
  2427. 'published' => $rowduble->published,
  2428. 'hc_input_show_default' => $rowduble->hc_input_show_default,
  2429. 'def_value' => $rowduble->def_value,
  2430. 'mask_on' => $rowduble->mask_on,
  2431. 'hc_left_right' => $rowduble->hc_left_right,
  2432. ),
  2433. array('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s','%s', '%s')
  2434. );
  2435.  
  2436. $queryMax=$wpdb->prepare("SELECT MAX(id) AS resId FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE hugeit_contact_id=%d",$formId);
  2437. $row8=$wpdb->get_results($queryMax);
  2438. $fieldID2=$row8[0]->resId;
  2439. $fieldQuery=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields WHERE id=%d",$fieldID2);
  2440. $rowimages=$wpdb->get_results($fieldQuery);
  2441.  
  2442. switch ( $inputtype ) {
  2443. case 'text':
  2444. echo json_encode( array(
  2445. "outputField" => hugeit_contact_textBoxHtml( $rowimages[0] ),
  2446. "outputFieldSettings" => hugeit_contact_textBoxSettingsHtml( $rowimages[0] ),
  2447. "beforeId" => $fieldID,
  2448. ) );
  2449. break;
  2450.  
  2451. case 'textarea':
  2452. echo json_encode( array(
  2453. "outputField" => hugeit_contact_textareaHtml( $rowimages[0] ),
  2454. "outputFieldSettings" => hugeit_contact_textareaSettingsHtml( $rowimages[0] ),
  2455. "beforeId" => $fieldID,
  2456. ) );
  2457. break;
  2458.  
  2459. case 'selectbox':
  2460. echo json_encode( array(
  2461. "outputField" => hugeit_contact_selectboxHtml( $rowimages[0] ),
  2462. "outputFieldSettings" => hugeit_contact_selectboxSettingsHtml( $rowimages[0] ),
  2463. "beforeId" => $fieldID,
  2464. ) );
  2465. break;
  2466.  
  2467. case 'checkbox':
  2468. echo json_encode( array(
  2469. "outputField" => hugeit_contact_checkboxHtml( $rowimages[0], $themeId ),
  2470. "outputFieldSettings" => hugeit_contact_checkboxSettingsHtml( $rowimages[0] ),
  2471. "beforeId" => $fieldID,
  2472. ) );
  2473. break;
  2474.  
  2475. case 'radio_box':
  2476. echo json_encode( array(
  2477. "outputField" => hugeit_contact_radioboxHtml( $rowimages[0], $themeId ),
  2478. "outputFieldSettings" => hugeit_contact_radioboxSettingsHtml( $rowimages[0] ),
  2479. "beforeId" => $fieldID,
  2480. ) );
  2481. break;
  2482.  
  2483. case 'file_box':
  2484. echo json_encode( array(
  2485. "outputField" => hugeit_contact_fileboxHtml( $rowimages[0], $themeId ),
  2486. "outputFieldSettings" => hugeit_contact_fileboxSettingsHtml( $rowimages[0] ),
  2487. "beforeId" => $fieldID,
  2488. ) );
  2489. break;
  2490.  
  2491. case 'custom_text':
  2492. echo json_encode( array(
  2493. "outputField" => hugeit_contact_cutomtextHtml( $rowimages[0] ),
  2494. "outputFieldSettings" => hugeit_contact_cutomtextSettingsHtml( $rowimages[0] ),
  2495. "customText" => "titleimage" . $fieldID . "",
  2496. "beforeId" => $fieldID,
  2497. ) );
  2498. break;
  2499.  
  2500. case 'e_mail':
  2501. echo json_encode( array(
  2502. "outputField" => hugeit_contact_emailHtml( $rowimages[0] ),
  2503. "outputFieldSettings" => hugeit_contact_emailSettingsHtml( $rowimages[0] ),
  2504. "beforeId" => $fieldID,
  2505. ) );
  2506. break;
  2507.  
  2508. case 'nameSurname':
  2509. echo json_encode( array(
  2510. "outputField" => hugeit_contact_nameSurnameHtml( $rowimages[0] ),
  2511. "outputFieldSettings" => hugeit_contact_nameSurnameSettingsHtml( $rowimages[0] ),
  2512. "beforeId" => $fieldID,
  2513. ) );
  2514. break;
  2515.  
  2516. case 'phone':
  2517. echo json_encode( array(
  2518. "outputField" => hugeit_contact_phoneHtml( $rowimages[0] ),
  2519. "outputFieldSettings" => hugeit_contact_phoneSettingsHtml( $rowimages[0] ),
  2520. "beforeId" => $fieldID,
  2521. ) );
  2522. break;
  2523.  
  2524. case 'hidden_field':
  2525. echo json_encode( array(
  2526. "outputField" => hugeit_contact_hiddenFieldHtml( $rowimages[0], $themeId ),
  2527. "outputFieldSettings" => hugeit_contact_hiddenFieldSettingsHtml($rowimages[0]),
  2528. "beforeId" => $fieldID,
  2529. ) );
  2530. break;
  2531.  
  2532. case 'page_break':
  2533. echo json_encode( array(
  2534. "outputField" => hugeit_contact_pageBreakHtml( $rowimages[0], $themeId ),
  2535. "outputFieldSettings" => hugeit_contact_pageBreakSettingsHtml($rowimages[0]),
  2536. "beforeId" => $fieldID,
  2537. ) );
  2538. break;
  2539.  
  2540. }
  2541. }
  2542. //Save Form Action
  2543. if ( isset( $_POST['task'] ) && $_POST['task'] == 'saveEntireForm' ) {
  2544. if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) {
  2545. return false;
  2546. }
  2547. $formId = sanitize_text_field($_POST['formId']);
  2548.  
  2549. $_POSTED=$_POST['formData'];
  2550.  
  2551.  
  2552. $query = $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "huge_it_contact_contacts_fields WHERE hugeit_contact_id = %d ORDER BY id ASC", $formId );
  2553. $rowim = $wpdb->get_results( $query );
  2554.  
  2555. if ( isset( $_POSTED ) ) {
  2556. if (isset($_POSTED["name"])) {
  2557. if ($_POSTED["name"] != '') {
  2558. $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));
  2559. $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));
  2560. $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));
  2561. }
  2562. }
  2563.  
  2564. if (isset($_POSTED['hugeit_contact_show_title_for_form_' . $formId]) && in_array($_POSTED['hugeit_contact_show_title_for_form_' . $formId], array('yes', 'no', 'default'))) {
  2565. update_option('hugeit_contact_show_title_for_form_' . $formId, $_POSTED['hugeit_contact_show_title_for_form_' . $formId]);
  2566. }
  2567. //Allowed html tags for wp_editor
  2568. global $allowedposttags;
  2569. $allowed_atts = array(
  2570. 'align' => array(),
  2571. 'type' => array(),
  2572. 'style' => array(),
  2573. 'src' => array(),
  2574. 'alt' => array(),
  2575. 'href' => array(),
  2576. 'target' => array(),
  2577. 'value' => array(),
  2578. 'name' => array(),
  2579. 'for' => array(),
  2580. 'width' => array(),
  2581. 'height' => array(),
  2582. 'data' => array(),
  2583. 'title' => array(),
  2584. );
  2585. $allowedposttags['form'] = $allowed_atts;
  2586. $allowedposttags['label'] = $allowed_atts;
  2587. $allowedposttags['input'] = $allowed_atts;
  2588. $allowedposttags['textarea'] = $allowed_atts;
  2589. $allowedposttags['strong'] = $allowed_atts;
  2590. $allowedposttags['small'] = $allowed_atts;
  2591. $allowedposttags['table'] = $allowed_atts;
  2592. $allowedposttags['span'] = $allowed_atts;
  2593. $allowedposttags['abbr'] = $allowed_atts;
  2594. $allowedposttags['code'] = $allowed_atts;
  2595. $allowedposttags['pre'] = $allowed_atts;
  2596. $allowedposttags['div'] = $allowed_atts;
  2597. $allowedposttags['img'] = $allowed_atts;
  2598. $allowedposttags['h1'] = $allowed_atts;
  2599. $allowedposttags['h2'] = $allowed_atts;
  2600. $allowedposttags['h3'] = $allowed_atts;
  2601. $allowedposttags['h4'] = $allowed_atts;
  2602. $allowedposttags['h5'] = $allowed_atts;
  2603. $allowedposttags['h6'] = $allowed_atts;
  2604. $allowedposttags['ol'] = $allowed_atts;
  2605. $allowedposttags['ul'] = $allowed_atts;
  2606. $allowedposttags['li'] = $allowed_atts;
  2607. $allowedposttags['em'] = $allowed_atts;
  2608. $allowedposttags['hr'] = $allowed_atts;
  2609. $allowedposttags['br'] = $allowed_atts;
  2610. $allowedposttags['tr'] = $allowed_atts;
  2611. $allowedposttags['td'] = $allowed_atts;
  2612. $allowedposttags['p'] = $allowed_atts;
  2613. $allowedposttags['a'] = $allowed_atts;
  2614. $allowedposttags['b'] = $allowed_atts;
  2615. $allowedposttags['i'] = $allowed_atts;
  2616. //Allowed html tags for wp_editor
  2617. foreach ($rowim as $key => $rowimages) {
  2618. $inputAllowedTypes = array('text', 'custom_text', 'textarea', 'selectbox', 'checkbox', 'radio_box', 'file_box', 'e_mail', 'buttons', 'captcha', 'simple_captcha_box','hidden_field','page_break');
  2619. $inputtype = $rowimages->conttype;
  2620. if (in_array($inputtype, $inputAllowedTypes)) {
  2621. $id = $rowimages->id;
  2622.  
  2623. $hc_other_field = '';
  2624.  
  2625. if ( isset($_POSTED['hc_other_field' . $id]) ) {
  2626. $hc_other_field = is_array($_POSTED['hc_other_field' . $id]) ? json_encode($_POSTED['hc_other_field' . $id]) : $_POSTED['hc_other_field' . $id];
  2627. }
  2628. $row_updated = $wpdb->update(
  2629. $wpdb->prefix . "huge_it_contact_contacts_fields",
  2630. array(
  2631. 'ordering' => isset($_POSTED['hc_ordering' . $id])? intval($_POSTED['hc_ordering' . $id]):0,
  2632. 'hc_required' => isset($_POSTED['hc_required' . $id])? sanitize_text_field($_POSTED['hc_required' . $id]):'off',
  2633. 'hc_input_show_default' => isset($_POSTED['hc_input_show_default' . $id])? sanitize_text_field($_POSTED['hc_input_show_default' . $id]):'',
  2634. 'hc_left_right' => isset($_POSTED['hc_left_right' . $id]) ? sanitize_text_field($_POSTED['hc_left_right' . $id]) : 'left',
  2635. 'hc_other_field' => $hc_other_field,
  2636. 'name' => isset($_POSTED['titleimage' . $id]) ? wp_kses($_POSTED['titleimage' . $id],$allowedposttags) : '',
  2637. 'description' => isset($_POSTED['im_description' . $id]) ? sanitize_text_field($_POSTED['im_description' . $id]) : '',
  2638. 'hc_field_label' => isset($_POSTED['imagess' . $id])? sanitize_text_field(wp_unslash($_POSTED['imagess' . $id])):'',
  2639. 'def_value' => isset($_POSTED['def_value' . $id])? sanitize_text_field(wp_unslash($_POSTED['def_value' . $id])):'',
  2640. 'mask_on' => isset($_POSTED['mask_on' . $id])? sanitize_text_field(wp_unslash($_POSTED['mask_on' . $id])):'',
  2641. 'field_type' => isset($_POSTED['field_type' . $id]) ? sanitize_text_field($_POSTED['field_type' . $id]) : '',
  2642. ),
  2643. array('id' => $rowimages->id)
  2644. );
  2645. }
  2646. }
  2647.  
  2648.  
  2649. echo json_encode(array("saveForm" => "success"));
  2650. }
  2651. }
  2652. /* End Save Entire Form */
  2653.  
  2654. /* Change Theme */
  2655. if (isset($_POST['task'])&&$_POST['task']=='changeFormTheme') {
  2656. if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'builder_nonce')) {
  2657. return false;
  2658. }
  2659.  
  2660. $themeId = absint($_POST['themeId']);
  2661. $formId = absint($_POST['formId']);
  2662. $all = $_POST['formData'];
  2663. parse_str("$all",$myArray);
  2664. $_POSTED = array_map('sanitize_text_field', $myArray);
  2665. $query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_it_contact_contacts_fields where hugeit_contact_id = %d order by id ASC",$formId);
  2666. $rowim=$wpdb->get_results($query);
  2667. if ( isset( $_POSTED["name"] ) ) {
  2668. if ( $_POSTED["name"] != '' ) {
  2669. $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 ) );
  2670. $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts SET hc_yourstyle = %s WHERE id = %d ", intval($themeId), $formId ) );
  2671. }
  2672. }
  2673. foreach ( $rowim as $key => $rowimages ) {
  2674. if ( isset( $_POSTED ) && isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) {
  2675. if ( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) {
  2676. $id = absint($rowimages->id);
  2677. if ( isset( $_POSTED[ "field_type" . $rowimages->id . "" ] ) ) {
  2678. $wpdb->query( $wpdb->prepare(
  2679. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2680. SET field_type = %s
  2681. WHERE id = %d", sanitize_text_field($_POSTED[ "field_type" . $rowimages->id . "" ]),
  2682. $id ) );
  2683. }
  2684. if ( isset( $_POSTED[ "hc_other_field" . $rowimages->id . "" ] ) ) {
  2685. $wpdb->query( $wpdb->prepare(
  2686. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2687. SET hc_other_field = %s
  2688. WHERE id = %d", sanitize_text_field($_POSTED[ "hc_other_field" . $rowimages->id . "" ]),
  2689. $id ) );
  2690. }
  2691. if ( isset( $_POSTED[ "titleimage" . $rowimages->id . "" ] ) ) {
  2692. $wpdb->query( $wpdb->prepare(
  2693. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2694. SET name = %s
  2695. WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "titleimage" . $rowimages->id . ""
  2696. ] )), $id ) );
  2697. }
  2698. if ( isset( $_POSTED[ "im_description" . $rowimages->id . "" ] ) ) {
  2699. $wpdb->query( $wpdb->prepare(
  2700. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2701. SET description = %s
  2702. WHERE id = %d", sanitize_text_field($_POSTED[ "im_description" . $rowimages->id . "" ]),
  2703. $id ) );
  2704. }
  2705. if ( isset( $_POSTED[ "hc_required" . $rowimages->id . "" ] ) ) {
  2706. $wpdb->query( $wpdb->prepare(
  2707. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2708. SET hc_required = %s
  2709. WHERE id = %d", sanitize_text_field($_POSTED[ "hc_required" . $rowimages->id . "" ]),
  2710. $id ) );
  2711. }
  2712. if ( isset( $_POSTED[ "imagess" . $rowimages->id . "" ] ) ) {
  2713. $wpdb->query( $wpdb->prepare(
  2714. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2715. SET hc_field_label = %s
  2716. WHERE id = %d", sanitize_text_field(stripslashes( $_POSTED[ "imagess" . $rowimages->id . ""
  2717. ] )), $id ) );
  2718. }
  2719. if ( isset( $_POSTED[ "hc_left_right" . $rowimages->id . "" ] ) ) {
  2720. $wpdb->query( $wpdb->prepare(
  2721. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2722. SET hc_left_right = %s
  2723. WHERE id = %d", sanitize_text_field($_POSTED[ "hc_left_right" . $rowimages->id . "" ]),
  2724. $id ) );
  2725. }
  2726. if ( isset( $_POSTED[ "hc_ordering" . $rowimages->id . "" ] ) ) {
  2727. $wpdb->query( $wpdb->prepare(
  2728. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2729. SET ordering = %s
  2730. WHERE id = %d", intval($_POSTED[ "hc_ordering" . $rowimages->id . "" ]),
  2731. $id ) );
  2732. }
  2733. if ( isset( $_POSTED[ "def_value" . $rowimages->id . "" ] ) ) {
  2734. $wpdb->query( $wpdb->prepare(
  2735. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2736. SET def_value = %s
  2737. WHERE id = %d", sanitize_text_field($_POSTED[ "def_value" . $rowimages->id . "" ]),
  2738. $id ) );
  2739. }
  2740. if ( isset( $_POSTED[ "mask_on" . $rowimages->id . "" ] ) ) {
  2741. $wpdb->query( $wpdb->prepare(
  2742. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2743. SET mask_on = %s
  2744. WHERE id = %d", sanitize_text_field($_POSTED[ "mask_on" . $rowimages->id . "" ]),
  2745. $id ) );
  2746. }
  2747. if ( isset( $_POSTED[ "hc_input_show_default" . $rowimages->id . "" ] ) ) {
  2748. $wpdb->query( $wpdb->prepare(
  2749. "UPDATE " . $wpdb->prefix . "huge_it_contact_contacts_fields
  2750. SET hc_input_show_default = %s
  2751. WHERE id = %d", sanitize_text_field($_POSTED[ "hc_input_show_default" . $rowimages->id . "" ]),
  2752. $id ) );
  2753. }
  2754. }
  2755. }
  2756. }
  2757. echo hugeit_contact_drawThemeNew($themeId);
  2758. }
  2759. /* Change Theme */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement