protected function showSearchForm()
    {
        include_once APPROOT . 'inc/lib_form_util.inc';
        include_once APPROOT . 'inc/lib_form.inc';
        $document_form = document_form('search');
        formArrayRefine($document_form);
        foreach ($person_form as $key => &$element) {
            if ($_GET[$key] != null) {
                $element['extra_opts']['value'] = $_GET[$key];
            }
        }
        $fields = shn_form_get_html_fields($document_form);
        $fields = place_form_elements($document_form, $fields);
        ?>
        <div class="control-group">
            <div class="controls"> 
                   <a class="btn" href="#document_field" id='close_doc_search_form'><i class="icon-remove"></i> <?php 
        echo _t('CLOSE');
        ?>
</a>
                <button type="submit" class="btn" name="search"  onclick="add_anchor(this.form,'document_field');" ><i class="icon-search"></i> <?php 
        echo _t('SEARCH');
        ?>
</button>	
               <button type="submit" class="btn btn-primary" name="new_doc"  onclick="add_anchor(this.form,'document_field');" ><i class="icon-plus icon-white"></i> <?php 
        echo _t('NEW');
        ?>
</button>
          </div></div>
        <?php 
    }
    protected function showForm($data)
    {
        include_once APPROOT . 'inc/lib_form_util.inc';
        include_once APPROOT . 'inc/lib_form.inc';
        $event_form = event_form('search');
        formArrayRefine($event_form);
        foreach ($event_form as $key => &$element) {
            if ($_GET[$key] != null) {
                $element['extra_opts']['value'] = $_GET[$key];
            }
        }
        $fields = shn_form_get_html_fields($event_form);
        $fields = place_form_elements($event_form, $fields);
        ?>
<button type="submit" class="btn" name="search"  ><i class="icon-search"></i> <?php 
        echo _t('SEARCH');
        ?>
</button>
        
		<a class="btn" href="#" id="related_event_search_close"><i class="icon-remove"></i> <?php 
        echo _t('CLOSE');
        ?>
</a>
		<?php 
        echo "<br/><br />";
    }
    protected function showForm()
    {
        include_once APPROOT . 'inc/lib_form_util.inc';
        include_once APPROOT . 'inc/lib_form.inc';
        $person_form = person_form('search');
        $address_form = address_form('search');
        formArrayRefine($person_form);
        //var_dump($person_form);
        foreach ($person_form as $key => &$element) {
            if ($_GET[$key] != null) {
                $element['extra_opts']['value'] = $_GET[$key];
            }
        }
        $fields = shn_form_get_html_fields($person_form);
        if ($fields['person_addresses'] != null) {
            formArrayRefine($address_form);
            $address_fields = shn_form_get_html_fields($address_form);
        }
        if ($fields['person_addresses'] != null) {
            $fields['person_addresses'] = null;
            $fields = place_form_elements($person_form, $fields);
            $address_fields = place_form_elements($address_form, $address_fields);
        } else {
            $fields = place_form_elements($person_form, $fields);
        }
        ?>
		
<button type="submit" class="btn" name="search" ><i class="icon-search"></i> <?php 
        echo _t('SEARCH');
        ?>
</button>
		<a class="btn" href="#" id="related_victim_search_close"><i class="icon-remove"></i> <?php 
        echo _t('CLOSE');
        ?>
</a>
		<br/><br/>
		<?php 
    }
    protected function showForm()
    {
        include_once APPROOT . 'inc/lib_form_util.inc';
        include_once APPROOT . 'inc/lib_uuid.inc';
        $person_form = person_form('search');
        $address_form = address_form('search');
        formArrayRefine($person_form);
        foreach ($person_form as $key => &$element) {
            if ($_GET[$key] != null) {
                $element['extra_opts']['value'] = $_GET[$key];
            }
        }
        $fields = shn_form_get_html_fields($person_form);
        if ($fields['person_addresses'] != null) {
            formArrayRefine($address_form);
            $address_fields = shn_form_get_html_fields($address_form);
        }
        if ($fields['person_addresses'] != null) {
            $fields['person_addresses'] = null;
            $fields = place_form_elements($person_form, $fields);
            $address_fields = place_form_elements($address_form, $address_fields);
        } else {
            $fields = place_form_elements($person_form, $fields);
        }
        ?>
       
	<?php 
        echo $this->mod != null ? "<input type='hidden' name='mod' value='{$this->mod}'/>" : '';
        echo $this->act != null ? "<input type='hidden' name='act' value='{$this->act}'/>" : '';
        echo $this->view != null ? "<input type='hidden' name='view' value='{$this->view}'/>" : '';
        echo $this->cancel != null ? "<input type='hidden' name='cancel' value='{$this->cancel}'/>" : '';
        ?>
			
       <a class="btn" href="<?php 
        echo get_url($this->mod, $this->act, null, null);
        ?>
"><i class="icon-chevron-left"></i> <?php 
        echo _t('BACK');
        ?>
</a>
       <a class="btn" href="<?php 
        echo get_url($this->mod, $this->cancel, null, null);
        ?>
"><i class="icon-remove-circle"></i> <?php 
        echo _t('CANCEL');
        ?>
</a>
       <?php 
        if ($this->act == "add_victim") {
            ?>
        <a class="btn" href="<?php 
            echo get_url($this->mod, $this->act, null, array("view" => "new_victim"));
            ?>
"><i class="icon-plus "></i> <?php 
            echo _t('ADD_NEW');
            ?>
</a>
      <?php 
        }
        ?>
<button type="submit" class="btn"><i class="icon-search"></i> <?php 
        echo _t('SEARCH');
        ?>
</button>
       <br /><br />
    <?php 
    }
 public function entity_search_form($entity_type)
 {
     include_once APPROOT . 'inc/lib_form_util.inc';
     if ($entity_type != null) {
         switch ($entity_type) {
             case 'event':
                 $this->search_header = _t("EVENT_SEARCH_FORM");
                 $this->search_form = event_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'person':
                 $this->search_header = _t("PERSON_SEARCH_FORM");
                 $this->search_form = person_form('search');
                 $this->address_search_form($this->search_form);
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'victim':
                 $this->search_header = _t("VICTIM_SEARCH_FORM");
                 $this->search_form = victim_form('search');
                 $this->address_search_form($this->search_form);
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'perpetrator':
                 $this->search_header = _t("PERPETRATOR_SEARCH_FORM");
                 $this->search_form = perpetrator_form('search');
                 $this->address_search_form($this->search_form);
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'source':
                 $this->search_header = _t("SOURCE_SEARCH_FORM");
                 $this->search_form = source_form('search');
                 $this->address_search_form($this->search_form);
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'intervening_party':
                 $this->search_header = _t("INTERVENING_PARTY_SEARCH_FORM");
                 $this->search_form = intervening_party_form('search');
                 $this->address_search_form($this->search_form);
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'information':
                 $this->search_header = _t("INFORMATION_SEARCH_FORM");
                 $this->search_form = information_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'intervention':
                 $this->search_header = _t("INTERVENTION_SEARCH_FORM");
                 $this->search_form = intervention_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'act':
                 $this->search_header = _t("ACT_SEARCH_FORM");
                 $this->search_form = act_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'involvement':
                 $this->search_header = _t("INVOLVEMENT_SEARCH_FORM");
                 $this->search_form = involvement_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
             case 'supporting_docs_meta':
                 $this->search_header = _t("DOCUMENT_SEARCH_FORM");
                 $this->search_form = document_form('search');
                 formArrayRefine($this->search_form);
                 $this->fields = shn_form_get_html_fields($this->search_form);
                 break;
         }
     }
 }