<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_TRANSPORT_TRANSVIEW';
$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/data_checks.inc");
include_once($path_to_root . "/includes/ui.inc");

include_once($path_to_root . "/transport/includes/db/vehicle_allocation_db.inc");


$js = "";
if ($SysPrefs->use_popup_windows)
	$js .= get_js_open_window(800, 500);
page(_($help_context = "View Vehicle Allocation"), true, false, "", $js);

//-------------------------------------------------------------------------------------------------
$woid = 0;
if ($_GET['trans_no'] != "")
{
	$vehi_allo_id = $_GET['trans_no'];
}

display_heading("Vehicle Allocation No: " . $vehi_allo_id);

//br(1);

start_table(TABLESTYLE2, "width=60%");

$myrow = view_vehicle_allocation($vehi_allo_id);
start_row();
if($myrow['vehicle_request_id'] > 0){
    label_cells(_("Vehi. Req. No"), get_trans_view_str(ST_VEHICLE_REQUEST,$myrow['vehicle_request_id']), "class='tableheader2'");
}else{
    label_cells(_("Vehi. Req. No"), '', "class='tableheader2'");
}
end_row();
//label_cells(_("Vehicle Allo. No."), $myrow['id'], "class='tableheader2'");
//end_row();
label_cells(_("Department"), $myrow['department'], "class='tableheader2'");
end_row();
label_cells(_("Project"), $myrow['project'], "class='tableheader2'");
end_row();
label_cells(_("Task"), $myrow['task'], "class='tableheader2'");
end_row();
label_cells(_("Vehicle Package"), $myrow['vahicle_package'], "class='tableheader2'");
end_row();
label_cells(_("Vehicle"), $myrow['vehicle'], "class='tableheader2'");
end_row();
label_cells(_("Cost"), number_format($myrow['amount'],2), "class='tableheader2'");
end_row();
label_cells(_("From Date Time"), $myrow['from_date_time'], "class='tableheader2'");
end_row();
label_cells(_("To Date Time"), $myrow['to_date_time'], "class='tableheader2'");
end_row();

global $petty_cash_float_transaction_types;
$payment_source_no_link = get_petty_cash_trans_view_str($myrow['payment_source_type'], $myrow['payment_source_no']);
if(isset($payment_source_no_link)){
    label_cells(_("Advance Payment"), $petty_cash_float_transaction_types[$myrow['payment_source_type']]." (".$payment_source_no_link.")", "class='tableheader2'");
}else{
    label_cells(_("Advance Payment"), '', "class='tableheader2'");
}
end_row();


//$adance_paid_va = get_vehicle_allocation_record_by_payment_vrc_entry($vrc_id);
//$adance_paid_va_link = get_transport_trans_view_str(ST_VEHICLE_ALLOCATION, $adance_paid_va["id"]);
//label_cells("Advance Paid Vehicle Allo. No.", $adance_paid_va_link,"align=center class='tableheader2'");  
//end_row();       
//label_cells(_("Batch No"), get_transport_trans_view_str(ST_VEHICLE_RUNNING_CHART_BATCH,$myrow['batch_no'] > 0 ? $myrow['batch_no'] : ''), "class='tableheader2'");
//end_row();


end_page(true, false, false, ST_VEHICLE_ALLOCATION, $vehi_allo_id);

?>
