-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindirect_costs_form.php
84 lines (66 loc) · 2.02 KB
/
indirect_costs_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
//$flagNoAuth = true;
require ('common/auth.php');
include ('classes/costs.class.php');
$arrJS[] = 'js/input_form.js';
$icoID=$_GET['icoID']?$_GET['icoID']:$_POST['icoID'];
$oBudget = new Budget($budget_scenario);
$oDocument = new Indirect_costs ($icoID);
$oDocument->defineEF();
$oDocument->defineGrid();
if ($_POST['DataAction']){
// echo '<pre>'; print_r($_POST); echo '</pre>';
if ($oDocument->save($_POST['DataAction'])){
$oDocument->refresh($oDocument->ID);
$arrActions = Array();
include('includes/inc_document_menu.php');
$oDocument->arrActions = $arrActions;
$oDocument->status = 'success';
header("Content-type: application/json");
$oDocument->getJSON();
}
die();
}
if ($_GET['tab']){
switch($_GET['tab']){
case 'kpi':
require_once ('classes/reports.class.php');
$sqlWhere = "WHERE source='".$oDocument->GUID."'";
$oReport = new Reports(Array('budget_scenario'=>$oDocument->budget->id));
$oReport->costsBySupplier($sqlWhere);
die();
break;
case 'financials':
require_once ('classes/reports.class.php');
$sqlWhere= "WHERE source='".$oDocument->GUID."'";
$oReport = new Reports(Array('budget_scenario'=>$oDocument->budget->id));
$oReport->masterByActivity($sqlWhere);
$oReport->masterByYACT($sqlWhere);
$oReport->salesRHQ($sqlWhere);
die();
break;
default:
break;
}
}
include ('includes/inc_document_menu.php');
//============================== Main form definition ==============================
$oDocument->fillGrid($oDocument->grid);
require ('includes/inc-frame_top.php');
require ('includes/inc_document_header.php');
?>
<script>
$(document).ready(function(){
// var grid=eiseGrid_find(doc.gridName);
// if (grid!=null){
// grid.change ("jan[]", function(oTr, input){
// for (m=1;m<months.length;m++){
// oTr.find("input[name='"+months[m]+"[]']").val(input.val());
// }
// })
// }
});
</script>
<?php
require ('includes/inc-frame_bottom.php');
?>