<?php
$page_security = 'SA_PROJECT_BOQ_ITEM_GROUPS';
$path_to_root = "../..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui/ui_input.inc");



include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
//include_once($path_to_root . "/includes/data_checks.inc");

include_once($path_to_root . "/estimation/includes/db/est_project_boq_item_groups_db.inc");
include_once($path_to_root . "/estimation/includes/ui/est_project_boq_item_groups_ui.inc");

include_once($path_to_root . "/estimation/includes/db/est_project_boq_items_db.inc");
//include_once($path_to_root . "/projects/includes/db/project_boq_item_detail_edit_db.inc");
//include_once($path_to_root . "/projects/includes/db/copy_project_boq_items_to_tasks_db.inc");
//include_once($path_to_root . "/projects/includes/db/tasks_db.inc");
include_once($path_to_root . "/estimation/includes/db/est_projects_db.inc");


include_once($path_to_root . "/admin/db/list_values_db.inc");

        
$js = '';

if ($SysPrefs->use_popup_windows) {
	$js .= get_js_open_window(900, 500);
}

if (user_use_date_picker()) {
	$js .= get_js_date_picker();
}


simple_page_mode(true);

if (isset($_GET["trans_no"]))
{
	$_POST["trans_no"] = $_GET["trans_no"];
}
if (isset($_POST["trans_no"]))
{
	$project_id = $_POST["trans_no"];
}




page(_($help_context = "Estimation BOQ Group Details"), true, false, false, $js);



start_form();

br(1);

$user_id = $_SESSION['wa_current_user']->user;
$r = can_access_est_project($project_id, $user_id);
if($r["success"] !== true){
    display_error($r["message"]);
    display_footer_exit();
    exit;
}

hidden('trans_no', $project_id);


br(2);

display_est_boq_item_groups($project_id);

//submit_center_first('Recalculate_Poject_PA', _("Recalculate Payment Application Summaries"), '', 'default');

end_form();


end_page();
