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

87 lines
2.1 KiB
PHP
Raw Normal View History

2015-03-16 22:45:25 +01:00
@extends('accounts.nav')
@section('content')
@parent
2015-04-28 22:13:52 +02:00
{!! Former::open('company/import_export')->addClass('col-md-8 col-md-offset-2 warn-on-exit') !!}
<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>&nbsp;</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>&nbsp;</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-06-04 22:53:58 +02:00
Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/company/import_export'))->appendIcon(Icon::create('remove-circle')),
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