<div class="row" wire:ignore>
    <?php
        $num = 0;
    ?>
    <!-- __BLOCK__ --><?php $__currentLoopData = $photoall; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $photo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <!-- __BLOCK__ --><?php if($photo['st'] == 0): ?>
        
            <div class="col-2 mb-5 large-responsive" id="photo_display">
                <div class="row ms-3 ">
                    <div class="row left-menu" style="height: auto;">
                        <div class="col-12">
                            <span class="text-number-pic"><?php echo e($photo['nu']); ?></span>
                        </div>
                        <div class="col-12 mt-4rem">
                            <a class        ="btn-left-menu zoomify_icon_all "
                                pic_number  ="<?php echo e($photo['nu']); ?>"
                                photo_id2   ="<?php echo e($photo['nu']); ?>"
                                photosrc    ="<?php echo e(mePHOTO($hn, $photo['na'], $folderdate)); ?>?a=<?php echo e(RandomString()); ?>"
                                photoname   ="<?php echo e($photo['na']); ?>"
                                case_id     ="<?php echo e($cid); ?>"
                                data-toggle ="tooltip"
                                title       ="zoom">
                                <i class="ri-search-line me-3"></i>
                            </a>
                        </div>
                        <a class="btn-left-menu"
                            href="<?php echo e(request()->is('capture*') ? url('capture/crop') : url('crop')); ?>?cid=<?php echo e($cid); ?>&hn=<?php echo e($hn); ?>&folderdate=<?php echo e($folderdate); ?>&photoname=<?php echo e($photo['na']); ?>&caseuniq=<?php echo e($caseuniq); ?>&photo_id=<?php echo e($photo['nu']); ?>&type=crop"
                            data-toggle="tooltip" title="crop">
                            <i class="ri-crop-line"></i>
                        </a>
                        <div class="col-12 mt-1">
                            <a wire:click="rollbackphoto('<?php echo e($key); ?>')" class="btn-left-menu picrollbacknew" id="picrollbacknew2<?php echo e($photo['nu']); ?>"
                                type="imgall" hn="<?php echo e($hn); ?>" photoname="<?php echo e($photo['na']); ?>"
                                status="<?php echo e($photo['st']); ?>" photo_id="<?php echo e($photo['nu']); ?>"
                                case_id="<?php echo e($cid); ?>">
                                <i class="ri-refresh-line"></i>
                            </a>
                        </div>
                        <div class="col-12 mt-1">
                            <a wire:click="removePhoto('<?php echo e($key); ?>')" class="btn-left-menu">
                                <i class="ri-close-fill ri-lg"></i>
                            </a>
                        </div>
                    </div>
                    <div class="col-12 photo-display" photo_id="<?php echo e($photo['nu']); ?>" >
                        <img class="img-thumbnail-all imgselect_new" wire:click="selectedPhoto('<?php echo e($key); ?>')"
                            src="<?php echo e(mePHOTO($hn, $photo['na'], $folderdate)); ?>?a=<?php echo e(RandomString()); ?>" width="100%">
                        <?php
                            if ($photo['ns'] != 0) {
                                $color = 'green';
                                $style = '';
                            } else {
                                $color = 'white';
                                $style = 'display: none';
                            }
                        ?>


                        <!-- __BLOCK__ --><?php if($photo['ns'] != 0): ?>
                            <div align="center" class="bb" id="bb<?php echo e($photo['nu']); ?>" style="<?php echo e($style); ?>"><?php echo e($photo['ns']); ?></div>
                            <?php
                                $num++;
                            ?>
                        <?php else: ?>
                            <div align="center" class="bb" id="bb<?php echo e($photo['nu']); ?>" style="<?php echo e($style); ?>">-</div>
                        <?php endif; ?> <!-- __ENDBLOCK__ -->





                        <div id="picselect<?php echo e($photo['nu']); ?>" style="background-color:green;" class="picselect">
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?> <!-- __ENDBLOCK__ -->
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->

    <!-- __BLOCK__ --><?php if(count($photoall) > 0): ?>
        <div class="row">
            <div class="col"></div>
            <div class="col-3">

                <script>
                    function refreshdelay() {
                        setTimeout(function() {
                            window.location.href = "<?php echo e(url("capture/procedure/$cid?select=1")); ?>";
                        }, 2000);
                    }
                </script>



                <a onclick="refreshdelay();"
                    class="btn btn-success btn-xl btn-block btn-loading btn-shadow w-100">
                    <h5 class="text-white"> Confirm Select Photo    </h5>
                </a>
            </div>
        </div>
    <?php endif; ?> <!-- __ENDBLOCK__ -->

    
    <script wire:ignore>
        $(document).ready(function() {
            num = <?php echo e($num); ?>;
            console.log(num);
            $('.photo-display').click(function() {
                var photo_id = $(this).attr('photo_id');
                var picnumall = $("#bb" + photo_id).html();
                if (picnumall != "" && picnumall != "-") {
                    num--;
                    $("#bb" + photo_id).attr("style", "display: none;");
                    $("#bb" + photo_id).html("-");
                    $('.bb').each(function() {
                        var currentNum = $(this).html();
                        if (currentNum != '-' && parseInt(currentNum) > parseInt(picnumall)) {
                            $(this).html(parseInt(currentNum) - 1);
                        }
                    });
                } else {
                    num++;
                    $("#bb" + photo_id).attr("style", "display: block;");
                    $("#bb" + photo_id).html(num);
                }
            });
        });
    </script>
</div>
<?php /**PATH D:\laragon\htdocs\screening\resources\views/case/component/reportwrite/photo/all.blade.php ENDPATH**/ ?>