DivisionByZeroError

Division by zero

/var/www/html/application/helpers/admin/statistics_helper.php(2610)

2598             if (isset($_POST['noncompleted']) and ($_POST['noncompleted'] == 1)) {
2599                 //counter
2600                 $i = 0;
2601 
2602                 while (isset($gdata[$i])) {
2603                     if (isset($showaggregated_indice_table[$i]) && $showaggregated_indice_table[$i] == "aggregated") {
2604                         // do nothing, we don't rewrite aggregated results
2605                         // or at least I don't know how !!! (lemeur)
2606                     } else {
2607                         //we want to have some "real" data here
2608                         if ($gdata[$i] != "N/A") {
2609                             //calculate percentage
2610                             $gdata[$i] = ($grawdata[$i] / $TotalCompleted) * 100;
2611                         }
2612                     }
2613 
2614                     //increase counter
2615                     $i++;
2616                 }    //end while (data available)
2617             }    //end if -> noncompleted checked
2618 
2619             //noncompleted is NOT checked
2620             else {
2621                 //calculate total number of incompleted records
2622                 $TotalIncomplete = max(($results - $TotalCompleted), 0); // don't show negative number

Stack Trace

#0
+
 /var/www/html/application/helpers/admin/statistics_helper.php(3713): statistics_helper->displayResults()
3708                 $outputs = $this->buildOutputList($rt, $language, $surveyid, $outputType, $sql, $sLanguageCode);
3709                 $sOutputHTML .= $outputs['statisticsoutput'];
3710                 //2. Collect and Display results #######################################################################
3711                 if (isset($outputs['alist']) && $outputs['alist']) {
3712                     //Make sure there really is an answerlist, and if so:
3713                     $display = $this->displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $usegraph, $browse, $sLanguageCode);
3714                     $sOutputHTML .= $display['statisticsoutput'];
3715                     $aStatisticsData = array_merge($aStatisticsData, $display['astatdata']);
3716                 }    //end if -> collect and display results
3717 
3718 
#1
+
 /var/www/html/application/controllers/admin/statistics.php(469): statistics_helper->generate_html_chartjs_statistics()
464         //Show Summary results
465         if (isset($summary) && $summary) {
466             $outputType = Yii::app()->request->getPost('outputtype', 'html');
467             switch ($outputType) {
468                 case 'html':
469                     $statisticsoutput .= $helper->generate_html_chartjs_statistics($surveyid, $summary, $summary, $usegraph, $outputType, 'DD', $statlang);
470                     break;
471                 case 'pdf':
472                     $helper->generate_statistics($surveyid, $summary, $summary, $usegraph, $outputType, 'D', $statlang);
473                     exit;
474                     break;
#4
+
 /var/www/html/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal()
81             $oMethod = new ReflectionMethod($this, $sDefault);
82         }
83 
84         // We're all good to go, let's execute it
85         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
86         return parent::runWithParamsInternal($this, $oMethod, $params);
87     }
88 
89     /**
90      * Some functions have different parameters, which are just an alias of the
91      * usual parameters we're getting in the url. This function just populates
2022-02-16 10:47:51 Apache/2.4.51 (Debian) Yii Framework/1.1.24-dev