- Posts: 89
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
After submission, the dummy question will then appear.
require_once 'meekrodb.class.php'; $pos = strpos($_SERVER["HTTP_HOST"],'ocalhost'); DB::$host='myHost'; DB::$user='myUsername'; DB::$password='myPassword'; DB::$dbName='myDatabaseName'; }
$survey=111111; $tbl_daten='lime_survey_'.$survey; $col_name=$survey.'X183X20282'; $col_gender=$survey.'X183X20284'; $col_age=$survey.'X183X20283'; ...
$daten_male=DB::query("SELECT {$col_height}/100 as height, {$col_weight} as weight FROM {$tbl_daten} WHERE {$col_gender}=1 AND not isnull(submitdate)"); $daten_female=DB::query("SELECT {$col_height}/100 as height, {$col_weight} as weight FROM {$tbl_daten} WHERE {$col_gender}=2 AND not isnull(submitdate)"); $daten_BMI=DB::query("SELECT {$col_BMI}, SUM(IF({$col_BMI} <20, 1, 0)) AS A1, SUM(IF({$col_BMI} BETWEEN 20 and 30, 1, 0)) AS A2, SUM(IF({$col_BMI} > 30, 1, 0)) AS A3 FROM {$tbl_daten} WHERE not isnull(submitdate) GROUP BY {$col_gender}"); $daten_Verlauf=DB::query("SELECT Date(submitdate) as Datum,sum(IF ({$col_gender}=1,1,0)) as male,sum(IF ({$col_gender}=2,1,0)) as female FROM {$tbl_daten} WHERE not isnull(submitdate) group by Datum order by Datum");
... series: [{ name: 'weiblich', type: 'scatter', color: 'rgba(83,223, 83, .5)', data: [ <?php $cm=count($daten_female); for ($i=0;$i<$cm;$i++) { echo '['.$daten_female[$i]['height'].','.$daten_female[$i]['weight'].'],'; } ?> ] }, { name: 'männlich', type: 'scatter', ...
Just I did not install a local copy of LS to understand its architecture and backend database, and this has heavily restricted my flexibility to control settings and parameters. Trying to do things from a frontend access without access to backend settings, is a bit of a pain.