<?php
/**********************************************************************
***********************************************************************/

$page_security = 'SA_PROJECT_STATUS_VIEW';
if (!@$_GET['popup'])
	$path_to_root = "../..";
else	
	$path_to_root = "../..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
//include_once($path_to_root . "/inventory/includes/inventory_db.inc");
include_once($path_to_root . "/projects/includes/db/project_inquiry_db.inc");
include_once($path_to_root . "/projects/includes/db/project_boq_item_groups_db.inc");
include_once($path_to_root . "/projects/includes/db/project_boq_item_details_view_db.inc");
include_once($path_to_root . "/projects/includes/db/tasks_db.inc");

include_once($path_to_root . "/projects/includes/ui/project_boq_item_groups_ui.inc");
include_once($path_to_root . "/projects/includes/ui/project_boq_item_details_view_ui.inc");


$js = '';

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

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

page(_($help_context = "Project BOQ Item Details View"), false, false, "", $js);


//---------------------------------------------------------------------------------------------------

//check_db_has_projects(_("There are no projects defined in the system."));

simple_page_mode(true);
//---------------------------------------------------------------------------------------------------

global $Ajax;

	start_form();

	br();
    
start_table(TABLESTYLE_NOBORDER);
start_row();
project_list_cells(_("Project:"), 'project_id', null, _('Select a project'), false);
submit_cells('SearchOrders', _("Display"),'',_('Search'), 'process');


//	check_cells(_("Show inactive:"), 'show_inactive', null, true);
end_row();
end_table();

br();

$Ajax->activate('proj_boq_details');
div_start('proj_boq_details');
if(isset($_POST['SearchOrders'])){
    display_project_boq_item_details_view(get_post('project_id'), 1);
}
div_end();

br();


br();
//------------------------------------------------------------------------------------------------



    end_form();
    end_page(@$_GET['popup'], false, false);



?>
