<div class="modal fade" id="<?= 'images-modal'.$i ?>">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h3 class="modal-title">Images des documents</h3>
			</div>
			<div class="modal-body">
				<?php
				$profile_image = $row->profile_image;
				$profile_image_file = empty($profile_image) ? null : @fopen($profile_image,'r');
				if($row->affiliation == 'CHILD') {

					$birthdate_proof_doc = $row->birthdate_proof_doc;
					$birthdate_proof_doc_file = empty($birthdate_proof_doc) ? null : @fopen($birthdate_proof_doc ,'r');

					$justice_doc = $row->justice_doc;
					$justice_doc_file = empty($justice_doc) ? null : @fopen($justice_doc ,'r');

					?>
					<div class="row text-center" style="justify-content: center; display: flex;">
						<div class="col-sm-6">
							<label><?= $this->lang->line('profile_image') ?></label>
							<div>
								<img src="<?= $profile_image_file ? $profile_image : base_url('images/broken.png') ?>"
									 alt="user_image" width="100%"/>
							</div>
						</div>
					</div>
					<div class="row" style="margin-top: 10px">
						<div class="col-sm-6 text-center">
							<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
							<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc :  base_url('images/broken.png') ?>"
								 alt="document_front" style="width: 100%;"/>

						</div>
						<div class="col-sm-6 text-center">
							<label><?= $this->lang->line('justice_doc') ?></label>
							<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
								 alt="document_back" style="width: 100%;"/>

						</div>
					</div>
				<?php } else {

					$marriage_certificate_doc = $row->marriage_certificate_doc;
					$marriage_certificate_doc_file = empty($marriage_certificate_doc) ? null : @fopen($marriage_certificate_doc,'r');

					$id_document_front = $row->id_document_front;
					$id_document_front_file = empty($id_document_front) ? null : @fopen($id_document_front ,'r');

					$id_document_back = $row->id_document_back;
					$id_document_back_file = empty($id_document_front) ? null : @fopen($id_document_back ,'r');

					?>

					<div class="row text-center" style="justify-content: center; display: flex;">
						<div class="col-sm-6">
							<label><?= $this->lang->line('profile_image') ?></label>
							<div>
								<img src="<?= $profile_image_file ? $profile_image : base_url('images/broken.png') ?>"
									 alt="user_image" width="100%"/>
							</div>
						</div>
						<div class="col-sm-6">
							<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
							<div>
								<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
									 alt="user_image" width="100%"/>
							</div>
						</div>
					</div>

					<div class="row" style="margin-top: 10px">
						<div class="col-sm-6 text-center">
							<label><?= $this->lang->line('id_document_image_front') ?></label>
							<img src="<?= $id_document_front_file ? $id_document_front :  base_url('images/broken.png') ?>"
								 alt="document_front" style="width: 100%;"/>

						</div>
						<div class="col-sm-6 text-center">
							<label><?= $this->lang->line('id_document_image_back') ?></label>
							<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
								 alt="document_back" style="width: 100%;"/>

						</div>
					</div>


				<?php } ?>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
			</div>
		</div>
	</div>
</div>
