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