$selected_characteristic = array(); //para cada plataforma, insere os id_plataforma escolhidos no array foreach ($model->characteristic as $characteristic) { array_push($selected_characteristic, $characteristic->id); } ?> <div> <?php echo TbHtml::label($model->getAttributeLabel('characteristic'), 'Characteristic'); ?> <p class="help-block">Choose the platform's characteristics:</p> <div class="model-char"> <div class="portlet-content"> <?php echo TbHtml::CheckBoxList('Characteristic', $selected_characteristic, CHtml::listData(Characteristic::model()->findAll(), 'id', 'name'), array('template' => '{input} {label}')); ?> <?php echo $form->error($model, 'characteristic'); ?> </div> </div> </div> </div> <?php $this->endWidget(); ?> </div><!-- form -->
//var_dump($model->platforms); foreach ($model->devices as $device) { array_push($selected_devices, $device->ID); } ?> <br/><br/> <div> <?php echo TbHtml::label($model->getAttributeLabel('devices'), 'Device'); ?> <div class="portlet-content" id="divprincipal"> <?php echo TbHtml::CheckBoxList('Devices', $selected_devices, CHtml::listData(Device::model()->findAll(), 'ID', 'DESCRIPTION'), array('template' => '{input} {label}')); ?> <?php echo $form->error($model, 'device'); ?> </div> </div> --> </br> <?php //echo $form->dropDownListControlGroup($model,'ID_PLATFORM',$platformsArray, array('span'=>5, 'empty' => '--- Escolha uma plataforma ---'));
//var_dump($model->platforms); foreach ($model->platforms as $platform) { array_push($selected_platforms, $platform->id); } ?> <div> <?php echo TbHtml::label($model->getAttributeLabel('platforms'), 'Platforms'); ?> <div class="portlet-content"> <!--echo TbHtml::inlineCheckBoxList('Platforms',/*'', $platformsArray,*/--> <?php echo TbHtml::CheckBoxList('Platforms', $selected_platforms, CHtml::listData(Platforms::model()->findAll(), 'id', 'name'), array('id' => 'item', 'template' => '{input} {label}', 'onchange' => 'verificaChecks()')); ?> <?php echo $form->error($model, 'platforms'); ?> </div> </div> </br> </div> <?php $this->endWidget(); ?>
$selected_category = array(); //para cada plataforma foreach ($model->category as $cat) { array_push($selected_category, $cat->id); } ?> <div> <?php echo TbHtml::label($model->getAttributeLabel('category'), 'Category'); ?> <p> <div class="portlet-content"> <?php echo TbHtml::CheckBoxList('Category', $selected_category, CHtml::listData(Category::model()->findAll(), 'id', 'name'), array('template' => '{input} {label}')); ?> <?php echo $form->error($model, 'category'); ?> </div> </p> <br/><br/> </div> </div></div></div></div></div></div> <br/>
foreach ($model->devices as $device) { array_push($selected_devices, $device->ID); } ?> <div> <?php echo TbHtml::label($model->getAttributeLabel('devices'), 'Device'); ?> <div class="portlet-content" id="divprincipal"> <?php echo TbHtml::CheckBoxList('Devices', $selected_devices, $devicesArray, array('template' => '{input} {label}')); ?> <?php echo $form->error($model, 'device'); ?> </div> </div> </br> <?php //echo $form->dropDownListControlGroup($model,'ID_PLATFORM',$platformsArray, array('span'=>5, 'empty' => '--- Escolha uma plataforma ---'));