$texte->value = HtmlInput::default_value('plabel', "", $_GET); echo $texte->input(); echo '</span>'; echo dossier::hidden(); $hid = new IHidden(); echo $hid->input("c1", $_REQUEST['c1']); echo $hid->input("c2", $_REQUEST['c2']); echo $hid->input("go"); echo HtmlInput::submit("go", _("Recherche")); echo '</form>'; //------------- FORM ---------------------------------- if (isset($_REQUEST['go'])) { $cn = Dossier::connect(); $plan = new Anc_Plan($cn, $_REQUEST['c2']); $plan->pa_id = $_REQUEST['c2']; if ($plan->exist() == false) { exit(_("Ce plan n'existe pas")); } $sql = "select po_name , po_description from poste_analytique " . "where pa_id=\$1 and " . " (po_name ~* \$2 or po_description ~* \$3) order by po_name"; $array = $cn->get_array($sql, array($_REQUEST['c2'], $_REQUEST['plabel'], $_REQUEST['plabel'])); if (empty($array) == true) { echo _("Aucun poste trouvé"); return; } $button = new IButton(); $button->name = _("Choix"); $button->label = _("Choix"); echo '<table>'; foreach ($array as $line) { $button->javascript = sprintf("\$('%s').value='%s';removeDiv('%s')", $_REQUEST['c1'], $line['po_name'], $ctl); echo '<tr>' . '<td>' . $button->input() . '</td>' . '<td>' . h($line['po_name']) . '</td><td>' . h($line['po_description']) . '</tr>';