 <!-- Overlay -->
    <div class="overlay"></div>
    <a href="javascript::void(0)" class="scrollToTop"><i class="las la-chevron-up"></i></a>


<!-- Register Section Starts Here -->
<div class="login-section register-section">
    <div class="login-thumb d-small-none">
        <img src="<?php echo base_url();?>files/assets/images/thumb/log-reg-bg.png" alt="thumb">
    </div>
    
    <div class="container">
        <div class="logo-mb-wrapper d-small-none">
            <!-- <a href="<?=base_url()?>" class="login-logo register-logo d-none d-lg-block"><img src="<?php echo base_url();?>files/assets/images/thumb/log-reg-logo.png" alt="thumb"></a> -->
            <!-- <a href="<?=base_url()?>" class="login-logo-two d-lg-none d-block text-center"><img src="<?php echo base_url();?>files/assets/images/thumb/log-reg-logo.png" alt="thumb"></a> -->
        </div>
        <div class="reset-area wait-sec-wrapper login-area d-flex justify-content-center align-items-center">
            <div class="register-selfie">
                <?php $this->load->view('template/message.php');?>

                <div class="mb-4">
                    <h2 class="title mb-2">Register Another Selfie</h2>
                    <p class="text">Add a maximum of 4 selfies for each account</p>
                </div>
                <?php
                    $total = 0;
                    if(!empty($getGuest->photo_url))
                    {
                        $total = 1;
                    }

                    $finalTotal = count($getExtraFace) + $total; 
                ?>
                <div class="selfie-item-wrapper">
                    <span class="fs--12px mb-2 pb-1">Selfies - <?=$finalTotal?>/4 Selfies Max</span>
                    <div class="row g-4">
                        <?php
                        if(!empty($getGuest->photo_url))
                        {
                        ?>
                        <div class="col-sm-4 col-6">
                            <div class="selfie-item">
                                <img src="http://d38x82mkkml5o1.cloudfront.net/<?=$getGuest->photo_url?>" alt="thumb" class="w-100">
                                <a href="<?=base_url('addface-image-delete/'.$getGuest->id.'/'.$getGuest->id.'?guest=true')?>" class="remove-selfie"><i class="las la-times"></i></a>
                            </div>
                        </div>
                    <?php }
                    ?>
                    <?php
                    foreach($getExtraFace as $value) 
                    {
                        ?>
                        <div class="col-sm-4 col-6">
                            <div class="selfie-item">
                                <img src="http://d38x82mkkml5o1.cloudfront.net/<?=$value->photo_url?>" alt="thumb" class="w-100">
                                <a href="<?=base_url('addface-image-delete/'.$value->id.'/'.$value->guest_id.'?guest=')?>" class="remove-selfie"><i class="las la-times"></i></a>
                            </div>
                        </div>
                        <?php
                    }
                    ?>
                     
                </div>
              </div>
              
                <div class="button-wrapper">
                    <a href="javascript:;" class="cmn--btn d-block w-100 mt-4 text-center btn--lg-face2 skipLogin">Continue</a>
                    <?php
                    if($finalTotal < $TotalImageUpload)
                    {
                        ?>
                        <a onclick="AddanotherSelfie()" href="javascript:;" class="cmn--btn d-block w-100 mt-sm-3 mt-2 active text-center btn--lg-face2 ">Add another Selfie</a>
                        <?php
                    }
                    ?>
                    

                </div>
          
        </div>
    </div>
</div>


<script src="<?php echo base_url();?>files/assets/js/lib/jquery-3.6.0.min.js"></script>

<script type="text/javascript">
    $('body').delegate('.skipLogin', 'click', function() {
        $.ajax({
            url: "<?php echo base_url(); ?>AuthController/reglogin",
            type: 'POST',
            data: {
                guest_id: '<?php echo $id; ?>',
                face_url: ''
            },
            success: function(msg) {
                if (msg == "success")
                {
                    document.location.href = "<?php echo base_url('login'); ?>";
                }
            }
        });
    });    


    function AddanotherSelfie() 
    {
        SiteDataStore('Add Face', 'Add Face');       
    }

         function SiteDataStore(type, desc) 
        {   
            $.ajax({
                    url : '<?=base_url()?>SiteDataStoreController/SiteDataStore',
                    type : 'POST',
                    data : {
                        id: '<?php echo $id;?>',
                        type : type,
                        desc : desc,
                    },
                    success : function(msg){
                        window.location.href = '<?=base_url('face-recognition/'.$id.'?addface=true')?>';
                    }
                });

        }
</script>