<? \S::set_session( 'form-token', bin2hex( random_bytes( 32 ) ) );?>
<div class="modal fade modal-contact" id="modal-contact" tabindex="-1" role="dialog" aria-labelledby="modal-contact" aria-hidden="true">
  <div class="modal-dialog modal-lg modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <h5 class="modal-title" id="modal-title">Compila il modulo</h5>
        <form method="POST" action="" enctype="multipart/form-data" id="modal-contact-form">
          <input type="hidden" name="action" value="send-contact-modal">
          <input type="hidden" name="token" value="<?= \S::get_session( 'modal-token' );?>">
          <input type="hidden" name="website" value="">
          <div class="form-row">
            <div class="form-group col-md-6">
              <input type="text" class="form-control" name="name" placeholder="Nome dell'azienda" required>
            </div>
            <div class="form-group col-md-6">
              <input type="text" class="form-control" name="email" placeholder="E-mail" required>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-6">
              <select class="form-control" name="address" required>
                <option value="" selected disabled>--- REGIONE ---</option>
                <option value="L'Aquila">L'Aquila</option>
                <option value="Basilicata">Basilicata</option>
                <option value="Calabria">Calabria</option>
                <option value="Campania">Campania</option>
                <option value="Emilia-Romagna">Emilia-Romagna</option>
                <option value="Friuli-Venezia Giulia">Friuli-Venezia Giulia</option>
                <option value="Lazio">Lazio</option>
                <option value="Liguria">Liguria</option>
                <option value="Lombardia">Lombardia</option>
                <option value="Marche">Marche</option>
                <option value="Molise">Molise</option>
                <option value="Piemonte">Piemonte</option>
                <option value="Puglia">Puglia</option>
                <option value="Sardegna">Sardegna</option>
                <option value="Sicilia">Sicilia</option>
                <option value="Toscana">Toscana</option>
                <option value="Trentino-Alto Adige / Südtirol">Trentino-Alto Adige / Südtirol</option>
                <option value="Umbria">Umbria</option>
                <option value="Valle d'Aosta / Vallée d'Aoste">Valle d'Aosta / Vallée d'Aoste</option>
                <option value="Veneto">Veneto</option>
              </select>
            </div>
            <div class="form-group col-6">
              <input type="text" class="form-control" id="zip_code" name="zip_code"  placeholder="Codice Postale">
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-6">
              <input type="text" class="form-control" name="phone" placeholder="Cellulare" required>
            </div>
            <div class="form-group col-md-6">
              <select class="form-control" name="kind_of_cooperation">
                <option value="">--- TIPO DI COLLABORAZIONE ---</option>
                <option value="klient prywatny">Cliente privato</option>
                <option value="sprzedawca">Rivenditore</option>
                <option value="firma budowlana">Impresa Edile</option>
                <option value="konstruktor">Costruttore</option>
                <option value="architekt">Architetto</option>
                <option value="przedsiębiorca">Imprenditore</option>
                <option value="producent">Produttore Infissi</option>
                <option value="agent">Agente</option>
                <option value="inny">Altro</option>
              </select>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-12">
              <textarea class="form-control" name="information" rows="2" placeholder="Altre informazioni"></textarea>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-12">
              <p>
                Crea una richiesta in base al progetto della tua casa o in base al design della tua casa. Si prega di fornire dimensioni, quantità e funzioni dei serramenti. Dimensioni del file fino a 10 MB.
              </p>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-12">
              <input type="file" name="files" class="files">
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-12">
              <div class="form-check">
                <input class="form-check-input" type="checkbox" id="gridCheck" required>
                <label class="form-check-label" for="gridCheck">
                  Autorizzo il trattamento dei miei dati personali da me sopra forniti per preparare un'offerta adeguata.
                </label>
              </div>
            </div>
            <div class="form-group col-12">
              <div class="form-check">
                <input class="form-check-input" type="checkbox" id="gridCheck2" required>
                <label class="form-check-label" for="gridCheck2">
                Autorizzo il trattamento dei miei dati personali per finalità di marketing.
                </label>
              </div>
            </div>
          </div>

          <div class="form-row">
            <div class="col-12">
              <div class="g-recaptcha" data-sitekey="6LfaovglAAAAAAieLVC7i4xGkQA5ufXUbWLipSbp"></div>
            </div>
          </div>
          <? if ( $settings['contact_form_captcha'] ):?>
            <div class="form-row">
              <div class="col-12 small">
                <div class="captcha">
                  <div class="check"> </div> <span>Non sono un robot</span>
                </div>
              </div>
            </div>
          <? endif;?>
          <div class="form-row">
            <div class="form-group col-12">
              <button type="submit" class="btn-black">invia la tua richiesta&nbsp;&nbsp;&nbsp; ></button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
<link class="footer" href="/plugins/fileuploader/jquery.fileuploader.min.css" rel="stylesheet" type="text/css">
<link class="footer" href="/plugins/fileuploader/font/font-fileuploader.css" rel="stylesheet" type="text/css">
<script class="footer" type="text/javascript" src="/plugins/fileuploader/jquery.fileuploader.min.js"></script>
<script class="footer" type="text/javascript">
  $( document ).ready( function() {
    $( '#modal-contact-form input.files' ).fileuploader({
      fileMaxSize: 10,
      extensions: [ 'jpg', 'jpeg', 'png', 'pdf', 'text/plain', 'csv', 'xml', 'xls', 'xlsx', 'doc', 'dot', 'docx' ],
      addMore: true,
      captions: {
        button: function (e) {
          return "SCEGLI UN FILE";
        },
        feedback: function (e) {
          return (
            "TRASCINA E RILASCIA O"
          );
        },
        feedback2: function (e) {
          return (
            e.length +
            " " +
            (1 < e.length ? "i file sono scelti" : "il file è scelto")
          );
        },
        confirm: "Conferma",
        cancel: "Cancella",
        name: "Nome",
        type: "Tipo file",
        size: "Dimensione file",
        dimensions: "Dimensioni",
        duration: "Durata",
        crop: "Taglia",
        rotate: "Ruota",
        sort: "Ordina",
        open: "Apri",
        download: "Scarica",
        remove: "Elimina",
        drop: "Posiziona il file qui per caricare",
        paste: '<div class="fileuploader-pending-loader"></div> Incolla file, clicca qui per cancellare',
        removeConfirmation: "Sei sicuro di voler eliminare il file?",
        errors: {
          filesLimit: "Solo ${limit} file possono essere caricati.",
          filesType: "Solo ${extensions} file possono essere caricati.",
          fileSize: "${name} è troppo grande! Scegli un file fino a ${fileMaxSize} MB.",
          filesSizeAll: "I file selezioni sono troppo grandi! Scegli un file fino a ${maxSize} MB.",
          fileName: "Un file con lo stesso nome ${name} è già selezionato.",
          remoteFile: "I file remoti non sono consentiti.",
          folderUpload: "Le cartelle non sono consentite.",
        }
      }
    });
  });
</script>



          <? if ( $settings['contact_form_captcha'] ):?>
  <link href="/libraries/jquery/captcha.css" rel="stylesheet" type="text/css">
  <script class="footer" type="text/javascript" src="/plugins/captcha.js"></script>
<? endif;?>
<script class="footer" type="text/javascript">
  <? if ( $settings['contact_form_captcha'] ):?>
    $( function()
    {
      $( '#modal-contact-form' ).captcha();
    });
  <? endif;?>
</script>

