<?php

$user = usr::getCurrentUser(1);
if (isset($data[0]['rate'])) {
    $widgets = $data;
} else {
    if (isset($_GET['Data'])) {
        $page = $_GET['Data'];
        if ($page != null) {
            $widgets = widgetControl::getPageWidgets($page);
        } else {
            $widgets = widgetControl::getPageWidgets(0);
        }
    }
}
?>

<!-- DashBoard -->
<div id="dashboard" class="dashboard col-xs-9">
    <div class="topHead" style="margin-bottom:0px;">
        <span class="greenMark"><?php 
print Core::translateToCurrentLocale("Dashboard");
?>
</span>
        <div class="line"></div>
    </div>
    <div class="widgetPager">
        <?php 
$data = $widgets[0]['rate'];
print Core::runView('Shared/widgetpager', $data);
$currentRate = $widgets[0]['rate'];
<?php

/*
 * Now it is the widget rate !!!
 *
 * */
if (isset($data['firstCurrency'])) {
    $currentRate = $data;
} else {
    if (isset($_GET['Data'])) {
        $currentRate = $_GET['Data'];
    }
}
$defaultValue = api::rate($currentRate['firstCurrency'], $currentRate['secondCurrency']);
$pages = widgetControl::getPages();
if (count($pages) > 0) {
    foreach ($pages as $key => $value) {
        $firstCur = $value['rate']['firstCurrency'];
        $secondCur = $value['rate']['secondCurrency'];
        $pages[$key]['value'] = api::rate($firstCur, $secondCur);
    }
}
?>

<div id="pageloader" class="widgetrate clearfix">
    <?php 
if (isset($pages)) {
    ?>
    <?php 
    foreach ($pages as $key => $value) {
        ?>