<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	if (isset($_GET['err']))
	{
		$titles = __('error_titles', true);
		$bodies = __('error_bodies', true);
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	include_once PJ_VIEWS_PATH . 'pjAdminMembers/elements/menu.php';
	$import_sources = __('import_sources', true);
	
	pjUtil::printNotice(__('infoImportTitle', true), __('infoImportBody', true),false);
	?>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminMembers&amp;action=pjActionImport" method="post" id="frmImportMember" class="form pj-form" autocomplete="off" enctype="multipart/form-data">
			<input type="hidden" name="csrf_token" value="<?php echo pjAppController::getCsrfToken(); ?>">
		<input type="hidden" name="member_import" value="1" />
		<p>
			<label class="title"><?php __('lblSkill'); ?></label>
			<span class="inline_block">
				<select id="skill_id" name="skill_id[]" class="pj-form-field w300 required" data-msg-required="<?php __('lblFieldRequired');?>" data-placeholder="--<?php __('lblChoose'); ?>--" multiple="multiple">
					<?php
					foreach ($tpl['skill_arr'] as $k => $v)
					{
						?><option value="<?php echo $v['id']; ?>"><?php echo $v['skill_title']; ?></option><?php
					}
					?>
				</select>
			</span>
		</p>
		
		<p>
			<label class="title"><?php __('lblSource'); ?></label>
			<span class="inline_block">
				<span class="block float_left t5 r10">
					<input type="radio" name="source" id="csv" value="csv" checked="checked" class="block float_left r5"/><label for="csv"><?php echo $import_sources['csv'] ;?></label>
				</span>
				<span class="block float_left t5 r10">
					<input type="radio" name="source" id="excel" value="excel" class="block float_left r5"/><label for="excel"><?php echo $import_sources['excel'] ;?></label>
				</span>
			</span>
		</p>
		<p class="nlSource nlSourceCSV">
			<label class="title"><?php __('lblCSVFile'); ?></label>
			<span class="inline_block">
				<input id="csv" name="csv" type="file" class="pj-form-field"/>
			</span>
		</p>
		<p class="nlSource nlSourceExcel">
			<label class="title"><?php __('lblMembers'); ?></label>
			<span class="inline_block">
				<textarea name="members" class="pj-form-field w500 h300"></textarea>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblUpdateMembers'); ?></label>
			<span class="inline_block">
				<label class="content">
					<input type="checkbox" name="update_members" id="update_members" value="T" />
				</label>
			</span>
		</p>
		<p>
			<label class="title">&nbsp;</label>
			<input type="submit" value="<?php __('btnImport'); ?>" class="pj-button" />
		</p>
	</form>
	<script type="text/javascript">
		var myLabel = myLabel || {};
		myLabel.csv_allowed = "<?php __('lblCSVAllowed'); ?>";
	myLabel.csrf_token = "<?php echo pjAppController::getCsrfToken(); ?>";
	</script>
	<?php
}
?>