userstatistics_helper
in package
Table of Contents
Properties
- $formatBold : mixed
- $pdf : pdf
- $sheet : Spreadsheet_Excel_Writer_Worksheet
- The Excel worksheet we are working on
- $workbook : Writer
- The current Excel workbook we are working on
- $xlsPercents : mixed
- $xlsRow : int
- Keeps track of the current row in Excel sheet
Methods
- _listcolumn() : mixed
- Returns a simple list of values in a particular column, that meet the requirements of the SQL
- generate_statistics() : string|null
- Generates statistics
- buildOutputList() : mixed
- Builds an array containing information about this particular question/answer combination
- displayResults() : array<string|int, mixed>
- displayResults builds html output to display the actual results from a survey
- getQuartile() : null|float
- Get the quartile using minitab method
- getLinefeed() : string
Properties
$formatBold
protected
mixed
$formatBold
protected
pdf
$pdf
$sheet
The Excel worksheet we are working on
protected
Spreadsheet_Excel_Writer_Worksheet
$sheet
$workbook
The current Excel workbook we are working on
protected
Writer
$workbook
$xlsPercents
protected
mixed
$xlsPercents
$xlsRow
Keeps track of the current row in Excel sheet
protected
int
$xlsRow
= 0
Methods
_listcolumn()
Returns a simple list of values in a particular column, that meet the requirements of the SQL
public
_listcolumn(mixed $surveyid, mixed $column[, mixed $sortby = "" ][, mixed $sortmethod = "" ][, mixed $sorttype = "" ]) : mixed
Parameters
- $surveyid : mixed
- $column : mixed
- $sortby : mixed = ""
- $sortmethod : mixed = ""
- $sorttype : mixed = ""
generate_statistics()
Generates statistics
public
generate_statistics(int $surveyid, mixed $allfields[, mixed $q2show = 'all' ][, int $usegraph = 0 ][, string $outputType = 'pdf' ][, string $pdfOutput = 'I' ][, mixed $sLanguageCode = null ][, bool $browse = true ]) : string|null
Parameters
- $surveyid : int
-
The survey ID
- $allfields : mixed
- $q2show : mixed = 'all'
- $usegraph : int = 0
- $outputType : string = 'pdf'
-
Optional - Can be xls, html or pdf - Defaults to pdf
- $pdfOutput : string = 'I'
-
Sets the target for the PDF output: DD=File download , F=Save file to local disk
- $sLanguageCode : mixed = null
- $browse : bool = true
-
Show browse buttons
Return values
string|nullbuildOutputList()
Builds an array containing information about this particular question/answer combination
protected
buildOutputList(string $rt, mixed $language, mixed $surveyid, string $outputType, mixed $sql, mixed $oLanguage[, bool $browse = true ]) : mixed
Parameters
- $rt : string
-
The code passed from the statistics form listing the field/answer (SGQA) combination to be displayed
- $language : mixed
-
The language to present output in
- $surveyid : mixed
-
The survey ID
- $outputType : string
- $sql : mixed
- $oLanguage : mixed
- $browse : bool = true
Tags
displayResults()
displayResults builds html output to display the actual results from a survey
protected
displayResults(mixed $outputs, int $results, mixed $rt, string $outputType, mixed $surveyid, mixed $sql, int $usegraph, bool $browse, mixed $sLanguage) : array<string|int, mixed>
Parameters
- $outputs : mixed
- $results : int
-
The number of results being displayed overall
- $rt : mixed
- $outputType : string
- $surveyid : mixed
- $sql : mixed
- $usegraph : int
- $browse : bool
- $sLanguage : mixed
Tags
Return values
array<string|int, mixed>getQuartile()
Get the quartile using minitab method
protected
getQuartile(int $quartile, string $fieldname, int $surveyid, string $sql, bool $excludezeros) : null|float
L=(1/4)(n+1), U=(3/4)(n+1) Minitab linear interpolation between the two closest data points. Minitab would let L = 2.5 and find the value half way between the 2nd and 3rd data points. In our example, that would be (4+9)/2 = 6.5. Similarly, the upper quartile value would be half way between the 7th and 8th data points, which would be (49+64)/2 = 56.5. If L were 2.25, Minitab would find the value one fourth of the way between the 2nd and 3rd data points and if L were 2.75, Minitab would find the value three fourths of the way between the 2nd and 3rd data points.
Parameters
- $quartile : int
-
use 0 for return of recordcount, otherwise will return Q1,Q2,Q3
- $fieldname : string
- $surveyid : int
- $sql : string
- $excludezeros : bool
Tags
Return values
null|floatgetLinefeed()
private
getLinefeed(string $outputType) : string
Parameters
- $outputType : string