<?php

$html = '<div class="routingInboundTargetFlex">';
$html .= CHtml::dropDownList(
                $targetTypeName, $data->targetType, $targetTypes, array(
            'class' => 'scalable routingInboundTargetType',
            'data-translation-target' => 'ROUTINGINBOUND_MODEL_TARGETS',
            'data-id' => $data->id
                )
);


$html .= '<div class="targetNumber keyOptions scalable-container routingInboundTarget "' . $visbleStyle . '">';
$html .= CHtml::dropDownList(
                $targetName, $data->targetType . "_" . $data->target, $listData, array(
            'class' => 'scalable',
            'data-translation-target' => 'ROUTINGINBOUND_MODEL_TARGETS',
                )
);
$html .= '</div>';


$visbleStyle = 'style="display:none;"';
if ($data->targetType == TargetType::UserVoiceMail) {
    $visbleStyle = 'style="display:inline-block;"'; //FIXME
}

$html .= '<div class="targetAnnouncement keyOptions scalable-container routingInboundTargetAnnouncement"' . $visbleStyle . '>';
$html .= CHtml::dropDownList(
                $announcementName, $data->announcement, $announcementList, array(
            'class' => 'scalable',
            'data-translation-target' => 'ROUTINGINBOUND_MODEL_TARGETS'
                )
);
$html .= '</div>';

$visbleStyle = '';
if ($data->targetType == TargetType::Manual) {
    $visbleStyle = 'style="display:inline-block;"'; //FIXME
}

$html .= '<div class="targetCustomNumber keyOptions scalable-container routingInboundTarget"' . $visbleStyle . '>';
$name = 'RoutingInbound[' . $data->id . '][customNumber]';
$html .= CHtml::textField(
                $name, $data->targetType == TargetType::Manual ? $data->target : '', array(
            'class' => 'hideableInput scalable scalable-manualTarget',
            'data-translation-id' => 'IVR_MODEL_TARGET_CUSTOM_NUMBER'
                )
);
$html .= '</div>';
echo $html;
