<?
if(!defined("B_PROLOG_INCLUDED")||B_PROLOG_INCLUDED!==true)die();
/**
 * Bitrix vars
 *
 * @var array $arParams
 * @var array $arResult
 * @var CBitrixComponentTemplate $this
 * @global CMain $APPLICATION
 * @global CUser $USER
 */

 use Bitrix\Main\Localization\Loc;
?>


<div>
<?if(!empty($arResult["ERROR_MESSAGE"]))
{
	foreach($arResult["ERROR_MESSAGE"] as $v)?>
	<span class="text-danger"><?=$v?></span><br>	
<?}
if($arResult["OK_MESSAGE"] <> '')
{
	?><span class="text-success"><?=$arResult["OK_MESSAGE"]?></span><br><?
}
?>
<form class="d-flex gap-3 flex-wrap" action="<?=POST_FORM_ACTION_URI?>" method="POST">
<?=bitrix_sessid_post()?>
    <div class="w-100 d-flex gap-3">
        <div class="w-50">
            <input type="text" name="user_name" placeholder="<?=Loc::GetMessage("MFT_NAME") ?><?= (empty($arParams["REQUIRED_FIELDS"]) || in_array("NAME", $arParams["REQUIRED_FIELDS"])) ? '*' : ''?>" class="form-control w-100" value="<?=$arResult["AUTHOR_NAME"]?>">
        </div>
        <div class="w-50">
            <input type="text" name="user_email" placeholder="<?=Loc::GetMessage("MFT_EMAIL") ?><?= (empty($arParams["REQUIRED_FIELDS"]) || in_array("EMAIL", $arParams["REQUIRED_FIELDS"])) ? '*' : ''?>" class="form-control w-100" value="<?=$arResult["AUTHOR_EMAIL"]?>">
        </div>
    </div>
    <div class="w-100">
        <input type="text" name="user_phone" placeholder="<?=Loc::GetMessage("MFT_PHONE") ?><?= (empty($arParams["REQUIRED_FIELDS"]) || in_array("PHONE", $arParams["REQUIRED_FIELDS"])) ? '*' : ''?>" class="form-control w-100" value="<?=$arResult["AUTHOR_PHONE"]?>">
    </div>
    <div class="w-100">
        <textarea value="<?=$arResult["MESSAGE"]?>" placeholder="<?=Loc::GetMessage("MFT_MESSAGE") ?><?= (empty($arParams["REQUIRED_FIELDS"]) || in_array("MESSAGE", $arParams["REQUIRED_FIELDS"])) ? '*' : ''?>" class="form-control w-100" name="MESSAGE"></textarea>
    </div>
		<?if($arParams["USE_CAPTCHA"] == "Y"):?>
		<div class="mf-captcha">
			<div class="mf-text"><?=GetMessage("MFT_CAPTCHA")?></div>
			<input type="hidden" name="captcha_sid" value="<?=$arResult["capCode"]?>">
			<img src="/bitrix/tools/captcha.php?captcha_sid=<?=$arResult["capCode"]?>" width="180" height="40" alt="CAPTCHA">
			<div class="mf-text"><?=GetMessage("MFT_CAPTCHA_CODE")?><span class="mf-req">*</span></div>
			<input type="text" name="captcha_word" size="30" maxlength="50" value="">
		</div>
		<?endif;?>
        <input type="submit" name="submit" class="btn my-3" value="<?=GetMessage("MFT_SUBMIT")?>">
		<input type="hidden" name="PARAMS_HASH" value="<?=$arResult["PARAMS_HASH"]?>">
</form>