<?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"])^]

$s8answers=[];
for ($i=1;$i<=17;$i++) {
    $s8answers[$i]=$ankieta->getValue('S8_'.$i);
}

$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->writeRadio('S9','A które piwo smakowe z alkoholem pije Pan[i|] najczęściej? ',$answers,true,@clean($data['S9']));

?>

<script type="text/javascript">

    $(document).ready(function() {
        <?
        foreach ($s8answers as $code=>$val) {
            if ($val==0) {
                print '$("#S9_'.$code.'").fancyfields("disable"); ';
            }
        }
        ?>
    });

</script>

