<?php

$html = '<div class="targetNumber keyOptions scalable-container"' . $visbleStyle . '>';
$html.= CHtml::dropDownList($name, $selectedPattern, $listData, array(
            'class' => 'scalable',
            'data-translation-target' => 'ROUTINGINBOUND_MODEL_PATTERNS',
            'onChange' => 'checkManualNumber(this);',
                )
);
$html.= '</div>';

$visbleStyle = '';
if ($data->patternType == PatternType::Manual) {
    $visbleStyle = 'style="display:inline-block;"';
}

$html.= '<div class="targetCustomNumber keyOptions scalable-container"' . $visbleStyle . '>';
$name = 'RoutingInbound[' . $data->id . '][customPattern]';
$html.= CHtml::textField($name, $data->patternType == PatternType::Manual ? $data->pattern : '', array(
            'class' => 'hideableInput scalable scalable-manualTarget',
            'data-translation-id' => 'IVR_MODEL_TARGET_CUSTOM_NUMBER'
                )
);
$html.='<i class="hideableClose scalable"></i></div>';

echo $html;
