add.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. @extends('layouts.idara.panel')
  2. @section('content')
  3. @include('backend.partials.import')
  4. @include('backend.partials.features')
  5. <section>
  6. <div class="card">
  7. <h5 class="card-header">Ajouter une coordonnées</h5>
  8. <div class="card-body">
  9. <form action="{{url('contacts')}}" method="post" enctype="multipart/form-data">
  10. @csrf
  11. <div class="form-group Coordonnee " id="Coordonnee">
  12. <label class="" for="exampleFormControlInput1"><strong>de coordonnées :</strong> </label>
  13. <br>
  14. <select onchange="optionCheck()" class="form-control" name="coorType" id="coorType" class="coordonnee" aria-describedby="validationServer04Feedback" style=" margin-bottom: 40px;" required>
  15. <option>Vueillez selectionner une coordonnées</option>
  16. @foreach ($coorTypes as $coorType)
  17. @if($contactNull ==null)
  18. <option value="{{ $coorType->id }}" {{ old('coorType') == $coorType->id ? 'selected' : '' }}>{{ $coorType->type }}</option>
  19. @elseif($contactNull !==null)
  20. <option value="{{ $coorType->id }}" {{ old('coorType') == $coorType->id ? 'selected' : '' }} {{$coorType->id== '3' ? 'disabled' : '' }}>{{ $coorType->type }}</option>
  21. @endif
  22. @endforeach
  23. </select>
  24. </div>
  25. <div class="form-group t_val">
  26. <label><strong>Coordonnée</strong> </label>
  27. <input type="text" class="form-control" name="coordonnees" placeholder="text" required>
  28. </div>
  29. <div style="margin-top:10px">
  30. <a type="submit" class="btn" target="blank" href="https://www.google.com/maps/search/gg+maps+alger/@36.6968581,2.9521356,11z/data=!3m1!4b1" id="hiddenDiv" style=" background:yellow; border:1px; visibility:hidden;">
  31. Clickez Ici <i class="fa-solid fa-map-location-dot"></i> </a></div>
  32. <div class="form-group add">
  33. <button type="submit" class="btn btn-primary" value="Ajouter">Ajouter</button>
  34. </div>
  35. </form>
  36. </div>
  37. </div>
  38. </section>
  39. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  40. <script>
  41. $(document).ready(function() {
  42. $("select[name=coorType]").on("change", function() {
  43. $value = $(this).val();
  44. $input = $(".t_val input");
  45. if ($value == 1)
  46. $input.removeAttr("class").attr({
  47. type: "tel"
  48. , class: "some-other-class form-control"
  49. , placeholder: "Ex: 00-00-00-00-00"
  50. , pattern: "[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}"
  51. });
  52. else if ($value == 2)
  53. $input.removeAttr("class").attr({
  54. type: "tel"
  55. , class: "some-other-class form-control"
  56. , placeholder: "Ex: 00-00-00-00-00"
  57. , pattern: "[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}"
  58. });
  59. else if ($value == 3)
  60. $input.removeAttr("class").attr({
  61. type: "email"
  62. , class: "some-other-class form-control"
  63. , placeholder: "Ex: xxxx@gmail.com"
  64. });
  65. else if ($value == 4)
  66. $input.removeAttr("class").attr({
  67. type: "url"
  68. , class: "some-other-class form-control"
  69. , placeholder: "https://goo.gl/maps/RpEVLKrSv549xcxb9"
  70. });
  71. else
  72. $input.removeAttr("class").attr({
  73. type: "text"
  74. , class: "some-other-class form-control"
  75. , placeholder: "Ex: https://www.xxxxxx.net/"
  76. });
  77. })
  78. })
  79. function optionCheck() {
  80. var option = document.getElementById("coorType").value;
  81. if (option == 4) {
  82. document.getElementById("hiddenDiv").style.visibility = "visible";
  83. } else {
  84. document.getElementById("hiddenDiv").style.visibility = "hidden";
  85. }
  86. }
  87. </script>
  88. <style>
  89. label {
  90. margin-bottom: 20px;
  91. }
  92. input {
  93. width: 100%;
  94. border-radius: 3px;
  95. }
  96. </style>
  97. @endsection