<?php
/**
 * Created by PhpStorm.
 * User: pejot
 * Date: 2015-03-08
 * Time: 22:39
 */
global $ankieta;
global $data;
global $page;
$ankieta->writeGap();

$ankieta->writeGap();
//$ankieta->writeHeader("REKRUT");
//$ankieta->writeGap();

//[^uncheckById(["P2","P3","P4","P5"])^]
//[^showOrClean(input,["P2","P3","P4","P5","P6"])^]
//[^clean(["P2","P3","P4","P5","P6"])^]
//[^showOrClean($("input[name=P1]"),["P2"])^]


$answers=array();
$answers[1]='Bavaria';
$answers[2]='Carlsberg 0,0%';
$answers[3]='Desperados 0,0%';
$answers[4]='Heineken 0%';
$answers[5]='Karmi';
$answers[6]='Lech Free 0,0% (jasne pełne)';
$answers[7]='Lech Free 0,0% (smakowe)';
$answers[8]='Łomża Rader 0,0%';
$answers[9]='Łomża 0,0%';
$answers[10]='Miłosław';
$answers[11]='Okocim Radler 0,0%';
$answers[12]='Okocim 0,0%';
$answers[13]='Perła 0,0%';
$answers[14]='Somersby 0,0%';
$answers[15]='Tyskie 0,0%';
$answers[16]='Warka Radler 0,0%';
$answers[17]='Žatecký 0,0%';
$answers[18]='Żywiec 0,0% (niesmakowe)';
$answers[19]='Żywiec 0,0% smakowe (LimonŻ, GrejfruŻ, OranŻ)';
$answers[20]='inne [-OTHER-]';

$ankieta->writeCheckbox('S10','Jakie piwa bezalkoholowe <b>pił[a|] Pan[i|] w ciągu ostatnich 4 tygodni?</b> ',$answers,true, @clean($data['S10'],NULL),'NUMERIC','',"<span onClick=\"doLogicS10($(this).find('input:checkbox').attr('id'));\">","</span>");



?>
<div style="display:none;">
<?
    $ankieta->writeInputNumber("S10ILE","ILE ODP",@clean($data['S10ILE']), true,'',"NUMERIC","2.0",false,2);
    ?>
</div>

<script type="text/javascript">

    function doLogicS10() {
        console.log('doLogicS10');
        var ile = $('input[name="S10[]"]:checkbox:checked').length;
        console.log('ile',ile);
        $('#S10ILE').val(ile);
    }

</script>


