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
| #!/usr/bin/perl
use CGI_Lite; # Utilisation du module CGI_Lite
$cgi=new CGI_Lite; # Création d'un nouvel objet CGI_Lite pour traiter le formulaire
%in = $cgi->parse_form_data; # Lecture des paramètres dans le tableau associatif %in
print "Content-type: text/html\n\n"; # Affichage de l'entête indispensable
print "<head>";
print "<title>Rapport des exceptions</title>";
#print "Content-Type: text/javascript\n\n";
print '<script language="JavaScript">';
print "function afficherAutre() {";
print 'alert("allo")';
print "if (document.form1.liste1.value ne 'Environnement') {";
print "<select name=liste1>";
for (my $j=0; $j <= $#liste; $j++) {
print "<option value=http://172.xx.xx.xxx/unix/$liste[$j]> $liste[$j]</option>";
}
print "</select>";
print "}";
print "}";
print "</script>";
print "</head>";
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>";
#$rep="http:\\pperse01\\rapports_des_seuils\\Tous_UNIX";
$rep="D:\\rapports_des_seuils\\Tous_UNIX";
$i = 0;
opendir(DIR, $rep) || die "Impossible de lire $rep : $!\n";
my @liste = grep { not /^[.][.]?\z/ && -r "$rep/$_" } readdir(DIR);
@liste = map{lc($_)} @liste;
closedir(DIR);
#for (my $j=0; $j <= $#liste; $j++) {
# @liste[$j] =~ s/[^0-9-]+//g;
#}
print "Le contenu du répertoire: $rep<br><br>\n";
#foreach (@liste) {
# $i++;
# print "<b>$_</b><br>\n";
#}
print "<b>Quel rapport voulez-vous voir ?</b><br>\n";
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>";
}
print "</select>";
print "<INPUT TYPE='button' VALUE='OK' onClick='location =
form1.liste1.options[form1.liste1.selectedIndex].value;'>";
print "</form>";
#
print "<hr>";
$rep="D:\\rapports_des_seuils\\UNIX";
$i = 0;
opendir(DIR, $rep) || die "Impossible de lire $rep : $!\n";
my @liste = grep { not /^[.][.]?\z/ && -r "$rep/$_" } readdir(DIR);
@liste = map{uc($_)} @liste;
closedir(DIR);
@liste[0] = "Environnement";
#for (my $j=0; $j <= $#liste; $j++) {
# @liste[$j] =~ s/[^0-9-]+//g;
#}
print "Le contenu du répertoire: $rep<br><br>\n";
#foreach (@liste) {
# $i++;
# print "<b>$_</b><br>\n";
#}
print "<b>Choisir votre environnement ?</b><br>\n";
print "<form>";
print "<select name=liste1 onChange=afficherAutre()>";
for (my $j=0; $j <= $#liste; $j++) {
print "<option value=http://172.xx.xx.xxx/unix/$liste[$j]> $liste[$j]</option>";
}
print "</select>";
#print "<INPUT TYPE='button' VALUE='OK' onClick='location =
# form.liste1.options[form.liste1.selectedIndex].value;'>";
print "</form>";
#$folder = "http:\\pperse01\cgi-bin";
#$dossier = opendir(DIR, $folder);
#while ($Fichier = readdir($dossier)) {
#if ($Fichier != "." && $Fichier != "..") {
#$nomFichier = $Fichier;
#print $nomFichier\n;
#print "<br>";
#}
#}
#closedir($dossier);
print "</body>";
print "</html>"; |
Partager