@extends('layouts.master')
@section('title')
    Nouvel Employeur
@stop
@section('content')
 
<div class='col-lg-8 col-lg-offset-2'>
 
    @if ($errors)
        @foreach ($errors->all() as $error)
            <div class='bg-danger alert'>{!! $error !!}</div>
        @endforeach
    @endif
    <h1><i class='fa fa-employeur'></i>Nouvel Employeur</h1>
 
     {!! Form::open(['employeur' => 'form', 'url' => '/tiers/employeurs', 'class' => 'form-horizontal']) !!}
  
    <ul class="nav nav-tabs">
        <li class="active"><a href="#nom" data-toggle="tab">Nom - Statut</a></li>
        <li><a href="#adresse" data-toggle="tab">Contact</a></li>
        <li><a href="#banque" data-toggle="tab">Banque</a></li>
        <li><a href="#cotisations" data-toggle="tab">Cotisations</a></li>
    </ul>

    <script>
        $('#myTab a').click(function (e) {
        e.preventDefault();
        $(this).tab('show');
        })

        $('a[data-toggle="tab"]').on('shown', function (e) {
        e.target // activated tab
        e.relatedTarget // previous tab
        })
    </script>



<div class="tab-content">


<!-- ------------------------------------- ONGLET NOM ------------------------------- -->
    <div class="tab-pane active" id="nom">

        <div class="form-group" style="padding-top:24px">
            <div class="col-md-8">
                {!! Form::label('nom', 'Nom') !!}
                {!! Form::text('nom', null, ['placeholder' => 'Nom', 'class' => 'form-control']) !!}
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-4">
                {!! Form::label('numrc', 'Numéro RC') !!}
                {!! Form::text('numrc', null, ['placeholder' => 'Numéro RC', 'class' => 'form-control']) !!}
            </div>

            <!--
            <div class="col-md-2">
                {!! Form::label('nbsal', 'Nombre de salariés') !!}
                {!! Form::text('nbsal', null, ['placeholder' => 'Nombre de salariés', 'class' => 'form-control']) !!}
            </div>
        -->

            <div class="col-md-2">
                {!! Form::label('statut', 'Statut') !!}
                <br/>
                    {!! 
                    Form::select(
                        'statut',
                        App\Models\MyApp::STATUTS_ENTREPRISE,
                        '',
                        [
                            'class' => 'selectpicker',
                        ]
                    ) 
                !!}
            </div>
        </div>  
        <div class="form-group">
            <div class="col-md-4">
                {!! Form::label('date_deb', 'Début d\'activité') !!}
                <div class="input-group">
                    <div class='input-group date' id='datepicker_date_deb'>
                            {!! Form::text('date_deb', '', ['placeholder' => 'Début d\'activité', 'class' => 'form-control']) !!}
                        <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
                        <script type="text/javascript">
                            $(function () {
                                $('#datepicker_date_deb').datepicker({
                                    format: "dd/mm/yyyy",language: "fr",autoclose: true
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>

            <div class="col-md-4">
                {!! Form::label('date_fin', 'Fin d\'activité') !!}
                <div class="input-group">
                    <div class='input-group date' id='datepicker_date_fin'>
                            {!! Form::text('date_fin', '', ['placeholder' => 'Fin d\'activité', 'class' => 'form-control']) !!}
                        <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
                        <script type="text/javascript">
                            $(function () {
                                $('#datepicker_date_fin').datepicker({
                                    format: "dd/mm/yyyy",language: "fr",autoclose: true
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-9">
            <div class='form-group'>
                {!! Form::label('verrou', 'Verrou') !!}
                {!! Form::checkbox('verrou', null, ['class' => 'form-control']) !!}
            </div>
        </div>

        <div class="col-md-9">
                <div class='form-group'>
                    {!! Form::label('observation', 'Observations') !!}
                    {!! Form::textarea('observation', null, ['placeholder' => 'Observations', 'class' => 'form-control', 'rows'=>'3']) !!}
                </div>
        </div>
    </div>

    <!-- ------------------------------------- ONGLET CONTACTS ------------------------------- -->

    <div class="tab-pane" id="adresse"  >

        <div class="form-group" style="padding-top:24px">
            <div class="col-md-9">
                {!! Form::label('adresse', 'Adresse') !!}
                {!! Form::textarea('adresse', null, ['placeholder' => 'Adresse', 'class' => 'form-control', 'rows'=>'2']) !!}
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-2">
                {!! Form::label('cp', 'Code Postal') !!}
                {!! Form::text('cp', null, ['placeholder' => 'Code Postal', 'class' => 'form-control']) !!}
            </div>

            <div class="col-md-4">
                {!! Form::label('district', 'District - Zone') !!}
                <br/>
                    {!! 
                    Form::select(
                        'district',
                        App\Models\MyApp::DISTRICTS2,
                        '',
                        [
                            'placeholder'=>'Choisissez un District/Zone','class' => 'selectpicker',
                        ]
                    )  
                !!}
            </div>

            <div class="col-md-4">
                {!! Form::label('ile', 'Ile') !!}
                <br/>
                    {!! 
                    Form::select(
                        'ile',
                        App\Models\MyApp::ILES2,
                        '',
                        [
                            'placeholder'=>'Choisissez une Ile','class' => 'selectpicker',
                        ]
                    ) 
                !!}                
            </div>
        </div>


       
        <div class="col-md-10 bg-info" style="padding:10px">
            <legend>Contact 1 / Responsable</legend>
            <div class="form-group">
                <div class="col-md-4">
                    {!! Form::label('responsable', 'Nom') !!}
                    {!! Form::text('responsable', null, ['placeholder' => 'Nom Responsable', 'class' => 'form-control'] )!!}
                </div>

                <div class="col-md-4">
                    {!! Form::label('email', 'Email') !!}
                    {!! Form::email('email', null, ['placeholder' => 'Email', 'class' => 'form-control'] )!!}
                </div>

                <div class="col-md-2">
                    {!! Form::label('tel', 'Téléphone') !!}
                    {!! Form::text('tel', null, ['placeholder' => 'Téléphone', 'class' => 'form-control']) !!}
                </div>

                <div class="col-md-2">
                    {!! Form::label('fax', 'Fax') !!}
                    {!! Form::text('fax', null, ['placeholder' => 'Fax', 'class' => 'form-control']) !!}
                </div>
            </div>
        </div>
        <div class="col-md-10 bg-warning" style="padding:10px">
            <legend>Contact 2</legend>
            <div class="form-group">
                <div class="col-md-4">
                    {!! Form::label('contact_nom', 'Nom') !!}
                    {!! Form::text('contact_nom', null, ['placeholder' => 'Nom Contact', 'class' => 'form-control'] )!!}
                </div>

                <div class="col-md-4">
                    {!! Form::label('contact_email', 'Email') !!}
                    {!! Form::email('contact_email', null, ['placeholder' => 'Email', 'class' => 'form-control'] )!!}
                </div>

                <div class="col-md-2">
                    {!! Form::label('contact_tel', 'Téléphone') !!}
                    {!! Form::text('contact_tel', null, ['placeholder' => 'Téléphone', 'class' => 'form-control']) !!}
                </div>
            </div>
        </div>
    </div>


<!-- ------------------------------------- ONGLET BANQUE ------------------------------- -->

    <div class="tab-pane" id="banque">
        <div class="form-group" style="padding-top:24px">
            <div class="col-md-4">
                {!! Form::label('banque', 'Banque') !!}
                <br/>
                    {!! 
                        Form::select(
                        'banque_id',
                        DB::table('banques')->where('active','=','1')->orderby(db::raw("nom"))->pluck(db::raw("CONCAT(nom,' - ',ville)"), 'id')->toArray(),
                        '',
                        [
                            'placeholder'=>'Choisissez une banque','class' => 'form-control'
                        ] 
                    )

                    !!}
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                {!! Form::label('compte', 'Compte') !!}
                {!!Form::text('compte', null, ['placeholder' => 'COMPTE', 'class' => 'form-control']) !!}
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                {!! Form::label('iban', 'IBAN') !!}
                {!!Form::text('iban', null, ['placeholder' => 'IBAN', 'class' => 'form-control']) !!}
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-6">
                {!! Form::label('secteur', "Secteur d'activité") !!}
                <br/>
                    {!! 
                        Form::select('sec_id',
                        DB::table('secteurs')->orderby(db::raw("nom"))->pluck(db::raw("nom"), 'id')->toArray(),
                        '',
                        [
                            'placeholder'=>"Choisissez un secteur d'activité",
                            'class' => 'form-control'
                        ]
                    ) 

                    !!}
            </div>
        </div>

    </div>


<!-- ------------------------------------- ONGLET COTISATIONS ------------------------------- -->


    <div class="tab-pane" id="cotisations" style="padding-top:24px">

        <fieldset >
            <legend>COTISATIONS</legend>
            <div class="form-group">
                <div class="col-md-8">
                    {!! Form::label('mode_cotis', 'Mode de cotisation') !!}
                </div>
                <div class="col-md-8 col-md-offset-1">
                    {!! Form::radio('mode_cotis','1','' )." Trimestrielles&nbsp;"  !!}
                    {!! Form::radio('mode_cotis','2','' )." Mensuelles&nbsp;"  !!}
                </div>
            </div>
            <br>
            <div class="form-group">
                <div class="col-md-4">
                    {!! Form::label('der_cotis', 'Dernière cotisation') !!}
                    <div class="input-group">
                        {!! Form::text('der_cotis', null, ['class' => 'form-control']) !!}
                        <div class="input-group-addon">CFP</div>
                    </div>
                </div>
                <div class="col-md-4">
                    {!! Form::label('der_mois', 'Mois concerné') !!}
                    <div class="input-group">
                        <div class='input-group date' id='datepicker_der_mois'>
                                {!! Form::text('der_mois', '', ['placeholder' => 'Mois concerné', 'class' => 'form-control']) !!}
                            <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>

                            <script type="text/javascript">
                                $(function () {
                                    $('#datepicker_der_mois').datepicker({
                                        format: "dd/mm/yyyy",
                                        language: "fr",
                                        autoclose: true
                                    });
                                });
                            </script>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    {!! Form::label('soldei', 'Solde antérieur') !!}
                    <div class="input-group">
                    {!! Form::text('soldei', null, ['class' => 'form-control']) !!}
                    <div class="input-group-addon">CFP</div>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-4">
                    {!! Form::label('date_med', 'Dernière mise en demeure') !!}
                    <div class='input-group date' id='datepicker_date_med'>
                            {!! Form::text('date_med', '', ['placeholder' => 'Dernière MED', 'class' => 'form-control']) !!}
                        <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>

                        <script type="text/javascript">
                            $(function () {
                                $('#datepicker_date_med').datepicker({
                                    format: "dd/mm/yyyy",language: "fr",autoclose: true
                                });
                            });
                        </script>
                    </div>
                </div>
                <div class="col-md-4">
                    {!! Form::label('date_maj', 'Dernière mise à jour') !!}
                    <div class='input-group date' id='datepicker_date_maj'>
                            {!! Form::text('date_maj', '', ['placeholder' => 'Dernière MAJ', 'class' => 'form-control']) !!}
                        <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>

                        <script type="text/javascript">
                            $(function () {
                                $('#datepicker_date_maj').datepicker({
                                    format: "dd/mm/yyyy",language: "fr",autoclose: true
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </fieldset>

        <br/>

        <fieldset class="">
            <legend>CONTENTIEUX</legend>
            <div class="form-group">
                <div class="col-md-6">
                    {!! Form::label('nom_cont', 'Libellé') !!}
                    {!! Form::text('nom_cont', null, ['placeholder' => 'Libellé du contentieux', 'class' => 'form-control']) !!}
                </div>


                <div class="col-md-5">
                    {!! Form::label('date_cont', 'Date du contentieux') !!}
                    <div class='input-group date' id='datepicker_date_cont'>
                            {!! Form::text('date_cont', '', ['placeholder' => 'Dernière MAJ', 'class' => 'form-control']) !!}
                        <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>

                        <script type="text/javascript">
                            $(function () {
                                $('#datepicker_date_cont').datepicker({
                                    format: "dd/mm/yyyy",language: "fr",autoclose: true
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </fieldset>

        </div>  

    </div> 

</div>


<div class='col-lg-10 col-lg-offset-2'>
    <div class='form-group'>
        {!! Form::submit('Enregistrer', ['class' => 'btn btn-primary']) !!}
    </div>
    {!! Form::close() !!}
</div>

</div>
@stop