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

if ( isset( $wordform_id ) && ! empty( $wordform_id ) ) {
	// Edit Created Forms
	// print_r($query_results );
	include_once SFTCY_WORDFORM_PLUGIN_DIR . 'admin/views/create_forms_edit_page.php';
} else {
	// Create New Forms
	?>

		<!-- 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>

		<!-- Start Main Form builder divs -->
		<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">
				
				<!-- Element: FORM Name -->
				<div id="wordformElement-1" class="wordform-input-element-div-wrapper wordform-input-element-div-wrapper-form-name wordform-create-form-name-label-title" data-input-element-type="form-name" data-element-index="1" >
					<span><?php esc_html_e( 'New Form', 'wordform-pro' ); ?></span>
				</div>
								
				<!-- Elements DropZone -->				
				<div id="wordform-sortable" class="wordform-dropzone-div-wrapper"></div>

				<!--Element: Submit Button  -->
				<div id="wordformElement-2" class="wordform-input-element-div-wrapper wordform-input-element-div-wrapper-submit-button" data-input-element-type="submit-button" data-element-index="2">
					<button class="button button-primary button-large wordform-admin-create-form-submit-button"><?php esc_html_e( 'Submit', 'wordform-pro' ); ?></button>
				</div>

		
				<input type="hidden" class="wordform-form-builder-element-number" value="2" />
				<input type="hidden" class="wordform-form-saved" value="false" />
				<input type="hidden" class="wordform-created-form-id" value="" />    
		
			</div><!-- /.wordform-builder-div-wrapper -->
			<!-- End Form Builder Zone -->

			<!-- Element Field Options - Right Sidebar -->
			<div class="wordform-builder-form-options-div-wrapper">				
				<?php include_once SFTCY_WORDFORM_PLUGIN_INC . 'elements/form-name.php'; ?>
				<?php include_once SFTCY_WORDFORM_PLUGIN_INC . 'elements/submit-button.php'; ?>
			</div><!-- /.wordform-builder-form-options-div-wrapper -->

			  
		</div><!-- ./wordform-div-wrapper -->
	<?php
}
?>
