<?php

echo "<div class='login'>\n";
if (!$login_timeout) { //FA logo and Version, Build Date.
	echo "<div class='logo'><img style='height:40px;' src='$path_to_root/themes/$def_theme/images/logo_frontaccounting.png'></div>\n";
	echo "<div class='msg'>"._("Version")." $version&nbsp;&nbsp;&nbsp;Build ".$SysPrefs->build_version."&nbsp;&nbsp;-&nbsp;&nbsp; "._("Login")."</div>\n";
}
else
	echo "<center><font size=5>"._('Authorization timeout')."</font></center>";
start_form(false, false, $_SESSION['timeout']['uri'], $form_name);
$img = ($pw_reset ? "mail-w" : "user-w");
echo "<div class='row'><div class='col-25 pic'><label for='$user_name_entry_field'>
	<img src='$path_to_root/themes/$def_theme/images/$img.png'></label></div>\n";
echo "<div class='col-75'><input type='text' name='$user_name_entry_field' placeholder='$user_name'></div>\n";
echo "</div>\n"; // row
if (!$pw_reset)
{
	echo "<div class='row'><div class='col-25 pic'><label for='password'><img src='$path_to_root/themes/$def_theme/images/lock-w.png'></label></div>\n";
	echo "<div class='col-75'><input type='password' name='password' value='$password' placeholder='"._("Password")."'></div>\n";
	echo "</div>\n"; // row
}

if ($login_timeout) {
	hidden('company_login_name', user_company());
} 
else {
	$coy =  user_company();
	if (!isset($coy))
		$coy = $def_coy;
	echo "<div class='row'><div class='col-25 pic'><label for='company_login_name'><img src='$path_to_root/themes/$def_theme/images/database-w.png'></label></div>\n";
	if (!@$SysPrefs->text_company_selection) {
		echo "<div class='col-75'>$company_select</div>\n"; 
	}
	else {
		echo "<div class='col-75'><input type='text' name='company_login_nickname' placeholder='"._("Company")."'></div>\n";
	}
	echo "</div>\n"; // row
	echo "<div class='helper' id='log_msg'>$demo_text</div>\n";
}
echo "<input type='hidden' id=ui_mode name='ui_mode' value='".!fallback_mode()."' >\n";
echo "<div class='row'><button type='submit' name='$submit_name' onclick=
	'set_fullmode();'" . (isset($blocked_msg) ? " disabled" : '') . ">$submit_text</button></div>\n";

if (!$pw_reset)
	timeout_post();
end_form(1);

echo "</div>\n"; // login
