<?php
if (!isset($c_language)) $c_language = NULL;
if ($c_language){
	if ($action == 'add'){
		if ((isset($_POST['submit']) && $_POST['submit'] != 'reload') OR !isset($_POST['submit'])){
			if (isset($_GET['language'])) $language = addslashes(trim(strip_tags(stripslashes($_GET['language']))));
		}
	}
	print "
<div class='form-row'>
	<label for='language' class='form-label'>".LABEL_LANGUAGE."</label>
	<div class='form-cols'>
		<div class='form-col form-medium'>
			<div class='form-controls'>
				<select class='select' name='language' id='language'>";
	$sql_tmp = "SELECT * FROM languages ORDER BY title";
	$result_tmp = $conn->prepare($sql_tmp);
	$result_tmp->execute();
	
  print "<option value=''>...</option>";
	while ($arr_tmp = $result_tmp->fetch()){
		if ($language == $arr_tmp['iso']){
			print "<option value='".$arr_tmp['iso']."' selected='selected'>".$arr_tmp['title']."</option>";
		} else print "<option value='".$arr_tmp['iso']."'>".$arr_tmp['title']."</option>";
	}
	print "
				</select>
			</div><!-- /.form-controls -->
		</div><!-- /.form-col -->
	</div><!-- /.form-cols -->
</div><!-- /.form-row -->

<hr/>";
}