1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
function _a_form($id_form, $params, $contenu) {
$a_form = "<a href=\"#\" onclick=\"";
foreach($params as $param) {
$a_form .= "document.getElementById('" . $param[0] . "').value='" . $param[1] . "';";
}
$a_form .= "document.getElementById('" . $id_form . "').submit(); return false\">";
$a_form .= $contenu;
$a_form .= "</a>";
return $a_form;
}
function form_lien($id_form, $href, $params, $target = "", $champs = array()) {
$form = "<form id=\"" . $id_form . "\" method=\"post\" action=\"" . $href . "\" " . $target . ">";
foreach($params as $param) {
$form .= "<input type=\"hidden\" id=\"" . $param[0] . "\" name=\"" . $param[1] . "\">";
}
foreach($champs as $champ) {
$form .= "<input type=\"hidden\" name=\"" . $champ[0] . "\" value=\"" . $champ[1] . "\">";
}
$form .= "</form>\n";
return $form;
} |
Partager