current code below:
Code: Select all
{foreach from=$fld_177 item=task name=foo}
{assign var='sum_all_foreach' value=$sum_all_foreach+$task}
{/foreach}
{assign var='result' value=$smarty.foreach.foo.total}
{assign temp_text value=$fld_177}
{assign var=result value=$temp_text|replace:',':''|count_characters}
{assign var='array' value=[$fld_140,$fld_145,$fld_150,$fld_155,$fld_160,$fld_165,$fld_170] scope=global}
{$arrValueCounts=$array|array_count_values}
{assign var=times value=50}
{foreach $arrValueCounts as $k=>$v}
{if $k == 'D'}
{math equation="x*y+z" x=$v y=$times z=$fld_190 assign=dom}
Dominance = {$dom}<br />
{elseif $k == 'C'}
{math equation="x*y+z" x=$v y=$times z=$fld_205 assign=com}
Competence = {$com}<br />
{elseif $k == 'A'}
{math equation="x*y+z" x=$v y=$times z=$result assign=att}
Attractivness = {$att}<br />
{elseif $k == 'S'}
{math equation="x*y+z" x=$v y=$times z=$fld_200 assign=soc}
Socio-Economics = {$soc}<br />
{elseif $k == 'W'}
{math equation="x*y+z" x=$v y=$times z=$fld_195 assign=war}
Warmth = {$war}<br />
{elseif $k == 'H'}
{math equation="x*y+z" x=$v y=$times z=$fld_210 assign=cha}
Charisma = {$cha}<br />
{elseif $k == 'V'}
{math equation="x*y+z" x=$v y=$times z=$fld_215 assign=vul}
Vulnarability = {$vul}<br />
{elseif $k == 'T'}
{math equation="x*y+z" x=$v y=$times z=$fld_184 assign=tru}
Trustworthyness = {$tru}<br />
{/if}
{/foreach}7 questions with 4 answers for each.
there are 8 character traits that the answers are drawn from but not in every set of answers.
Then after the 7 questions are asked, there are 8 tie breakers that score specifically on each trait, then
The score from the trait questions is added to the answers from the first 7 questions and the results are displayed.
My issue is that I need to find the top 2 values and display them as 'primary' and 'secondary' traits.
it's complicated and I have everything up to the finding the top 2.
Code: Select all
{php}{/php}
and
{$smarty->max($dom,$com,$att,$soc,$war,$cha,$vul,$tru)}



