<div class="modal fade in" id="author_affiliation" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Author's Affiliations</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">

						@include('admin.author.angular_edit_author_affiliation')
						<div ng-controller="Affiliation">
							<div class="table-responsive">
								<table class="table table-bordered table-striped" ng-if="tasks.length > 0">
									
									<tr>
										<th>No.</th>
										<th>Institution</th>
										<th>Department</th>
										<th>Address</th>
										<th>Country</th>
										<th>City</th>
										<th>Postal Code</th>
										<th>Phone</th>
										<th>Fax</th>
										<th>Action</th>
									</tr>
									
									<tr ng-repeat="(index, aff) in affiliations">
										
										<td>
											 {[{ index + 1 }]}
											 <input type="hidden" name="aff_id[]" value="{[{ aff.aff_id }]}" />
										</td>
										<td> {[{ aff.institution }]}</td>
										<td> {[{ aff.department }]}</td>
										<td> {[{ aff.address }]}</td>
										<td> {[{ aff.country }]}</td>
										<td> {[{ aff.city }]}</td>
										<td> {[{ aff.postal_code }]}</td>
										<td> {[{ aff.phone }]}</td>
										<td> {[{ aff.fax }]}</td>

										<td nowrap>
										
										
											<button type="button" class="btn btn-success btn-xs" ng-click="EditAffiliation(index)" >Edit</button>
											<button type="button" class="btn btn-danger btn-xs" ng-click="DeleteAffiliation(index)" >Delete</button>
										
										
										</td>
										
									</tr>
								</table>
							</div>
						    
							
							
							<div class="form-group col-lg-12 col-md-12 col-sm-12">
								<h3>{[{ affiliation_heading }]}</h3>
							</div>
							
							<div id="div_institution" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Institution:</label>
								<input type="text" ng-model="institution"  class="form-control input-md" placeholder="Institution">	
							</div>
							
							<div id="div_department" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Department:</label>
								<input type="text" ng-model="department"  class="form-control input-md" placeholder="Department">
							</div>

							<div id="div_address" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Address:*</label>
								<input type="text" ng-model="address"  class="form-control input-md" placeholder="address">
							</div>

							<div id="div_aff_country" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Country:</label>
								<select class="form-control" id="aff_country" ng-model="aff_country">
								<option value="">Country</option>
									@foreach ($country as $countries)
									<option value="{{$countries->printable_name}}"> {{$countries->printable_name}}</option>
									@endforeach
								</select>
							</div>

							<div id="div_postal_code" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Postal Code:</label>
								<input type="text" ng-model="postal_code" class="form-control input-md" placeholder="Postal Code" >
							</div>
							
							<div id="div_city" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">City:</label>
								<input type="text" ng-model="city" class="form-control input-md" placeholder="City" >
							</div>

							<div id="div_phone" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Phone:</label>
								<input type="text" ng-model="phone"  class="form-control input-md" placeholder="Phone" >
							</div>

							<div id="div_fax" class="form-group col-lg-4 col-md-4 col-sm-4">
								<label class="control-label">Fax:</label>
								<input type="text" ng-model="fax" class="form-control input-md" placeholder="Fax" >
							</div>

							<div id="div_web_view" class="form-group col-lg-12 col-md-12 col-sm-12">
								<label class="control-label">Web View:*</label>
								<textarea ng-model="web_view" class="form-control input-md" placeholder="Web View" ></textarea> 
							</div>
							
							<div class="form-group col-lg-12 col-md-12 col-sm-12">
								<div ng-switch="action">
									<div ng-switch-when="INSERT">
										<input class="btn btn-success btn-xs " type="button" ng-click="AddAffiliation()" value="Add Affiliation" />
									</div>
									<div ng-switch-when="UPDATE">
										<input class="btn btn-success btn-xs " type="button" ng-click="UpdateAffiliation()" value="Update Affiliation" />
									</div>
								</div>
							</div>
							
							
							<input type="hidden" id="author_id" name="author_id" value="" />
							<input class="btn btn-success btn-xs" id="get_aff" type="button" ng-click="GetAffiliation()" value="Get AFF" style="display: none;" />
							
							<div style="clear:both;"></div>
						</div>


                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
            </div>
        </div>
    </div>
</div>							

