lilalo

diff lm @ 4:774de5c1ad00

lm report выводит страничку-индекс для курса
author devi
date Tue May 24 13:35:21 2005 +0300 (2005-05-24)
parents 6c1d2b9f45e7
children 7d4d067f9823
line diff
     1.1 --- a/lm	Tue May 24 13:00:28 2005 +0300
     1.2 +++ b/lm	Tue May 24 13:35:21 2005 +0300
     1.3 @@ -7,6 +7,7 @@
     1.4  use Switch;
     1.5  use XML::Simple;
     1.6  use Getopt::Long;
     1.7 +use utf8;
     1.8  
     1.9  our $XMLClass;
    1.10  our $XMLCourse;
    1.11 @@ -323,7 +324,52 @@
    1.12  	my $date=$XMLClass->{"date"};
    1.13  	my $encoding=$XMLClass->{"charset"};
    1.14  
    1.15 -	print "date=$date\n";
    1.16 +	my $center = $XMLClass->{"center"};
    1.17 +	my $instructor = $XMLClass->{"instructor"}->{"firstname"}." ".$XMLClass->{"instructor"}->{"surname"};
    1.18 +	my $course_name = $XMLCourse->{"fullname"}[0];
    1.19 +
    1.20 +	# Индекс для данного класса
    1.21 +
    1.22 +	my $head;
    1.23 +
    1.24 +	$head="Журналы лабораторных работ";
    1.25 +	open(HTML, ">$webdir/$date/index.html")
    1.26 +		or die "Can't open $webdir/$date/index.html for writing";
    1.27 +	binmode HTML, ":utf8";
    1.28 +	print HTML <<HEAD;
    1.29 +	<html>
    1.30 +	<head>
    1.31 +	<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
    1.32 +	<title>$head</title>
    1.33 +	</head>
    1.34 +	<body>
    1.35 +	<h1>$head</h1>
    1.36 +	<p>
    1.37 +	Курс: $course_name ($course)<br/>
    1.38 +	Начало: $date<br/>
    1.39 +	Учебный центр: $center <br/>
    1.40 +	Инструктор: $instructor <br/>
    1.41 +	</p>
    1.42 +	<table>
    1.43 +HEAD
    1.44 +	for my $student (@{$XMLClass->{"student"}}) {
    1.45 +		my $user = $student->{"user"};
    1.46 +		my $hostname = $student->{"host"};
    1.47 +		print HTML "<tr>\n";
    1.48 +		print HTML "<td>",$student->{"firstname"}," ",$student->{"surname"},"</td>\n";
    1.49 +		print HTML "<td>",$hostname,"</td>\n";
    1.50 +		print HTML "<td><a href=\"$hostname/$user.html\">",$user,"</td>\n";
    1.51 +		print HTML "<td><a href=\"$hostname/root.html\">","root","</td>\n";
    1.52 +		print HTML "</tr>\n";
    1.53 +	}
    1.54 +	print HTML <<TAIL;
    1.55 +	</table>
    1.56 +	</html>
    1.57 +TAIL
    1.58 +	close (HTML);
    1.59 +	exit;
    1.60 +
    1.61 +	# Собственно журналы
    1.62  
    1.63  	for my $student (@{$XMLClass->{"student"}}) {
    1.64  		my $user = $student->{"user"};
    1.65 @@ -346,6 +392,9 @@
    1.66  			" --encoding $encoding"
    1.67  		);
    1.68  	}
    1.69 +
    1.70 +	
    1.71 +	
    1.72  }
    1.73  
    1.74  sub load_run