<?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]='Captain Jack';
$answers[2]='Corona';
$answers[3]='Desperados';
$answers[4]='Fortuna';
$answers[5]='Garage';
$answers[6]='Gingers';
$answers[7]='Hardmade';
$answers[8]='Lech Shandy';
$answers[9]='Okocim Radler';
$answers[10]='Redd’s';
$answers[11]='Somersby';
$answers[12]='Warka Radler';
$answers[13]='Żywiec (LimonŻ, GrejfruŻ, OranŻ)';
$answers[14]='inne [-OTHER-]';
$answers[15]='Inne [-OTHER-]';
$answers[16]='Inne [-OTHER-]';
$answers[17]='Inne [-OTHER-]';
$ankieta->writeCheckbox('S8','Jakie piwa smakowe z alkoholem <b>kupił[a|] Pan[i|] w ciągu ostatnich 4 tygodni</b>? ',$answers,true, @clean($data['S8'],NULL),'NUMERIC','',"<span onClick=\"doLogicS8($(this).find('input:checkbox').attr('id'));\">","</span>");



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

<script type="text/javascript">

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

</script>


