Skip to content

Commit

Permalink
Finishing Up
Browse files Browse the repository at this point in the history
  • Loading branch information
priyankanasa committed Aug 29, 2014
1 parent 5208e0e commit e143f44
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 51 deletions.
53 changes: 35 additions & 18 deletions modules/reportdash/reportdashCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
};

//*****************[ Region Handelers ]*******************//

$scope.years = ['2014-2015', '2013-2014', '2012-2013'];
$scope.selectedYear = $scope.years[0];
$scope.$watch('selectedYear', function() {
Expand All @@ -30,7 +29,7 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
});

function fetchDistricts(selectedState) {
console.log(selectedState);

$scope.districts = [];
$scope.selectedDistrict = null;
$scope.districts = $scope.regions[1][selectedState];
Expand Down Expand Up @@ -222,6 +221,9 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
],
type: 'donut'
},
color: {
pattern: ['#96281B', '#CF000F', '#F64747', '#F62459', '#9A12B3', '#663399', '#2C3E50', '#336E7B', '#9467bd', '#26A65B', '#8c564b', '#16A085', '#F89406', '#D35400', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5']
},
donut: {
title: "Total Work",
},
Expand Down Expand Up @@ -254,8 +256,11 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
],
type: 'donut'
},
color: {
pattern: ['#96281B', '#CF000F', '#F64747', '#F62459', '#9A12B3', '#663399', '#2C3E50', '#336E7B', '#9467bd', '#26A65B', '#8c564b', '#16A085', '#F89406', '#D35400', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5']
},
donut: {
title: "Total Expenditure",
title: "Total Expenditure"
},
size: {
'height': 400
Expand Down Expand Up @@ -410,27 +415,38 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
// View Results //
//////////////////////////

YearlyReportNational.fetch($scope.selectedYear).then(function(response) {
$scope.yearlydata = response[0];
});
MonthlyReportNational.fetch($scope.selectedYear).then(function(response) {
$scope.monthlydata = response[0];
loadGraph();
});

$scope.viewResults = function() {
params = buildCode();
$window.ga('send', 'event',$scope.selectedYear, params.code_type, params.code);


YearlyReport.fetch(params, $scope.selectedYear).then(function(response) {
function loadNational(){
YearlyReportNational.fetch($scope.selectedYear).then(function(response) {
$scope.yearlydata = response[0];
});
MonthlyReport.fetch(params, $scope.selectedYear).then(function(response) {
MonthlyReportNational.fetch($scope.selectedYear).then(function(response) {
$scope.monthlydata = response[0];
loadGraph();
});
};
loadNational();

$scope.viewResults = function() {


if ($scope.selectedYear && !$scope.selectedState && !$scope.selectedDistrict && !$scope.selectedBlock && !$scope.selectedGP){
$window.ga('send', 'event',$scope.selectedYear, 'National');
loadNational();
}

else
{
params = buildCode();
$window.ga('send', 'event',$scope.selectedYear, params.code_type, params.code);
YearlyReport.fetch(params, $scope.selectedYear).then(function(response) {
$scope.yearlydata = response[0];
});
MonthlyReport.fetch(params, $scope.selectedYear).then(function(response) {
$scope.monthlydata = response[0];
loadGraph();
});
}
};

function loadGraph() {

Expand Down Expand Up @@ -605,6 +621,7 @@ reportdash.controller('reportdashCtrl', ['$scope','$window','$location', '$rootS
['Renovation of traditional water bodies', $scope.monthlydata.WH_exp]
];


$scope.hh_providedemployment_chart.data.columns[1] = [
'Previous year',
$scope.monthlydata.april_hh_P_emp_pre,
Expand Down
64 changes: 32 additions & 32 deletions modules/reportdash/tabular/tableview.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ <h3>Demand Registration</h3>
<tbody>
<tr>
<td colspan="2">Households demanded employment</td>
<td>{{yearlydata.demand_register}}</td>
<td>{{yearlydata.demand_register | number}}</td>
</tr>
<tr>
<td colspan="2">Households allotted employment</td>
<td>{{yearlydata.work_alloted}}</td>
<td>{{yearlydata.work_alloted | number}}</td>
</tr>
<tr>
<td colspan="2">Households provided employment</td>
<td>{{yearlydata.hh_provided_employment}}</td>
<td>{{yearlydata.hh_provided_employment | number}}</td>
</tr>
<!-- <tr>
<td colspan="2">Unmet Demand</td>
<td>{{yearlydata.work_alloted}}</td>
<td>{{yearlydata.work_alloted | number}}</td>
</tr> -->
<tr>
<td rowspan="4">Unemployment allowances</td>
<td>Person-days of unemployment due</td>
<td>{{yearlydata.payable_days_unemp}}</td>
<td>{{yearlydata.payable_days_unemp | number}}</td>
</tr>
<tr>
<td>Amount payable (Rs.)</td>
<td>{{yearlydata.payable_amount_unemp}}</td>
<td>{{yearlydata.payable_amount_unemp | number}}</td>
</tr>
<tr>
<td>Approved days</td>
<td>{{yearlydata.approved_days}}</td>
<td>{{yearlydata.approved_days | number}}</td>
</tr>
<tr>
<td>Rejected days</td>
<td>{{yearlydata.rejected_days}}</td>
<td>{{yearlydata.rejected_days | number}}</td>
</tr>
</tbody>
</table>
Expand All @@ -60,48 +60,48 @@ <h3>Physical Progress</h3>
<tbody>
<tr>
<td colspan="2">Person-days projected</td>
<td>{{yearlydata.labour_budget}}</td>
<td>{{yearlydata.labour_budget | number}}</td>
</tr>
<tr>
<td rowspan="3">Person-days generated</td>
<td>SC %</td>
<td>{{yearlydata.SCper}}</td>
<td>{{yearlydata.SCper | number}}</td>
</tr>
<tr>
<td>ST %</td>
<td>{{yearlydata.STper}}</td>
<td>{{yearlydata.STper | number}}</td>
</tr>
<tr>
<td>Women %</td>
<td>{{yearlydata.Womenper}}</td>
<td>{{yearlydata.Womenper | number}}</td>
</tr>
<tr>
<td colspan="2">Work completion rate</td>
<td>{{yearlydata.Work_completion_rate}}</td>
<td>{{yearlydata.Work_completion_rate | number}}</td>
</tr>
<tr>
<td colspan="2">Total GPs</td>
<td>{{yearlydata.Tgp}}</td>
<td>{{yearlydata.Tgp | number}}</td>
</tr>
<tr>
<td colspan="2">GPs with nil expenditure</td>
<td>{{yearlydata.NIL_EXP}}</td>
<td>{{yearlydata.NIL_EXP | number}}</td>
</tr>
<tr>
<td colspan="2">GPs with no employment generation in last month</td>
<td>{{yearlydata.lastmon_nilgp}}</td>
<td>{{yearlydata.lastmon_nilgp | number}}</td>
</tr>
<tr>
<td colspan="2">GPs with no approved works</td>
<td>{{yearlydata.app_panch}}</td>
<td>{{yearlydata.app_panch | number}}</td>
</tr>
<tr>
<td colspan="2">GPs with no ongoing works</td>
<td>{{yearlydata.ong_panch}}</td>
<td>{{yearlydata.ong_panch | number}}</td>
</tr>
<tr>
<td colspan="2">Households completed 100 days</td>
<td>{{yearlydata.hh_completed_100days}}</td>
<td>{{yearlydata.hh_completed_100days | number}}</td>
</tr>
</tbody>
</table>
Expand All @@ -119,59 +119,59 @@ <h3>Financial Progress</h3>
<tbody>
<tr>
<td colspan="2">Total expenditure (in lacs of Rs.)</td>
<td>{{yearlydata.tot_exp}}</td>
<td>{{yearlydata.tot_exp | number}}</td>
</tr>
<tr>
<td rowspan="2">Total Expenditure</td>
<td>Wage (%)</td>
<td>{{yearlydata.wage_perc}}</td>
<td>{{yearlydata.wage_perc | number}}</td>
</tr>
<tr>
<td>Admin (%)</td>
<td>{{yearlydata.adm_perc}}</td>
<td>{{yearlydata.adm_perc | number}}</td>
</tr>
<tr>
<td rowspan="2">Delayed compensation</td>
<td>Payable (in delay days)</td>
<td>{{yearlydata.payable_days_delay}}</td>
<td>{{yearlydata.payable_days_delay | number}}</td>
</tr>
<tr>
<td>Amount payable (Rs.)</td>
<td>{{yearlydata.payable_amount_delay}}</td>
<td>{{yearlydata.payable_amount_delay | number}}</td>
</tr>
<tr>
<td colspan="2">Average wage per person-day</td>
<td>{{yearlydata.avg_wage_per_PD}}</td>
<td>{{yearlydata.avg_wage_per_PD | number}}</td>
</tr>
<!-- <tr>
<td colspan="2">Average cost per PD</td>
<td>{{yearlydata.avg_cost_per_PD}}</td>
<td>{{yearlydata.avg_cost_per_PD | number}}</td>
</tr>-->
<!--<tr>
<td rowspan="4">eFMS</td>
<td>Total number of blocks %</td>
<td>{{yearlydata.total_blk}}</td>
<td>{{yearlydata.total_blk | number}}</td>
</tr>
<tr>
<td>Started in No. of blocks(wages)</td>
<td>{{yearlydata.blk_wage_efms}}</td>
<td>{{yearlydata.blk_wage_efms | number}}</td>
</tr>
<tr>
<td>Started in No. of blocks(Material)</td>
<td>{{yearlydata.blk_mat_efms}}</td>
<td>{{yearlydata.blk_mat_efms | number}}</td>
</tr>
<tr>
<td>Started in No. of blocks(Admin)</td>
<td>{{yearlydata.blk_adm_efms}}</td>
<td>{{yearlydata.blk_adm_efms | number}}</td>
</tr>
<tr>-->
<td rowspan="2">DBT</td>
<td>Percent of active workers' A/Cs freezed</td>
<td>{{yearlydata.frez_act_pers}}</td>
<td>{{yearlydata.frez_act_pers | number}}</td>
</tr>
<tr>
<td>Percent of Aadhar seeding against total active workers</td>
<td>{{yearlydata.aadhaar_seedpers}}</td>
<td>{{yearlydata.aadhaar_seedpers | number}}</td>
</tr>
</tbody>
</table>
Expand Down
7 changes: 6 additions & 1 deletion modules/reportdash/viz/viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<span class="glyphicon glyphicon-list-alt"></span>&nbsp; Expenditure By Category
</div>
<div id="expenditure_category_wise_chart" vizconfig="expenditure_category_wise_chart" c3chart></div>
<div class="text-center lead">Total Expenditure: {{ monthlydata.AV_exp + monthlydata.CA_exp + monthlydata.DP_exp+monthlydata.DW_exp +
monthlydata.FG_exp + monthlydata.FP_exp + monthlydata.FR_exp + monthlydata.IC_exp +
monthlydata.IF_exp + monthlydata.LD_exp + monthlydata.OP_exp + monthlydata.PG_exp +
monthlydata.RC_exp + monthlydata.RS_exp + monthlydata.SK_exp + monthlydata.WC_exp +
monthlydata.WH_exp | number}}</div>
</div>


Expand All @@ -55,7 +60,7 @@

<div class="chart">
<div class="chart-header">
<span class="glyphicon glyphicon-list-alt"></span>&nbsp; Wage Expenditure
<span class="glyphicon glyphicon-list-alt"></span>&nbsp; Wage Expenditure (in lakhs of Rs.)
</div>
<div id="wage_expenditure_chart" vizconfig="wage_expenditure_chart" c3chart></div>
</div>
Expand Down

0 comments on commit e143f44

Please sign in to comment.