Adding sort algorythm

Wasted already 10hrs 17mins  on that project.

Took 2 minutes
This commit is contained in:
2020-08-07 15:30:57 +02:00
parent 08318bee66
commit 8bfe0c6205
5 changed files with 26 additions and 16 deletions

View File

@ -93,23 +93,33 @@ HTML;
{
throw new RuntimeException( 'Error while reading the questions in langauge file', 203 );
}
$questions = '';
$questions = '<div class="col s12 l6 xl6">';
$switch = (int)round( count( language::$lang_file['questions'] ) / 2 );
foreach( language::$lang_file['questions'] as $number => $question )
{
$questions .= <<<CHECKBOX
<label style="font-size: 1.15em;">
<label style="">
<input name="question_$number" type="checkbox" class="filled-in" />
<span class="black-text text-lighten-3">$question</span>
</label><br>
CHECKBOX;
if( (int)$number === $switch )
{
$questions .= '</div><div class="col l6 s12 xl6">';
}
}
$form_start = <<<HTML
<form action="" method="post">
<div class="row">
HTML;
$submit = language::$lang_file[language::CALCULATE];
$form_end = <<<HTML
<br>
</div>
</div>
<button class="btn waves-effect btn-large waves-light" type="submit" name="submit" value="checked">{$submit}
<i class="material-icons right">send</i>
</button>