I am trying to show dynamic data count in popup model in PHP but in model data value is always showing the last data count only.
In image we can see p1,p2,p3 are count so when user click on yellow icon popup appears and same dynamic count p1,p1 needs to show in popup model, but it only shows last count which is p9 in pop up modal
<?php
$formatCount =1;
while ($showformatsexecrow = mysql_fetch_array($showformatsexec)) {
echo '<div class="ui-widget photo">
<tr>
<td align="left" Width="115px">'
//Here p1,p2,p3 count with radio button appears
'<p>"P'.$formatCount.'"</p>
<input align="left" Width="115px" name = "P1" type = "radio" value = "'.$formatshow.'"
</font>
<body>
<a class="open-button" popup-open="popup-1" href="javascript:void(0)">
<i class="fa fa-eye" style="color:white !important;" aria-hidden="true"></i></a>'
//popup modal code and $formatCount is dymaic value data in popup which is showing here last value only
'<div class="popup" popup-name="popup-1">
<div class="popup-content">
<p>"P'.$formatCount.'"</p>
</div>
</div>
</td>
</tr>
</div>';
$formatCount++;
}
?>
JQuery Code:
<script>
$(function () {
// Open Popup
$('[popup-open]').on('click', function () {
var popup_name = $(this).attr('popup-open');
$('[popup-name="' + popup_name + '"]').fadeIn(300);
});
});
</script>