
<?php if(is_project_user() === false AND is_sales_man_user() === false AND is_customer_user() === false){ ?>

<style type="text/css">
body{color: #000 !important;}

/*PROFIT LOSS CHART COLORS*/
.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar, .ct-series-a .ct-slice-donut {
stroke: #23c6c8;
}

.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar, .ct-series-b .ct-slice-donut {
stroke: #ed5565;
}

.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar, .ct-series-c .ct-slice-donut {
stroke: #2B9C1B;
}

.ct-label {
fill: rgb(255 255 255 / 80%);
color: rgb(255 255 255 / 80%);
font-size: 1rem;
line-height: 1;
}
/*PROFIT LOSS CHART COLORS*/

.client-detail{height: 720px;}

.vertical-timeline-content::before{display: none;}
    .custom-col{padding: 2px !important;}
    #vertical-timeline {
        position: relative;
        padding: 0;
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }
    .vertical-container{width: 100% !important; max-width: 100% !important;}
    .vertical-timeline-icon {
        position: absolute;
        top: 0;
        left: 0;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        font-size: 12px;
        border: 3px solid #f1f1f1;
        text-align: center;
    }
    .vertical-timeline-icon i{margin-top: -5px !important;}
    #vertical-timeline::before{left: 13px !important;}
    .vertical-timeline-content{margin-left: 40px !important; padding: 0.5em; font-size: 12px;}
    .client-detail .vertical-timeline-content p{font-size: 12px; cursor: pointer;}
    /*.dark-timeline .vertical-timeline-content, .dark-timeline.center-orientation .vertical-timeline-content{background: #fff;}*/
    /*RTL STYLING FOR DASHBOARD*/
    body.rtls .vertical-timeline-icon{left: 88% !important; z-index: 1;}
    body.rtls #vertical-timeline::before{left: 93% !important;}
    body.rtls .vertical-timeline-content{margin-right: 40px !important; margin-left: 0px !important;}
    body.rtls .slimScrollBar{right: 97% !important;}
    body.rtls .vertical-timeline-content .vertical-date{float: right;}
</style>



<div class="row" style="background: #f6f6f6; padding: 5px; padding-bottom: 0px;">
      <div class="col-md-9 b-r">
            
            <div class="row desktop-view-cash-marque" style="margin-bottom: 7px;">
                  <div class="col-md-12 b-r">
                        <div class="row">
                              <div class="col-md-1 report-btn-db">
                                    <a href="<?= url('/reports/accounts?type=cashbook&currency=usd'); ?>" class="btn btn-primary sm db-cash-report" style="writing-mode: vertical-lr; padding: 7.5px 15px;"><?= print_lang($app_lang,'dashboard_cash_btn'); ?></a>
                              </div>
                              <div class="col-md-11" style="background: #2b9c1b; color: #fff;">
                                    <div class="row">
                                          <div class="col-md-12" style="padding: 0;">
                                                <h4 style="width: 18%; margin: 0; padding: 8px; background: #4ecd3c; display: block;float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>"><?= print_lang($app_lang,'current_cash'); ?></h4>
                                                <?php if(check_user_access('dashboard_cash') === TRUE){ ?>
                                                  <marquee style="margin-top: 4px;" class="cash-marque" width="82%" direction="<?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>" height="20px" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">
                                                        <?php
                                                        $stat_array = $cash_stats['current_cash'];
                                                        foreach($currencies as $row){
                                                            $stat_amount = array_key_exists($row['uid'],$stat_array) ? $stat_array[$row['uid']] : 0;
                                                            if(check_user_access('dashboard_cash') === FALSE){$stat_amount = 0;}
                                                        ?>
                                                              <span style="display: inline-block; width: 150px;"><?= amount_number_format( $stat_amount ); ?> <?= $row['name']; ?></span>
                                                        <?php } ?>
                                                  </marquee>
                                                <?php } ?>
                                          </div>
                                    </div>
                                    <div class="row">
                                          <div class="col-md-12" style="padding: 0;">
                                                <div class="db-current-cash">
                                                      <h4 style="width: 18%; margin: 0; padding: 8px; background: #4ecd3c; display: block;float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>;"><?= print_lang($app_lang,'yesterday_cash'); ?></h4>
                                                      <?php if(check_user_access('dashboard_cash') === TRUE){ ?>
                                                        <marquee style="margin-top: 4px;" class="cash-marque" width="82%" direction="<?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>" height="20px" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">
                                                              <?php
                                                              $stat_array = $cash_stats['yesterday_cash'];
                                                              foreach($currencies as $row){
                                                                  $stat_amount = array_key_exists($row['uid'],$stat_array) ? $stat_array[$row['uid']] : 0;
                                                                  if(check_user_access('dashboard_cash') === FALSE){$stat_amount = 0;}
                                                              ?>
                                                                    <span style="display: inline-block; width: 150px;"><?= amount_number_format( $stat_amount ); ?> <?= $row['name']; ?></span>
                                                              <?php } ?>
                                                        </marquee>
                                                      <?php } ?>
                                                </div>
                                          </div>
                                    </div>
                              </div>
                        </div>
                  </div>
            </div>

            <!-- MOBILE MARQUE FOR CURRENT YESTERDAY CASH -->
            <div class="row mobile-view-cash-marque" style="margin-bottom: 7px;">
                  <div class="col-md-12 b-r">
                        <div class="row">
                              <div class="col-md-1 report-btn-db">
                                    <a href="<?= url('/reports/accounts?type=cashbook&currency=usd'); ?>" class="btn btn-primary sm db-cash-report" style="writing-mode: vertical-lr; padding: 7px 13px;"><?= print_lang($app_lang,'dashboard_cash_btn'); ?></a>
                              </div>
                              <div class="col-md-11" style="background: #2b9c1b; color: #fff;">
                                    <div class="row">
                                          <div class="col-md-12" style="padding: 0;">
                                                <h4 style="width: 40%; margin: 0; padding: 8px; background: #4ecd3c; display: block;float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>"><?= print_lang($app_lang,'current_cash'); ?></h4>
                                                <marquee style="margin-top: 4px;" class="cash-marque" width="60%" direction="<?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>" height="20px" scrolldelay="2" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">
                                                      <?php
                                                      $stat_array = $cash_stats['current_cash'];
                                                      foreach($currencies as $row){
                                                          $stat_amount = array_key_exists($row['uid'],$stat_array) ? $stat_array[$row['uid']] : 0;
                                                          if(check_user_access('dashboard_cash') === FALSE){$stat_amount = 0;}
                                                      ?>
                                                          <span style="display: inline-block; width: 100px;"><?= amount_number_format( $stat_amount ); ?> <?= $row['name']; ?></span>
                                                      <?php } ?>
                                                </marquee>
                                          </div>
                                    </div>
                                    <div class="row">
                                          <div class="col-md-12" style="padding: 0;">
                                                <div class="db-current-cash">
                                                      <h4 style="width: 40%; margin: 0; padding: 8px; background: #4ecd3c; display: block;float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>;"><?= print_lang($app_lang,'yesterday_cash'); ?></h4>
                                                      <marquee style="margin-top: 4px;" class="cash-marque" width="60%" direction="<?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>" height="20px" scrolldelay="2" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">
                                                            <?php
                                                            $stat_array = $cash_stats['yesterday_cash'];
                                                            foreach($currencies as $row){
                                                                $stat_amount = array_key_exists($row['uid'],$stat_array) ? $stat_array[$row['uid']] : 0;
                                                                if(check_user_access('dashboard_cash') === FALSE){$stat_amount = 0;}
                                                            ?>
                                                                  <span style="display: inline-block; width: 100px;"><?= amount_number_format( $stat_amount ); ?> <?= $row['name']; ?></span>
                                                            <?php } ?>
                                                      </marquee>
                                                </div>
                                          </div>
                                    </div>
                              </div>
                        </div>
                  </div>
            </div>
            <!-- MOBILE MARQUE FOR CURRENT YESTERDAY CASH -->
      </div>





    <div class="col-md-3 b-r" style="padding: 12px 18px; background: #fff;">
        <h2 style="margin-top: 0px; font-size: 18px; margin-bottom: 0px;"><?= Session::get('branch_name'); ?></h2>
    </div>
</div>


<?php


$today_sales = isset($dashboard_today_business_overall_stats['sales_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['sales_amount_in_all_currencies'] : null;
$today_lots = isset($dashboard_today_business_overall_stats['lots_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['lots_amount_in_all_currencies'] : null;
$today_cars = isset($dashboard_today_business_overall_stats['cars_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['cars_amount_in_all_currencies'] : null;
$today_total_sales = $today_sales + $today_lots + $today_cars;


$today_profit_sales = isset($dashboard_today_business_overall_stats['sales_profit_in_all_currencies']) ? $dashboard_today_business_overall_stats['sales_profit_in_all_currencies'] : null;
$today_profit_lots = isset($dashboard_today_business_overall_stats['lots_profit_in_all_currencies']) ? $dashboard_today_business_overall_stats['lots_profit_in_all_currencies'] : null;
$today_profit_cars = isset($dashboard_today_business_overall_stats['cars_profit_in_all_currencies']) ? $dashboard_today_business_overall_stats['cars_profit_in_all_currencies'] : null;
$today_total_profit_sales = $today_profit_sales + $today_profit_lots + $today_profit_cars;

$today_sales_return = isset($dashboard_today_business_overall_stats['sales_return_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['sales_return_amount_in_all_currencies'] : null;

$today_purchases = isset($dashboard_today_business_overall_stats['purchases_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['purchases_amount_in_all_currencies'] : null;
$today_production = isset($dashboard_today_business_overall_stats['production_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['production_amount_in_all_currencies'] : null;
$today_cpurchases = isset($dashboard_today_business_overall_stats['cpurchases_amount_in_all_currencies']) ? $dashboard_today_business_overall_stats['cpurchases_amount_in_all_currencies'] : null;
$today_total_purchases = $today_purchases + $today_production + $today_cpurchases;

$today_expenses = isset($dashboard_today_business_overall_stats['expenses_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['expenses_amount_all_in_main_currency'] : null;

$today_supplier_paid = isset($dashboard_today_business_overall_stats['payable_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['payable_amount_all_in_main_currency'] : null;

$today_client_received = isset($dashboard_today_business_overall_stats['receivable_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['receivable_amount_all_in_main_currency'] : null;

$today_cash_in = isset($dashboard_today_business_overall_stats['cash_in_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['cash_in_amount_all_in_main_currency'] : null;

$today_cash_out = isset($dashboard_today_business_overall_stats['cash_out_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['cash_out_amount_all_in_main_currency'] : null;

$today_extra_income = isset($dashboard_today_business_overall_stats['extra_income_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['extra_income_amount_all_in_main_currency'] : null;

$today_bank_in = isset($dashboard_today_business_overall_stats['banks_in_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['banks_in_amount_all_in_main_currency'] : null;

$today_bank_out = isset($dashboard_today_business_overall_stats['banks_out_amount_all_in_main_currency']) ? $dashboard_today_business_overall_stats['banks_out_amount_all_in_main_currency'] : null;




$overall_sales = isset($dashboard_business_overall_stats['sales_amount_in_all_currencies']) ? $dashboard_business_overall_stats['sales_amount_in_all_currencies'] : null;
$overall_lots = isset($dashboard_business_overall_stats['lots_amount_in_all_currencies']) ? $dashboard_business_overall_stats['lots_amount_in_all_currencies'] : null;
$overall_cars = isset($dashboard_business_overall_stats['cars_amount_in_all_currencies']) ? $dashboard_business_overall_stats['cars_amount_in_all_currencies'] : null;
$overall_total_sales = $overall_sales + $overall_lots + $overall_cars;


$overall_profit_sales = isset($dashboard_business_overall_stats['sales_profit_in_all_currencies']) ? $dashboard_business_overall_stats['sales_profit_in_all_currencies'] : null;
$overall_profit_lots = isset($dashboard_business_overall_stats['lots_profit_in_all_currencies']) ? $dashboard_business_overall_stats['lots_profit_in_all_currencies'] : null;
$overall_profit_cars = isset($dashboard_business_overall_stats['cars_profit_in_all_currencies']) ? $dashboard_business_overall_stats['cars_profit_in_all_currencies'] : null;
$overall_total_profit_sales = $overall_profit_sales + $overall_profit_lots + $overall_profit_cars;


$overall_purchases = isset($dashboard_business_overall_stats['purchases_amount_in_all_currencies']) ? $dashboard_business_overall_stats['purchases_amount_in_all_currencies'] : null;
$overall_production = isset($dashboard_business_overall_stats['production_amount_in_all_currencies']) ? $dashboard_business_overall_stats['production_amount_in_all_currencies'] : null;
$overall_cpurchases = isset($dashboard_business_overall_stats['cpurchases_amount_in_all_currencies']) ? $dashboard_business_overall_stats['cpurchases_amount_in_all_currencies'] : null;
$overall_total_purchases = $overall_purchases + $overall_production + $overall_cpurchases;

$overall_inventory = isset($dashboard_business_overall_stats['inventory_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['inventory_amount_all_in_main_currency'] : null;

$overall_receivable = isset($dashboard_business_overall_stats['receivable_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['receivable_amount_all_in_main_currency'] : null;

$overall_payable = isset($dashboard_business_overall_stats['payable_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['payable_amount_all_in_main_currency'] : null;

$overall_cash = isset($dashboard_business_overall_stats['cash_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['cash_amount_all_in_main_currency'] : null;

$overall_bank = isset($dashboard_business_overall_stats['banks_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['banks_amount_all_in_main_currency'] : null;

$overall_expenses = isset($dashboard_business_overall_stats['expenses_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['expenses_amount_all_in_main_currency'] : null;

$overall_damage = isset($dashboard_business_overall_stats['damage_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['damage_amount_all_in_main_currency'] : null;

$overall_assets = isset($dashboard_business_overall_stats['assets_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['assets_amount_all_in_main_currency'] : null;


$overall_capital = isset($dashboard_business_overall_stats['capitals_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['capitals_amount_all_in_main_currency'] : null;
$overall_shareholder_credit = isset($dashboard_business_overall_stats['shareholder_credit_all_in_main_currency']) ? $dashboard_business_overall_stats['shareholder_credit_all_in_main_currency'] : null;
$overall_turnover = isset($dashboard_business_overall_stats['turnover_all_in_main_currency']) ? $dashboard_business_overall_stats['turnover_all_in_main_currency'] : null;
$overall_items_opening = isset($dashboard_business_overall_stats['items_all_in_main_currency']) ? $dashboard_business_overall_stats['items_all_in_main_currency'] : null;
$lots_profit = isset($dashboard_business_overall_stats['lots_profit_in_all_currencies']) ? $dashboard_business_overall_stats['lots_profit_in_all_currencies'] : null;
$cars_profit = isset($dashboard_business_overall_stats['cars_profit_in_all_currencies']) ? $dashboard_business_overall_stats['cars_profit_in_all_currencies'] : null;
$sales_profit = isset($dashboard_business_overall_stats['sales_profit_in_all_currencies']) ? $dashboard_business_overall_stats['sales_profit_in_all_currencies'] : null;
$transfer_out_profit = isset($dashboard_business_overall_stats['transfer_out_profit_in_all_currencies']) ? $dashboard_business_overall_stats['transfer_out_profit_in_all_currencies'] : null;
$services_amount = isset($dashboard_business_overall_stats['services_all_in_main_currency']) ? $dashboard_business_overall_stats['services_all_in_main_currency'] : null;
$custom_sales_services_amount = isset($dashboard_business_overall_stats['custom_sales_amount_in_all_currencies']) ? $dashboard_business_overall_stats['custom_sales_amount_in_all_currencies'] : null;
$extra_income_amount = isset($dashboard_business_overall_stats['extra_income_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['extra_income_amount_all_in_main_currency'] : null;
$overall_opening_balance = isset($dashboard_business_overall_stats['opening_balance_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['opening_balance_amount_all_in_main_currency'] : null;
$expenses_amount = isset($dashboard_business_overall_stats['expenses_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['expenses_amount_all_in_main_currency'] : null;
$supplier_amount = isset($dashboard_business_overall_stats['payable_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['payable_amount_all_in_main_currency'] : null;

// $total_equity = ($overall_capital + $overall_items_opening + $lots_profit + $cars_profit + $sales_profit + $services_amount + $custom_sales_services_amount + $extra_income_amount + $overall_opening_balance + $supplier_amount) - $expenses_amount;

$total_assets_amount = $overall_cash + $overall_bank + $overall_inventory + $overall_receivable + $overall_assets;
$total_liabilities_amount = $supplier_amount + $overall_capital + $overall_items_opening + $overall_opening_balance + $services_amount + $extra_income_amount + $custom_sales_services_amount + $lots_profit + $cars_profit + $sales_profit - $expenses_amount - $total_assets_amount;

$total_balance_sheet_capital_amount = $overall_capital + $overall_items_opening + $overall_opening_balance - $overall_shareholder_credit;
$total_balance_sheet_other_incomes = $extra_income_amount;
$total_balance_sheet_earnings = $lots_profit + $cars_profit + $sales_profit + $services_amount + $custom_sales_services_amount - $expenses_amount - $overall_turnover;

$total_balance_sheet_equity = $total_balance_sheet_capital_amount + $total_balance_sheet_other_incomes + $total_balance_sheet_earnings;

$total_equity = $total_balance_sheet_equity - $total_liabilities_amount;


?>


<div class="row" style="background: #f6f6f6; padding: 5px; padding-top: 0px;">
    <div class="col-md-9 b-r">

        <div class="row" style="color: #000 !important;">


            <div class="col-md-6">
              <?php if(1==1){ ?>
                  <div class="ibox float-e-margins" style="margin-bottom: 5px !important;">
                      <div class="ibox-title" style="border-bottom: 2px solid #2B9C1B !important;">
                          <h5><?= print_lang($app_lang,'dashboard_today_overview'); ?></h5>
                      </div>


                      <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                          <div class="row">
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_sales'); ?></small>
                                  <?php if(check_user_access('today_overview_sales') === FALSE){$today_total_sales = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_total_sales ); ?></h4>
                              </div>

                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_profit'); ?></small>
                                  <?php if(check_user_access('system_profit') === FALSE){$today_total_profit_sales = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_total_profit_sales ); ?></h4>
                              </div>
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_sales_return'); ?></small>
                                  <?php if(check_user_access('today_overview_sales_return') === FALSE){$today_sales_return = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_sales_return ); ?></h4>
                              </div>
                          </div>
                      </div>


                      <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                          <div class="row">
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_purchases'); ?></small>
                                  <?php if(check_user_access('today_overview_purchases') === FALSE){$today_total_purchases = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_total_purchases ); ?></h4>
                              </div>

                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_expenses'); ?></small>
                                  <?php if(check_user_access('today_overview_expenses') === FALSE){$today_expenses = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_expenses ); ?></h4>
                              </div>
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_supplier_paid'); ?></small>
                                  <?php if(check_user_access('today_overview_supplier_paid') === FALSE){$today_supplier_paid = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_supplier_paid ); ?></h4>
                              </div>
                          </div>
                      </div>


                      <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                          <div class="row">
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_client_recieved'); ?></small>
                                  <?php if(check_user_access('today_overview_client_received') === FALSE){$today_client_received = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_client_received ); ?></h4>
                              </div>

                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_cash_in'); ?></small>
                                  <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_cash_in ); ?></h4>
                              </div>
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_cash_out'); ?></small>
                                  <?php if(check_user_access('today_overview_cash_out') === FALSE){$today_cash_out = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_cash_out ); ?></h4>
                              </div>
                          </div>
                      </div>


                      <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                          <div class="row">
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_extra_income'); ?></small>
                                  <?php if(check_user_access('today_overview_extra_income') === FALSE){$today_extra_income = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_extra_income ); ?></h4>
                              </div>

                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_bank_in'); ?></small>
                                  <?php if(check_user_access('today_overview_bank_in') === FALSE){$today_bank_in = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_bank_in ); ?></h4>
                              </div>
                              <div class="col-xs-4">
                                  <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_bank_out'); ?></small>
                                  <?php if(check_user_access('today_overview_bank_out') === FALSE){$today_bank_out = 0;} ?>
                                  <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $today_bank_out ); ?></h4>
                              </div>
                          </div>
                      </div>
                  </div>
                <?php } ?>
            </div>


            <div class="col-md-6">
              <?php if(1==1){ ?>
                <div class="ibox float-e-margins" style="margin-bottom: 5px !important;">
                    <div class="ibox-title" style="border-bottom: 2px solid #2B9C1B !important;">
                        <h5><?= print_lang($app_lang,'dashboard_business_overview'); ?></h5>
                    </div>
                    <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_sales'); ?></small>
                                <?php if(check_user_access('business_overview_sales') === FALSE){$overall_total_sales = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_total_sales ); ?></h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_profit'); ?></small>
                                <?php if(check_user_access('system_profit') === FALSE){$overall_total_profit_sales = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_total_profit_sales ); ?></h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_purchases'); ?></small>
                                <?php if(check_user_access('business_overview_purchases') === FALSE){$overall_total_purchases = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_total_purchases ); ?></h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_current_stock'); ?></small>
                                <?php if(check_user_access('business_overview_current_stock') === FALSE){$overall_inventory = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_inventory ); ?></h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_recievable'); ?></small>
                                <?php if(check_user_access('business_overview_receivable') === FALSE){$overall_receivable = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_receivable ); ?></h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'supplier_due'); ?></small>
                                <?php if(check_user_access('business_overview_payable') === FALSE){$overall_payable = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_payable ); ?></h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_cash'); ?></small>
                                <?php if(check_user_access('business_overview_cash') === FALSE){$overall_cash = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_cash ); ?></h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_bank'); ?></small>
                                <?php if(check_user_access('business_overview_bank') === FALSE){$overall_bank = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_bank ); ?></h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_expenses'); ?></small>
                                <?php if(check_user_access('business_overview_expenses') === FALSE){$overall_expenses = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_expenses ); ?></h4>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content" style="padding: 12px 20px 12px 20px !important;">
                        <div class="row">
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_damage_stock'); ?></small>
                                <?php if(check_user_access('business_overview_damage_stock') === FALSE){$overall_damage = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_damage ); ?></h4>
                            </div>

                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_fixed_assets'); ?></small>
                                <?php if(check_user_access('business_overview_fixed_assets') === FALSE){$overall_assets = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $overall_assets ); ?></h4>
                            </div>
                            <div class="col-xs-4">
                                <small class="stats-label" style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_equity'); ?></small>
                                <?php if(check_user_access('business_overview_equity') === FALSE){$total_equity = 0;} ?>
                                <h4 style="width: 100%; border-bottom: 1px dotted #737373 !important; display: block; margin-bottom: 0px;"><?= amount_number_format( $total_equity ); ?></h4>
                            </div>
                        </div>
                    </div>
                </div>
              <?php } ?>
            </div>


        </div>
        <!-- Widgets Row TODAY AND BUSSINESS OVERVIEW -->



        <?php if(check_user_access('dash_construction_stats') === TRUE){ ?>
        <?php if($at_dash_item_settings['construction'] == 'enable'){ ?>
            <!-- construction projects stats -->
            <div class="row" style="background: #fff; margin: 0; padding: 10px 0px;">
                <div class="col-md-12">
                    <table class="table" style="margin-bottom: 0px;">
                        <tbody>
                            <tr>
                                <td><button type="button" class="btn btn-danger btn-sm"><?= $overall_projects_dash_stats['number_of_pending_projects']; ?></button><strong><?= print_lang($app_lang,'dash_number_of_pending_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-success btn-sm"><?= $overall_projects_dash_stats['number_of_completed_projects']; ?></button><strong><?= print_lang($app_lang,'dash_number_of_completed_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-primary btn-sm"><?= amount_number_format( $overall_projects_dash_stats['cost_of_pending_projects'] ); ?></button><strong><?= print_lang($app_lang,'dash_cost_of_pending_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-warning btn-sm"><?= amount_number_format( $overall_projects_dash_stats['cost_of_completed_projects'] ); ?></button><strong><?= print_lang($app_lang,'dash_cost_of_completed_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-info btn-sm"><?= amount_number_format( $overall_projects_dash_stats['pending_amount_of_projects'] ); ?></button><strong><?= print_lang($app_lang,'dash_pending_amount_of_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-danger btn-sm"><?= amount_number_format( $overall_projects_dash_stats['expenses_deductions_of_completed_projects'] ); ?></button><strong><?= print_lang($app_lang,'dash_expenses_deductions_of_completed_projects'); ?></strong></td>
                                <td><button type="button" class="btn btn-primary btn-sm"><?= amount_number_format( $overall_projects_dash_stats['profit_of_completed_projects'] ); ?></button><strong><?= print_lang($app_lang,'dash_profit_of_completed_projects'); ?></strong></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- construction projects stats -->
        <?php } ?>
        <?php } ?>






        <?php if(check_user_access('dash_business_performance_stats') === TRUE){ ?>
        <!-- RECIVEVED PAYABLE AND RECIEVEABLE ROW -->
        <?php 
          $overall_received = isset($dashboard_business_overall_stats['received_amount_all_in_main_currency']) ? $dashboard_business_overall_stats['received_amount_all_in_main_currency'] : null;
          $overall_metu_sales = isset($dashboard_business_overall_stats['metu_sales_amount_in_all_currencies']) ? $dashboard_business_overall_stats['metu_sales_amount_in_all_currencies'] : null;
          if($at_dash_item_settings['metu'] != 'enable'){$overall_metu_sales = 0; }
          $net_overall_received = $overall_received - $overall_metu_sales;
          
          $stats_section = _dashboard_calculate_system_stats_section($overall_receivable,$overall_payable,$net_overall_received);
          $total_stats_percentage = $stats_section['receivable_percent'] + $stats_section['payable_percent'] + $stats_section['received_percent'];
        ?>
        <div class="row">
          <?php if($total_stats_percentage > 0){?>
            <div class="col-md-12" style="margin-top: 10px;">
                <div class="progress_bar_recievable bg-warning" style="width: <?= $stats_section['receivable_percent']; ?>%; background: #ff9623 !important; height: 40px; display: block; float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>;"></div>
                <div class="progress_bar_recievable bg-danger" style="width: <?= $stats_section['payable_percent']; ?>%; background: #d70c21 !important; height: 40px; display: block; float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>;"></div>
                <div class="progress_bar_recievable bg-primary" style="width: <?= $stats_section['received_percent']; ?>%; height: 40px; display: block; float: <?php if($app_direction == 'rtl'){ echo 'right'; }else{ echo 'left'; } ?>;"></div>
            </div>
          <?php } ?>
            <div class="col-md-12">
                <div class="row" style="background: #fff; margin: 0 auto;">
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($stats_section['receivable']); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small class="text-warning" style="font-size: 15px; font-weight: 700; color: #ff9623 !important; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_recievable'); ?></small>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($stats_section['payable']); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small class="text-danger" style="font-size: 15px; font-weight: 700; color: #d70c21 !important; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_payable'); ?></small>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($stats_section['received']); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small style="font-size: 15px; font-weight: 700; color: #2B9C1B; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_recieved'); ?></small>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- RECIVEVED PAYABLE AND RECIEVEABLE ROW -->
        <?php } ?>

        <?php if($at_dash_item_settings['metu'] == 'enable'){ ?>
        <?php if(check_user_access('dash_metu_performance_stats') === TRUE){ ?>
        <!-- RECIVEVED PAYABLE AND RECIEVEABLE ROW -->
        <div class="row">
            <div class="col-md-12">
                <div class="row" style="background: #fff; margin: 0 auto;">
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($metu_purchased); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small class="text-warning" style="font-size: 15px; font-weight: 700; color: #ff9623 !important; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_metu_purchase'); ?></small>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($metu_sold); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small class="text-danger" style="font-size: 15px; font-weight: 700; color: #d70c21 !important; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_metu_sold'); ?></small>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="ibox-content text-center">
                            <h3 class="no-margins" style="margin-bottom: 5px !important;"><?= amount_number_format($metu_ava); ?></h3>
                            <?php if(check_user_access('today_overview_cash_in') === FALSE){$today_cash_in = 0;} ?>
                            <small style="font-size: 15px; font-weight: 700; color: #2B9C1B; width: 100%; border-top: 1px dotted #737373 !important; border-bottom: 1px dotted #737373 !important; display: block;"><?= print_lang($app_lang,'dashboard_metu_available'); ?></small>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- RECIVEVED PAYABLE AND RECIEVEABLE ROW -->
        <?php } ?>
        <?php } ?>



        <?php if(check_user_access('dash_expenses_graph') === TRUE){ ?>
        <!-- EXPENSE SECTION ROW -->
        <div class="row" style="background: #fff; margin: 20px auto; padding: 10px 0px;">
            <div class="col-md-12">
                <div class="row">
                    <!-- Expense Total AMount -->
                    <div class="col-md-3">
                        <h2 style="font-weight: 900;"><?= print_lang($app_lang,'dashboard_expenses'); ?></h2>
                        <span style="font-size: 20px; font-weight: 600;"><?= amount_number_format($overall_expenses); ?></span>
                    </div>
                    <!-- Expense Total AMount -->

                    <!-- Expense Types AMount -->
                    <div class="col-md-6 custom-col" style="margin-top: 20px;">
                        <div class="row">
                            
                            <?php $et_color = 0; foreach($dashboard_business_overall_stats['_graphs_types_names'] as $key => $row){
                              $color_type = isset($dashboard_business_overall_stats['_graphs_types_colors'][$key]) ? $dashboard_business_overall_stats['_graphs_types_colors'][$key] : '#fff';
                              $amount_type = isset($dashboard_business_overall_stats['_graphs_types_amounts'][$key]) ? $dashboard_business_overall_stats['_graphs_types_amounts'][$key] : 0;
                            ?>
                                <div class="col-md-6 custom-col">
                                    <span class="btn m-r-sm" style="background: <?= $color_type; ?>;"></span><span style="font-size: 12px;"><strong><?= $row; ?></strong>: <?= amount_number_format($amount_type); ?></span>
                                </div>
                            <?php $et_color++; } ?>

                        </div>
                    </div>
                    <!-- Expense Types AMount -->

                    <!-- Expense Chart Col -->
                    <div class="col-md-3 custom-col text-center">
                        <canvas id="expense-graph" width="175" height="175" style="margin: 0 auto;"></canvas>
                    </div>
                    <!-- Expense Chart Col -->
                </div>
            </div>
        </div>
        <!-- EXPENSE SECTION ROW -->
        <?php } ?>





        <?php if(check_user_access('dash_profit_and_loss_graph') === TRUE){ ?>
        <!-- PROFIT & LOSS ROW -->
        <div class="row" style="background: #fff; margin: 20px auto; padding: 10px 4px;">
            <!-- PROFIT & LOSS -->
            <h2 style="font-weight: 900;"><?= print_lang($app_lang,'dashboard_profit_loss'); ?></h2>
            <hr>
            <div class="col-md-5">
                <!-- NET PROFIT -->
                <div class="success-element ui-sortable-handle" style="<?php if($app_direction == 'rtl'){ echo 'border-right: 5px solid #2B9C1B;'; }else{ echo 'border-left: 5px solid #2B9C1B;'; } ?> padding: 0px 6px; margin-top: 12px;">
                    <div class="agile-detail">
                      <?php $overall_net_profit = $overall_total_profit_sales - $overall_expenses; ?>
                        <span style="font-size: 20px; font-weight: 600; display: block;"><?= amount_number_format($overall_net_profit); ?></span>
                        <span class="text-muted" style="font-size: 14px;"><?= print_lang($app_lang,'dashboard_net_profit'); ?></span>
                    </div>
                </div>

                <!-- EXPENSES -->
                <div class="success-element ui-sortable-handle" style="<?php if($app_direction == 'rtl'){ echo 'border-right: 5px solid #ed5565;'; }else{ echo 'border-left: 5px solid #ed5565;'; } ?> padding: 0px 6px; margin-top: 12px;">
                    <div class="agile-detail">
                        <span style="font-size: 20px; font-weight: 600; display: block;"><?= amount_number_format($overall_expenses); ?></span>
                        <span class="text-muted" style="font-size: 14px;"><?= print_lang($app_lang,'dashboard_expenses'); ?></span>
                    </div>
                </div>

                <!-- PROFIT -->
                <div class="success-element ui-sortable-handle" style="<?php if($app_direction == 'rtl'){ echo 'border-right: 5px solid #23c6c8;'; }else{ echo 'border-left: 5px solid #23c6c8;'; } ?> padding: 0px 6px; margin-top: 12px;">
                    <div class="agile-detail">
                        <span style="font-size: 20px; font-weight: 600; display: block;"><?= amount_number_format($overall_total_profit_sales); ?></span>
                        <span class="text-muted" style="font-size: 14px;"><?= print_lang($app_lang,'dashboard_profit'); ?></span>
                    </div>
                </div>
            </div>

            <!-- PROFIT LOSS CHART -->
            <div class="col-md-7" style="margin-top: 10px; max-height: 220px; overflow: hidden;">
                <div id="profit-loss-chart" class="ct-perfect-fourth"></div>
            </div>
            <!-- PROFIT LOSS CHART -->
        </div>
        <!-- PROFIT & LOSS ROW -->
        <?php } ?>

    </div>


    <!-- RIGHT BAR DATA -->
    <div class="col-md-3 b-r">   
        <!-- Currency Row -->
        <div class="row">
            <div class="col-md-12 custom-col">
                <form id="dash-currency-form" action="<?php echo url('/dashboard'); ?>">
                    <div class="form-group" style="margin-bottom: 0px;">
                        <select class="form-control chosen-select" name="currency" onchange="this.form.submit()">
                            <option disabled="" selected="">-- <?= print_lang($app_lang,'select_currency'); ?> --</option>
                            <?php foreach($currencies as $row){ ?>
                                <option value="<?= $row['uid']; ?>" <?php if($dashboard_currency == $row['uid']){ echo 'selected="selected"'; } ?>><?= $row['name']; ?> (<?= $row['symbol']; ?>)</option>
                            <?php } ?>
                        </select>
                    </div>
                </form>
            </div>
        </div>
        <!-- CURRENCY ROW -->

        <?php if(check_user_access('dash_bank_accounts_notifications') === TRUE){ ?>
        <!-- BANK DETAILS SECTIOn -->
        <div class="row">
            <div class="col-md-12 custom-col">
                <div class="ibox float-e-margins" style="margin-bottom: 4px;">
                    <div class="ibox-title" style="padding-left: 2px;">
                        <h4 style="margin: 0 5px 0 5px;"><?= print_lang($app_lang,'dashboard_bank_accounts'); ?></h4>
                    </div>
                    <div class="ibox-content" style="padding-top: 3px;">
                        
                        <?php foreach($bank_section as $bank_section_row){ ?>
                            <!-- Bank Activity Row -->
                            <div class="row" style="border-bottom: 1px solid lightgray;">
                                <div class="col-md-8 custom-col">
                                    <h5 style="margin-bottom: 3px; font-weight: 700; font-size: 13px;"><?= $bank_section_row['name']; ?></h5>
                                    <p style="font-size: 12px;" class="text-muted"><?= $bank_section_row['narration']; ?></p>
                                </div>
                                <div class="col-md-4 custom-col">
                                    <p style="margin-bottom: 3px; text-align: right; font-size: 12px; font-weight: 700;"><?= amount_number_format($bank_section_row['amount']); ?></p>
                                    <p style="margin-bottom: 3px; font-size: 10px; text-align: right;" class="text-muted"><?= get_elapsed_time($bank_section_row['time']); ?></p>
                                </div>
                            </div>
                            <!-- Bank Activity Row -->
                        <?php } ?>

                    </div>
                </div>

            </div>
        </div>
        <!-- BANK DETAILS SECTION -->
        <?php } ?>






        <?php if(check_user_access('dash_activity_alerts') === TRUE){ ?>
        <!-- ACTIVITIES DROPDOWN MODULES -->
        <div class="row" style="background: #fff;">
            <div class="col-md-5 custom-col">
                <h3 style="margin: 10px 5px 0 5px;"><?= print_lang($app_lang,'dashboard_activities'); ?></h3>
            </div>
            <div class="col-md-7 custom-col">
                <div class="form-group" style="margin-bottom: 0px;">
                    <select class="form-control chosen-select" name="activity" form="dash-currency-form" onchange="this.form.submit()">
                        <option <?php if($_activity == 'all'){ echo 'selected="selected"'; } ?> value="all"><?= print_lang($app_lang,'activities_dropdown_all'); ?></option>
                        <option <?php if($_activity == 'sales'){ echo 'selected="selected"'; } ?> value="sales"><?= print_lang($app_lang,'activities_dropdown_sales'); ?></option>
                        <option <?php if($_activity == 'purchases'){ echo 'selected="selected"'; } ?> value="purchases"><?= print_lang($app_lang,'activities_dropdown_purchases'); ?></option>
                        <option <?php if($_activity == 'production'){ echo 'selected="selected"'; } ?> value="production"><?= print_lang($app_lang,'activities_dropdown_production'); ?></option>
                        <option <?php if($_activity == 'journal'){ echo 'selected="selected"'; } ?> value="journal"><?= print_lang($app_lang,'activities_dropdown_journal'); ?></option>
                        <option <?php if($_activity == 'extra_income'){ echo 'selected="selected"'; } ?> value="extra_income"><?= print_lang($app_lang,'activities_dropdown_extra_income'); ?></option>
                        <option <?php if($_activity == 'damage_stock'){ echo 'selected="selected"'; } ?> value="damage_stock"><?= print_lang($app_lang,'activities_dropdown_damage_stock'); ?></option>
                        <option <?php if($_activity == 'warehouse_transfer'){ echo 'selected="selected"'; } ?> value="warehouse_transfer"><?= print_lang($app_lang,'activities_dropdown_warehouse'); ?></option>
                        <option <?php if($_activity == 'transit'){ echo 'selected="selected"'; } ?> value="transit"><?= print_lang($app_lang,'activities_dropdown_transit'); ?></option>
                        <option <?php if($_activity == 'payslips'){ echo 'selected="selected"'; } ?> value="payslips"><?= print_lang($app_lang,'activities_dropdown_payslips'); ?></option>
                        <option <?php if($_activity == 'expenses'){ echo 'selected="selected"'; } ?> value="expenses"><?= print_lang($app_lang,'activities_dropdown_expenses'); ?></option>
                        <option <?php if($_activity == 'lot_purchase'){ echo 'selected="selected"'; } ?> value="lot_purchase"><?= print_lang($app_lang,'activities_dropdown_lot_purchases'); ?></option>
                        <option <?php if($_activity == 'lot_sold'){ echo 'selected="selected"'; } ?> value="lot_sold"><?= print_lang($app_lang,'activities_dropdown_lot_sold'); ?></option>
                        <option <?php if($_activity == 'lot_moved'){ echo 'selected="selected"'; } ?> value="lot_moved"><?= print_lang($app_lang,'activities_dropdown_lot_moved'); ?></option>
                    </select>
                </div>
            </div>
        </div>
        <!-- ACTIVITIES DROPDOWN MODULES -->


        <!-- ACTIVITIES NOTIFICATIONS ROW -->
        <div class="row">
            <div class="col-md-12 custom-col">
                <div class="ibox ">
                    <div class="ibox-content custom-col">
                        <div class="tab-content">
                            <div id="contact-1" class="tab-pane active">
                                <div class="client-detail">
                                <div class="full-height-scroll">
                                    <strong style="margin: 0 5px 0 5px;"><?= print_lang($app_lang,'dashboard_need_attention'); ?></strong>
                                    <div id="vertical-timeline" class="vertical-container dark-timeline">
                                        
                                        <?php
                                        $dabc_count = 0;
                                        $dash_activity_alert_count = 1;
                                        $dash_activity_backgrounds = array('navy-bg','red-bg','lazur-bg','yellow-bg','blue-bg');
                                        ?>
                                        <?php foreach($alerts_notifications['activity_alerts'] as $activity_alert_row){ ?>
                                            <?php
                                            if($dash_activity_alert_count > 30){ break; }
                                            if($dabc_count >= 4){ $dabc_count = 0; }
                                            $dash_activity_background_color = $dash_activity_backgrounds[$dabc_count];
                                            ?>
                                            <!-- Activity Rows -->
                                            <div class="vertical-timeline-block activity-url-proceeder" data-url="<?= empty($activity_alert_row['url']) ? '' : url('/').$activity_alert_row['url']; ?>">
                                                <div class="vertical-timeline-icon <?= $dash_activity_background_color; ?>">
                                                    <i class="fa fa-exclamation"></i>
                                                </div>
                                                <div class="vertical-timeline-content">
                                                    <p class="overflow-elepsis"><?= ucwords(str_replace('_', ' ', $activity_alert_row['module'])); ?> <?= ucwords($activity_alert_row['activity']); ?>: <?= ucwords($activity_alert_row['details']); ?></p>
                                                    <span class="vertical-date small text-muted"> <?= get_elapsed_time($activity_alert_row['activity_time']); ?> </span>
                                                </div>
                                            </div>
                                            <!-- Activity Rows -->
                                        <?php $dash_activity_alert_count++; $dabc_count++; } ?>

                                    </div>
                                </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- ACTIVITIES ROW -->
        <?php } ?>

    </div>
</div>


<?php $_graph_profit = amount_number_format($overall_total_profit_sales); ?>
<?php $_graph_expenses = amount_number_format($overall_expenses); ?>
<?php $_graph_net_profit = $overall_total_profit_sales - $overall_expenses; ?>
<?php $_graph_net_profit = amount_number_format($_graph_net_profit); ?>

<script>
    names = JSON.parse('<?= json_encode($dashboard_business_overall_stats['_graphs_types_names']); ?>');
    amounts = JSON.parse('<?= json_encode($dashboard_business_overall_stats['_graphs_types_amounts']); ?>');
    colors = JSON.parse('<?= json_encode($dashboard_business_overall_stats['_graphs_types_colors']); ?>');

    _graph_profit = '<?= $_graph_profit; ?>';
    _graph_expenses = '<?= $_graph_expenses; ?>';
    _graph_net_profit = '<?= $_graph_net_profit; ?>';




    $(document).ready(function()
    {
        // ----------------------------------------
        var doughnutData = {
            labels: names, // ["App","Software","Laptop"],
            datasets: [{
                data: amounts, //[70,27,85],
                backgroundColor: colors //["#a3e1d4","#dedede","#9CC3DA"]
            }]
        } ;

        var doughnutOptions = { responsive: false, legend: { display: false } };
        var ctx4 = document.getElementById("expense-graph").getContext("2d");
        new Chart(ctx4, {type: 'doughnut', data: doughnutData, options:doughnutOptions});
        // ----------------------------------------

        // ----------------------------------------
        // Gauge chart
        new Chartist.Pie('#profit-loss-chart', {
            labels: [_graph_profit,_graph_expenses,_graph_net_profit],
            series: [5000, 5000, 5000]
        }, {
            donut: true,
            donutWidth: 60,
            startAngle: 270,
            total: 30000,
            showLabel: true
        });
        // ----------------------------------------
    });
</script>

<?php }else{ ?>

<?php if(is_project_user() === true){ ?>
  <h2>Project User</h2>
<?php } ?>

<?php if(is_sales_man_user() === true OR is_marketer_user() === true){ ?>
  <style type="text/css">
    .navbar-default.navbar-static-side{display: none !important;}
    #page-wrapper{width: 100%; margin: 0;}
    .footer.fixed{margin: 0;}
  </style>
  <h2>Welcome to Panel!</h2>
<?php } ?>

<?php if(is_customer_user() === true){ ?>
  <style type="text/css">
    .navbar-default.navbar-static-side{display: none !important;}
    #page-wrapper{width: 100%; margin: 0;}
    .footer.fixed{margin: 0;}
  </style>
  <h2>Welcome to Panel!</h2>
<?php } ?>

<?php } ?>