@extends('admin/layouts/default')
{{-- Page title --}}
@section('title')
Add Volume
@parent
@stop
{{-- page level styles --}}
@section('header_styles')
@include('admin.layouts.css')
<link href="{{ asset('assets/vendors/select2/css/select2.min.css') }}" type="text/css" rel="stylesheet">
<link href="{{ asset('assets/vendors/select2/css/select2-bootstrap.css') }}" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('assets/vendors/bootstrap-tagsinput/css/bootstrap-tagsinput.css') }}" />
<link rel="stylesheet" href="{{ asset('assets/vendors/bootstrap-tagsinput/css/app.css') }}" />
@stop
{{-- Page content --}}
@section('content')
<section class="content-header">
   <!--section starts-->
   <h1>
      Add Volume
   </h1>
   <ol class="breadcrumb">
      <li>
         <a href="{{ route('admin.dashboard') }}">
         <i class="livicon" data-loop="true" data-name="home" data-size="14">
         </i>
         Dashboard
         </a>
      </li>
      <li class="active">
         Add Volume
      </li>
   </ol>
</section>
<!--section ends-->
<section class="content paddingleft_right15">
   <!--main content-->
   <div class="row">
      <div class="panel panel-primary ">
         <div class="panel-heading">
            <h3 class="panel-title">
               <i class="livicon" data-c="#fff" data-hc="white" data-loop="true" data-name="gear" data-size="16">
               </i>
               Options
            </h3>
            <span class="pull-right clickable">
            <i class="glyphicon glyphicon-chevron-up">
            </i>
            </span>
         </div>
         <div class="panel-body">
	
            <div class="row acc-wizard">
			   @isset($volume)					{{ Form::model($volume, array('url' => array('admin/volumes',$volume->volume_id), 'method' => 'PUT')) }}
				@else					{{ Form::open(array('url' => 'admin/volumes')) }}
				@endisset 
               <div class="col-md-3 pd-2">
                  <p class="mar-2">
                     Follow the steps below to add new journal.
                  </p>
                  <ol class="acc-wizard-sidebar">
                     <li class="acc-wizard-todo">
                        <a href="#volume">
                        Volume
                        </a>
                     </li>
                     <li class="acc-wizard-todo">
                        <a href="#meta">
                        Meta Tags
                        </a>
                     </li>
                  </ol>
               </div>
               <div class="col-md-9 pd-r">
                  <div class="panel-group" id="accordion-demo">
                     <!-- /.panel.panel-default -->
                     <div class="panel panel-default">
                        <div class="panel-heading">
                           <h4 class="panel-title">
                              <a data-parent="#accordion-demo" data-toggle="collapse" href="#volume">
                              Volume
                              </a>
                           </h4>
                        </div>
                        <div class="panel-collapse collapse" id="volume">
                           <div class="panel-body">
                              <form id="form-volume">
                                 <div class="my-3" id="e-book">
								 
                                    <div class="form-group @if ($errors->has('journal_id')) has-error @endif ">
                                       <label class="control-label" for="select21">
                                       Select Journal
                                       </label>
									   
                                       <select class="form-control select2" id="journal_id" name="journal_id">
                                          <option selected="true" disabled="disabled" hidden>Select Journal</option>
                                          @foreach($journal as $key => $value)
                                          <option value="{{$key}}" 
										  @isset($volume) @if($volume->journal_id == $key) selected @endif @endisset
										  @if( old("journal_id") == $key ) selected @endif
										  >{{$value}}</option>
                                          @endforeach
                                       </select>
                                    </div>
                                    <div class="form-group @if ($errors->has('year_id')) has-error @endif ">
                                       <label class="control-label" for="e1">Year: *</label>																
                                       <select class="form-control " id="" name="year_id">
                                          <option selected="true" disabled="disabled" hidden>Select Year</option>
                                          @foreach($year_search as $key => $value)
                                          <option value="{{$key}}" 
											@isset($volume) @if($volume->year_id == $key) selected @endif @endisset
											@if( old("year_id") == $key ) selected @endif
										  >{{$value}}</option>
                                          @endforeach	
                                       </select>
                                    </div>
                                    
								   <div class="form-group @if ($errors->has('volume_name')) has-error @endif @isset($volume_exist) has-error @endisset">								   
									  <label for="e1" class="control-label">Volume: *</label>
									  <input type="text" name="volume_name"  class="form-control input-md" placeholder="Volume"
									  value=" {{ old("volume_name", isset($volume->volume_name) ? $volume->volume_name : '') }} ">
									  
									  <label for="e1" class="control-label"> @if ($errors->has('volume_name')) {{ $errors->first('volume_name') }} @endif </label>
								   </div>
								
								 
								   
								   <div class="form-group">
									  <label for="e1" class="control-label">Total no. of Issues:</label>
									  <input type="text" name="total_no_of_issues"  class="form-control input-md" 
									  placeholder="Total no. of Issues"
									  value=" {{ old("total_no_of_issues", isset($volume->total_no_of_issues) ? $volume->total_no_of_issues : '') }} ">
								   </div>
                                    
                                    <div class="acc-wizard-step pt-3">
                                    </div>
                                 </div>
                              </form>
                           </div>
                           <!--/.panel-body -->
                        </div>
                     </div>
                     <!-- /#adjusthtml -->
                  </div>
                  <!-- /.panel.panel-default -->
                  @include('admin.meta_tag.meta_tag')
                  <!-- /.panel.panel-default -->
				  
				    @isset($volume)
					{{ Form::submit('Update', array('class' => 'btn btn-primary','value' => 'submit', 'name' => 'submit' ))  }}
				@else
					{{ Form::submit('Save', array('class' => 'btn btn-primary','value' => 'submit' , 'name' => 'submit' )) }}
				@endisset 
				  
               </div>
			   
			
			   
			 
			   
               {{ Form::close() }}
            </div>
         </div>
      </div>
   </div>
</section>
<!--main content ends-->
<!-- content -->
@stop
<script type="text/javascript" src="{!! asset('js/jquery.min.js') !!}"></script>
<script>
   $(function () {
   
   	$(".select2").select2({
   		theme:"bootstrap",
   		placeholder:"",
   		width: '100%'
   	});
       
   });
   
</script>
{{-- page level scripts --}}
@section('footer_scripts')
@include('admin.layouts.js')
<script src="{{ asset('assets/vendors/select2/js/select2.js') }}" type="text/javascript"></script>    
<script src="{{ asset('assets/vendors/bootstrap-tagsinput/js/bootstrap-tagsinput.js') }}"  type="text/javascript"></script>
		
@stop