<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>

<script src="https://www.google.com/recaptcha/api.js"></script>

<style>
  label {
    display: block !important;
  }

  .spacer-container {
    margin-bottom: 50px;
  }

  .optional,
  .message-regex {
    display: none;
  }

  #main-text {
    margin-left: 30%;
  }

  #reg-btn {
    margin-left: 10%;
  }

  <?php if (strpos($_SERVER['REQUEST_URI'], "registration") !== false) : ?>#jform_spacer_default-lbl {
    display: none;
  }

  .registration {
    width: 60%;
  }

  .link {
    cursor: pointer;
    color: blue !important;
    ;
  }

  #member-registration {
    padding: 10px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    width: 120%;
  }

  .page-header {
    margin-left: 25%;
  }

  <?php endif; ?>
</style>

<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?= JText::_('COM_USERS_LOGIN_HEADER') ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p class="text-white"><?= JText::_('COM_USERS_LOGIN_LABEL') ?></p>
        <?= JModuleHelper::renderModule(JModuleHelper::getModule('login', 'Login Form')) ?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<div class="registration<?php echo $this->pageclass_sfx; ?> ">
  <?php if ($this->params->get('show_page_heading')) : ?>
    <div class="page-header">
      <h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
    </div>
  <?php endif; ?>
  <form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate form-horizontal well" enctype="multipart/form-data">
    <?php // Iterate through the form fieldsets and display each one. 
    ?>
    <?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
      <?php $fields = $this->form->getFieldset($fieldset->name); ?>
      <?php if (count($fields)) : ?>
        <fieldset>
          <?php // If the fieldset has a label set, display it as the legend. 
          ?>
          <?php if (isset($fieldset->label)) : ?>
            <legend><?php echo JText::_($fieldset->label); ?></legend>
          <?php endif; ?>
          <?php // Iterate through the fields in the set and display them. 
          ?>
          <?php foreach ($fields as $field) : ?>
            <?php // If the field is hidden, just display the input. 
            ?>
            <?php if ($field->hidden) : ?>
              <?php echo $field->input; ?>
            <?php else : ?>
              <div class="control-group">
                <div class="control-label">
                  <?php echo $field->label; ?>
                  <?php if (!$field->required && $field->type !== 'Spacer') : ?>
                    <span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?></span>
                  <?php endif; ?>
                </div>
                <div class="controls">
                  <?php echo $field->input; ?>
                </div>
              </div>
            <?php endif; ?>
          <?php endforeach; ?>
        </fieldset>
      <?php endif; ?>
    <?php endforeach; ?>
    <div class="control-group phone-group">
      <div class="control-label">
        <label id="jform_phone-lbl" for="jform_phone" class="required">
          Telefonnummer<span class="star">&nbsp;*</span></label>
      </div>
      <div class="controls">
        <input type="tel" name="jform[phone]" class="validate-phone required" id="jform_phone" value="" size="30" placeholder="Telefonnummer" required="required" aria-required="true">
        <div class="message-regex">Please use a valid phone number</div>
      </div>
    </div>
    <div class="control-group profession-group">
      <div class="control-label">
        <label id="jform_profession-lbl" for="jform_profession" class="required">
          Beruf<span class="star">&nbsp;*</span></label>
      </div>
      <div class="controls">
        <select id="jform_profession" name="jform[profession]" style="width:100%" required>
          <option value="" selected="selected">Select</option>
          <option value="19">Not professional</option>
          <option value="1">Professional - Architect</option>
          <option value="4">Professional - Interior Designer</option>
          <option value="18">Professional - Other</option>
          <option value="10">Student Architect</option>
          <option value="11">Student Interior Designer</option>
        </select>
      </div>
    </div>
    <div class="control-group country-group">
      <div class="control-label">
        <label id="jform_country-lbl" for="jform_country" class="required">
          Land<span class="star">&nbsp;*</span></label>
      </div>
      <div class="controls">
        <select id="jform_country" name="jform[country]" style="width:100%" required>
          <option value="" selected="selected">--- Please select an option ---</option>
          <option value="355">Albania</option>
          <option value="213">Algeria</option>
          <option value="1251">Andorra</option>
          <option value="1252">Angola</option>
          <option value="1253">Antigua and Barbuda</option>
          <option value="54">Argentina</option>
          <option value="1255">Armenia</option>
          <option value="61">Australia</option>
          <option value="43">Austria</option>
          <option value="41">Austria-Dealer</option>
          <option value="1258">Azerbaijan</option>
          <option value="1259">Bahamas</option>
          <option value="1260">Bahrain</option>
          <option value="1261">Bangladesh</option>
          <option value="1262">Barbados</option>
          <option value="1263">Belarus</option>
          <option value="32">Belgium</option>
          <option value="1265">Belize</option>
          <option value="1266">Benin</option>
          <option value="1267">Bhutan</option>
          <option value="92">BIMLadder registered</option>
          <option value="1268">Bolivia</option>
          <option value="387">Bosnia and Herzegovina</option>
          <option value="1270">Botswana</option>
          <option value="55">Brazil</option>
          <option value="1272">Brunei</option>
          <option value="1273">Bulgaria</option>
          <option value="1274">Burkina Faso</option>
          <option value="1275">Burundi</option>
          <option value="1276">Cambodia</option>
          <option value="1277">Cameroon</option>
          <option value="2">Canada</option>
          <option value="1279">Cape Verde</option>
          <option value="1280">Central African Republic</option>
          <option value="1281">Chad</option>
          <option value="1282">Chile</option>
          <option value="1283">China</option>
          <option value="1284">Colombia</option>
          <option value="1285">Comoros</option>
          <option value="1286">Congo</option>
          <option value="506">Costa Rica</option>
          <option value="1288">Cote d'Ivoire</option>
          <option value="38">Croatia</option>
          <option value="1290">Cuba</option>
          <option value="196">Cyprus</option>
          <option value="42">Czech Republic</option>
          <option value="45">Denmark</option>
          <option value="1294">Djibouti</option>
          <option value="1295">Dominica</option>
          <option value="1297">East Timor (Timor Timur)</option>
          <option value="1298">Ecuador</option>
          <option value="20">Egypt</option>
          <option value="1300">El Salvador</option>
          <option value="1301">Equatorial Guinea</option>
          <option value="1302">Eritrea</option>
          <option value="1303">Estonia</option>
          <option value="1304">Ethiopia</option>
          <option value="1305">Fiji</option>
          <option value="1306">Finland</option>
          <option value="33">France</option>
          <option value="1308">Gabon</option>
          <option value="1309">Gambia, The</option>
          <option value="1310">Georgia</option>
          <option value="49">Germany</option>
          <option value="492">Germany (Alpha-Software)</option>
          <option value="495">Germany (Breeze Media)</option>
          <option value="494">Germany (Encee)</option>
          <option value="493">Germany (Hannes Süer)</option>
          <option value="490">Germany (IT-Concept)</option>
          <option value="491">Germany (POLZIN Systemhaus)</option>
          <option value="233">Ghana</option>
          <option value="44">Great Britain</option>
          <option value="30">Greece</option>
          <option value="1314">Grenada</option>
          <option value="1315">Guatemala</option>
          <option value="1316">Guinea</option>
          <option value="1317">Guinea-Bissau</option>
          <option value="1318">Guyana</option>
          <option value="1319">Haiti</option>
          <option value="1320">Honduras</option>
          <option value="36">Hungary</option>
          <option value="1322">Iceland</option>
          <option value="91">India</option>
          <option value="969">Indonesia</option>
          <option value="1325">Iran</option>
          <option value="1326">Iraq</option>
          <option value="35">Ireland</option>
          <option value="73">Israel</option>
          <option value="39">Italy</option>
          <option value="1330">Jamaica</option>
          <option value="81">Japan</option>
          <option value="1332">Jordan</option>
          <option value="1333">Kazakhstan</option>
          <option value="1334">Kenya</option>
          <option value="1335">Kiribati</option>
          <option value="82">Korea</option>
          <option value="1336">Korea, North</option>
          <option value="1337">Korea, South</option>
          <option value="78">Kuwait</option>
          <option value="1339">Kyrgyzstan</option>
          <option value="1340">Laos</option>
          <option value="71">Latvia</option>
          <option value="961">Lebanon</option>
          <option value="1343">Lesotho</option>
          <option value="1344">Liberia</option>
          <option value="1345">Libya</option>
          <option value="1346">Liechtenstein</option>
          <option value="1347">Lithuania</option>
          <option value="1348">Luxembourg</option>
          <option value="1349">Macedonia</option>
          <option value="1350">Madagascar</option>
          <option value="1351">Malawi</option>
          <option value="60">Malaysia</option>
          <option value="1353">Maldives</option>
          <option value="1354">Mali</option>
          <option value="356">Malta</option>
          <option value="1356">Marshall Islands</option>
          <option value="1357">Mauritania</option>
          <option value="1358">Mauritius</option>
          <option value="52">Mexico</option>
          <option value="1360">Micronesia</option>
          <option value="1361">Moldova</option>
          <option value="1362">Monaco</option>
          <option value="1363">Mongolia</option>
          <option value="1364">Montenegro</option>
          <option value="978">MOROCCO</option>
          <option value="1366">Mozambique</option>
          <option value="1367">Myanmar</option>
          <option value="1368">Namibia</option>
          <option value="94">Namirial registered</option>
          <option value="93">Namirial trial</option>
          <option value="1369">Nauru</option>
          <option value="1370">Nepal</option>
          <option value="31">Netherland</option>
          <option value="975">NEW ZEALAND</option>
          <option value="64">New Zealand</option>
          <option value="1373">Nicaragua</option>
          <option value="1374">Niger</option>
          <option value="74">Nigeria</option>
          <option value="99">Non-profit</option>
          <option value="47">Norway</option>
          <option value="1377">Oman</option>
          <option value="0">Other</option>
          <option value="1378">Pakistan</option>
          <option value="1379">Palau</option>
          <option value="1380">Panama</option>
          <option value="1381">Papua New Guinea</option>
          <option value="1382">Paraguay</option>
          <option value="13">Peru</option>
          <option value="63">Philippines</option>
          <option value="48">Poland</option>
          <option value="51">Portugal</option>
          <option value="1387">Qatar</option>
          <option value="40">Romania</option>
          <option value="401">Romania</option>
          <option value="402">Romania</option>
          <option value="7">Russia</option>
          <option value="1390">Rwanda</option>
          <option value="1391">Saint Kitts and Nevis</option>
          <option value="1392">Saint Lucia</option>
          <option value="1393">Saint Vincent</option>
          <option value="1394">Samoa</option>
          <option value="1395">San Marino</option>
          <option value="1396">Sao Tome and Principe</option>
          <option value="966">Saudi Arabia</option>
          <option value="1397">Saudi Arabia</option>
          <option value="1398">Senegal</option>
          <option value="1400">Seychelles</option>
          <option value="1401">Sierra Leone</option>
          <option value="1402">Singapore</option>
          <option value="65">Singapore</option>
          <option value="421">Slovakia</option>
          <option value="86">Slovenia</option>
          <option value="861">Slovenia</option>
          <option value="95">Software license</option>
          <option value="1405">Solomon Islands</option>
          <option value="1406">Somalia</option>
          <option value="27">South Africa</option>
          <option value="34">Spain</option>
          <option value="1409">Sri Lanka</option>
          <option value="1410">Sudan</option>
          <option value="1411">Suriname</option>
          <option value="1412">Swaziland</option>
          <option value="1413">Sweden</option>
          <option value="46">Sweden</option>
          <option value="1414">Switzerland</option>
          <option value="1415">Syria</option>
          <option value="381">Szerbia</option>
          <option value="88">Taiwan</option>
          <option value="1417">Tajikistan</option>
          <option value="1418">Tanzania</option>
          <option value="1419">Thailand</option>
          <option value="1420">Togo</option>
          <option value="1421">Tonga</option>
          <option value="96">Trial / Reader</option>
          <option value="1422">Trinidad and Tobago</option>
          <option value="1423">Tunisia</option>
          <option value="90">Turkey</option>
          <option value="1425">Turkmenistan</option>
          <option value="1426">Tuvalu</option>
          <option value="1427">Uganda</option>
          <option value="1428">Ukraine</option>
          <option value="973">UNITED ARAB EMIRATES</option>
          <option value="11">United States of America</option>
          <option value="1432">Uruguay</option>
          <option value="1433">Uzbekistan</option>
          <option value="1434">Vanuatu</option>
          <option value="1435">Vatican City</option>
          <option value="1436">Venezuela</option>
          <option value="1437">Vietnam</option>
          <option value="84">Vietnam</option>
          <option value="1438">Yemen</option>
          <option value="1439">Zambia</option>
          <option value="1440">Zimbabwe</option>
        </select>
      </div>
    </div>
    <div class="control-group city-group">
      <div class="control-label">
        <label id="jform_city-lbl" for="jform_city" class="required">
          Stadt<span class="star">&nbsp;*</span></label>
      </div>
      <div class="controls">
        <input type="text" name="jform[city]" id="jform_city" value="" class="required" size="30" placeholder="Stadt" maxlength="255" required="required" aria-required="true">
      </div>
    </div>
    <div class="control-group address-group">
      <div class="control-label">
        <label id="jform_address-lbl" for="jform_address" class="">
          Adresse</label> <span class="optional">(optional)</span>
      </div>
      <div class="controls">
        <input type="text" name="jform[address]" id="jform_address" value="" size="30" placeholder="Adresse" maxlength="255">
      </div>
    </div>
    <div class="control-group zip-group">
      <div class="control-label">
        <label id="jform_zip-lbl" for="jform_zip" class="">
          Postleitzahl</label> <span class="optional">(optional)</span>
      </div>
      <div class="controls">
        <input type="text" name="jform[zip]" id="jform_zip" value="" size="30" placeholder="Postleitzahl" maxlength="255">
      </div>
    </div>
    <div class="control-group gdpr-group">
      <div class="control-label" style="display: none;">
        <label id="jform_gdpr-lbl" for="jform_gdpr" class="required">
          <span class="no-title">Privacy Policy</span><span class="star">&nbsp;*</span></label>
      </div>

      <div class="controls">
        <fieldset id="jform_gdpr" class="required checkboxes" required="required" aria-required="true">
          <label for="jform_gdpr0" class="checkbox ">
            <input type="checkbox" id="jform_gdpr0" name="jform[gdpr][]" value="1"> Ich habe die <a href="/datenschutzbestimmungent" target="_blank">Datenschutzbestimmungen</a> von ARCHLine.XP gelesen und bin damit einverstanden</a></label>
        </fieldset>
      </div>
    </div>

    <div class="control-group">
      <div class="controls">
        <button type="submit" class="btn btn-primary validate g-recaptcha" data-sitekey="6Le1o70lAAAAAAyKS0PSXpNnU8YfFzpKOUqxB6We" data-callback='onCatpchaSubmit' data-action='submit'>
          <?php echo JText::_('JREGISTER'); ?>
        </button>
        <a class="btn" href="<?php echo JRoute::_(''); ?>" title="<?php echo JText::_('JCANCEL'); ?>">
          <?php echo JText::_('JCANCEL'); ?>
        </a>
        <input type="hidden" name="option" value="com_users" />
        <input type="hidden" name="task" value="registration.register" />
      </div>
    </div>

    <?php echo JHtml::_('form.token'); ?>
  </form>
</div>

<script>
  function onCatpchaSubmit(token) {
    document.getElementById("member-registration").submit();
  }
</script>