<div class="row">
	<div class="col-md-12" id="printtopscroll">
	<h2 class='h3'>Book Proposal</h2>
        @php
        			$reg_type = "bookproposal";
        @endphp	
  <hr>

  	 <div class="card bigbox-hvr-slow">
		  <div class="card-body">
	   
<form name="first" method="post" action="{{ route('proposal') }}" enctype="multipart/form-data">    
	@csrf
 <div class="row">
 	<div class="col-md-12">
 		
		@if ($errors->any())
		<div class="form-row">
		<div class="col-md-12 alert alert-danger px-3 pt-3">
			<strong>Whoops!</strong> There were some problems with your input.<br>
			<ul class="px-3 pt-2 m-0 ">
				@foreach ($errors->all() as $error)
					<li>{{ $error }}</li>
				@endforeach
			</ul>
		</div>
		</div>
		@endif

        @if ($message = Session::get('success'))
			<div class="alert alert-success alert-dismissible fade show" role="alert">
				{!! $message !!}
				<button type="button" class="close" data-dismiss="alert" aria-label="Close">
				<span aria-hidden="true">&times;</span>
				</button>
			</div>
        @endif

        <input type="hidden" name="reg_type" value="{{$reg_type}}">
        <input type="hidden" name="journal_id" value="{{$journal->journal_id}}">
	
		<div class="form-row">
			<div class="form-group col-md-12">
				<label class="control-label">Title of the proposed Book: *</label>
				<input type="text" name="title_proposed_book" value="{{ old("title_proposed_book") }}" class="form-control" required="required">
			</div>
			<div class="form-group col-md-12">
				<label for="edit-last_name">Editor/Author Name: *</label>
				<input type="text" name="editor_name" value="{{ old("editor_name") }}" class="form-control" required="required">
			</div>

			<div class="form-group col-md-12">
				<label for="edit-email">Editor/Author Affiliation: *</label>
				<textarea class="form-control" rows="2" name="editor_affiliation" required>{{ old("editor_affiliation") }}</textarea>
			</div>

			<div class="form-group col-md-12">
				<label for="edit-email">Editor's/Author's List of Publications (Last - 5 Years): *</label>
				<textarea class="form-control" rows="4" name="list_of_publications" required>{{ old("list_of_publications") }}</textarea>
			</div>

			<div class="form-group col-md-12">
				<label for="edit-email">Book Description: *</label>
				<textarea class="form-control" rows="4" name="book_description" required>{{ old("book_description") }}</textarea>
			</div>

			<div class="form-group col-md-12">
				<label for="edit-email">Proposal Keywords:</label>
				<textarea class="form-control" rows="3" name="proposal_keywords">{{ old("proposal_keywords") }}</textarea>
			</div>

			<div class="form-group col-md-3">
				<label for="edit-last_name">Book Type: *</label>
				<select class="form-control w-100" id="country" name="book_type"  required = 'required'>
					<option value="Authored Book" @if(old('book_type') == "Authored Book") {{ 'selected' }} @endif>Authored Book</option>
					<option value="Edited Book" @if(old('book_type') == "Edited Book") {{ 'selected' }} @endif>Edited Book</option>
				</select>
			</div>

			<div class="form-group col-md-4">
				<label for="edit-last_name">Total Chapters: *</label>
				<select class="form-control w-100" id="country" name="total_chapter"  required = 'required'>
					<option value="">Select Number of Chapters</option>
				@for($a = 3; $a < 26; $a++)	
					<option value="{{$a}}" @if(old('total_chapter') == $a) {{ 'selected' }} @endif>{{$a}}</option>
				@endfor	
				</select>
			</div>

			<div class="form-group col-md-5">
				<label class="control-label">Tentative date for submission of ALL manuscripts:</label>
				<input type="date" name="date_for_submission" value="{{ old("date_for_submission") }}" class="form-control">
			</div>


			<div class="form-group col-md-12">
				<label for="edit-email">Comments:</label>
			<textarea cols="60" rows="3" name="comments" id="edit-comments" class="form-control">{{ old('comments') }}</textarea>
			</div>

			<div class="form-group col-md-12"> 
			<hr >
				<h2 class='h3'>Contact Information:</h2>
			</div>
		</div>	

		<div class="form-row">

			<div class="form-group col-md-4">
				<label for="edit-last_name">Title: *</label>
				<select class="form-control w-100" id="title" name="title"  required = 'required'>
					<option value="Mr." @if(old('title') == 'Mr.') {{ 'selected' }} @endif>Mr. </option>
					<option value="Mrs." @if(old('title') == 'Mrs.') {{ 'selected' }} @endif>Mrs.</option>
					<option value="Ms." @if(old('title') == 'Ms.') {{ 'selected' }} @endif>Ms</option>
					<option value="Prof." @if(old('title') == 'Prof.') {{ 'selected' }} @endif>Prof.</option>
					<option value="Dr." @if(old('title') == 'Dr.') {{ 'selected' }} @endif>Dr.</option>	
				</select>
			</div>

			<div class="form-group col-md-4">
				<label class="control-label">First Name: *</label>
			<input type="text" maxlength="50" name="first_name" size="60" value="{{ old("first_name") }}" class="form-control" required="required">
			</div>
			
			<div class="form-group col-md-4">
				<label for="edit-last_name">Last Name: *</label>
				<input type="text" maxlength="100" name="last_name" id="" size="60" value="{{ old("last_name") }}" class="form-control" required="required">
			</div>

			<div class="form-group col-md-4">
				<label for="edit-last_name">User Category: *</label>
				<select class="form-control w-100" id="user_category" name="user_category"  required = 'required'>
					<option value="Professor" @if(old('user_category') == 'Professor') {{ 'selected' }} @endif>Professor</option>
					<option value="Student" @if(old('user_category') == 'Student') {{ 'selected' }} @endif>Student</option>
					<option value="Researcher" @if(old('user_category') == 'Researcher') {{ 'selected' }} @endif>Researcher</option>
					<option value="Medical professional/Practitioner" @if(old('user_category') == 'Medical professional/Practitioner') {{ 'selected' }} @endif>Medical professional/Practitioner</option>
					<option value="Other" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Other</option>				
				</select>
			</div>

			<div class="form-group col-md-4">
				<label for="edit-email">Address:</label>
				<textarea class="form-control" rows="2" name="address">{{ old("address") }}</textarea>
			</div>

			<div class="form-group col-md-4">
				<label class="control-label">City/Town: *</label>
			<input type="text" maxlength="50" name="city" size="60" value="{{ old("city") }}" class="form-control" required="required">
			</div>

			<div class="form-group col-md-4">
				<label for="edit-last_name">Country: *</label>
				<select class="form-control w-100" id="country" name="country"  required = 'required'>
					<option value="">Country</option>
					@foreach ($country as $countries)
					<option value="{{$countries->country_id}}" {{ old("country") == $countries->country_id ? "selected" : "" }}> {{$countries->printable_name}}</option>
					@endforeach
				</select>
			</div>

			<div class="form-group col-md-4">
				<label class="control-label">State/Province:</label>
				<select class="form-control w-100" id="state" name="state">
					<option value="Others" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Others</option>
					<option value="Alabama" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Alabama</option>
					<option value="Alaska" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Alaska</option>
					<option value="Arizona" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Arizona</option>
					<option value="Arkansas" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Arkansas</option>
					<option value="California" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>California</option>
					<option value="Colorado" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Colorado</option>
					<option value="Connecticut" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Connecticut</option>
					<option value="Delaware" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Delaware</option>
					<option value="District of Columbia" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>District of Columbia</option>
					<option value="Florida" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Florida</option>
					<option value="Georgia" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Georgia</option>
					<option value="Hawaii" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Hawaii</option>
					<option value="Idaho" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Idaho</option>
					<option value="Illinois" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Illinois</option>
					<option value="Indiana" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Indiana</option>
					<option value="Iowa" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Iowa</option>
					<option value="Kansas" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Kansas</option>
					<option value="Kentucky" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Kentucky</option>
					<option value="Louisiana" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Louisiana</option>
					<option value="Maine" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Maine</option>
					<option value="Maryland" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Maryland</option>
					<option value="Massachusetts" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Massachusetts</option>
					<option value="Michigan" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Michigan</option>
					<option value="Minnesota" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Minnesota</option>
					<option value="Mississippi" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Mississippi</option>
					<option value="Missouri" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Missouri</option>
					<option value="Montana" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Montana</option>
					<option value="Nebraska" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Nebraska</option>
					<option value="Nevada" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Nevada</option>
					<option value="New Hampshire" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>New Hampshire</option>
					<option value="New Jersey" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>New Jersey</option>
					<option value="New Mexico" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>New Mexico</option>
					<option value="New York" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>New York</option>
					<option value="North Carolina" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>North Carolina</option>
					<option value="North Dakota" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>North Dakota</option>
					<option value="Ohio" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Ohio</option>
					<option value="Oklahoma" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Oklahoma</option>
					<option value="Oregon" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Oregon</option>
					<option value="Pennsylvania" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Pennsylvania</option>
					<option value="Rhode Island" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Rhode Island</option>
					<option value="South Carolina" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>South Carolina</option>
					<option value="South Dakota" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>South Dakota</option>
					<option value="Tennessee" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Tennessee</option>
					<option value="Texas" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Texas</option>
					<option value="Utah" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Utah</option>
					<option value="Vermont" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Vermont</option>
					<option value="Virginia" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Virginia</option>
					<option value="Washington" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Washington</option>
					<option value="West Virginia" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>West Virginia</option>
					<option value="Wisconsin" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Wisconsin</option>
					<option value="Wyoming" @if(old('user_category') == 'Other') {{ 'selected' }} @endif>Wyoming</option>	
				</select>		
			</div>

			<div class="form-group col-md-4">
				<label class="control-label">ZIP/Postal code:</label>
			<input type="text" maxlength="50" name="zipcode" size="60" value="{{ old("zipcode") }}" class="form-control">
			</div>

			<div class="form-group col-md-4">
				<label for="edit-email">Email: *</label>
				<input type="email" maxlength="50" name="email" id="" size="60" value="{{ old("email") }}" class="form-control" required="required">
			</div>

			<div class="form-group col-md-4">
				<label for="edit-email">Phone:</label>
				<input type="text" maxlength="50" name="phone" id="" size="60" value="{{ old("phone") }}" class="form-control">
			</div>			

			<div class="form-group col-md-4">
				<label for="edit-email">Fax:</label>
				<input type="text" maxlength="50" name="fax" id="" size="60" value="{{ old("fax") }}" class="form-control">
			</div>			

			<div class="form-group col-md-12">
              <div class="form-group row mt-3 w-100"> 
                    
                      <div class="col-auto mx-auto w-100 d-flex ">
                          <div class="col-md-6 text-right">
                              <div class="captcha">                                       
                                  <span>{!! captcha_img() !!}</span>             
                              </div>
                          </div>
                          <div class="col-md-6">                                        
                              <button type="button" class="btn btn-danger" class="refresh-captcha" id="refresh-captcha">
                                  &#x21bb;
                              </button> 
                          </div>
                      </div>
                      <div class="form-group my-2 mx-auto">
                          <input id="captcha" type="text" class="form-control" placeholder="Enter Captcha" name="captcha">
                          @if ($errors->has('captcha'))

                            <span class="invalid-feedback" style="display: block;">

                                <strong>{{ $errors->first('captcha') }}</strong>

                            </span>

                        @endif
                      </div>
              </div>			
          </div>
			
		</div>
		<hr>
		</div>
 	<div class="col-md-9 text-center m-auto">
		
		
		   <a class="btn btn-outline-dark" href="/journal/{{$journal->journal_id}}">Back</a>
		   <input class="btn btn-dark" name="issue_purchase_form" type="submit" value="Submit">	
		   <br />
		   <br />

	  </div>
	</div>
   
		</form>
				
        </div>
    
      </div>
    </div>
   </div>



   @section('footer_scripts')
<script type="text/javascript">
$(document).ready(function(){
    /* Get iframe src attribute value i.e. YouTube video url
    and store it in a variable */
    var url = $("#cartoonVideo").attr('src');
    
    /* Remove iframe src attribute on page load to
    prevent autoplay in background */
    $("#cartoonVideo").attr('src', '');
    
    /* Assign the initially stored url back to the iframe src
    attribute when modal is displayed */
    $("#myModal").on('shown.bs.modal', function(){
        $("#cartoonVideo").attr('src', url);
    });
    
    /* Assign empty url value to the iframe src attribute when
    modal hide, which stop the video playing */
    $("#myModal").on('hide.bs.modal', function(){
        $("#cartoonVideo").attr('src', '');
    });
});
</script>

<!--JQuery & Script for BS4 Custom file upload-->
<script src="{{ asset('js/jquery-3.2.1.slim.min.js') }}"></script>
<script>
            $('#inputGroupFile01').on('change',function(){
                //get the file name
                var fileName = $(this).val();
                //replace the "Choose a file" label
                $(this).next('.custom-file-label').html(fileName);
            })
</script>
   @stop
