- <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
- <div class="form-group">
- <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($sQuery); ?>" >
+ <div class="top-bar" id="structured-query-selector">
+ <div class="search-type-link">
+ <a id="switch-to-reverse" href="<?php echo CONST_Website_BaseURL; ?>reverse.php?format=html">reverse search</a>
+ </div>
+ <?php
+ $bSimpleQuery = !empty($aMoreParams['q']);
+ $bStructuredQuery = !$bSimpleQuery
+ && !(empty($aMoreParams['street'])
+ && empty($aMoreParams['city'])
+ && empty($aMoreParams['county'])
+ && empty($aMoreParams['state'])
+ && empty($aMoreParams['country'])
+ && empty($aMoreParams['postalcode']));
+ ?>
+ <div class="radio-inline">
+ <input type="radio" name="query-selector" id="simple" value="simple" <?php if ($bSimpleQuery) { echo 'checked="checked"'; } ?> >
+ <label for="simple">simple</label>
+ </div>
+ <div class="radio-inline">
+ <input type="radio" name="query-selector" id="structured" value="structured" <?php if ($bStructuredQuery) { echo 'checked="checked"'; } ?> >
+ <label for="structured">structured</label>
+ </div>
+
+ <form role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
+ <div class="form-group-simple"
+ <?php
+ if ($bStructuredQuery) {
+ echo 'style="display:none;"';
+ }
+ ?>>
+ <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($aMoreParams['q'] ?? ''); ?>" >