<?php
function floorDec($val, $precision = 2)
{
    if ($precision < 0) {
        $precision = 0;
    }
    $numPointPosition = intval(strpos($val, '.'));
    if ($numPointPosition === 0) { //$val is an integer
        return $val;
    }
    return floatval(substr($val, 0, $numPointPosition + $precision + 1));
}
?>

<div class="container-fluid">
    <div class="row column_title">
        <div class="col-md-12">
            <div class="page_title">
                <h2>Dashboard</h2>
            </div>
        </div>
    </div>
    <div class="row column1">
        <div class="col-md-6 col-lg-3">
            <div class="full counter_section margin_bottom_30">
                <div class="couter_icon">
                    <div>
                        <i class="fa fa-user green_color"></i>
                    </div>
                </div>
                <div class="counter_no">
                    <div>
                        <p class="total_no"><?=$users?></p>
                        <p class="head_couter">Users</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-6 col-lg-3">
            <div class="full counter_section margin_bottom_30">
                <div class="couter_icon">
                    <div>
                        <i class="fas fa-hamburger" style="color: #0d26b2;"></i>
                    </div>
                </div>
                <div class="counter_no">
                    <div>
                        <p class="total_no"><?=$foodtypes?></p>
                        <p class="head_couter">Food Types</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-lg-3">
            <div class="full counter_section margin_bottom_30">
                <div class="couter_icon">
                    <div>
                        <i class="fas fa-seedling" style="color: #4caf50;"></i>
                    </div>
                </div>
                <div class="counter_no">
                    <div>
                        <p class="total_no"><?=$allergytypes?></p>
                        <p class="head_couter">Allergy Types</p>
                    </div>
                </div>
            </div>
        </div>


    </div>
    <div class="row column1">
        <div class="col-lg-12 col-md-12">
            <div class="white_shd full margin_bottom_30">
                <div class="full graph_head">
                    <div class="heading1 margin_0">
                        <h2>User Signup Trend</h2>
                    </div>
                </div>
                <div class="map_section padding_infor_info">
                    <canvas id="line_chart"></canvas>
                </div>
            </div>
        </div>
    </div>

    <div class="row column1">
        <div class="col-lg-6 col-md-6">
            <div class="white_shd full margin_bottom_30">
                <div class="full graph_head">
                    <div class="heading1 margin_0">
                        <h2>Active Users</h2>
                    </div>
                </div>
                <div class="map_section padding_infor_info">
                    <canvas id="activeUsersChart"></canvas>
                </div>
            </div>
        </div>

        <div class="col-lg-6 col-md-6">
            <div class="white_shd full margin_bottom_30">
                <div class="full graph_head">
                    <div class="heading1 margin_0">
                        <h2>New vs Returning Users</h2>
                    </div>
                </div>
                <div class="map_section padding_infor_info">
                    <canvas id="newReturningUsersChart"></canvas>
                </div>
            </div>
        </div>

        <div class="col-lg-6 col-md-6">
            <div class="white_shd full margin_bottom_30">
                <div class="full graph_head">
                    <div class="heading1 margin_0">
                        <h2>User Engagement Metrics</h2>
                    </div>
                </div>
                <div class="map_section padding_infor_info">
                    <canvas id="userEngagementChart"></canvas>
                </div>
            </div>
        </div>

        <div class="col-lg-6 col-md-6">
            <div class="white_shd full margin_bottom_30">
                <div class="full graph_head">
                    <div class="heading1 margin_0">
                        <h2>User Demographics</h2>
                    </div>
                </div>
                <div class="map_section padding_infor_info">
                    <canvas id="demographicsChart"></canvas>
                </div>
            </div>
        </div>

    </div>



</div>