<!-- Script PHP/MYSQL of management of classifieds ads developed by Script PAG. Script PAG all rights reserved. Use under license. http://www.script-pag.com -->
<div class="container-100">
	<div class="container-100-child forms">

		<h1><?php echo $info_page; ?></h1>
		<form id="form_captcha" action="send_contact.php" method="post">
			<?php if($param_api_gg['activ_gg_recaptcha'] == 1): ?>
				<script src="https://www.google.com/recaptcha/api.js"></script>
			<?php endif; ?>
			
			<div>
		
				<?php if (!empty($error['contact_name'])) : ?>
				<p class="p-error"><?php echo $language['page_send_cont_error1']; ?></p>
				<?php elseif (!empty($error['contact_email'])) : ?>
				<p class="p-error"><?php echo $language['page_send_cont_error2']; ?></p>
				<?php elseif (!empty($error['contact_title'])) : ?>
				<p class="p-error"><?php echo $language['page_send_cont_error3']; ?></p>
				<?php elseif (!empty($error['contact_msg'])) : ?>
				<p class="p-error"><?php echo $language['page_send_cont_error4']; ?></p>
				<?php elseif (!empty($error['contact_cod'])) : ?>
				<p class="p-error"><?php echo $language['page_send_cont_error5']; ?></p>
				<?php elseif(isset($error['ban'])) : ?>
				<p class="p-error"><?php echo $language['page_send_msg_error5']; ?></p>
				<?php endif; ?>
				
				<input type="text" name="contact_name" placeholder="<?php echo $language['page_send_cont_name']; ?>" value="<?php if(!empty($_POST['contact_name'])) echo htmlspecialchars($_POST['contact_name']); ?>" />
				<input type="text" name="contact_email" placeholder="<?php echo $language['page_send_cont_email']; ?>" value="<?php if(!empty($_POST['contact_email'])) echo htmlspecialchars($_POST['contact_email']); ?>" />
				<input type="text" name="contact_phone" placeholder="<?php echo $language['page_send_cont_phone'] .' '. $language['page_send_cont_phone_info']; ?>" value="<?php if (!empty($_POST['contact_phone'])) echo htmlspecialchars($_POST['contact_phone']); ?>" />
				
				<select name="contact">
					<?php 
						
						foreach($cache_mails_contact as $v)
						{
							$id_cont = (int) $v['id_cont'];
							
							if(isset($v['name_contact_'. $_SESSION['code_lang']]))
							$name_contact = stripslashes(htmlspecialchars($v['name_contact_'. $_SESSION['code_lang']], ENT_QUOTES));
							
							if(!empty($_POST['contact']) && $_POST['contact'] == $id_cont)
							echo '<option value="'. $id_cont .'" selected="selected">'. $name_contact .'</option>';
							
							else echo '<option value="'. $id_cont .'">'. $name_contact .'</option>';
						}
					 
					?>
				</select>

				<input type="text" name="contact_title" placeholder="<?php echo $language['page_send_cont_subject']; ?>" value="<?php if (!empty($_POST['contact_title'])) echo htmlspecialchars($_POST['contact_title']); elseif(!empty($id_ad)) echo $language['page_send_cont_subject_ad_report'] . $id_ad; ?>" />
				<textarea class="textarea-height-strong" name="contact_msg" placeholder="<?php echo $language['page_send_cont_mes']; ?>"><?php if (!empty($_POST['contact_msg'])) echo htmlspecialchars($_POST['contact_msg']); elseif(!empty($id_ad)) echo $language['page_send_cont_mes_ad_report']; ?></textarea>
				
				<?php if($param_api_gg['activ_gg_recaptcha'] == 1): ?>
				<div class="recaptcha">
					<div class="g-recaptcha" data-sitekey="<?php echo urlencode($param_api_gg['gg_recaptcha_site_key']); ?>"></div>
				</div>
				<?php endif; ?>
				
			</div>
			
			<input type="submit" value="<?php echo $language['bt_submit']; ?>" />
			
		</form>

	</div>
</div>