$total_estimated_value[] = $row['estimated_amount'];
    //get available procurement methods
    if (!in_array($row['procurement_method'], $available_procurement_methods)) {
        $available_procurement_methods[] = $row['procurement_method'];
    }
    //get pdes
    if (!in_array($row['pdeid'], $total_pdes)) {
        $total_pdes[] = $row['pdeid'];
    }
}
//print_array(array_sum($total_contract_value));
$contracts_by_procurement_method = array();
//print_array($available_procurement_methods);
foreach ($available_procurement_methods as $method) {
    //get contracts for each method for the same duration
    $contracts_by_procurement_method[$method] = get_contracts_by_procurement_method($method, $from, $to);
}
?>

<div class="">

    <!-------->
    <div id="">
        <ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
            <li class="active"><a href="#report_summary" data-toggle="tab">Report summary</a></li>

            <li><a href="#report_details" data-toggle="tab">Report details</a></li>
            <?php 
if (isset($graph_view)) {
    ?>
                <li><a href="#report_graphic" data-toggle="tab">Report graphic</a></li>
$completed_contracts_total_pdes = array();
foreach ($completed_contracts as $row) {
    $completed_contracts_total_contract_value[] = $row['total_actual_payments'];
    $completed_contracts_total_estimated_value[] = $row['final_contract_value'];
    //get available procurement methods
    if (!in_array($row['procurement_method'], $completed_contracts_available_procurement_methods)) {
        $completed_contracts_available_procurement_methods[] = $row['procurement_method'];
    }
    //get pdes
    if (!in_array($row['pdeid'], $completed_contracts_total_pdes)) {
    }
    $completed_contracts_contracts_by_procurement_method = array();
    //print_array($available_procurement_methods);
    foreach ($completed_contracts_available_procurement_methods as $method) {
        //get contracts for each method for the same duration
        $completed_contracts_contracts_by_procurement_method[$method] = get_contracts_by_procurement_method($method, $from, $to, $this->session->userdata('isadmin') == 'Y' ? $this->input->post('pde') : $this->session->userdata('pdeid'));
    }
}
?>

<div class="">

    <!-------->
    <div id="">
        <ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
            <li class="active"><a href="#report_summary" data-toggle="tab">General summary</a></li>

            <li><a href="#report_summary_awarded" data-toggle="tab">Awarded contracts summary</a></li>

            <li><a href="#report_details" data-toggle="tab">Awarded contracts details</a></li>
            <li><a href="#report_summary_completed" data-toggle="tab">Completed contracts summary</a></li>