<?php
if (!isset($c_languages)) $c_languages = NULL;
if ($c_languages){
	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." ";
	if (!isset($multi_module)) print "*";
	print "</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 label";
	$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'>".id($arr_tmp['label'])."</option>";
		} else print "<option value='".$arr_tmp['iso']."'>".id($arr_tmp['label'])."</option>";
	}
	print "
				</select>
			</div><!-- /.form-controls -->
		</div><!-- /.form-col -->
	</div><!-- /.form-cols -->
</div><!-- /.form-row -->

<hr/>";
}