snippet($this->enkaEncode(' '),20,'...') . $align . '\qc\cell';//prva prazna
//za vsak stolpec
for($j=0; $j<$count-1; $j++){
$table1 .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($defw_dynamic * ($j+1)) );
$tableEnd1 .= '\pard\intbl'.$bold.' '.$this->enkaEncode($answers[$j][$i]).'\qc\cell';
}
$tableEnd1 .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table1.$tableEnd1);
}
}
}
}
$this->tableEnd();
}
/** Izriše sumarnik v horizontalni obliki za multi checbox
*
* @param unknown_type $spid - spremenljivka ID
*/
function sumMultiHorizontalCheckbox($spid,$_from) {
global $lang;
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
$_answersOther = array();
# ugotovimo koliko imamo kolon
$gid=0;
$_clmn_cnt = SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_vars']-SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_other'];
# tekst vprašanja
/////////////////PRVA TABELA////////////////
//prva vrstica
$this->tableFirstLine($spremenljivka['variable'], $spremenljivka['naslov']);
//druga vrstica
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1100;
$defw_part2 = 2200;
$defw_part3 = 5000;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_subquestion']),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + $defw_part3 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_answers']),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_valid']),20,'...').'\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + 2 * $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_num_units']),20,'...').'\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
//tretja vrstica
$_variables = SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['variables'];
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1100;
$defw_part2 = 2200;
$defw_part3 = 5000;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\cell';
$defw_dynamic = round($defw_part3 / count($_variables) );
$count = 1;
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($variable['naslov'].' ('.$variable['gr_id']. ')'),20,'...').'\qc\cell';
}
$count++;
}
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...').'\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + 2 * $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...').'\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
//podatkovne vrstice
foreach (SurveyAnalysis::$_HEADERS[$spid]['grids'] AS $gid => $grids) {
$_cnt = 0;
# vodoravna vrstice s podatki
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1100;
$defw_part2 = 2200;
$defw_part3 = 5000;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grids['variable']),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grids['naslov']),20,'...') . $align . '\cell';
$_arguments = 0;
$_max_appropriate = 0;
$_max_cnt = 0;
// prikaz frekvenc
$defw_dynamic = round($defw_part3 / count($grids['variables']) );
$count = 1;
foreach ($grids['variables'] AS $vkey => $variable) {
$_sequence = $variable['sequence'];
$_valid = SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
$_cnt = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$_arguments += $_cnt;
$_max_appropriate = max($_max_appropriate, (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
$_max_cnt = max ($_max_cnt, ((int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt'])));
if ($variable['other'] == true) {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vkey,'sequence'=>$_sequence);
}
if ($variable['other'] != true) {
$_percent = ($_valid > 0 ) ? $_cnt * 100 / $_valid : 0;
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_cnt.' ('.SurveyAnalysis::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'). ')'),20,'...').'\qc\cell';
}
$count++;
}
# veljavno
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_max_cnt),20,'...').'\qc\cell';
#ustrezno
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + 2 * $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_max_appropriate),20,'...').'\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
$this->tableEnd();
/////////////////KONEC PRVE TABELE////////////////
////////////DRUGA TABELA///////////////////
//prva vrstica
$this->tableFirstLine($spremenljivka['variable'], $spremenljivka['naslov']);
//druga vrstica
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_subquestion']),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + $defw_part3 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_arguments']),20,'...') . $align . '\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
//tretja vrstica
$_variables = SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['variables'];
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . $align . '\cell';
$defw_dynamic = round($defw_part3 / (count($_variables)+1) );
$count = 1;
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($variable['naslov'].' ('.$variable['gr_id']. ')'),20,'...').'\qc\cell';
}
$count++;
}
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_full );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_anl_suma1']),20,'...').'\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
//vrstice s podatki
foreach (SurveyAnalysis::$_HEADERS[$spid]['grids'] AS $gid => $grids) {
$_cnt = 0;
# vodoravna vrstice s podatki
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grids['variable']),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grids['naslov']),20,'...') . $align . '\cell';
$_arguments = 0;
$_max_appropriate = 0;
$_max_cnt = 0;
// prikaz frekvenc
foreach ($grids['variables'] AS $vkey => $variable) {
$_sequence = $variable['sequence'];
$_valid = SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
$_cnt = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$_arguments += $_cnt;
$_max_appropriate = max($_max_appropriate, (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
$_max_cnt = max ($_max_cnt, ((int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt'])));
if ($variable['other'] == true) {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vkey,'sequence'=>$_sequence);
}
if ($variable['other'] != true) {
$_percent = ($_valid > 0 ) ? $_cnt * 100 / $_valid : 0;
}
}
$defw_dynamic = round($defw_part3 / (count($_variables)+1) );
$count = 1;
foreach ($grids['variables'] AS $vkey => $variable) {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
$_cnt = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$_percent = ($_arguments > 0 ) ? $_cnt * 100 / $_arguments : 0;
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_cnt.' ('.SurveyAnalysis::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'). ')'),20,'...').'\qc\cell';
$count++;
}
}
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_full );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_arguments),20,'...').'\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
$this->tableEnd();
///////////KONEC DRUGE TABELE//////////////
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && SurveyAnalysis::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
self::outputOtherAnswers($oAnswers);
$this->tableEnd();
}
}
}
/** Izriše multi number odgovore. izpiše samo povprečja
*
* @param unknown_type $spid
*/
function sumMultiNumber($spid,$_from) {
global $lang;
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
$_cols = $spremenljivka['cnt_all'] / $spremenljivka['cnt_grids'];
//prva vrstica
$this->tableFirstLine($spremenljivka['variable'], $spremenljivka['naslov']);
//druga vrstica
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_opisne_subquestion']),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + $defw_part3 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($lang['srv_analiza_sums_average']),20,'...') . '\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
if ($_grids_count > 0) {
# naslovna vrstica
$_row = $spremenljivka['grids'][0];
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(' '),20,'...') . '\cell';
$defw_dynamic = round($defw_part3 / count($_row['variables']) );
$count = 1;
foreach ( $_row['variables'] AS $rid => $_col ) {
$_sequence = $_col['sequence']; # id kolone z podatki
if ($_col['other'] != true) {
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($_col['naslov']),20,'...').'\qc\cell';
}
else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
$count++;
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
$last = 0;
foreach ($spremenljivka['grids'] AS $gid => $grid) {
$_variables_count = count($grid['variables']);
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '';
$align = '\ql';
$bold = '\b0';
$tableHeader = '\trowd\trql\trrh400';
$table = '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd = '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grid['variable']),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($grid['naslov']),20,'...') . '\cell';
if ($_variables_count > 0) {
$defw_dynamic = round($defw_part3 / $_variables_count );
$count = 1;
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
if ($variable['other'] != true) {
# tabela z navedbami
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + ($count * $defw_dynamic) );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode(SurveyAnalysis::formatNumber(SurveyAnalysis::$_FREQUENCYS[$_sequence]['average'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'')),20,'...').'\qc\cell';
}
$count++;
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
}
}
$this->tableEnd();
}
function outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,&$_kumulativa,$_options=array()) {
global $lang;
$text = array();
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'textAnswerExceed'=>false # ali presegamo število tekstovnih odgovorov za prikaz
);
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
$cssBck = ' '.SurveyAnalysis::$cssColors['0_' . ($counter & 1)];
$_valid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_kumulativa += $_valid;
# ali presegamo število prikazanih vrstic, takrat v zadnji prikazani dodamo link več.. ostale vrstice pa skrijemo
if ($options['textAnswerExceed'] == true) {
if ($counter == TEXT_ANSWER_LIMIT ) {
# link za več
$show_more = '(več...)
'.NEW_LINE;
} elseif ($counter > TEXT_ANSWER_LIMIT ) {
$hide_row = ' hidden';
$_exceed = true;
}
}
//if ($counter < TEXT_MAX_ANSWER_LIMIT) {
$text[] = ' ';
$addText = (($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' ('.$vAnswer['text'] .')' : '');
$text[] = $this->encodeText($vkey.$addText);
$text[] = $this->encodeText((int)$vAnswer['cnt']);
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_valid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
/*} elseif ($counter == TEXT_MAX_ANSWER_LIMIT ) {
echo '';
echo ' . . . Prikazujemo samo prvih '.TEXT_MAX_ANSWER_LIMIT.' veljavnih odgovorov! | ';
echo '
';
}*/
self::tableRow($text);
$counter++;
return $counter;
}
function outputSumaValidAnswerVertical($counter,$_sequence,$spid,$_options=array()) {
global $lang;
$text = array();
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'textAnswerExceed'=>false # ali presegamo število tekstovnih odgovorov za prikaz
);
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_brez_MV = ((int)SurveyAnalysis::$currentMissingProfile === 2) ? TRUE : FALSE;
$_sufix = '';
$text[] = $this->encodeText($lang['srv_anl_valid']);
$text[] = $this->encodeText($lang['srv_anl_suma1']);
$text[] = $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0);
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = $this->encodeText(SurveyAnalysis::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = ' ';
self::tableRow($text);
$counter++;
return $counter;
}
function outputInvalidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_options=array()) {
global $lang;
$text = array();
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'textAnswerExceed'=>false # ali presegamo število tekstovnih odgovorov za prikaz
);
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_invalid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
$_Z_MV = ((int)SurveyAnalysis::$missingProfileData['display_mv_type'] === 2) ? TRUE : FALSE;
if($_Z_MV){
$text[] = ' ';
$text[] = $this->encodeText($vkey.' (' . $vAnswer['text'].')');
//echo ''.SurveyAnalysis::formatNumber($_invalid, NUM_DIGIT_PERCENT, '%').'
'.NEW_LINE;
//echo ''.$vAnswer['cnt'].'
'.NEW_LINE;
$text[] = $this->encodeText((int)$vAnswer['cnt']);
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = ' ';
$text[] = ' ';
$this->tableRow($text);
}
$counter++;
return $counter;
}
function outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$_options = array()) {
global $lang;
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'textAnswerExceed'=>false # ali presegamo število tekstovnih odgovorov za prikaz
);
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
$cssBck = ' '.SurveyAnalysis::$cssColors['text_' . ($counter & 1)];
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_brez_MV = ((int)SurveyAnalysis::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
if(!$_brez_MV){
$text = array();
$text[] = $this->encodeText($lang['srv_anl_missing']);
$text[] = $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt']);
$answer['cnt'] = SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
$text[] = $this->encodeText((int)$answer['cnt']);
$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = ' ';
$text[] = ' ';
$this->tableRow($text);
}
$counter++;
return $counter;
}
function outputSumaVertical($counter,$_sequence,$spid, $_options = array()) {
global $lang;
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'textAnswerExceed'=>false # ali presegamo število tekstovnih odgovorov za prikaz
);
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
$cssBck = ' '.SurveyAnalysis::$cssColors['0_' .($counter & 1)];
$_brez_MV = ((int)SurveyAnalysis::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
if(!$_brez_MV){
$params = array('borderB' => 1);
$text = array();
$text[] = ' ';
$text[] = $this->encodeText($lang['srv_anl_suma2']);
$text[] = $this->encodeText((SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0));
$text[] = $this->encodeText(SurveyAnalysis::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = ' ';
$text[] = ' ';
$this->tableRow($text, $params);
}
}
function outputOtherAnswers($oAnswers) {
global $lang;
$spid = $oAnswers['spid'];
$_variable = SurveyAnalysis::$_HEADERS[$spid]['grids'][$oAnswers['gid']]['variables'][$oAnswers['vid']];
$_sequence = $_variable['sequence'];
$_frekvence = SurveyAnalysis::$_FREQUENCYS[$_variable['sequence']];
//prva vrstica
$this->tableFirstLine($_variable['variable'], SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )');
//druga vrstica
$this->tableHeader();
// konec naslovne vrstice
$counter = 1;
$_kumulativa = 0;
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
if ($vAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
$counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,array('isOtherAnswer'=>true));
}
}
# izpišemo sumo veljavnih
$counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,array('isOtherAnswer'=>true));
}
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
$counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,array('isOtherAnswer'=>true));
}
}
# izpišemo sumo veljavnih
$counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,array('isOtherAnswer'=>true));
}
#izpišemo še skupno sumo
$counter = self::outputSumaVertical($counter,$_sequence,$spid,array('isOtherAnswer'=>true));
}
/** za multi grid tekstovne vrstice doda vrstico z labeliami grida
*
* @param $gkey
* @param $gAnswer
* @param $spid
* @param $_options
*/
function outputGridLabelVertical($gid,$grid,$vid,$variable,$spid,$_options=array()) {
$text = array();
$text[] = $this->encodeText($variable['variable']);
$text[] = $this->encodeText(($grid['naslov'] != '' ? $grid['naslov']. ' - ' : '').$variable['naslov']);
$text[] = ' ';
$text[] = ' ';
$text[] = ' ';
$text[] = ' ';
$this->tableRow($text);
$counter++;
return $counter;
}
function createFrontPage(){
global $lang;
$this->rtf->new_line(10);
$this->rtf->TextCell($this->encodeText( SurveyInfo::getInstance()->getSurveyTitle()), array('width' => 9500, 'height' => 3,
'align' => 'center', 'valign' => 'middle' , 'border' => array('top','bottom', 'left','right'),
'colorF' => "0", 'colorB' => "0" ) );
$this->rtf->new_line(3);
// dodamo info:
$this->rtf->TextCell("", array('width' => 9500, 'height' => 1,
'align' => 'left', 'valign' => 'bottom' , 'border' => array('bottom'),'colorF' => "0" ) );
$infoTable = array();
$imenaTable = array();
if ( SurveyInfo::getInstance()->getSurveyTitle() != SurveyInfo::getInstance()->getSurveyAkronim() )
$imenaTable[] = array($lang['export_firstpage_shortname'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim()), "");
if ( SurveyInfo::getInstance()->getSurveyTitle() != SurveyInfo::getInstance()->getSurveyAkronim() )
$imenaTable[] = array($lang['export_firstpage_longname'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyTitle()), "");
$imenaTable[] = array($lang['export_firstpage_qcount'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyQuestionCount()), "" );
$imenaTable[] = array($lang['export_firstpage_active_from'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyStartsDate()),"" );
$imenaTable[] = array($lang['export_firstpage_active_until'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyExpireDate()),"" );
$imenaTable[] = array($lang['export_firstpage_author'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyInsertName()),"" );
$imenaTable[] = array($lang['export_firstpage_edit'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyEditName()),"" );
$imenaTable[] = array($lang['export_firstpage_date'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyInsertDate()),"" );
$imenaTable[] = array($lang['export_firstpage_date'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyEditDate()),"" );
$imenaTable[] = array($lang['export_firstpage_desc'].': '.$this->encodeText(SurveyInfo::getInstance()->getSurveyInfo()),"" );
$this->rtf->TableFromArray( array( 4600, 4600 ), $imenaTable);
$this->rtf->new_page();
}
function enkaEncode($text){ // popravimo sumnike ce je potrebno
$text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
return strip_tags($text);
}
function encodeText($text){ // popravimo sumnike ce je potrebno
$text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
$text = str_replace(array("š","š","č"),array("š","š","č"),$text);
return strip_tags($text);
}
function snippet($text,$length=64,$tail="...") {
/*$text = trim($text);
$txtl = strlen($text);
if($txtl > $length)
{
for($i=1;$text[$length-$i]!=" ";$i++)
{
if($i == $length)
{
return substr($text,0,$length) . $tail;
}
}
$text = substr($text,0,$length-$i+1) . $tail;
}*/
return $text;
}
function setGrupa($grupa) {$this->grupa = $grupa;}
function getGrupa() {return $this->grupa;}
function setUserId($usrId) {$this->usrId = $usrId;}
function getUserId() {return ($this->usrId)?$this->usrId:false;}
function setDisplayFrontPage($display) {$this->pi['displayFrontPage'] = $display;}
function getDisplayFrontPage() {return ($this->pi['displayFrontPage'] == true || $this->pi['displayFrontPage'] == 1);}
function tableFirstLine($field1, $field2){
global $lang;
$defw_full = 10300;
$defw_part = 900;
$defw_part2 = 9400;
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = '\clbrdrt\brdrs\brdrw10';
//$align = ($arrayParams['align']=='center' ? '\qc' : '\ql');
$bold = '\b';
$this->rtf->MyRTF .= "{\par";
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($field1),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($field2),20,'...') . '\ql\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableHeader(){
global $lang;
$naslov = array();
$naslov[] = ' ';
$naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleAnswers']);
$naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleFrekvenca']);
$naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleOdstotek']);
$naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleVeljavni']);
$naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleKumulativa']);
$params = array('borderB' => 1, 'bold' => 'B', 'align2' => 'C');
$this->tableRow($naslov, $params);
}
function tableRow($arrayText, $arrayParams=0){
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1300;
$defw_part2 = 4200;
//$borderB = ($arrayParams['borderB']==1 ? '\clbrdrb\brdrs\brdrw10' : '');
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = ($arrayParams['borderT']==1 ? '\clbrdrt\brdrs\brdrw10' : '');
$align2 = ($arrayParams['align2']=='C' ? '\qc' : '\ql');
$bold = ($arrayParams['bold']=='B' ? '\b' : '\b0');
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[0]),20,'...') . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[1]),20,'...') . $align2 . '\cell';
for($i=0; $i<4; $i++){
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + ($i+1) * $defw_part + $defw_part2);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[$i+2]),20,'...').'\qc\cell';
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableRowVerticalCheckbox($arrayText, $arrayParams=0){
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1000;
$defw_part2 = 2400;
//$borderB = ($arrayParams['borderB']==1 ? '\clbrdrb\brdrs\brdrw10' : '');
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = ($arrayParams['borderT']==1 ? '\clbrdrt\brdrs\brdrw10' : '');
$align = ($arrayParams['align']=='C' ? '\qc' : '\ql');
$bold = ($arrayParams['bold']=='B' ? '\b' : '\b0');
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[0]),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[1]),20,'...') . $align . '\cell';
for($i=0; $i<7; $i++){
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + ($i+1) * $defw_part + $defw_part2);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[$i+2]),20,'...').'\qc\cell';
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableRowNumberVertical($arrayText, $arrayParams=0){
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1100;
$defw_part2 = 2800;
//$borderB = ($arrayParams['borderB'] == 1 ? '\clbrdrb\brdrs\brdrw10' : '');
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = ($arrayParams['borderT'] == 1 ? '\clbrdrt\brdrs\brdrw10' : '');
$borderS = '\clbrdrl\brdrs\brdrw10';
$align = ($arrayParams['align']=='C' ? '\qc' : '\ql');
$bold = ($arrayParams['bold']=='B' ? '\b' : '\b0');
if($arrayText[1] == ' '){
$borderB = '';
$borderT = '';
$borderS = '';
}
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[0]),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT. $borderS . $borderB . $borderS. '\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[1]),20,'...') . $align . '\cell';
for($i=0; $i<6; $i++){
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + ($i+1) * $defw_part + $defw_part2);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[$i+2]),20,'...').'\qc\cell';
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableRowHorizontal($arrayText, $arrayParams=0){
$defw_full = 10300;
$defw_part0 = 900;
$defw_part = 1100;
$defw_part2 = 2200;
$defw_part3 = 3900;
//$borderB = ($arrayParams['borderB']==1 ? '\clbrdrb\brdrs\brdrw10' : '');
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = ($arrayParams['borderT']==1 ? '\clbrdrt\brdrs\brdrw10' : '');
$align = ($arrayParams['align']=='C' ? '\qc' : '\ql');
$bold = ($arrayParams['bold']=='B' ? '\b' : '\b0');
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[0]),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[1]),20,'...') . $align . '\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + $defw_part3 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[2]),20,'...') . $align . '\qc\cell';
for($i=0; $i<3; $i++){
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + ($i+1) * $defw_part + $defw_part2 + $defw_part3);
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[$i+3]),20,'...').'\qc\cell';
}
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableRowMultiText($arrayText, $arrayParams=0){
$defw_full = 10300;
$defw_part0 = 900;
$defw_part2 = 2200;
$defw_part3 = 7200;
//$borderB = ($arrayParams['borderB']==1 ? '\clbrdrb\brdrs\brdrw10' : '');
$borderB = '\clbrdrb\brdrs\brdrw10';
$borderT = ($arrayParams['borderT']==1 ? '\clbrdrt\brdrs\brdrw10' : '');
$align = ($arrayParams['align']=='C' ? '\qc' : '\ql');
$bold = ($arrayParams['bold']=='B' ? '\b' : '\b0');
$tableHeader = '\trowd\trql\trrh400';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[0]),20,'...') . $align . '\qc\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[1]),20,'...') . $align . '\cell';
$table .= '\clvertalc'.$borderT.'\clbrdrl\brdrs\brdrw10' . $borderB . '\clbrdrr\brdrs\brdrw10\cellx'.( $defw_part0 + $defw_part2 + $defw_part3 );
$tableEnd .= '\pard\intbl'.$bold.' '.$this->snippet($this->enkaEncode($arrayText[2]),20,'...') . $align . '\qc\cell';
$tableEnd .= '\pard\intbl\row';
$this->rtf->MyRTF .= $this->rtf->enkaEncode($tableHeader.$table.$tableEnd);
}
function tableEnd(){
$this->rtf->MyRTF .= "}";
$this->rtf->new_line(1);
}
function formatNumber ($value, $digit = 0, $sufix = "") {
if ($value <> 0 && $value != null)
$result = round($value, $digit);
else
$result = "0";
$result = number_format($result, $digit, '.', ',') . $sufix;
return $result;
}
}
?>