]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/country.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
26 my $flagdir = '/srv/web/ipfire/html/images/flags';
33 require '/var/ipfire/general-functions.pl';
34 require "${General::swroot}/lang.pl";
35 require "${General::swroot}/header.pl";
37 &Header
::showhttpheaders
();
39 &Header
::openpage
($Lang::tr
{'countries'}, 1, '');
40 &Header
::openbigbox
('100%', 'left');
42 &Header
::openbox
('100%', 'left', $Lang::tr
{'country codes and flags'});
43 print "<table class='tbl'>";
44 print "<tr><th style='width=5%;'><b>$Lang::tr{'flag'}</b></th>";
45 print "<th style='width=5%;'><b>$Lang::tr{'countrycode'}</b></th>";
46 print "<th style='width=40%; text-align:left;'><b>$Lang::tr{'country'}</b></th>";
47 print "<th> </th>";
48 print "<th style='width=5%;'><b>$Lang::tr{'flag'}</b></th>";
49 print "<th style='width=5%;'><b>$Lang::tr{'countrycode'}</b></th>";
50 print "<th style='width=40%; text-align:left;'><b>$Lang::tr{'country'}</b></th></tr>";
52 @flaglist = <$flagdir/*>;
58 if (!-d
) { push(@flaglistfiles,substr($_,rindex($_,"/")+1)); }
61 foreach $flag (@flaglistfiles)
65 my $flagcode = uc(substr($flag, 0, 2));
66 my $fcode = lc($flagcode);
67 my $country = Locale
::Country
::code2country
($fcode);
68 if($fcode eq 'eu') { $country = 'Europe'; }
69 if($fcode eq 'tp') { $country = 'East Timor'; }
70 if($fcode eq 'yu') { $country = 'Yugoslavia'; }
72 print "<td $col><a id='$fcode'><img src='/images/flags/$fcode.png' alt='$flagcode' title='$flagcode'/></a></td>";
73 print "<td $col>$flagcode</td>";
74 print "<td $col>$country</td></tr>\n";
79 $col="style='background-color:${Header::table2colour};'";
81 $col="style='background-color:${Header::table1colour};'";
84 print "<td $col><a id='$fcode'><img src='/images/flags/$fcode.png' alt='$flagcode' title='$flagcode'/></a></td>";
85 print "<td $col>$flagcode</td>";
86 print "<td $col>$country</td>";
87 print "<td $col> </td>";
95 &Header
::closebigbox
();
98 <div style='text-align:center'>
99 <a href='$ENV{'HTTP_REFERER'}'>$Lang::tr{'back'}</a>
104 &Header
::closepage
();