1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/views/accounts/import_map.blade.php

73 lines
1.7 KiB
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
@extends('accounts.nav')
@section('content')
@parent
{{ Former::open('company/import_export')->addClass('warn-on-exit') }}
2014-04-01 12:30:43 +02:00
{{ Former::legend('import_clients') }}
2013-11-26 13:45:07 +01:00
@if ($headers)
<label for="header_checkbox">
2014-04-01 12:30:43 +02:00
<input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> {{ trans('texts.first_row_headers') }}
2013-11-26 13:45:07 +01:00
</label>
<table class="table">
<thead>
<tr>
2014-04-01 12:30:43 +02:00
<th>{{ trans('texts.column') }}</th>
<th class="col_sample">{{ trans('texts.sample') }}</th>
<th>{{ trans('texts.import_to') }}</th>
2013-11-26 13:45:07 +01:00
</tr>
</thead>
@for ($i=0; $i<count($headers); $i++)
<tr>
<td>{{ $headers[$i] }}</td>
<td class="col_sample">{{ $data[1][$i] }}</td>
<td>{{ Former::select('map[' . $i . ']')->options($columns, $mapped[$i], true)->raw() }}</td>
</tr>
@endfor
</table>
<span id="numClients"></span>
@endif
2014-04-01 12:30:43 +02:00
{{ Former::actions( Button::lg_primary_submit(trans('texts.import')), '&nbsp;|&nbsp;', link_to('company/import', trans('texts.cancel')) ) }}
2013-11-26 13:45:07 +01:00
{{ Former::close() }}
<script type="text/javascript">
$(function() {
var numClients = {{ count($data) }};
function setSampleShown() {
if ($('#header_checkbox').is(':checked')) {
$('.col_sample').show();
setNumClients(numClients - 1);
} else {
$('.col_sample').hide();
setNumClients(numClients);
}
}
function setNumClients(num)
{
if (num == 1)
{
2014-04-01 12:30:43 +02:00
$('#numClients').html("1 {{ trans('texts.client_will_create') }}");
2013-11-26 13:45:07 +01:00
}
else
{
2014-04-01 12:30:43 +02:00
$('#numClients').html(num + " {{ trans('texts.clients_will_create') }}");
2013-11-26 13:45:07 +01:00
}
}
$('#header_checkbox').click(setSampleShown);
setSampleShown();
});
</script>
@stop