added modal image on edit-kyc

This commit is contained in:
gelonspr 2024-03-08 10:34:02 +08:00
parent 27197918b6
commit fd058edfd0
2 changed files with 176 additions and 67 deletions

View File

@ -78,3 +78,80 @@
display: block; display: block;
} }
.kycImg , .selfieImg{
border-radius: 5px;
cursor: pointer;
transition: 0.3s;
}
.kycImg:hover , .selfieImg:hover{
box-shadow: 5px 10px 5px lightblue;
opacity: 0.7;
}
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.9);
}
.modal-content {
margin: auto;
display: block;
width: 80%;
height: auto;
max-width: 700px;
}
.modal-content, #caption {
-webkit-animation-name: zoom;
-webkit-animation-duration: 0.6s;
animation-name: zoom;
animation-duration: 0.6s;
}
@-webkit-keyframes zoom {
from {-webkit-transform:scale(0)}
to {-webkit-transform:scale(1)}
}
@keyframes zoom {
from {transform:scale(0)}
to {transform:scale(1)}
}
.close {
position: absolute;
top: 15px;
right: 35px;
color: #f1f1f1;
font-size: 40px;
font-weight: bold;
transition: 0.3s;
}
.close:hover,
.close:focus {
color: #bbb;
text-decoration: none;
cursor: pointer;
}
@media only screen and (max-width: 700px){
.modal-content {
width: 100%;
}
}

View File

@ -6,6 +6,8 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="edit-kyc.css"> <link rel="stylesheet" href="edit-kyc.css">
</head> </head>
<body> <body>
@ -32,12 +34,17 @@
<?php <?php
// Display selfie image // Display selfie image
if (!empty($array['selfie'])) { if (!empty($array['selfie'])) {
echo '<img src="' . $array['selfie'] . '" alt="Selfie Image">'; echo '<img src="' . $array['selfie'] . '" alt="Selfie Image" id="kycImg" class="selfieImg" onclick="trigger(\'kycImg\', \'Selfie Image\');">';
} else { } else {
echo '<p>No selfie available.</p>'; echo '<p>No selfie available.</p>';
} }
?> ?>
</div> </div>
<div id="myModal" class="modal">
<span class="close" onclick="closeModal()">&times;</span>
<img class="modal-content" id="img01" style="max-width: 100%; max-height: 80vh; width: auto; height: auto; margin: auto; display: block;">
</div>
<h3>User Information</h3> <h3>User Information</h3>
<div class="form-container"> <div class="form-container">
<fieldset disabled> <fieldset disabled>
@ -69,13 +76,19 @@
<?php <?php
if (!empty($array['images'])) { if (!empty($array['images'])) {
foreach ($array['images'] as $image) { foreach ($array['images'] as $image) {
echo '<img src="' . $image['link'] . '" alt="KYC Image">';
$img = $image['link'] ;
echo '<img src="' . $img . '" alt="KYC Image" id="'. $img . '" class="kycImg" onclick="trigger(\''. $img . '\', \'KYC Image\');">';
} }
} else { } else {
echo '<p>No images available.</p>'; echo '<p>No images available.</p>';
} }
?> ?>
</div> </div>
<div id="myModal" class="modal">
<span class="close">&times;</span>
<img class="modal-content" id="img01">
</div>
<h3>KYC Information</h3> <h3>KYC Information</h3>
<div class="form-container"> <div class="form-container">
<form> <form>
@ -136,7 +149,7 @@
</div> </div>
</div> </div>
<script> <script type="text/javascript">
function handleCheckboxChange() { function handleCheckboxChange() {
// Check the status of checkboxes and enable/disable the "Accept" button // Check the status of checkboxes and enable/disable the "Accept" button
var areAllChecked = document.querySelectorAll('#checkboxForm input[type="checkbox"]:checked').length === 4; var areAllChecked = document.querySelectorAll('#checkboxForm input[type="checkbox"]:checked').length === 4;
@ -178,6 +191,25 @@
alert("Please provide a valid reason for rejection."); alert("Please provide a valid reason for rejection.");
} }
} }
var captionText = document.getElementById("captionText");
function trigger(var1, caption) {
var modal = document.getElementById("myModal");
var modalImg = document.getElementById("img01");
modal.style.display = "block";
modalImg.src = document.getElementById(var1).src;
captionText.innerHTML = caption;
}
var span = document.getElementsByClassName("close")[0];
function closeModal() {
var modal = document.getElementById("myModal");
modal.style.display = "none";
}
</script> </script>
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true"> <div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">