{% extends "base_site.html" %}
{% load iclock_tags %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
	<a href="/">{%trans "Home"%}</a> &rsaquo;
	{%trans "U-exported to upload data"%}
</div>
<br/><br/><h1>&nbsp;&nbsp;&nbsp;{%trans "U-exported to upload data"%}</h1>
{% endblock %}

{% block extrahead %}
<link href="/media/css/changelists.css" type="text/css" rel="stylesheet">
<style>
</style>
<script src="{{ MEDIA_URL }}/jslib/pg.js"></script>
<script>
function setSN() {
	$("#txtSN").val($("#md_slt").val());
}
$(function(){
	$("#aGetSN").click(function(){
		createDialog(setSN, setSN, "/iclock/data/iclock/miniData?key=SN", "{%trans "device choice"%}", "{%trans 'device'%}", 350);
	});
});

function checkform() {
	if (document.getElementById("txtSN").value == "") {
		alert("{%trans "device choice"%}");
		return false;
	}
	if (document.getElementById("fileUser").value == ""
		&& document.getElementById("fileTransaction").value == ""
		&& document.getElementById("fileFptemp").value == "") {
			alert(_("You upload a filex no choice"));
			return false;
	}
	if (document.getElementById("fileUser").value == "" && document.getElementById("fileFptemp").value != "") {
		alert("{%trans 'If you plan to upload fingerprint template, users upload information at the same time'%}");
		return false;
	}
}
</script>
{% endblock %}

{% block content %}
<br />
<form id="form1" action="" method="POST" enctype="multipart/form-data">
<table width="800px" border="1">
	<tr>
		<th width="220px">{%trans "Device"%}</th><th width="100px">{%trans "File type"%}</th><th>{%trans "Select file"%}</th>
	</tr>
	<tr class="row1">
		<td rowspan="3">
			<input type="text" name="SN" id="txtSN" value="" readonly /> <br />
			&nbsp;&nbsp;<a href="#"" id="aGetSN">[{%trans "select device"%}]</a><br />
			&nbsp;&nbsp;
      {%trans 'Here set to upload data files from the downloaded to the device which transaction was the U-disk'%}
		</td>
		<td>{%trans "transaction file"%}</td>
		<td><input type="file" name="file_transaction"" id="fileTransaction" />&nbsp;&nbsp;1_attlog.dat</td>
	</tr>
	<tr class="row2">
		<td>{%trans "users File"%}</td>
		<td><input type="file" name="file_user" id="fileUser" />&nbsp;&nbsp;user.dat</td>
	</tr>
	<tr class="row1">
		<td>{%trans "fingerprint template file"%}</td>
		<td>
			<input type="file" name="file_fptemp" id="fileFptemp" />&nbsp;&nbsp;template.dat
			<br />{%trans "If upload fingerprint template must also upload file related to the user's information"%}
		</td>
	</tr>
	<tr class="row2">
		<td colspan="3">&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="{%trans "upload file"%}" onclick="return checkform();"/></td>
	</tr>
</table>
</form>
{% endblock %}

