<?php

class DolphinHSite
{
    public static function buttonGroupList($list, $field, $select)
    {
        $htm = '';
        $htm .= '<span class="span-btn-group1 btn-group1">';
        foreach ($list as $id => $name) {
            $class = $id == $select ? ' active' : '';
            $htm .= '<button type="button" onclick="$(\'#' . $field . '-btn\').val(' . $id . ');" class="btn btn-default' . $class . '">' . $name . '</button>';
        }
        $htm .= '</span>';

        $htm .= CHtml::hiddenField($field, $select, array('id' => $field . '-btn'));

        return $htm;
    }
}

?>