#!/usr/bin/perl

require('cgi-lib.pl');
&ReadParse();

$zone=$in{'zone'};
$name=$in{'name'};
$num=$in{'num'};

print "Content-type:text/html\n\n";

if (($zone eq '')||($name eq '')||($num eq ''))
{
 print 'ERROR!';
 exit;
}

open(H,"../$zone/$name\-lap$num\.html");
@lines=<H>;
close H;

print q{<HTML>
<HEAD>
};

$i=0;
while ($lines[$i]!~/\<title/i)
{
 $i++;
}
print $lines[$i];
print q{</HEAD>
<BODY BGCOLOR=WHITE>
<H2 ALIGN=CENTER>Egyedi ingatlanlap<BR>
<FONT COLOR=DARKBLUE>Allgemeine Angaben<BR>
</FONT><FONT COLOR=DARKGREEN>General data</FONT></H2>
<P>
<BR>
<CENTER>
<TABLE BORDER CELLPADDING=10>
<TR>
<TD>
<B>};
print $num;
print q{.)</B>
</TD>
</TR>
</TABLE>
</CENTER>
<P>
<BR>
<FORM METHOD=POST ACTION="editgd.cgi">
<INPUT TYPE=HIDDEN NAME="zone" VALUE="};
print $zone;
print q{">
<INPUT TYPE=HIDDEN NAME="name" VALUE="};
print $name;
print q{">
<INPUT TYPE=HIDDEN NAME="num" VALUE="};
print $num;
print q{">
<TABLE BORDER>
<TR>
<TD>Telep&uuml;l&eacute;s neve:<BR>
(<FONT COLOR="#0000A0">Siedlung</FONT>, <FONT COLOR="#008000">Name of settlement</FONT>)</TD>
<TD>
<B>};

while ($lines[$i]!~/\<\!\-\-name\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{</B>
</TD>
</TR>
<TR>
<TD>Adatfelv&eacute;tel d&aacute;tuma:<BR>
(<FONT COLOR="#0000A0">Datum der Datenaufname</FONT>, <FONT COLOR="#008000">Year of survery</FONT>)</TD>
<TD><INPUT NAME="date" SIZE=12 VALUE="};

while ($lines[$i]!~/\<\!\-\-date\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD>Tulajdonos neve:<BR>
(<FONT COLOR="#0000A0">Besitzer</FONT>, <FONT COLOR="#008000">Owner</FONT>)
</TD>
<TD><INPUT NAME="owner" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-owner\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD>Aj&aacute;nlatot tev&otilde; szervezet neve:<BR>
(<FONT COLOR="#0000A0">Angebotsgeber</FONT>, <FONT COLOR="#008000">Tenders invited by</FONT>)</TD>
<TD><INPUT NAME="tender" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-tender\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD>C&iacute;me:<BR>
(<FONT COLOR="#0000A0">Adresse</FONT>, <FONT COLOR="#008000">Address</FONT>)</TD>
<TD><INPUT NAME="address" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-address\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD>Telefon/Fax:</TD>
<TD><INPUT NAME="phone" SIZE=12 VALUE="};

while ($lines[$i]!~/\<\!\-\-phone\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Kontakt szem&eacute;ly:<BR>
(<FONT COLOR="#0000A0">Kontaktmann</FONT>, <FONT COLOR="#008000">Contact person</FONT>)</TD>
<TD><INPUT NAME="contact" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-contact\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Ingatlan pontos helye:<BR>
(<FONT COLOR="#0000A0">Ort der Immobilien</FONT>, <FONT COLOR="#008000">Exact place of real estate</FONT>)</TD>
<TD><INPUT NAME="exact" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-exact\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Helyrajzi sz&aacute;ma:<BR>
(<FONT COLOR="#0000A0">Parzellenzahl</FONT>, <FONT COLOR="#008000">No. in cadastral survey</FONT>)</TD>
<TD><INPUT NAME="no" SIZE=12 VALUE="};

while ($lines[$i]!~/\<\!\-\-no\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Esetleges terhei:<BR>
(<FONT COLOR="#0000A0">Belastungen</FONT>, <FONT COLOR="#008000">Mortgage (if any)</FONT>)</TD>
<TD><INPUT NAME="mortgage" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-mortgage\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Jelenlegi Hasznos&iacute;t&aacute;s:<BR>
(<FONT COLOR="#0000A0">Derzeitige Anwendung</FONT>, <FONT COLOR="#008000">Present util.</FONT>)</TD>
<TD><INPUT NAME="presentutil" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-presentutil\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Hasznos&iacute;t&aacute;si javaslat:<BR>
(<FONT COLOR="#0000A0">Empfehlung f&uuml;r Anwendung</FONT>, <FONT COLOR="#008000">Proposal for util.</FONT>)</TD>
<TD><INPUT NAME="proposal" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-proposal\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>
<TABLE BORDER>
<TR>
<TD>Hasznos&iacute;t&aacute;s form&aacute;ja:<BR>
(<FONT COLOR="#0000A0">Art der Anwendung</FONT>, <FONT COLOR="#008000">Form of utilization</FONT>)</TD>
<TD>T&aacute;rsul&aacute;s<BR>
(<FONT COLOR="#0000A0">Vereinigung</FONT>, <FONT COLOR="#008000">Association</FONT>)</TD>
<TD>B&eacute;rlet<BR>
(<FONT COLOR="#0000A0">Vermieten</FONT>, <FONT COLOR="#008000">Leasing</FONT>)</TD>
<TD>Elad&aacute;s<BR>
(<FONT COLOR="#0000A0">Verkauf</FONT>, <FONT COLOR="#008000">Sale</FONT>)</TD>
<TD>&Aacute;r:<BR>
(<FONT COLOR="#0000A0">Preis</FONT>, <FONT COLOR="#008000">Price</FONT>)</TD>
</TR>
<TR>
<TD><INPUT NAME="formutil" SIZE=15 VALUE="};

while ($lines[$i]!~/\<\!\-\-formutil\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT NAME="association" SIZE=15 VALUE="};

while ($lines[$i]!~/\<\!\-\-association\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT NAME="leasing" SIZE=15 VALUE="};

while ($lines[$i]!~/\<\!\-\-leasing\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT NAME="sale" SIZE=15 VALUE="};

while ($lines[$i]!~/\<\!\-\-sale\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT NAME="price" SIZE=15 VALUE="};

while ($lines[$i]!~/\<\!\-\-price\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>
<P>
<B>Az ingatlan jellege</B><BR>
<TEXTAREA NAME="jelleg" ROWS=10 COLS=80 WRAP=SOFT>};

while ($lines[$i]!~/\<\!\-\-jelleg\-\-\>/i)
{
 $i++;
}
$i++;
$j='';
while ($lines[$i]!~/\<\/B\>/i)
{
 $lines[$i]=~s/\<B\>//gi;
 $j.=$lines[$i++];
}
$lines[$i]=~s/\<B\>//gi;
$lines[$i]=~s/\<\/B\>//gi;
$j.=$lines[$i];
$j=~s/\<BR\>//gi;
print $j;

print q{</TEXTAREA>

<P><B>Az ingatlan funkci&oacute;ja</B><BR> 
<TEXTAREA NAME="function" ROWS=10 COLS=80 WRAP=SOFT>};

while ($lines[$i]!~/\<\!\-\-function\-\-\>/i)
{
 $i++;
}
$i++;
$j='';
while ($lines[$i]!~/\<\/B\>/i)
{
 $lines[$i]=~s/\<B\>//gi;
 $j.=$lines[$i++];
}
$lines[$i]=~s/\<B\>//gi;
$lines[$i]=~s/\<\/B\>//gi;
$j.=$lines[$i];
$j=~s/\<BR\>//gi;
print $j;

print q{</TEXTAREA>

<TABLE BORDER>
<TR> 
<TD>Alapter&uuml;let:<BR>
(<FONT COLOR="#0000A0">Gr&ouml;sse</FONT>, <FONT COLOR="#008000">Area</FONT>)
</TD>
<TD><INPUT NAME="area" SIZE=6 VALUE="};

while ($lines[$i]!~/\<\!\-\-area\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) m\<SUP\>2\<\/SUP\>\<\/B\>/i;
print $1;

print q{"> m<SUP>2</SUP></TD>  
</TR>
<TR>
<TD>Becs&uuml;lt &eacute;rt&eacute;k:<BR>
(<FONT COLOR="#0000A0">Prognostisiertes Wert</FONT>, <FONT COLOR="#008000">Estimated value</FONT>)</TD>
<TD>
<INPUT NAME="value" SIZE=6 VALUE="};

while ($lines[$i]!~/\<\!\-\-value\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) 1000 HUF\<\/B\>/i;
print $1;

print q{"> 1000 HUF
</TD>
</TR>
<TR> 
<TD>Be&eacute;p&iacute;tetts&eacute;g:<BR>
(<FONT COLOR="#0000A0">Einbaustufe</FONT>, <FONT COLOR="#008000">Built in</FONT>)</TD>
<TD><INPUT NAME="builtin" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-builtin\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) m\<SUP\>2\<\/SUP\>\<\/B\>/i;
print $1;

print q{"> m<SUP>2</SUP></TD>
</TR>
<TR>
<TD>Belmagass&aacute;g:<BR>
(<FONT COLOR="#0000A0">Innenh&ouml;he</FONT>, <FONT COLOR="#008000">Inside height</FONT>)</TD>
<TD><INPUT NAME="height" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-height\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) m\<\/B\>/i;
print $1;

print q{"> m</TD>
</TR>
<TR> 
<TD>Homlokzati sz&eacute;less&eacute;g:<BR>
(<FONT COLOR="#0000A0">Breite der Fassade</FONT>, <FONT COLOR="#008000">Frontal width</FONT>) </TD>
<TD><INPUT NAME="width" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-width\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) m\<\/B\>/i;
print $1;

print q{"> m</TD>
</TR>
<TR>
<TD>&Eacute;p&iacute;t&eacute;s &eacute;ve:<BR>
(<FONT COLOR="#0000A0">Baujahr</FONT>, <FONT COLOR="#008000">Building year</FONT>)</TD>
<TD><INPUT NAME="building" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-building\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR> 
<TD>Fel&uacute;j&iacute;t&aacute;s &eacute;ve:<BR>
(<FONT COLOR="#0000A0">Jahr der Renovierung</FONT>, <FONT COLOR="#008000">Year of reconstruction</FONT>)</TD>
<TD><INPUT NAME="reconstruction" SIZE=4 VALUE="};

while ($lines[$i]!~/\<\!\-\-reconstruction\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD>Szil&aacute;rd burkolat&uacute; &uacute;ton megk&ouml;zel&iacute;thet&otilde;-e:<BR>
(<FONT COLOR="#0000A0">Erreichbar auf der Stra&szlig;e mit fester Oberfl&auml;che</FONT>,
<FONT COLOR="#008000">Accessible by hard surface road</FONT>) </TD>
<TD>
<SELECT NAME="access" SIZE=1>
};

while ($lines[$i]!~/\<\!\-\-access\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT /i;
if ($1 eq 'igen')
{
 print q{<OPTION SELECTED>igen
<OPTION>nem};
}
elsif ($1 eq 'nem')
{
 print q{<OPTION>igen
<OPTION SELECTED>nem};
}
else
{
 print "ERROR!";
}

print q{</SELECT>
</TD>
</TR>
<TR>
<TD>T&aacute;vols&aacute;ga f&otilde;&uacute;tvonalt&oacute;l:<BR>
(<FONT COLOR="#0000A0">Entfernung von der Landstrasse</FONT>, <FONT COLOR="#008000">Distance from main road</FONT>)</TD>
<TD><INPUT NAME="road_distance" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-road_distance\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) km\<\/B\>/i;
print $1;

print q{"> km</TD>
</TR>
<TR>
<TD>T&aacute;vols&aacute;ga vas&uacute;tvonalt&oacute;l:<BR>
(<FONT COLOR="#0000A0">Entfernung von der Eisenbahn</FONT>, <FONT COLOR="#008000">Distance from railway</FONT>)</TD>
<TD><INPUT NAME="rail_distance" SIZE=5 VALUE="};

while ($lines[$i]!~/\<\!\-\-rail_distance\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) km\<\/B\>/i;
print $1;

print q{"> km</TD>
</TR>
<TR>
<TD>Telefon f&otilde;vonalak sz&aacute;ma:<BR>
(<FONT COLOR="#0000A0">Anzahl der Telefonlinien</FONT>, <FONT COLOR="#008000">Number of telephone lines</FONT>)</TD>
<TD><INPUT NAME="phone_number" SIZE=12 VALUE="};

while ($lines[$i]!~/\<\!\-\-phone_number\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) db\<\/B\>/i;
print $1;

print q{"> db</TD>
</TR>
<TR>
<TD>V&iacute;z:<BR>
(<FONT COLOR="#0000A0">Wasser</FONT>, <FONT
COLOR="#008000">Water</FONT>)</TD>  
<TD>
<SELECT NAME="water" SIZE=1>
};

while ($lines[$i]!~/\<\!\-\-water\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT /i;
if ($1 eq 'van')
{
 print q{<OPTION SELECTED>van
<OPTION>nincs};
}
elsif ($1 eq 'nincs')
{
 print q{<OPTION>van
<OPTION SELECTED>nincs};
}
else
{
 print "ERROR!";
}

print q{
</SELECT>
</TD>
</TR>
<TR>
<TD>G&aacute;z:<BR>
(<FONT COLOR="#0000A0">Gas</FONT>, <FONT COLOR="#008000">Gas</FONT>)</TD>
<TD>
<SELECT NAME="gas" SIZE=1>
};

while ($lines[$i]!~/\<\!\-\-gas\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT /i;
if ($1 eq 'van')
{
 print q{<OPTION SELECTED>van
<OPTION>nincs};
}
elsif ($1 eq 'nincs')
{
 print q{<OPTION>van
<OPTION SELECTED>nincs};
}
else
{
 print "ERROR!";
}

print q{
</SELECT>
</TD>
</TR>
<TR>
<TD>Elektromos &aacute;ram:<BR>
(<FONT COLOR="#0000A0">Elektrizit&auml;t</FONT>, <FONT COLOR="#008000">Electricity</FONT>)</TD>
<TD>
<SELECT NAME="electricity" SIZE=1>
};

while ($lines[$i]!~/\<\!\-\-electricity\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT /i;
if ($1 eq 'van')
{
 print q{<OPTION SELECTED>van
<OPTION>nincs};
}
elsif ($1 eq 'nincs')
{
 print q{<OPTION>van
<OPTION SELECTED>nincs};
}
else
{
 print "ERROR!";
}

print q{
</SELECT>
</TD>
</TR>

<TR>
<TD>Csatorna:<BR>
(<FONT COLOR="#0000A0">Kanalisation</FONT>, <FONT COLOR="#008000">Canalization</FONT>)</TD>
<TD>
<SELECT NAME="canal" SIZE=1>
};

while ($lines[$i]!~/\<\!\-\-canal\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT /i;
if ($1 eq 'van')
{
 print q{<OPTION SELECTED>van
<OPTION>nincs};
}
elsif ($1 eq 'nincs')
{
 print q{<OPTION>van
<OPTION SELECTED>nincs};
}
else
{
 print "ERROR!";
}

print q{
</SELECT>
</TD>
</TR>

<TR>
<TD>&Aacute;llaga:<BR>
(<FONT COLOR="#0000A0">Zustand</FONT>, <FONT COLOR="#008000">Condition</FONT>)
</TD>
<TD><INPUT NAME="condition" SIZE=50 VALUE="};

while ($lines[$i]!~/\<\!\-\-condition\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>  
<P>
<TABLE WIDTH=100%>
<TR>
<TD ALIGN=LEFT>
<INPUT TYPE=SUBMIT VALUE="   M&oacute;dos&iacute;t&aacute;s elv&eacute;gz&eacute;se   "
</TD>
<TD ALIGN=RIGTH>
<INPUT TYPE=RESET VALUE="Eredeti &aacute;llapot">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
};