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

73 lines
1.5 KiB
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
@extends('accounts.nav')
@section('content')
@parent
2014-02-18 16:07:22 +01:00
{{ Former::open('company/import_export') }}
2013-11-26 13:45:07 +01:00
{{ Former::legend('Import Clients') }}
@if ($headers)
<label for="header_checkbox">
<input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> Use first row as headers
</label>
<table class="table">
<thead>
<tr>
<th>Column</th>
<th class="col_sample">Sample</th>
<th>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>
<td>{{ Former::select('map[' . $i . ']')->options($columns, $mapped[$i], true)->raw() }}</td>
</tr>
@endfor
</table>
<span id="numClients"></span>
@endif
2014-02-18 16:07:22 +01:00
{{ Former::actions( Button::lg_primary_submit('Import'), '&nbsp;|&nbsp;', link_to('company/import', '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)
{
$('#numClients').html('1 client will be created');
}
else
{
$('#numClients').html(num + ' clients will be created');
}
}
$('#header_checkbox').click(setSampleShown);
setSampleShown();
});
</script>
@stop