$q = new IText('query');
$q->value = isset($query) ? $query : '';
$r .= '<span style="margin-left:50px">';
$r .= _('Fiche contenant') . HtmlInput::infobulle(19);
$r .= $q->input();
$r .= HtmlInput::submit('fs', _('Recherche'), "", "smallbutton");
$r .= '</span>';
$r .= dossier::hidden() . HtmlInput::hidden('op', 'add_concerned_card');
$r .= HtmlInput::request_to_hidden(array('ag_id'));
$r .= '</form>';
$query = HtmlInput::default_value_get("query", "");
$sql_array['query'] = $query;
$sql_array['typecard'] = 'all';
$fiche = new Fiche($cn);
/* Build the SQL and show result */
$sql = $fiche->build_sql($sql_array);
/* We limit the search to MAX_SEARCH_CARD records */
$sql = $sql . ' order by vw_name limit ' . MAX_SEARCH_CARD;
$a = $cn->get_array($sql);
for ($i = 0; $i < count($a); $i++) {
    $array[$i]['quick_code'] = $a[$i]['quick_code'];
    $array[$i]['name'] = h($a[$i]['vw_name']);
    $array[$i]['accounting'] = $a[$i]['accounting'];
    $array[$i]['first_name'] = h($a[$i]['vw_first_name']);
    $array[$i]['description'] = h($a[$i]['vw_description']);
    $array[$i]['javascript'] = sprintf("action_save_concerned(%d,'%s','%s')", $gDossier, $a[$i]['f_id'], $ag_id);
}
//foreach
echo $r;
require_once 'template/card_result.php';
$response = ob_get_contents();