PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/src/www/clients/templates/create.blade.php

https://bitbucket.org/mdoviedor/hotelium
PHP | 98 lines | 72 code | 24 blank | 2 comment | 5 complexity | 5a9962e4309b22bf09b69cf685b709c9 MD5 | raw file
 1@extends('templates::app')
 2
 3@section('title', 'Clientes')
 4@section('subtitle', 'Crear')
 5
 6@section('submenu')
 7    @include('templates::partials.submenu')
 8@endsection
 9
10@section('content')
11
12    <form class="form-horizontal" method="POST" role="form">
13    {{ csrf_field() }}
14
15    @include('templates::forms.horizontal.string', [
16        'id' => 'name',
17        'name' => 'Nombres: *',
18        'placeholder' => 'Nombres'
19    ])
20
21    @include('templates::forms.horizontal.string', [
22       'id' => 'lastname',
23       'name' => 'Apellido: *',
24       'placeholder' => 'Número Piso'
25    ])
26
27    @include('templates::forms.horizontal.radio', [
28        'id' => 'identification_type',
29        'name' => 'Tipo de Identificación: *',
30        'placeholder' => 'Tipo de Identificación',
31        'values' => \models\Client::IDENTIFICATION_TYPES
32    ])
33
34    @include('templates::forms.horizontal.string', [
35        'id' => 'identification_number',
36        'name' => 'Número de Identificación: *',
37        'placeholder' => 'Número de Identificación'
38    ])
39
40    @include('templates::forms.horizontal.number', [
41        'id' => 'phone',
42        'name' => 'Télefono:',
43        'placeholder' => 'Télefono'
44    ])
45
46    @include('templates::forms.horizontal.number', [
47        'id' => 'cellphone',
48        'name' => 'Móvil:',
49        'placeholder' => 'Móvil'
50    ])
51
52    @include('templates::forms.horizontal.area', [
53        'id' => 'address',
54        'name' => 'Dirección: *',
55        'placeholder' => 'Dirección'
56    ])
57
58    @include('templates::forms.horizontal.string', [
59        'id' => 'birth_date',
60        'name' => 'Fecha de Nacimiento: *',
61        'placeholder' => 'DD-MM-YYYY'
62    ])
63
64
65    @include('templates::forms.horizontal.button_primary', [
66        'name' => 'Crear',
67    ])
68
69
70@endsection
71
72@section('script')
73
74
75            <script type="text/javascript">
76
77                function format(event) {
78                    const input = $(event.target);
79                    const value = input.val();
80                    const countText = value.length;
81
82                    if (countText === 2) {
83                        input.val(value + '-');
84                    } else if (countText === 5) {
85                        // var ano = (new Date()).getFullYear();
86                        // input.val(value + '-' + ano);
87                    } else if (countText > 10) {
88                        input.val(value.substring(0, 10));
89                    }
90                }
91
92                $(document).ready(() => {
93                    $('#birth_date').keyup(format);
94                });
95
96            </script>
97
98@endsection