{* 
  Let's make some variabiles assigning ro/en
*}

{if 'ro' === $page_lang}
{* Romana *}
  {assign var='gitm_fullname' value='Nume Prenume'}
  {assign var='gitm_company_name' value='Compania'}
  {assign var='gitm_brief' value='design grafic pentru..'}
  {assign var='gitm_deadline' value='Data'}
  {assign var='gitm_buget' value='Euro'}
  {assign var='gitm_email' value='E-mail'}
  {assign var='gitm_phone' value='Telefon'}
  {assign var='gitm_submit' value='Trimite'}
{else}
{* Engleza *}
  {assign var='gitm_fullname' value='Full Name'}
  {assign var='gitm_company_name' value='Company Name'}
  {assign var='gitm_brief' value='designing a ...'}
  {assign var='gitm_deadline' value='Date or Timeframe'}
  {assign var='gitm_buget' value='Euro'}
  {assign var='gitm_email' value='E-mail'}
  {assign var='gitm_phone' value='Phone'}
  {assign var='gitm_submit' value='Send'}
{/if}

<!-- Modal -->
<div class="modal fade" id="get_in_touch-modal" tabindex="-1" role="dialog" aria-labelledby="gitm-label">
	<div class="get_in_touch-modal modal-dialog">

	  <!-- Header -->
		<div class="get_in_touch-header modal-header">
			<button type="button" class="close" 
							data-dismiss="modal" 
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
			</button> <!-- .close Button -->
		{if 'en' === $page_lang}
      <h3 id="gitm-label">Speed Request</h3>
      
    {else}
      <h3 id="gitm-label">Contact rapid</h3>
      
    {/if}
		</div>
	  <!-- /Header -->
		
		<!-- Content -->
		<div class="get_in_touch-content modal-body">
			
	    <div class="get_in_touch-form">
        <div id="result"></div>
        <form id="get_in_touch-form">
          <input type="hidden" name="page_lang" value="{$page_lang}">
        	<p>
					{if 'en' === $page_lang}
        		<label for="gitf-fullname" class="form-group">My name is
        	{else}
        		<label for="gitf-fullname" class="form-group">Ma numesc
        	{/if}
        		<input type="text" name="fullname" id="gitf-fullname" placeholder="{$gitm_fullname}" required> <br class="visible-xs"></label>

					{if 'en' === $page_lang}
        		<label for="gitf-company" class="form-group">and I'm with
        	{else}
        		<label for="gitf-company" class="form-group">si reprezint
        	{/if}
        		<input type="text" name="company_name" id="gitf-company" placeholder="{$gitm_company_name}"> <br class="visible-xs"></label>
        	</p> <!-- End form text -->

        	<p>
					{if 'en' === $page_lang}
        		<label for="gitf-brief" class="form-group">I am in need of a partner to assist me with
        	{else}
        		<label for="gitf-brief" class="form-group">Am nevoie de un partener pentru a ma ajuta cu
        	{/if}
            <input type="text" name="brief" id="gitf-brief" placeholder="{$gitm_brief}" required> <br class="visible-xs"></label>

					{if 'en' === $page_lang}
            <label for="gitf-deadline" class="form-group">with a goal of having that completed on or near
        	{else}
            <label for="gitf-deadline" class="form-group">termenul limita fiind pe
        	{/if}
            <input type="text" name="deadline" id="gitf-deadline" placeholder="{$gitm_deadline}"> <br class="visible-xs"></label>
        	</p> <!-- End form text -->
        	
        	<p>
					{if 'en' === $page_lang}
            <label for="gitf-buget" class="form-group">I am looking to stay around a budget of 
        	{else}
            <label for="gitf-buget" class="form-group">Bugetul alocat pentru acest proiect este de aproximativ
        	{/if}
            <input type="text" name="buget" id="gitf-buget" placeholder="{$gitm_buget}"> <br class="visible-xs"></label>
        	</p> <!-- End form text -->
        		
        	<p>
					{if 'en' === $page_lang}
            <label for="gitf-email" class="form-group">You can reach me at
        	{else}
            <label for="gitf-email" class="form-group">Ma puteti contacta pe
        	{/if}
            <input type="email" name="email" id="gitf-email" placeholder="{$gitm_email}" required> <br class="visible-xs"></label>
						<br>
					{if 'en' === $page_lang}
            <label for="gitf-phone" class="form-group">or call me on
        	{else}
            <label for="gitf-phone" class="form-group">sau ma puteti suna pe
        	{/if}
            <input type="text" name="phone" id="gitf-phone" placeholder="{$gitm_phone}" required> </label>
          </p> <!-- End form text -->
					<div class="form-group">
					{if 'en' === $page_lang}
            to get the conversation started. Thanks!
        	{else}
            pentru a discuta mai multe detalii sau sa stabilim o intalnire. Multumesc!
        	{/if}
          </div>

          <!-- Submit button -->
          <div class="form-group text-center">
              <button class="btn btn-primary">{$gitm_submit} </button>
          </div> <!-- ./form-group -->

          <div id="error_container" class="hide"></div>

        </form> <!-- .#get_in_touch-form -->
	    </div><!-- ./get_in_touch-form -->

		</div> <!-- ./get_in_touch-content -->
		<!-- /Content -->

	</div> <!-- ./get_in_touch-modal -->
</div> <!-- ./Modal -->

<script src="{root_url}/js/bootstrapValidator.min.js"></script>
<script>
    $(document).ready(function() {
        $('#get_in_touch-form').bootstrapValidator({
	        	container: '#error_container',
            excluded: [':disabled', ':hidden', ':not(:visible)'],
            feedbackIcons: {
                valid: 'fa fa-check',
                invalid: 'fa fa-times',
                validating: 'fa fa-refresh'
            },
            live: 'enabled',
        }).on('success.form.bv', function(e) {
          // Prevent default form submission
          e.preventDefault();

          var $form = $(e.target);

          // Send all form data to back-end
          $.ajax({
              url: 'get_in_touch_progress.php',
              type: 'POST',
              data: $form.serialize(),
              dataType: 'json',
              success: function(response) {
                  if(response.type == 'error')
                  {
                      output = response.text;
                  }else{
                      output = response.text; 
                      $form.bootstrapValidator('resetForm', true);
                      $('#get_in_touch-form').hide();
                  }
                  $("#result").hide().html(output).slideDown();

              }
          }); //ajax
        }); //ON function


        $('#get_in_touch-modal').on('show.bs.modal', function() {
            $('#get_in_touch-form').bootstrapValidator('resetForm', true);
        });
    });
</script>