<div class="row">
    <div class="widget-box">
        <div class="widget-header">
            <p class="widget-title">Cập nhật thông tin Nhạc sĩ</p>
        </div>
        <div class="widget-body">
            <div class="widget-main">
                <?php
                $url = (isset($call_back) && $call_back) ? 'backend/cmsTrack/addComposer/'.$track[0]['id'].'/'.$call_back : 'backend/cmsTrack/addComposer/'.$track[0]['id'];
                $attributes = array('class' => 'form-horizontal', 'id' => 'myform');
                echo form_open_multipart(base_url($url), $attributes);
                ?>
                <div class="form-group">
                    <label class="col-lg-3"></label>
                    <div class="col-lg-3">
                        <input type="hidden" name="id" value="<?php echo $track[0]['id']; ?>" />
                        <?php
                        if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');}
                        ?>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3">Tên bài hát (*)</label>
                    <div class="col-lg-3">
                        <p><?php echo $track[0]['title']; ?></p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3">Chọn Nhạc sĩ</label>
                    <div class="col-lg-3">
                        <select id='form-field-select-3' name="composer" style='width: 200px;'
                            class="chosen-select form-control" data-placeholder="Choose a State...">
                            <option value="0">- Chọn -</option>
                            <?php foreach ($list_user as $composers): ?>
                            <option value="<?php echo $composers['id']; ?>"
                                <?php if($composer && $composer == $composers['id']){ echo 'selected="selected"'; } else  echo ''; ?>>
                                <?php echo $composers['full_name']; ?>
                            </option>
                            <?php endforeach; ?>
                        </select>
                        <?php if(validation_errors()){echo form_error('composer', '<div class="error">', '</div>');} ?>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-lg-3">
                        <a href="<?php echo base_url('backend/cmsTrack/showTrack/'.$track[0]['id']);?>"
                            onclick="return confirm('Bạn có chắc chắn muốn quay lại trang chi tiết không?')">
                            <button type="button" class="btn btn-sm btn-default">
                                <i class="ace-icon fa fa-arrow-left"></i>Quay lại
                            </button>
                        </a>
                    </div>
                    <div class="col-lg-4">
                        <button class="btn btn-sm btn-primary" type="submit" name="btnSave">
                            <i class="ace-icon fa fa-check bigger-110"></i>Lưu lại
                        </button>
                    </div>
                </div>
                <?php echo form_close(); ?>
            </div>
        </div>
    </div>
</div><!-- /.row -->
<script>
    $(document).ready(function () {
        $('.chosen-select').chosen({
            allow_single_deselect: true,
            no_results_text: "Không có kết quả cần tìm"
        });
    });
</script>
