| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function generateDetailHtml($type,$values){ |
||
| 35 | if($type === 'select'){ |
||
| 36 | $html = ''; |
||
| 37 | $html .= '<select class="form-control">'; |
||
| 38 | $html .= '<option value="">Seleziona</option>'; |
||
| 39 | foreach($values as $value){ |
||
| 40 | $html .= '<option value="'.$value->id.'">'.$value->value.'</option>'; |
||
| 41 | } |
||
| 42 | $html .= '</select>'; |
||
| 43 | return $html; |
||
| 44 | } |
||
| 45 | if($type === 'checkbox'){ |
||
| 46 | $html = ''; |
||
| 47 | |||
| 48 | foreach($values as $value){ |
||
| 49 | $html .= '<div class="custom-control custom-checkbox">'; |
||
| 50 | $html .= '<input type="checkbox" class="custom-control-input" id="defaultUnchecked_'.$value->id.'">'; |
||
| 51 | $html .= '<label class="custom-control-label" for="defaultUnchecked_'.$value->id.'">'.$value->value.'</label>'; |
||
| 52 | $html .= '</div>'; |
||
| 53 | } |
||
| 54 | |||
| 55 | return $html; |
||
| 56 | } |
||
| 60 |