print html_options($QUERY->get_list('boolean_op'), @$criterion->get_operator($i));
        print '</select></label>';
    }
    print '<input type="text" name="' . $root_key . '[v]" id="' . $root_key . '" value="' . htmlspecialchars(@$criterion->get_value($i), ENT_QUOTES) . '" />';
    print '<label class="label_between" for="' . $root_key . '[index]">in</label>';
    print '<select name="' . $root_key . '[index]" id="' . $root_key . '[index]">';
    print html_options($QUERY->get_list($criterion->get_list()), @$criterion->get_index($i));
    print '</select></li>';
}
?>
        </ol>
    </fieldset>
<? /* Advanced fields */ ?>
    <fieldset class="searchset">
        <?php 
echo html_query_criterion_input($QUERY, 'text', NULL, TRUE);
?>
    </fieldset>
<? endif /*Basic/Advanced*/?>
    <fieldset class="controlset">
        <ol>
            <li class="years to_the_left solo">
                  <label for ="">Year:</label>
                  <?php 
echo html_query_date_list($QUERY, 'date_start');
?>
                  <label class="label_between">to</label>
                  <?php 
echo html_query_date_list($QUERY, 'date_end');
?>
                  <?php 
<?php
// $Id$
// Search form for database applications
// James Fryer, 30 Aug 08
// BUFVC Potnia copyright 2011, BUFVC et al. See LICENSE for licensing information (GPL3). See http://potnia.org, http://bufvc.ac.uk

$is_advanced = $MODE == 'advanced';
?>

<fieldset class="searchset-<?=$MODE?>">
<? if (!$is_advanced): ?>	
		<?= html_query_criterion_input($QUERY, 'q', Array(
	        'placeholder'=>"Leave blank for all records",
	         ), TRUE ); ?>

<? else: /* Advanced search form*/ ?>
    <ol class="advanced-input">
<?php
    $criterion = $QUERY['q'];
for ($i = 0; $i < $criterion->advanced_value_count; $i++ )
    {
    $root_key = $criterion->get_qs_key() . '['. $i . ']';
    if ($i == 0)
        print '<li><label for="' . $root_key . '[v]">' . $criterion->label . ':</label>';
    else
        {
        print '<li><label for="' . $root_key . '[oper]">';
        print '<select name="' . $root_key . '[oper]" id="' . $root_key . '[oper]">';
        print html_options($QUERY->get_list('boolean_op'), @$criterion->get_operator($i) );
        print '</select></label>';
        }