<!-- /.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="#add_chapter_form">eBook Chapter</a>
		</h4>
	</div>
	<div class="panel-collapse collapse" id="add_chapter_form">	{{ Form::open(array('url' => 'admin/chapters','files' => true)) }}		   
		<div class="panel-body">
				<div class="form-group">
					<label for="select28" class="control-label">
						eBook: *
					</label>
				 <select id="ebook_id" name ="ebook_id" class="form-control select21" required="required">
					<option value="">Select eBooks...</option>
					 @foreach ($ebook as $ebooks)
						<option value="{{$ebooks->ebook_id}}"  @if(old('ebook_id') == $ebooks->ebook_id) {{ 'selected' }}
						@endif> {{$ebooks->title}}</option>
					@endforeach
					</select>
					<input type="hidden" id="link_id" name="link_id" value='edit'>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Volume: *</label>
					<select id="ebook_volume_id" name="ebook_volume_id" class="form-control select2" name="select_state" required="required">
						<option value="">Select Volume</option>
							@if (session('ebook_volume_search'))
							@foreach(session('ebook_volume_search') as $ebook_volume)
								<option value="{{$ebook_volume->ebook_volume_id}}" title="{{$ebook_volume->select_ebook_type}}"
								 @if(old('ebook_volume_id') == $ebook_volume->ebook_volume_id) selected @endif
								>{{$ebook_volume->volume_name}} - (Type {{$ebook_volume->select_ebook_type}})</option>
							@endforeach
							@endif
					</select>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Chapter Number: *</label>
					<input type="text" min="1" max="50"  name="chapter_no" id="chapter_no" class="form-control input-md" placeholder="Chapter Number" required="required" value="{{ old('chapter_no') }}">
					<span id ="lbl_chapter" class="control-label"></span>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Title: *</label>
					<input type="text" name="title" id="title" class="form-control input-md" placeholder="Text Here..." required="required" value="{{ old('title') }}">
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">DOI:</label>
					<input type="text" name="doi" id="doi" class="form-control input-md" placeholder="DOI" value="{{ old('doi') }}">
					<p>Leave it blank to generate DOI automatically.</p>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Abstract:</label>
					<textarea class="form-control editor-cls" id="abstract" name="abstract" placeholder="Please enter your message here..." rows="5">{{ old('abstract') }}</textarea>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Keywords:</label>
					<input type="text" id="keywords" name="keywords" class="form-control input-md" id="keywords" name="keywords" placeholder="Please enter keywords" data-role="tagsinput" value="{{ old('keywords') }}">
					<p>Place "," separated keywords.</p>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Video Link:</label>
					<textarea class="form-control resize_vertical" id="video_link" name="video_link" placeholder="Please enter your message here..." rows="5">{{ old('video_link') }}</textarea>
				</div>
				
			   <div class="form-group">
					<label for="e1" class="control-label">First Page: *</label>
					<input type="text" name="first_page" id="first_page" class="form-control input-md" placeholder="First Page" required="required" value="{{ old('first_page') }}" onblur="javascript: CountPages()">
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Last Page: *</label>
					<input type="text" name="last_page" id="last_page" class="form-control input-md" placeholder="Last Page" required="required" value="{{ old('last_page') }}" onblur="javascript: CountPages()">
					<p>Last page should be greater than First page</p>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Total Page Count:</label>
					<input type="text" name="page_count" id="page_count" class="form-control input-md" placeholder="Total Page Count" value="{{ old('page_count') }}">
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Is Packaged: *</label>
					<select id="e1" class="form-control select2" name="is_packaged">
						<option value="2" @if(old('is_packaged') == 2) {{ 'selected' }}
						@endif>Packaging Not Required</option>
						<option title="Packaged" value="1" @if(old('is_packaged') == 1) {{ 'selected' }}
						@endif>Packaged</option>
						<option title="Not Packaged" value="0" @if(old('is_packaged') == 0) {{ 'selected' }}
						@endif>Not Packaged</option>
					</select>
				</div>
				<div class="form-group">
					<label for="e1" class="control-label">Chapter Uploaded: *</label>
					<select id="e1" class="form-control select2" name="is_uploaded">
						<option value="1" @if(old('is_uploaded') == 1) {{ 'selected' }}
						@endif>Yes</option>
						<option value="0" @if(old('is_uploaded') == 0) {{ 'selected' }}
						@endif>No</option>
					</select>
				</div>
				
				<div class="form-group text-right">
					{{ Form::submit('Submit', array('class' => 'btn btn-primary','value' => 'submit' , 'name' => 'submit_chapter_form' )) }}
				</div>
		</div>
		<!--/.panel-body -->
	</div>
	{{ Form::close() }}	  
</div>
<!-- /#adjusthtml -->