<div class="collapse" id="collapseMembership">
  	<div class="card card-body">
		<h4 class="card-title">Professional Memberships</h4>
		<hr>
		
		
		<div class="container">
			<div class="row">
				<div class="btn-group ml-auto">
					<?php if ($role == 'admin'): ?>
						<a class="btn btn-info btn-sm" style="margin-bottom:15px; width: 200px;" href="<?php echo base_url('hr/StaffProfile/actionReport/'.$staff_id.'/6'); ?>" target="_blank">
							<i class="fa fa-print"></i> Print
						</a>
					<?php endif ?>
				</div>
			</div>
		</div>
		

		<div class="table-responsive">
			<table id="table_membership" class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>Action Type ( Effective date )</th>
						<th>Details</th>
						<th>Attachment</th>
						<th>Created At</th>
						<!-- <?php if($role == 'admin'): ?>
						<th>Action</th>
						<?php endif ?> -->
						

					</tr>
				</thead>
				<tbody>						

					<?php if($professionalMemberships) foreach ($professionalMemberships as $key => $member): ?>
						
						<tr class="link-row">
							<td scope="row">
								<?php
									echo $member->action_type.' <br/><b>( '.date('d-F-Y',strtotime($member->action_efective_date)).' )</b>';
								?>
							</td>
							<td>
								<?php
									echo '<b>Professional Bodies : </b>'.$member->professional_body
										.'<br/><b>Name of Membership : </b>'.$member->certificate
										.'<br/><b>Type of Membership : </b>'.$member->membership
										.'<br/><b>Membership Number : </b>'.$member->membership_no
										.'<br/><b>Year : </b>'.$member->year;
								?>
							</td>
							<td><a href="<?php echo base_url('hr/staffProfile/openAttachment/'.$member->mask_id.'/2'); ?>" target="_blank"><?php echo $member->attachment_name; ?></a></td>				
							<td><?php echo $member->created_at; ?></td>
							<?php if($role == 'admin'): ?>
							<!-- <td class="text-center">
								<div class="btn-group">
									<button onclick="btnEditProMember(this)" class="btn btn-success btn-sm" data-content="<?php //echo base64_encode(json_encode($member)); ?>" data-toggle="modal" data-target="#membershipModal"><i class="fas fa-edit"></i></button>
									<button onclick="btnRemoveProMember(<?php //echo $member->id; ?>)" class="btn btn-danger  btn-sm"><i class="fas fa-trash"></i></button>
								</div>
							</td> -->
							<?php endif ?>
						</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
	</div><br>
</div>

<div class="modal fade" id="membershipModal">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="racks-modal-title">Edit Professional Memberships</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<form action="<?php echo base_url('/hr/StaffProfile/createMembership/'.$staff_id); ?>" method="POST" class="form-horizontal" id="mdl-professional-membership-form" enctype="multipart/form-data">
				<div class="modal-body">
					<input type="hidden" class="form-control" name="attachmentID" id="mdl-professional-membership-attachment">
					<input type="hidden" class="form-control" name="id" id="mdl-professional-membership-id">
					
					<div class="form-group">
						<label>Professional Bodies</label>
						<input type="text" class="form-control" placeholder="Enter Professional Bodies" name="professional_body" id="mdl-promember-profbody">
					</div>	
					<div class="form-group">
						<label>Name of Membership</label>
						<input type="text" class="form-control"  placeholder="Enter Name of Membership" name="certificate" id="mdl-promember-cert">
					</div>
					<div class="form-group">
						<label>Type of Membership</label>
						<input type="text" class="form-control" placeholder="Enter Membership" name="membership" id="mdl-promember-membership">
					</div>
					<div class="form-group">
						<label>Membership Number</label>
						<input type="text" class="form-control" placeholder="Enter Membership Number" name="membership_no" id="mdl-promember-membership-no">
					</div>
					<div class="form-group">
						<label>Year</label>
						<input type="number" class="form-control" placeholder="Year" name="year" id="mdl-promember-year">
					</div>
					<div class="form-group">
						<label>Attachment</label>
						<input type="file" class="form-control" name="attachment">
					</div>		
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-danger btn-sm" style="margin-bottom:15px; width: 200px;" data-dismiss="modal"><i class="fa fa-ban"></i> Cancel</button>
					<button type="submit" class="btn btn-success btn-sm" style="margin-bottom:15px; width: 200px;"><i class="fa fa-save"></i> Submit</button>
				</div>
			</form>
		</div>
	</div>
</div>