<?php
if(!isset($_SESSION['admin_data']) && !empty($_SESSION['admin_data'])){ // testing

$num_mem=$_SESSION['admin_data']['num_mem'];
$num_keywords=$_SESSION['admin_data']['num_keywords'];
$num_blog=$_SESSION['admin_data']['num_blog'];
$num_ser=$_SESSION['admin_data']['num_ser'];
}else{

$nummem=$this->db->query("SELECT mid FROM site_mem");
$num_mem=$nummem->num_rows();

$numblog=$this->db->query("SELECT blog_id FROM site_blogs");
$num_blog=$numblog->num_rows();

$numsub=$this->db->query("SELECT sbc_id FROM site_subscribe");
$num_sub=$numsub->num_rows();

$numser=$this->db->query("SELECT service_id FROM `x-services`");
$num_ser=$numser->num_rows();
// $num_cou='0';
// $numcou='0';

$num_keywords='0';
$_SESSION['admin_data']['num_ser']=$numser;
$_SESSION['admin_data']['num_blog']=$numblog;
$_SESSION['admin_data']['num_mem']=$num_mem;
$_SESSION['admin_data']['num_keywords']=$num_keywords;
} 

?>

<div class="app-main__outer">
<div class="app-main__inner">
<div class="app-page-title">
                            <div class="page-title-wrapper">
                                <div class="page-title-heading">
                                    <div class="page-title-icon">
                                        <img src="<?=base_url('assets/avator/favicon.png')?>" style='height: 35px;' >
                                    </div>
                                    <div>Your Admin Dashboard
                                        <div class="page-title-subheading">You can manage your website details here.
                                        </div>
                                    </div>
                                </div>
                                <div class="page-title-actions">
                                    <!-- <button type="button" data-toggle="tooltip" title="Example Tooltip" data-placement="bottom" class="btn-shadow mr-3 btn btn-dark">
                                        <i class="fa fa-star"></i>
                                    </button> -->
                                    <!-- div class="d-inline-block dropdown">
                                        <button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn-shadow dropdown-toggle btn btn-info">
                                            <span class="btn-icon-wrapper pr-2 opacity-7">
                                                <i class="fa fa-business-time fa-w-20"></i>
                                            </span>
                                            Buttons
                                        </button>
                                        <div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu dropdown-menu-right">
                                            <ul class="nav flex-column">
                                                <li class="nav-item">
                                                    <a href="javascript:void(0);" class="nav-link">
                                                        <i class="nav-link-icon lnr-inbox"></i>
                                                        <span>
                                                            Inbox
                                                        </span>
                                                        <div class="ml-auto badge badge-pill badge-secondary">86</div>
                                                    </a>
                                                </li>
                                                <li class="nav-item">
                                                    <a href="javascript:void(0);" class="nav-link">
                                                        <i class="nav-link-icon lnr-book"></i>
                                                        <span>
                                                            Book
                                                        </span>
                                                        <div class="ml-auto badge badge-pill badge-danger">5</div>
                                                    </a>
                                                </li>
                                                <li class="nav-item">
                                                    <a href="javascript:void(0);" class="nav-link">
                                                        <i class="nav-link-icon lnr-picture"></i>
                                                        <span>
                                                            Picture
                                                        </span>
                                                    </a>
                                                </li>
                                                <li class="nav-item">
                                                    <a disabled href="javascript:void(0);" class="nav-link disabled">
                                                        <i class="nav-link-icon lnr-file-empty"></i>
                                                        <span>
                                                            File Disabled
                                                        </span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div> -->
                                </div>    </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3">
                                    <div class="card-shadow-primary mb-3 widget-chart widget-chart2 text-left card">
                                        <div class="widget-chat-wrapper-outer">
                                            <a href="<?=base_url('admin/perform/web/users')?>" class="no_link" >
                                            <div class="widget-chart-content"><h6 class="widget-subheading">Users</h6>
                                                <div class="widget-chart-flex">
                                                    <div class="widget-numbers mb-0 w-100">
                                                        <div class="widget-chart-flex">
                                                            <div class="fsize-4">
                                                                <small class="opacity-5"></small>
                                                               <?=$num_mem;?>
                                                            </div>
                                                            <div class="ml-auto">
                                                                <div class="widget-title ml-auto font-size-lg font-weight-normal text-muted">
                                                                    <span class="text-success pl-2">+</span>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </a>
                                        </div>
                                    </div>
                                </div>
                                <!--<div class="col-sm-3">-->
                                    <!--    <a href="<?=base_url('admin/perform/web/blogs')?>" class="no_link" >-->
                                    <!--<div class="card-shadow-primary mb-3 widget-chart widget-chart2 text-left card">-->
                                    <!--        <div class="widget-chat-wrapper-outer">-->
                                    <!--        <div class="widget-chart-content"><h6 class="widget-subheading">Blogs</h6>-->
                                    <!--            <div class="widget-chart-flex">-->
                                    <!--                <div class="widget-numbers mb-0 w-100">-->
                                    <!--                    <div class="widget-chart-flex">-->
                                    <!--                        <div class="fsize-4">-->
                                    <!--                            <small class="opacity-5"></small>-->
                                    <!--                            <?=$num_blog;?>-->
                                    <!--                        </div>-->
                                    <!--                        <div class="ml-auto">-->
                                    <!--                            <div class="widget-title ml-auto font-size-lg font-weight-normal text-muted">-->
                                    <!--                                <span class="text-success pl-2"></span>-->
                                    <!--                            </div>-->
                                    <!--                        </div>-->
                                    <!--                    </div>-->
                                    <!--                </div>-->
                                    <!--            </div>-->
                                    <!--        </div>-->
                                    <!--    </div>-->
                                    <!--</div>-->
                                    <!--</a>-->
                                <!--</div>-->
                                <div class="col-sm-3">
                                    <a href="<?=base_url('admin/perform/web/products')?>" class="no_link" >
                                        <div class="card-shadow-primary mb-3 widget-chart widget-chart2 text-left card">
                                        <div class="widget-chat-wrapper-outer">
                                            <div class="widget-chart-content"><h6 class="widget-subheading">Products</h6>
                                                <div class="widget-chart-flex">
                                                    <div class="widget-numbers mb-0 w-100">
                                                        <div class="widget-chart-flex">
                                                            <div class="fsize-4">
                                                                <small class="opacity-5"></small>
                                                                <?=$num_ser?>
                                                            </div>
                                                            <div class="ml-auto">
                                                                <div class="widget-title ml-auto font-size-lg font-weight-normal text-muted">
                                                                    <span class="text-success pl-2"></span>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </a>
                                </div><div class="col-sm-3">
                                    <a href="<?=base_url('admin/perform/web/subscribe')?>" class="no_link">
                                        <div class="card-shadow-primary mb-3 widget-chart widget-chart2 text-left card">
                                        <div class="widget-chat-wrapper-outer">
                                            <div class="widget-chart-content"><h6 class="widget-subheading">Subscribes</h6>
                                                <div class="widget-chart-flex">
                                                    <div class="widget-numbers mb-0 w-100">
                                                        <div class="widget-chart-flex">
                                                            <div class="fsize-4">
                                                                <small class="opacity-5"></small>
                                                                <?=$num_sub;?>
                                                            </div>
                                                            <div class="ml-auto">
                                                                <div class="widget-title ml-auto font-size-lg font-weight-normal text-muted">
                                                                    <span class="text-success pl-2"></span>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </a>
                                </div>
                        </div>