<?= $this-> include('templates/header');?>
<?php use App\Libraries\TimeHelper; ?>
<main id="nsofts_main">
    <div class="nsofts-container">

        <div class="row g-4">
            
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Notification</span>
                                <span class="h3 font-bold mb-0"><?php echo $notificationTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-warning text-white text-lg">
                                    <i class="ri-notification-2-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Custom Ads</span>
                                <span class="h3 font-bold mb-0"><?php echo $customAdsTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-danger text-white text-lg">
                                    <i class="ri-advertisement-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Extream codes</span>
                                <span class="h3 font-bold mb-0"><?php echo $extreamTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-success text-white text-lg">
                                    <i class="ri-xing-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">1-Stream</span>
                                <span class="h3 font-bold mb-0"><?php echo $streamTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-info text-white text-lg">
                                    <i class="ri-mist-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Blocklist</span>
                                <span class="h3 font-bold mb-0"><?php echo $blocklistTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-primary text-white text-lg">
                                    <i class="ri-spam-3-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Device ID</span>
                                <span class="h3 font-bold mb-0"><?php echo $deviceIdTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-warning text-white text-lg">
                                    <i class="ri-group-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Activation Code</span>
                                <span class="h3 font-bold mb-0"><?php echo $activationCodeTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-danger text-white text-lg">
                                    <i class="ri-group-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Reports</span>
                                <span class="h3 font-bold mb-0"><?php echo $reportsTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-success text-white text-lg">
                                    <i class="ri-feedback-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Store Policy</span>
                                <span class="h3 font-bold mb-0"><?php echo $storePolicyTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-info text-white text-lg">
                                    <i class="ri-alarm-warning-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-sm-6 col-12">
                <div class="card card-badge">
                    <div class="card-body">
                        <div class="row">
                            <div class="col">
                                <span class="h6 font-semibold text-muted text-sm d-block mb-2">Admin</span>
                                <span class="h3 font-bold mb-0"><?php echo $adminTotalCount; ?></span>
                            </div>
                            <div class="col-auto">
                                <div class="icon-shape bg-primary text-white text-lg">
                                    <i class="ri-admin-line"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
            
        <div class="row g-4 mt-2">
            <div class="col-lg-7 col-md-6">
                <div class="card card-dashboard h-100">
                    <div class="card-body p-4">
                        <div class="d-flex justify-content-between align-items-center">
                            <div class="me-2">
                                <h5 class="mb-4">App Theme</h5>
                            </div>
                        </div>
                        <div>
                            <?php  if ($settings['is_theme'] == '2') { ?>
                                <img src="<?= base_url('assets/images/themes/Glossy.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '3') { ?>
                                <img src="<?= base_url('assets/images/themes/BlackPanther.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '4') { ?>
                                <img src="<?= base_url('assets/images/themes/MovieUI.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '5') { ?>
                                <img src="<?= base_url('assets/images/themes/VUI.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '6') { ?>
                                <img src="<?= base_url('assets/images/themes/ChristmasUI.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '7') { ?>
                                <img src="<?= base_url('assets/images/themes/HalloweenUI.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '8') { ?>
                                <img src="<?= base_url('assets/images/themes/Ramadan.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else if ($settings['is_theme'] == '9') { ?>
                                <img src="<?= base_url('assets/images/themes/Sports.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;" >
                            <?php } else { ?>
                                <img src="<?= base_url('assets/images/themes/OneUI.png') ?>" alt="" style="width: 100%; height: auto; min-width: 100%; min-height: 100%; max-width: 100%; border-radius: 10px;">
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>  
            <div class="col-lg-5 col-md-6">
                <div class="card card-dashboard h-100">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between">
                            <h5 class="mb-0">New Reports</h5>
                        </div>
                        <?php if(!empty($result)){ ?>
                        
                            <?php $i=0; foreach($result as $row){ ?>
                            
                                <div class="d-flex align-items-center mt-4">
                                    <span class="d-block fw-semibold"><?php echo $row['report_title'];?></span>
                                    <span><td><?= esc(TimeHelper::calculateTimeSpan($row['report_on'])); ?></td></span>
                                </div>
                                
                            <?php $i++; } ?> 
                            
                        <?php } else { ?>
                            <ul class="p-2">
                                <h3 class="text-center">No data found !</h3>
                            </ul>
                        <?php } ?>
                    </div>
                </div>
            </div> 
        </div>
        
    </div>
</main>
<?= $this-> include('templates/footer');?>