1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
| my $q = new CGI;
my $login = $q->param("login");
my $pass = $q->param("pass");
my $espece = $q->param("espece");
my $site = $q->param("site");
my $schema = GREGOR_Serre->getSchema();
my $droit = $q->param("droit");
my $plante_select = $q->param("plante_select");
my $text_test = $q->param("text_test");
my $script ="<script language=javascript>
</script>";
print $q->header();
print FORM->getHeader("Worksheet");
if ( $login , $pass)
{
#si 1er passage, on initialise les variables a 1 apr defaut : 1 test
if ($text_test=='')
{
$text_test = 1;
}
print $script, "\n<body><center>\n";
print $q->h1("Worksheet");
my $exist = requete avec count(*)
if ($exist->[0][0] eq 0)
{
print "<table border=1>";
print "<tr align=center>
<td>
<table border=0>
<tr align=center bgcolor=\"FFFFE8\">
my (@nature_test, @endroit_test, @protocole_test);
#Tests
print "<form name='nb_fecond' action='fiche_travail_new.cgi' method='post' enctype='multipart/form-data'>";
print $q->textfield(-name=>'text_test', default=>$text_test, size=>1);
print $q->hidden(-name=>'text_prel', -value=>$text_prel);
print $q->hidden(-name=>'login', -value=>$login);
print $q->hidden(-name=>'pass', -value=>$pass);
print $q->hidden(-name=>'plante_select', -value=>$plante_select);
for (my $x=1; $x<=$text_test; $x++)
{
print $q->hidden(-name=>'nature_test['.$x.']', -value=>'$nature_test[$x]');
print $q->hidden(-name=>'endroit_test['.$x.']', -value=>'$endroit_test[$x]');
print $q->hidden(-name=>'protocole_test['.$x.']', -value=>'$protocole_test[$x]');
}
print $q->submit(-name=>"submit_test", -value=>'OK', -action=>'');
print "</form>";
print "</td><tr></table></td></tr><tr><td align=center>";
print "<table border=1><tr><td align=center> N° </td><td align=center> Nature </td><td align=center> Type d'explant </td><td align=center> Protocole </td</tr>";
my $nature_test = requete pr recup valeur a mettre dans liste deroulante
my $endroit_test = requete pr recup valeur a mettre dans liste deroulante
my $protocole_test = requete pr recup valeur a mettre dans liste deroulante
for (my $j=1; $j<=$text_test;$j++)
{
print "<tr><td align=center>$j</td><td>";
print FORM->bd_combo("nature_test[]", $nature_test, "", 1, "");
print "</td><td>";
print FORM->bd_combo("endroit_test[]", $endroit_test, "", 1, "");
print "</td><td>";
print FORM->bd_combo("protocole_test[]", $protocole_test, "", 1, "");
print "</td></tr>";
}
print "</table>";
print "<br></td></tr>";
print "</td></tr></table>";
print $q->hidden(-name=>'text_test', -value=>$text_test);
print $q->hidden(-name=>'login', -value=>$login);
print $q->hidden(-name=>'pass', -value=>$pass);
print $q->hidden(-name=>'plante_select', -value=>$plante_select);
for (my $x=1; $x<=$text_test; $x++)
{
print $q->hidden(-name=>'nature_test['.$x.']', -value=>'$nature_test[$x]');
print $q->hidden(-name=>'endroit_test['.$x.']', -value=>'$endroit_test[$x]');
print $q->hidden(-name=>'protocole_test['.$x.']', -value=>'$protocole_test[$x]');
}
print $q->submit(-name=>"submit", -value=>'Validate');
print "</form>";
}
my @lst_params = $q->param;
foreach my $param (@lst_params) {
my $val = $q->param($param);
print "$param : $val<br>";
}
print $q->end_html();
} |
Partager