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

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


include_once($path_to_root . "/includes/session.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 . "/projects/includes/db/project_boq_item_groups_db.inc");
include_once($path_to_root . "/projects/includes/db/project_boq_items_db.inc");
include_once($path_to_root . "/projects/includes/db/project_payment_application_details_db.inc");
include_once($path_to_root . "/projects/includes/db/project_payment_application_db.inc");

include_once($path_to_root . "/projects/includes/ui/project_payment_application_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();
}

simple_page_mode(true);
page(_($help_context = "Project Payment Application Details"));

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

$pa_id = 0;

if(isset($_GET['PAId']))
{
    $_POST['PAId'] = $_GET['PAId'];
}
if(isset($_POST['PAId']))
{
    $pa_id = $_POST['PAId'] ;
}

$boq_group_id = 0;

if(isset($_GET['BOQGroupId']))
{
    $_POST['BOQGroupId'] = $_GET['BOQGroupId'];
}
if(isset($_POST['BOQGroupId']))
{
    $boq_group_id = $_POST['BOQGroupId'] ;
}





start_form();
br();

$payment_application = get_project_payment_application_header($pa_id);
$boq_item_group = get_project_boq_item_group_record($boq_group_id);
display_heading2("BOQ Items of group ".$boq_item_group['description']);

br();

start_table(TABLESTYLE, "width=30%");

$pa_records = get_payment_application_header_record($pa_id);
$date = $pa_records['ord_date'];

label_row("Entry Date:", sql2date($date));
end_table();

hidden('BOQGroupId', $boq_group_id); 

br();    

hidden('PAId', $_POST['PAId']); 

display_project_payment_application_details($pa_id, $boq_group_id);




br();

if (!@$_GET['popup'])
{
    end_form();
    end_page(@$_GET['popup'], false, false);
}




?>
