Skip to content

Commit

Permalink
Add the following summary reports
Browse files Browse the repository at this point in the history
* Applicants by status.
* Applications/leases over time.
* Applications/leases by property.
* Leases by property over time.
* Lease value by property over time.
  • Loading branch information
Ahmad Gneady committed Nov 19, 2020
1 parent ac28ef2 commit f3da716
Show file tree
Hide file tree
Showing 16 changed files with 3,180 additions and 1 deletion.
2,130 changes: 2,130 additions & 0 deletions app/hooks/SummaryReport.php

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions app/hooks/footer-extras.php
Expand Up @@ -11,3 +11,18 @@
</script>

<?php } ?>

<?php if(strpos($_SERVER['PHP_SELF'], 'summary-reports-')) { ?>

<script>
$j(function() {
var vSpacer = $j('div.hidden-print');
vSpacer.eq(vSpacer.length - 2).replaceWith('<div class="alert alert-info">' +
'<i class="glyphicon glyphicon-exclamation-sign"></i> ' +
'This report was created by ' +
'<a href="https://bigprof.com/appgini/applications/summary-reports-plugin" target="_blank" title="Summary Reports plugin for AppGini">Summary Reports plugin for AppGini</a>.' +
'</div>');
})
</script>

<?php } ?>
76 changes: 76 additions & 0 deletions app/hooks/language-summary-reports.php
@@ -0,0 +1,76 @@
<?php

// IMPORTANT:
// ==========
// When translating, only translate the strings that are
// TO THE RIGHT OF the arrow sign (=>).
//
// Do NOT translate the strings between square brackets ([]) or (<>)
// =====================================================
$ReportTranslation = array(
'back' => "Back",
'print report' => "Print Report",
'export report to csv file' => "Export report to CSV file",
'records' => "<n> records",
'from to' => "from <FROM> to <TO>",
'period from to' => "Period from <FROM> to <TO>",
'change' => "Change",
'report configuration' => "Report Configuration",
'report period' => "Report Period",
'month to date' => "Month-to-date",
'month to date description' => 'Include data from month-to-date. Compare with the same period last month, and the same period last year.',
'current month' => "Current month",
'current month description' => 'Include data from the entire current month. Compare with last month, and the same month last year.',
'last month' => "Last month",
'last month description' => 'Include data from last month. Compare with the month before, and the same month last year.',
'quarter to date' => "Quarter-to-date",
'quarter to date description' => 'Include data from quarter-to-date. Compare with the same period last quarter, and the same period last year.',
'current quarter' => "Current quarter",
'current quarter description' => 'Include data from current quarter. Compare with the last one and the same quarter last year.',
'last quarter' => "Last quarter",
'last quarter description' => 'Include data from last quarter. Compare with the quarter before and the same quarter last year.',
'year to date' => "Year-to-date",
'year to date description' => 'Include data from year-to-date. Compare with same period last year and the same period the year before.',
'current year' => "Current year",
'current year description' => 'Include data from current year. Compare with last year and the year before.',
'last year' => "Last year",
'last year description' => 'Include data from last year. Compare to the two years before.',
'comparison period 1' => "Comparison Period 1",
'comparison period 2' => "Comparison Period 2",
'from' => "From",
'to' => "To",
'order by' => "Order by",
'descending' => "Descending",
'ascending' => "Ascending",
'appearance' => "Appearance (applies instantly)",
'show row numbers' => "Show row numbers",
'alignment of label column' => "Alignment of <LABEL> column",
'alignment of other columns' => "Alignment of other columns",
'apply' => "Apply",
'close' => "Close",
'charts-color-theme' => 'Charts color theme',
'rainbow' => 'Rainbow',
'reds' => 'Red shades',
'oranges' => 'Orange shades',
'yellows' => 'Yellow shades',
'greens' => 'Green shades',
'blues' => 'Blue shades',
'violets' => 'Violet shades',
'grays' => 'Gray shades',
'barchart-orientation' => 'Bar chart orientation',
'barchart-aspect-ratio' => 'Bar chart aspect ratio (height : width)',
'barchart-bar-width' => 'Bars width in the bar chart (pixels)',
'barchart-bar-spacing' => 'Bars spacing in the bar chart (pixels)',
'barchart-bar-width-default-hint' => 'A value of 0 (the default) sets the bar width automatically.',
'barchart-width' => 'Width of bar chart',
'piechart-width' => 'Width of pie charts',
'piechart-labels' => 'Labels on pie charts',
'labels' => 'Labels',
'labels-values' => 'Labels and values',
'labels-percentages' => 'Labels and percentages',
'labels-values-percentages' => 'Labels, values and percentages',
'automatic' => 'Automatic',
'loading report header' => 'Loading report header ...',
'loading report footer' => 'Loading report footer ...',
'no-report-data' => 'Either no data was found for this report, or you don\'t have sufficient permissions.',
);
13 changes: 13 additions & 0 deletions app/hooks/links-home.php
Expand Up @@ -14,3 +14,16 @@
);
*/


