
	<!-- /.panel.panel-default -->
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4 class="panel-title">
				<a data-parent="#accordion-volume_form" data-toggle="collapse" href="#volume_form">Ebook Volume</a>
			</h4>
		</div>
		<div class="panel-collapse collapse" id="volume_form">
		@isset($volume)
			{{ Form::model($volume, array('url' => array('admin/ebook_volume',$volume->ebook_volume_id), 'method' => 'PUT', 'files' => true)) }}
		@else
			{{ Form::open( array('url' => 'admin/ebook_volume','files' => true)) }}
		@endisset  
			<div class="panel-body">
			
			
			
						<div class="form-group">
							<label class="control-label" for="e1">
								Status:
							</label>
							<select class="form-control" id="e1" name="ebook_status">
							   <option title="Normal" value="1" @if(isset($volume) && $volume->ebook_status == 1) selected @endif >Normal</option>
								<option title="Pre-Published" value="2" @if(isset($volume) && $volume->ebook_status == 2) selected @endif >Pre-Published</option>
								<option title="Future" value="3" @if(isset($volume) && $volume->ebook_status == 3) selected @endif>Future</option>
							</select>
						</div>
						<div class="form-group">
							<label class="control-label" for="e1">
								eBook Type:
							</label>
							<select class="form-control" id="e1" name="ebook_type">
					<option title="General eBook" value="1" @if(old('ebook_type')=='1' ) selected @endif @if(isset($volume) && $volume->ebook_type == 1) selected @endif
								>General eBook</option>
					<option title="Series" value="2" @if(old('ebook_type')=='2' ) selected @endif @if(isset($volume) && $volume->ebook_type == 2) selected @endif
						>Series</option>
				</select>

						</div>
						<div class="form-group">
							<label class="control-label" for="e1">
								eBook Type2:
							</label>
							<select class="form-control" id="e1" name="ebook_meta_type">
					<option value="0" @if(old('ebook_meta_type')==0) selected @endif @if(isset($volume) && $volume->ebook_meta_type == 0) selected @endif
								>Edited</option>
					<option value="1" @if(old('ebook_meta_type')==1) selected @endif @if(isset($volume) && $volume->ebook_meta_type == 1) selected @endif
								>Monograph</option>
							</select>
							
						</div>

			<div class="form-group">
				<label class="control-label" for="select21">
					Indexing:
				</label>
				<select class="form-control select2" multiple="multiple" name="index_id[]">
					@foreach ($indexing as $key => $value)
					<option value="{{$key}}" @if (old("index_id")){{ (in_array($key, old("index_id")) ? "selected":"") }} @elseif(isset($ebookvolumeindexing) and in_array($key, $ebookvolumeindexing)) selected @endif>{{$value}}</option>
					@endforeach
				</select>
			</div>

						<div class="form-group">

							<label class="control-label" for="select21">
								Select eBook
							</label>
							<select class="form-control select2" id="ebook_id" name="ebook_id">
							<option selected="true" disabled="disabled" hidden>Select Ebook Volume</option>
								@foreach($ebook as $key => $value)														
					<option value="{{$key}}" @isset($volume) @if($volume->ebk_ebook_id == $key) selected @endif
									@endisset
										@if(old('ebook_id') == $key ) selected @endif 
									>{{$value}}</option>
								@endforeach
							</select>
						</div>
						<div class="form-group">
							<label class="control-label" for="e1">
								Select Volume Type:
							</label>
							
							
							<select class="form-control" id="select_ebook_type" name="select_ebook_type">
							@if(old('select_ebook_type') != null)
								
								@if(strtolower(old('select_ebook_type')) == 'pdf') 
									<option title="PDF" value="PDF" selected="selected">PDF</option>
									<option title="Video" value="video">Video</option>
								@elseif(strtolower(old('select_ebook_type')) == 'video') 
									<option title="PDF" value="PDF">PDF</option>
									<option title="Video" value="video" selected="selected">Video</option>
								@endif																	
								
							@elseif(isset($volume))	
							
								@if(strtolower($volume->select_ebook_type) == 'pdf') 
									<option title="PDF" value="PDF" selected="selected">PDF</option>
									<option title="Video" value="video">Video</option>
								@elseif(strtolower($volume->select_ebook_type) == 'video') 
									<option title="PDF" value="PDF">PDF</option>
									<option title="Video" value="video" selected="selected">Video</option>
								@endif
								
							@else
								<option title="PDF" value="PDF">PDF</option>
								<option title="Video" value="video">Video</option>
							@endif	
							
							</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">
							<label>E-book Publication Date:</label>
							<div class="input-group">
								<div class="input-group-addon">
						<i class="livicon" data-name="laptop" data-size="16" data-c="#555555" data-hc="#555555" data-loop="true"></i>
								</div>
								<input  name="publication_date" type="text" class="form-control " id="publication_date" value="{{ old("publication_date", isset($volume->publication_date) ? strftime('%Y-%m-%d',$volume->publication_date) : '') }}" />
							</div>
							<!-- /.input group -->
						</div>
							
						 <hr class="my-2" />
						
						<div class="form-group col-lg-4 col-md-4 col-sm-4">
							<label  class="control-label">Expected Date:</label>
						</div>
						
						<div class="form-group col-lg-4 col-md-4 col-sm-4">
								
							<select class="form-control select2" id="" name="expected_date_year">																	
							<option selected="true" disabled="disabled" hidden>Select Year</option>
								 @for ($i = date('Y'); $i >= 2000; $i--)
					<option value="{{ $i }}" @isset($volume) @if($volume->expected_date_year == $i) selected @endif
								@endisset
								
								@if(old('expected_date_year') == $i) selected @endif 
								
								
								>{{ $i }}</option>
								@endfor
							</select>
								
								
						</div>

						<div class="form-group col-lg-4 col-md-4 col-sm-4">
						
							<select class="form-control select2" id="" name="expected_date_month">    
							<option selected="true" disabled="disabled" hidden>Select Month</option>          
							@foreach($month_arr as $key =>  $value)											
					<option value='{{ $key }}' @isset($volume) @if($volume->expected_date_month == $key) selected @endif
									@endisset
									>{{ $value }}</option>
							@endforeach						
							</select>
							
						</div>
					 <hr class="my-2" />
			
					
					<div class="form-group @if ($errors->has('volume_name')) has-error @endif " >
						<label class="control-label">Volume: *</label>
				<input type="text" name="volume_name" id="volume_name" class="form-control input-md" placeholder="Volume" value="{{ old("volume_name", isset($volume->volume_name) ? $volume->volume_name : '') }}">
						@if ($errors->has('volume_name'))															
							<label class="control-label">{{ $errors->first('volume_name') }} </label>
						@endif																
						<span id="lbl_volume"></span>
					</div>
					

					<!------------------------------------------------------------>
					<div class="form-group">
						<label class="control-label">Series Title:</label>
				<input type="text" name="ebook_subtitle" id="" class="form-control input-md" placeholder="Series Title" value="{{ old("ebook_subtitle", isset($volume->ebook_subtitle) ? $volume->ebook_subtitle : '') }}">
						
					</div>
					<div class="form-group">
						<label class="control-label">ISBN:</label>
					
				<input type="text" name="isbn" id="" class="form-control input-md" placeholder="ISBN" value="{{ old("isbn", isset($volume->isbn) ? $volume->isbn : '') }}">
						
					</div>
					<div class="form-group">
						<label class="control-label">ISSN:</label>
				<input type="text" name="issn" id="" class="form-control input-md" placeholder="ISSN" value="{{ old("issn", isset($volume->issn) ? $volume->issn : '') }}">
					</div>
					
					@if (isset($volume->eisbn))
					<div class="form-group @if ($errors->has('file_name')) has-error @endif" >
						<label class="control-label">eISBN:</label>
						<input type="text" disabled class="form-control input-md" value="{{ $volume->eisbn }}">
						<input type="hidden" name="eisbn" class="form-control input-md" value="{{ $volume->eisbn }}">
						
					</div>
					@else
					<div class="form-group @if ($errors->has('file_name')) has-error @endif" >
						<label class="control-label">eISBN:</label>
				<input type="text" name="eisbn" class="form-control input-md" placeholder="eISBN" value="{{ old("eisbn", isset($volume->eisbn) ? $volume->eisbn : '') }}">
						@if ($errors->has('eisbn'))															
							<label class="control-label">{{ $errors->first('eisbn') }} </label>
						@endif	
					</div>	
					@endif
					
					<div class="form-group">
						<label class="control-label">eISSN:</label>
				<input type="text" name="eissn" id="" class="form-control input-md" placeholder="eISSN" value="{{ old("eissn", isset($volume->eissn) ? $volume->eissn : '') }}">
					</div>
					<!------------------------------------------------------------>
					
					<div class="form-group">
						<label class="control-label">Flyer Link:</label>

					@isset($volume->flyer_link) @if($volume->flyer_link == '') <span class="text-danger">No File Uploaded</span> @else <strong><span> {{$volume->flyer_link}}</span></strong> 
						@if($user==1)
							<a href="{{ route('DeleteEbookVolumeFile', array('id' => $volume->ebook_volume_id, 'file_type' => 'flyer_link')) }}">[remove]</a> 
						@endif	
					@endif @endisset
					
						<div class="fileinput fileinput-new input-group" data-provides="fileinput">
							<div class="form-control" data-trigger="fileinput">
								<i class="glyphicon glyphicon-file fileinput-exists"></i>
								<span class="fileinput-filename"></span>
							</div>
							
							<span class="input-group-addon btn btn-default btn-file">
							
								<span class="fileinput-new">Select file</span>
								<span class="fileinput-exists">Change</span>
								
								<input type="file" name="flyer_link"></span>
								
							<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
						</div>
						<p>E.g: filename.pdf</p>
					</div>

					<div class="form-group">
						<label class="control-label">Complete eBook Price Print on Demand:</label>
				<input type="text" name="ebook_price_pod" id="" class="form-control input-md" placeholder="Complete eBook Price Print on Demand" value="{{ old("ebook_price_pod", isset($volume->ebook_price_pod) ? $volume->ebook_price_pod : '') }}">
					</div>
					<div class="form-group">
						<label class="control-label">Complete eBook Price Print On Demand and PDF:</label>
						<input type="text" name="ebook_price_pod_pdf" id="" class="form-control input-md" placeholder="Complete eBook Price Print On Demand and PDF" value="{{ old("ebook_price_pod_pdf", isset($volume->ebook_price_podandpdf) ? $volume->ebook_price_podandpdf : '') }}">
					</div>
					<div class="form-group">
						<label class="control-label">Complete eBook Price:</label>
				<input type="text" name="ebook_price" id="" class="form-control input-md" placeholder="Complete eBook Price" value="{{ old("ebook_price", isset($volume->ebook_price) ? $volume->ebook_price : '') }}">
					</div>
					<div class="form-group">
						<label class="control-label">Individual Chapter Price:</label>
				<input type="text" name="chapter_price" id="" class="form-control input-md" placeholder="Individual Chapter Price" value="{{ old("chapter_price", isset($volume->chapter_price) ? $volume->chapter_price : '') }}">
					</div>
				
					<div class="form-group">
						<label class="control-label">Introduction:</label>
						<textarea class="form-control resize_vertical" id="message" name="introduction" placeholder="Please enter text here..." rows="5">@isset($volume) {{ $volume->introduction }} @endisset</textarea>
					</div>
				
					<div class="form-group">
						<label class="control-label">Book Audience:</label>
						<textarea class="form-control resize_vertical" id="book_audience" name="book_audience" placeholder="Please enter text here..." rows="5">@isset($volume) {{ $volume->book_audience }} @endisset</textarea>
					</div>

					<div class="form-group">
						<label class="control-label">DOI</label>
				<input type="text" name="doi" id="" class="form-control input-md" placeholder="DOI" value="{{ old("doi", isset($volume->doi) ? $volume->doi : '') }}">
						<p>Leave it blank to generate DOI automatically.</p>
					</div>
					<div class="form-group">
						<label class="control-label">URL</label>
				<input type="text" name="url" id="" class="form-control input-md" placeholder="URL" value="{{ old("url", isset($volume->url) ? $volume->url : '') }}">
					</div>
					<div class="form-group">
						<label class="control-label">eBook/Volume Uploaded</label>
						<select id="e1" class="form-control select2" name="is_uploaded">
					<option title="No" value="0" @isset($volume) @if($volume->is_uploaded == 0) selected @endif
							@endisset
							>No</option>
					<option title="Yes" value="1" @isset($volume) @if($volume->is_uploaded == 1) selected @endif
							@endisset
							>Yes</option>
						</select>
						
					</div>
					<div class="form-group">
						<label class="control-label">Is Packaged: *</label>
						<select name="is_packaged" class="form-control select2" id="edit-is-packaged">
							<option title="Packaging Not Required" value="2">Packaging Not Required</option>
							<option title="Packaged" value="1">Packaged</option>
							<option title="Not Packaged" value="0">Not Packaged</option>
						</select>
						
					</div>
					
					<div class="form-group">
						<label for="e1" class="control-label">Amazon Paperback:</label>
						<input type="text" name="amazon_paperback" id="amazon_paperback" class="form-control input-md" placeholder="Amazon Parper back" value="{{ old("amazon_paperback", isset($volume->amazon_paperback) ? $volume->amazon_paperback : '') }}">
					</div>
					<div class="form-group">
						<label for="e1" class="control-label">Amazon kindle:</label>
						<input type="text" name="amazon_kindle" id="amazon_kindle" class="form-control input-md" placeholder="Amazon kindle" value="{{ old("amazon_kindle", isset($volume->amazon_kindle) ? $volume->amazon_kindle : '') }}">
					</div>
					
					<hr>
					
					<div class="form-group text-right">
						@isset($volume)
							{{ Form::submit('Update', array('class' => 'btn btn-primary','value' => 'submit', 'name' => 'update_ebook_volume_form' ))  }}
						@else
							{{ Form::submit('Submit', array('class' => 'btn btn-primary','value' => 'submit' , 'name' => 'submit_ebook_volume_form' )) }}
						@endisset 
					</div>
			
				
		</div>
		{{ Form::close() }}
	</div>
</div>