summaryrefslogtreecommitdiffstats
path: root/views/main_page.tt
blob: c7ad6b01a495ae76f6537694a872ad7fcd8cd68e (plain)
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
<html>
	<body>
		% (my @tab) = @{$_[0]->{'table'}};
		% my $pool_id=0;
		% my $pool_isbn=1;
		% my $pool_title=2;
		% my $pool_author=3;
		% my $pool_owner=4;
		% my $pool_state=5;
		% my $pool_who=6;
		% my $pool_can_borrow=7;
		% my $pool_reserved=8;
		% my $pool_comment=9;
		<table border=7>
		<tr><td>id</td><td>isbn</td><td>tytul</td><td>autor</td><td>wlasiciciel</td><td>jest?</td><td>kto?</td><td>mozna brac?</td><td>zarezerwowana?</td><td>komentarz</td></tr>
		<tr>
		
		% for (my $i=0;$i<$#tab+1;$i++)
		% {
		% 	for (my $ii=0;$ii<9;$ii++) #Jest 9 pol w kazdym rekordzie
		% 	{
		
		% 		if ($ii==$pool_state || $ii==$pool_can_borrow || $ii==$pool_reserved)
		% 		{
		%			if ($tab[$i][$ii]==1)
		% 			{
		% 				$tab[$i][$ii] = 'Tak';
		% 			}
		% 			else
		% 			{
		% 				$tab[$i][$ii] = 'Nie';
		% 			}
		% 		}
				<td> <%= $tab[$i][$ii] %> </td>
		% 	}
		%= "\n"
			</tr>
			<tr>
		% }
		
		</table>
		
		<br>
		Rezerwacja ksiazek. Podaj id ksiazki do zarezerwowania. <br>
		<form action="http://i.am-a.cat:3000/res" method="post">
			<input type="text" name="book_id">
			<input type="submit" value="zarezerwuj">
		</form>
	</body>
</html>