/* summary_reports links */
$homeLinks[] = array(
'url' => 'hooks/summary-reports-list.php',
'title' => 'Summary Reports',
'groups' => array('*'),
'table_group' => 'Leases',
'description' => '',
'grid_column_classes' => 'col-xs-12 col-sm-6 col-md-6 col-lg-6',
'panel_classes' => '',
'link_classes' => '',
'icon' => 'hooks/summary_reports-logo-md.png'
);
8 changes: 8 additions & 0 deletions app/hooks/links-navmenu.php
Expand Up @@ -10,3 +10,11 @@
);
*/


/* summary_reports links */
$navLinks[] = array(
'url' => 'hooks/summary-reports-list.php',
'title' => 'Summary Reports',
'groups' => array('*'),
'icon' => 'hooks/summary_reports-logo-md.png'
);
146 changes: 146 additions & 0 deletions app/hooks/summary-reports-applicants_and_tenants-0.php
@@ -0,0 +1,146 @@
<?php
/* Include Requeried files */
define("PREPEND_PATH", "../");
$hooks_dir = dirname(__FILE__);
include("{$hooks_dir}/../defaultLang.php");
include("{$hooks_dir}/../language.php");
include("{$hooks_dir}/../lib.php");
include("{$hooks_dir}/language-summary-reports.php");
include("{$hooks_dir}/SummaryReport.php");
@header("Content-Type: text/html; charset=" . datalist_db_encoding);

$x = new StdClass;
$x->TableTitle = "Applicants By Status";
include_once("{$hooks_dir}/../header.php");

$filterable_fields = array (
0 => 'id',
1 => 'last_name',
2 => 'first_name',
3 => 'email',
4 => 'phone',
5 => 'birth_date',
6 => 'driver_license_number',
7 => 'driver_license_state',
8 => 'requested_lease_term',
9 => 'monthly_gross_pay',
10 => 'additional_income',
11 => 'assets',
12 => 'status',
13 => 'notes',
);


$config_array = array(
'reportHash' => 'id5fq91qu393nf0k42r1',
'request' => $_REQUEST,
'groups_array' => $groups_array,
'override_permissions' => false,
'title' => 'Applicants By Status',
'custom_where' => '',
'table' => 'applicants_and_tenants',
'label' => 'status',
'group_function' => 'count',
'label_title' => 'Status',
'value_title' => 'Count of Applicants and tenants',
'thousands_separator' => ',',
'decimal_point' => '.',

// show data table section?
'data_table_section' => 1,

// max number of data points to show on charts
'chart_data_points' => 20,

// barchart options
'barchart_section' => 0,
'barchart_options' => array(
// see https://gionkunz.github.io/chartist-js/api-documentation.html#chartistbar-declaration-defaultoptions
'axisX' => array(
'offset' => 30,
'position' => 'end',
'labelOffset' => array('x' => 0, 'y' => 0),
'showLabel' => true,
'showGrid' => true,
'scaleMinSpace' => 30,
'onlyInteger' => false
),
'axisY' => array(
'offset' => 40,
'position' => 'start',
'labelOffset' => array('x' => 0, 'y' => 0),
'showLabel' => true,
'showGrid' => true,
'scaleMinSpace' => 20,
'onlyInteger' => false
),
// 'width' => false,
// 'height' => false,
// 'high' => false,
// 'low' => false,
'referenceValue' => 0,
'chartPadding' => array('top' => 15, 'right' => 15, 'bottom' => 5, 'left' => 10),
'seriesBarDistance' => 15,
'stackBars' => false,
'stackMode' => 'accumulate',
'horizontalBars' => false,
'distributeSeries' => false,
'reverseData' => false,
'showGridBackground' => false,
'classNames' => array(
'chart' => 'ct-chart-bar',
'horizontalBars' => 'ct-horizontal-bars',
'label' => 'ct-label',
'labelGroup' => 'ct-labels',
'series' => 'ct-series',
'bar' => 'ct-bar',
'grid' => 'ct-grid',
'gridGroup' => 'ct-grids',
'gridBackground' => 'ct-grid-background',
'vertical' => 'ct-vertical',
'horizontal' => 'ct-horizontal',
'start' => 'ct-start',
'end' => 'ct-end'
)
),

// piechart options
'piechart_section' => 1,
'piechart_options' => array(
// see https://gionkunz.github.io/chartist-js/api-documentation.html#chartistpie-declaration-defaultoptions
// 'width' => false,
// 'height' => false,
'chartPadding' => 5,
'classNames' => array(
'chartPie' => 'ct-chart-pie',
'chartDonut' => 'ct-chart-donut',
'series' => 'ct-series',
'slicePie' => 'ct-slice-pie',
'sliceDonut' => 'ct-slice-donut',
'sliceDonutSolid' => 'ct-slice-donut-solid',
'label' => 'ct-label'
),
'startAngle' => 0,
// 'total' => false,
'donut' => false,
'donutSolid' => false,
'donutWidth' => 60,
'showLabel' => true,
'labelOffset' => '50',
'labelPosition' => 'center',
'labelDirection' => 'neutral',
'reverseData' => false,
'ignoreEmptyValues' => true
),
'piechart_classes' => 'ct-square',

'date_format' => 'm/d/Y',
'date_separator' => '/',
'jsmoment_date_format' => 'MM/DD/YYYY',
'label_field_index' => 13,
'filterable_fields' => $filterable_fields
);
$report = new SummaryReport($config_array);
echo $report->render();

include_once("{$hooks_dir}/../footer.php");

0 comments on commit f3da716

Please sign in to comment.