<?php
///////////////////////////////////////////////////////////////////////////////////////////
///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
///////////////////////////////////////////////////////////////////////////////////////////

############################################################

require_once __DIR__.'/../all_fns_adm.php';

foreach($cache_cat as $v)
{
	if($v['id_cat'] == $_POST['form_note'])
	{
		$par_cat = (int) $v['par_cat'];
		
		foreach($cache_lang as $row)
		{
			$id_lang = (int) $row['id_lang'];
			$code_lang = stripslashes(htmlspecialchars($row['code_lang'], ENT_QUOTES));
			$active = (int) $row['active'];
			
			if($active == 1)
			{
			?>
			<div class="flex-container div-form">
				<p class="title"><?php echo $language_adm['page_note_txt'] .' <span class="uppercase">'. $code_lang .'</span>'; ?></p>
				<div>
					<input type="hidden" name="par_cat" value="<?php echo $par_cat; ?>" />
					<input type="hidden" name="<?php echo $code_lang; ?>" value="<?php echo $code_lang; ?>" />
					<textarea type="text" cols="55" rows="4" name="note_<?php echo $id_lang; ?>"><?php if(!empty($_POST['note_'. $id_lang])) echo htmlspecialchars($_POST['note_'. $id_lang]); elseif(!empty($v['note_cat_'. $code_lang])) echo $v['note_cat_'. $code_lang]; ?></textarea>
				</div>
			</div>
			<?php
			}
		}
	}
}


