@extends('lamis.layout.main')
@section('content')
 <main>
     <div class="inner_header">
            <div class="container">
                <h2>{{__('site.projourney')}}</h2>
            </div>
            <img src="{{url('')}}/assets/lamis/images/home-topr.png" alt="" class="slider_shape">
        </div>
        
        <section class="segment">
            <div class="container">
                 @if(Session::has('error'))
<p class="alert {{ Session::get('alert-class', 'alert-danger') }}">{{ Session::get('error') }}</p>
@endif
 @if(Session::has('success'))
<p class="alert {{ Session::get('alert-class', 'alert-success') }}">{{ Session::get('success') }}</p>
@endif
                <div class="text text-center">
                    <h4>{{servicelang($service_id)}}
                     @if(projectformscheck($service_id,$project_id))
                    <a href="{{url(getCurrentLocale().'/final/print/'.$service_id)}}" class="btn btn-primary" style="background-color:#AF387D;border-color:#AF387D;"><i class="fas fa-print"></i></a>
                    @endif
                    </h4>
                   
                </div>
                <div class="content">
                    <ul class="nav nav-tabs" id="myTab" role="tablist">
                        @foreach($forms as $key=>$row)
                        <li class="nav-item">
                          <a class="nav-link @if(Session::has('next')) @if(Session('next') == $key) active @endif  @else @if($key == '0') active @endif  @endif " id="home-tab" data-toggle="tab" href="#home_{{$key}}" role="tab" aria-controls="home" aria-selected="true">{{formquestion($row->id)}}</a>
                        </li>
                        @endforeach
                       
                    </ul>
                    <div class="tab-content" id="myTabContent">
                        
                         @foreach($forms as $key=>$row)
                        <div class="tab-pane fade show @if(Session::has('next')) @if(Session('next') == $key) active @endif  @else @if($key == '0') active @endif  @endif" id="home_{{$key}}" role="tabpanel" aria-labelledby="home-tab">
                            <div class="text-container">
                                <form method="POST" id="form" action="{{url(getCurrentLocale().'/step')}}">
                                    @CSRF
                                    <div class="form-group">
                                        <input type="hidden" name="form_id" value="{{$row->id}}">
                                        <input type="hidden" name="service_id" value="{{$row->service->id}}">
                                        <input type="hidden" name="project_id" value="{{$project_id}}">
                                        <input type="hidden" name="current" value="{{$key}}">
                                        <input type="hidden" id="action_{{$key}}" name="action">
                                        <textarea class="form-control" name="description" id="exampleFormControlTextarea1" @if(checkproject()) disabled @endif placeholder="اكتب هنا ..." rows="15">@if(projectformisset($row->id,$project_id)) {{projectdescription($row->id,$project_id)}} @endif</textarea>
                                    </div>
                                    <div class="buttons">
                                        <button onclick="routings({{$key}},'1')" class="save-button follow-btn">{{__('site.save_continue')}}</button>
                                        <button onclick="routings({{$key}},'0')" class="save-button close-btn">{{__('site.save_close')}}</button>

                                    </div>
                                </form>
                            </div>
                        </div>
                        @endforeach
                       
                       
                    </div>
                </div>
            </div>
            <img src="{{url('')}}/assets/lamis/images/home-topr.png" alt="" class="r-top wow fadeInRight slow">
            <img src="{{url('')}}/assets/lamis/images/home-topl.png" alt="" class="l-top wow fadeInLeft slow">
            <img src="{{url('')}}/assets/lamis/images/home-bottomr.png" alt="" class="r-bottom animated fadeInRight slow">
        </section>
    </main>
  @push('js')
  <script>
      function routings(elem,data){
           
          $('#action_'+elem).val(data);
         
      }
  </script>
  @endpush

@stop