<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
include_once SFTCY_WORDFORM_PLUGIN_DIR . 'admin/views/pages-header-template.php';

$data              = json_decode( $query_results[0]['builtform_html_data'], true );
$builtform         = isset( $data['builtform_data'] ) ? wp_kses( $data['builtform_data'], SFTCY_Wordform_Ajaxhandler::sc_wordform_allowed_html_tags() ) : '';
$builtform_options = isset( $data['builtform_options_data'] ) ? wp_kses( $data['builtform_options_data'], SFTCY_Wordform_Ajaxhandler::sc_wordform_allowed_html_tags() ) : '';
?>

<!-- Start wordform build Top information & action buttons bar-->
<div class="wordform-build-top-information-action-buttons-wrapper">
	<div class="wordform-draggable-elements-info-wrapper"></div>

	<div class="wordform-build-canvas-info-wrapper">
		<!-- Actions Update Info -->
		<p class="wordform-message-info"></p>
	</div>

	<div class="wordform-build-form-options-customization-info-wrapper">
		<!-- Action Buttons -->
		<div class="wordform-form-action-buttons-wrapper">
			<!-- Save Button -->
			<button type="button" class="button button-primary button-large wordform-save-btn">						
				<i class="fa-solid fa-file-circle-check"></i>
				<?php esc_html_e( 'Save Form', 'wordform-pro' ); ?>
			</button>
			<!-- Preview & Test Button -->
			<a type="button" class="button button-primary button-large wordform-preview-btn disabled" href="#" target="_blank">
				<span class="dashicons dashicons-welcome-view-site"></span> <?php esc_html_e( 'Preview & Test', 'wordform-pro' ); ?>
			</a>      								
		</div>			
	</div>
</div><!-- /.wordform-build-top-information-action-buttons-wrapper -->
<!-- Tooltip div -->
<div class="wordform-customozed-input-options-tooltip-hints" title="<i class='fa-sharp fa-solid fa-circle-exclamation fa-beat fa-lg'></i> <?php esc_html_e( 'Customize Form element options', 'wordform-pro' ); ?>"></div>



<div class="wordform-div-wrapper">	

		<!-- Start Draggable Input Elements -->      
		<!-- Tooltip div -->
		<div class="wordform-draggable-elements-div-wrapper" title="<i class='fa-sharp fa-solid fa-circle-exclamation fa-beat fa-lg'></i> <?php esc_html_e( 'Drag & drop elements into DropZone area or click to add. Rearrange by dragging elements inside DropZone', 'wordform-pro' ); ?>">

			<h4><i class="fa-solid fa-circle-chevron-down wordform-standard-elements-collapse-icon"></i> Standard Form Elements</h4>
			<div class="wordform-build-draggable-standard-fields">					
				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-singletext button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="singletext" type="button" >
					<i class="fa-sharp fa-regular fa-address-card"></i>
					<?php esc_html_e( 'Name', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-singlenumber button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="singlenumber" type="button" >
					<i class="fa-sharp fa-solid fa-arrow-up-1-9"></i>
					<?php esc_html_e( 'Number', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-multitext button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="multitext" type="button" >
					<i class="fa-sharp fa-solid fa-text-width"></i>
					<?php esc_html_e( 'Description', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-select button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="select" type="button" >
					<i class="fa-sharp fa-solid fa-square-caret-down"></i>
					<?php esc_html_e( 'Dropdown Options', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-checkbox button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="checkbox" type="button" >
					<i class="fa-sharp fa-solid fa-square-check"></i>
					<?php esc_html_e( 'Checkboxes', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-radio button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="radio" type="button" >
					<i class="fa-sharp fa-regular fa-circle-dot"></i>
					<?php esc_html_e( 'Multiple Choice', 'wordform-pro' ); ?></button>
				</div>

			</div><!-- /.wordform-build-draggable-standard-fields -->

			<h4><i class="fa-solid fa-circle-chevron-down wordform-advance-elements-collapse-icon"></i> Advanced Form Elements</h4>
			<div class="wordform-build-draggable-advanced-fields">
				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-range button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="range" type="button" >
					<i class="fa-solid fa-sliders"></i>
					<?php esc_html_e( 'Range Slider', 'wordform-pro' ); ?></button>
				</div>

				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-email button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="email" type="button" >
					<i class="fa-sharp fa-solid fa-at"></i>
					<?php esc_html_e( 'Email', 'wordform-pro' ); ?></button>
				</div>


				<div class="draggable-form-element-wrapper">
					<?php if ( SFTCY_Wordform_Captcha::wordform_gd_library_available() ) { ?>
					<button class="draggable-element wordform-type-captcha button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="captcha" type="button" >
					<i class="fa-solid fa-shield"></i>
						<?php esc_html_e( 'Numeric Captcha', 'wordform-pro' ); ?></button>				   				   				   
					<?php } ?>	
				</div>
				
				<div class="draggable-form-element-wrapper">
					<button class="draggable-element wordform-type-gcaptcha button button-secondary button-large wordform-drag-elements-button" data-wordform-element-name="gcaptcha" type="button" >				
					<i class="fa-brands fa-google"></i>
					<?php esc_html_e( 'Google reCaptcha', 'wordform-pro' ); ?></button>				   				   				   					
				</div>

			</div><!-- /.wordform-build-draggable-advanced-fields -->				

		</div> <!-- /.wordform-draggable-elements-div-wrapper  -->


		<!-- Start Form Builder Zone -->
		<div class="wordform-builder-div-wrapper">
			<?php echo wp_kses( stripslashes( $builtform ), SFTCY_Wordform_Ajaxhandler::sc_wordform_allowed_html_tags() ); ?>	
		</div><!-- /.wordform-builder-div-wrapper -->
		<!-- End Form Builder Zone -->

		<!-- Element Field Options - Right -->
		<div class="wordform-builder-form-options-div-wrapper">
			<?php echo wp_kses( stripslashes( $builtform_options ), SFTCY_Wordform_Ajaxhandler::sc_wordform_allowed_html_tags() ); ?>
		</div><!-- /.wordform-builder-form-options-div-wrapper -->


</div><!-- ./wordform-div-wrapper -->
