<?

$row = $this->company->Assoc();

if($this->company->Numrows == 0){

	?>
	<tr class="append_register_row">
		<th><?=$this->Language('Firma nimi');?></th>
		<td><input type="text" name="name"/></td>
	<tr>
	<tr class="append_register_row">
		<th><?=$this->Language('Email');?></th>
		<td><input type="text" name="email"/></td>
	<tr>
	<tr class="append_register_row" id="register_btn_row">
		<th></th>
		<td><input type="submit" name="register" value="<?=$this->Language('Registreeri');?>"/></td>
	<tr>
	<?
}
else{

	if($row['status'] == 0){

		?>
		<tr class="append_register_row">
			<th><?=$this->Language('Firma nimi');?></th>
			<td><?=$row['name'];?></td>
		<tr>
		<tr class="append_register_row">
			<th><?=$this->Language('Email');?></th>
			<td><?=$row['email'];?></td>
		<tr>
		<tr class="append_register_row">
			<th></th>
			<td style="color:red;"><?=$this->Language('Firma kustutatud');?></td>
		<tr>
		<?
	}
	else if($this->company->Numrows > 1){

		?>
		<tr class="append_register_row">
			<th><?=$this->Language('Firma nimi');?></th>
			<td><?=$row['name'];?></td>
		<tr>
		<tr class="append_register_row">
			<th><?=$this->Language('Email');?></th>
			<td><?=$row['email'];?></td>
		<tr>
		<tr class="append_register_row">
			<th></th>
			<td style="color:red;"><?=$this->Language('Antud registri koodiga on registreeritud 2 firmat, palun võta ühendust info@infojuht.ee');?></td>
		<tr>
		<?
	}
	else if(!$row['email'] && $row['client_id'] > 0){

		?>
		<tr class="append_register_row">
			<th><?=$this->Language('Firma nimi');?></th>
			<td><?=$row['name'];?></td>
		<tr>
		<tr class="append_register_row">
			<th><?=$this->Language('Email');?></th>
			<td><?=$row['email'];?></td>
		<tr>
		<tr class="append_register_row">
			<th></th>
			<td style="color:red;"><?=$this->Language('Teil ei ole emaili aadressi meie baasis, palun võtke ühendust info@infojuht.ee');?></td>
		<tr>
		<?
	}
	else if($row['client_id'] > 0){

		?>
		<tr class="append_register_row">
			<th><?=$this->Language('Firma nimi');?></th>
			<td><?=$row['name'];?></td>
		<tr>
		<tr class="append_register_row">
			<th><?=$this->Language('Email');?></th>
			<td><?=$row['email'];?></td>
		<tr>
		<tr class="append_register_row">
			<th></th>
			<td style="color:red;"><?=$this->Language('Firma juba registreeritud');?></td>
		<tr>
		<?
	}
	else{

		?>
		<tr class="append_register_row">
			<th><?=$this->Language('Firma nimi');?></th>
			<td><?=$row['name'];?></td>
		<tr>
		<tr class="append_register_row">
			<th><?=$this->Language('Email');?></th>
			<td><input type="hidden" name="email" value="1"/><?=$row['email'];?></td>
		<tr>
		<tr class="append_register_row" id="register_btn_row">
			<th></th>
			<td><input type="submit" name="register" value="<?=$this->Language('Registreeri');?>"/></td>
		<tr>
		<?
	}
}

?>