| 12
 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
 
 |  
#!/usr/bin/perl
 
use CGI_Lite;
 
$cgi=new CGI_Lite;
 
%in = $cgi->parse_form_data;
 
$rep1="D:\\rapports_des_seuils\\Tous_UNIX";
$i = 0;
opendir(DIR, $rep1) || die "Impossible de lire $rep1 : $!\n"; 
my @liste = grep { not /^[.][.]?\z/ && -r "$rep1/$_" } readdir(DIR);
@liste = map{lc($_)} @liste;
closedir(DIR);
#
$rep="D:\\rapports_des_seuils\\UNIX";
$i = 0;
opendir(DIR, $rep) || die "Impossible de lire $rep : $!\n"; 
my @listeA = grep { not /^[.][.]?\z/ && -r "$rep/$_" } readdir(DIR);
@listeA = map{uc($_)} @listeA;
closedir(DIR);
$cpt = $#listeA;
#
for (my $j=0; $j <= $cpt; $j++) {
$rep="D:\\rapports_des_seuils\\UNIX\\$listeA[$j]";
opendir(DIR, $rep) || die "Impossible de lire $rep : $!\n"; 
my @listeU1 = grep { not /^[.][.]?\z/ && -r "$rep/$_" } readdir(DIR);
# ici il faudrait que @listeU1 puisse s'incrémenter tout seul i.e
# @listeU$j donc deviendrait @listeU1 puis @listeU2 et ainsi de suite..
# ou un autre moyen je ne sais plus...
@listeU1 = map{uc($_)} @listeU1;
closedir(DIR);
my @cpt1 = $#listeU1;
}
#
print "Content-type: text/html\n\n"; # Affichage de l'entête indispensable
print <<"FIN";
<html>
<head>
<title>Rapport des exceptions</title>
<script language="JavaScript">
var Html =""; // mettre la variable html à blanc
d = new Date(); 
document.write('<p align="right"><font color="black">'+d.toLocaleDateString()+','+d.toLocaleTimeString()+'</font></p>');
 
function afficherAutre() {
alert("allo");
alert(document.forms.form1.liste1A.value);
if (document.forms.form1.liste1A.value == "http://172.xx.xx.xxx/unix/Environnement") {
 alert("Je trouve environnement");
}
for (j=0; j <= $cpt; j++) {
 document.forms.form1.elements['liste1A'].options[document.forms.form1.elements['liste1A'].selectedIndex].value;
// alert("je passe dans le for " +j);
// <option value=http://172.xx.xx.xxx/unix/$listeA[$j]/$listeA[$j]> $listeA[$j]</option>
                          }
Html += '<b>Choix du rapport: <\/b><font size="4"><\/font>';
Html += ' <select name="dtrap">';
for (i=0; i <= 15; i++) {
 Html += '<option value="http://172.xx.xx.xxx/unix/$listeA[$i]/$listeA[$i]"> $listeU1[$i]<\/option>';
}
Html += ' <\/select>';
//-- ici On écrit le résultat du html
document.write( Html);
}
</script>
</head>
FIN
print "<body>";
print "<img style= 'float: left' src='../bandeau1.jpg' alt='logo'><p align=center><font size=4>RAPPORT D\'ANALYSE DES EXCEPTIONS DES PFI</p></font>";
print "<p> </p>";
print "<p> </p>";
print "<hr>";
print "Le contenu du répertoire: $rep1<br><br>";
print "<b>Quel rapport voulez-vous voir ?</b><br>";
print "<form name='form1' method='post' action=''>";
print "<select name=liste1>";
for (my $j=0; $j <= $#liste; $j++) {
print "<option value=http://172.xx.xx.xxx/tous_unix/$liste[$j]> $liste[$j]</option>\n";
                           }
print "</select>";
print "<INPUT TYPE='button' VALUE='OK' onClick='location =
       form1.liste1.options[form1.liste1.selectedIndex].value;'>";
#
print "<hr>";
print "Le contenu du répertoire: $rep<br><br>";
print "<b>Choisir votre environnement ?</b><br>";
print "<select name=liste1A onChange=afficherAutre()>";
for (my $j=0; $j <= $#listeA; $j++) {
print "<option value=http://172.27.96.172/unix/$listeA[$j]> $listeA[$j]</option>";
                           }
print "</select>";
print "</form>";
print "</body>\n";
print "</html>\n"; | 
Partager