2015-10-14 16:15:39 +02:00
|
|
|
@extends('header')
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
@section('content')
|
|
|
|
@parent
|
|
|
|
|
2015-10-14 16:15:39 +02:00
|
|
|
@include('accounts.nav', ['selected' => ACCOUNT_IMPORT_EXPORT])
|
|
|
|
|
|
|
|
{!! Former::open('settings/' . ACCOUNT_IMPORT_EXPORT)->addClass('warn-on-exit') !!}
|
2015-04-28 22:13:52 +02:00
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{!! trans('texts.import_clients') !!}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
@if ($headers)
|
|
|
|
|
|
|
|
<label for="header_checkbox">
|
|
|
|
<input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> {{ trans('texts.first_row_headers') }}
|
|
|
|
</label>
|
|
|
|
|
2015-04-28 22:13:52 +02:00
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<table class="table invoice-table">
|
2015-03-16 22:45:25 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('texts.column') }}</th>
|
|
|
|
<th class="col_sample">{{ trans('texts.sample') }}</th>
|
|
|
|
<th>{{ trans('texts.import_to') }}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
@for ($i=0; $i<count($headers); $i++)
|
|
|
|
<tr>
|
|
|
|
<td>{{ $headers[$i] }}</td>
|
|
|
|
<td class="col_sample">{{ $data[1][$i] }}</td>
|
2015-04-28 22:13:52 +02:00
|
|
|
<td>{!! Former::select('map[' . $i . ']')->options($columns, $mapped[$i], true)->raw() !!}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
@endfor
|
|
|
|
</table>
|
|
|
|
|
2015-04-28 22:13:52 +02:00
|
|
|
<p> </p>
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<span id="numClients"></span>
|
|
|
|
@endif
|
|
|
|
|
2015-04-28 22:13:52 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2015-04-28 22:13:52 +02:00
|
|
|
{!! Former::actions(
|
2015-10-14 16:15:39 +02:00
|
|
|
Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/settings/import_export'))->appendIcon(Icon::create('remove-circle')),
|
2015-11-17 14:53:14 +01:00
|
|
|
Button::success(trans('texts.import'))->submit()->large()->appendIcon(Icon::create('floppy-disk'))) !!}
|
2015-04-28 22:13:52 +02:00
|
|
|
{!! Former::close() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
<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)
|
|
|
|
{
|
|
|
|
$('#numClients').html("1 {{ trans('texts.client_will_create') }}");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('#numClients').html(num + " {{ trans('texts.clients_will_create') }}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#header_checkbox').click(setSampleShown);
|
|
|
|
setSampleShown();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|