<?php 
/**
 * @package    Contact Form
 * @author     Arrowthemes https://arrowthemes.com
 * @copyright  Copyright (C) 2016 Arrowthemes. All rights reserved.
 * @license    http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

defined ('_JEXEC') or die;

?>  
    <?php if ( $params->get("pretext") != "" ) : ?>
      <?php echo $params->get("pretext"); ?>
    <?php endif; ?>

  	<form class="uk-form" method="post" action="<?php echo JRoute::_('index.php'); ?>">

      <div class="uk-grid uk-grid-width-medium-1-1 uk-grid-width-1-1">      	
          
          <?php if ( $params->get("field1_show") == 1 ) : ?>
          <div class="uk-grid-margin <?php if (trim($params->get ("field1_icon"))!= '') : ?>uk-form-icon<?php endif; ?>">
              <?php if (trim($params->get ("field1_icon"))!= '') : ?><i class="uk-<?php echo $params->get ("field1_icon"); ?>"></i><?php endif; ?>
              <input type="<?php echo $params->get ("field1_type"); ?>" name="field1" <?php if ($params->get("field1_required")) echo "required"; ?> placeholder="<?php echo $params->get ("field1_text"); ?>" id="field1_<?php echo $module->id; ?>" class="uk-width-1-1">
          </div>
          <?php endif; ?>

          <?php if ( $params->get("field2_show") == 1 ) : ?>
          <div class="uk-grid-margin <?php if (trim($params->get ("field2_icon"))!= '') : ?>uk-form-icon<?php endif; ?>">
              <?php if (trim($params->get ("field2_icon"))!= '') : ?><i class="uk-<?php echo $params->get ("field2_icon"); ?>"></i><?php endif; ?>
              <input type="<?php echo $params->get ("field2_type"); ?>" name="field2" <?php if ($params->get("field2_required")) echo "required"; ?> placeholder="<?php echo $params->get ("field2_text"); ?>" id="field2_<?php echo $module->id; ?>" class="uk-width-1-1">
          </div>
          <?php endif; ?>

          <?php if ( $params->get("field3_show") == 1 ) : ?>
          <div class="uk-grid-margin <?php if (trim($params->get ("field3_icon"))!= '') : ?>uk-form-icon<?php endif; ?>">
              <?php if (trim($params->get ("field3_icon"))!= '') : ?><i class="uk-<?php echo $params->get ("field3_icon"); ?>"></i><?php endif; ?>
              <input type="<?php echo $params->get ("field3_type"); ?>" name="field3" <?php if ($params->get("field3_required")) echo "required"; ?> placeholder="<?php echo $params->get ("field3_text"); ?>" id="field3_<?php echo $module->id; ?>" class="uk-width-1-1">
          </div>
          <?php endif; ?>

          <?php if ( $params->get("field4_show") == 1 ) : ?>
          <div class="uk-grid-margin <?php if (trim($params->get ("field4_icon"))!= '') : ?>uk-form-icon<?php endif; ?>">
              <?php if (trim($params->get ("field4_icon"))!= '') : ?><i class="uk-<?php echo $params->get ("field4_icon"); ?>"></i><?php endif; ?>
              <input type="<?php echo $params->get ("field4_type"); ?>" name="field4" <?php if ($params->get("field4_required")) echo "required"; ?> placeholder="<?php echo $params->get ("field4_text"); ?>" id="field4_<?php echo $module->id; ?>" class="uk-width-1-1">
          </div>
          <?php endif; ?>

          <?php if ( $params->get("field5_show") == 1 ) : ?>
          <div class="uk-grid-margin <?php if (trim($params->get ("field5_icon"))!= '') : ?>uk-form-icon<?php endif; ?>">
              <?php if (trim($params->get ("field5_icon"))!= '') : ?><i class="uk-<?php echo $params->get ("field5_icon"); ?>"></i><?php endif; ?>
              <input type="<?php echo $params->get ("field5_type"); ?>" name="field5" <?php if ($params->get("field5_required")) echo "required"; ?> placeholder="<?php echo $params->get ("field5_text"); ?>" id="field5_<?php echo $module->id; ?>" class="uk-width-1-1">
          </div>
          <?php endif; ?>

          <div class="uk-hidden">
              <label class="control-label" for="secure_<?php echo $module->id; ?>">Honeypot</label>
              <input type="text" name="secure" placeholder="<?php echo $params->get("honeypottext") ?>" id="secure_<?php echo $module->id; ?>" class="form-control">
          </div>

          <?php if ( $params->get("message_show") == 1 ) : ?>
          <div class="uk-grid-margin">
              <textarea name="message" <?php if ($params->get("message_required")) echo "required"; ?> placeholder="<?php echo $params->get("message_text"); ?>" class="uk-width-1-1" id="message_<?php echo $module->id; ?>"></textarea>
          </div>
          <?php endif; ?>

          <?php if ( $params->get("captcha") == 1 ) : ?> 
          <div class="form-group"> 
            <?php if ( $params->get("showlabelcaptcha") == 1 ) : ?>
              <label class="control-label" for="captcha_<?php echo $module->id; ?>"></label>
            <?php endif; ?>
              <div id="dynamic_recaptcha_1" class="g-recaptcha" data-sitekey="<?php echo $params->get("captcha_sitekey"); ?>"></div>
          </div>
          <?php endif; ?>
          
          <div class="form-group uk-margin-remove">
            <button type="submit" class="uk-button uk-margin-top <?php echo $params->get("buttonclass"); ?>"><?php echo $params->get("buttontext"); ?></button>
          </div>

          <?php echo JHtml::_( 'form.token' ); ?>                
          <input type="hidden" name="check" value="1">
        </div>
    </form>

    <?php if ( $params->get("posttext") != "" ) : ?>
      <?php echo $params->get("posttext"); ?>
    <?php endif; ?>