<?php

// Disable direct call
if ( ! defined( 'ABSPATH' ) ) { exit; }


/* Theme setup section
-------------------------------------------------------------------- */

if ( !function_exists( 'seohub_template_form_1_theme_setup' ) ) {
	add_action( 'seohub_action_before_init_theme', 'seohub_template_form_1_theme_setup', 1 );
	function seohub_template_form_1_theme_setup() {
		seohub_add_template(array(
			'layout' => 'form_1',
			'mode'   => 'forms',
			'title'  => esc_html__('Contact Form 1', 'seohub')
			));
	}
}

// Template output
if ( !function_exists( 'seohub_template_form_1_output' ) ) {
	function seohub_template_form_1_output($post_options, $post_data) {
		global $SEOHUB_GLOBALS;
		?>
		<form <?php echo ($post_options['id'] ? ' id="'.esc_attr($post_options['id']).'"' : ''); ?> data-formtype="<?php echo esc_attr($post_options['layout']); ?>" method="post" action="<?php echo esc_url($post_options['action'] ? $post_options['action'] : $SEOHUB_GLOBALS['ajax_url']); ?>">
			<div class="sc_form_info">
				<div class="sc_form_item sc_form_field label_over"><label class="required" for="sc_form_username"><?php esc_html_e('Name', 'seohub'); ?></label><input id="sc_form_username" type="text" name="username" placeholder="<?php esc_attr_e('Name *', 'seohub'); ?>"></div>
				<div class="sc_form_item sc_form_field label_over"><label class="required" for="sc_form_email"><?php esc_html_e('E-mail', 'seohub'); ?></label><input id="sc_form_email" type="text" name="email" placeholder="<?php esc_attr_e('E-mail *', 'seohub'); ?>"></div>
			</div>
			<div class="sc_form_item sc_form_message label_over"><label class="required" for="sc_form_message"><?php esc_html_e('Message', 'seohub'); ?></label><textarea id="sc_form_message" name="message" placeholder="<?php esc_attr_e('Message', 'seohub'); ?>"></textarea></div>
			<div class="sc_form_item sc_form_button"><button><?php esc_html_e('Send', 'seohub'); ?></button></div>
			<div class="result sc_infobox"></div>
		</form>
		<?php
	}
}
?>