<style>
    .defaultSkin table{
        width: 200px !important;
    }
    /*    .mceFirst{
            width: 10% !important;
        }*/
    .defaultSkin table tbody tr td{
        /*width: 10px !important;*/
    }
</style>
<div class="col-sm-10">
    <div class="row ">
        <div class="col-sm-12 "><br></div>
        <div class="col-sm-12 ">
            <div class="col-sm-12">
                <label>Update Bug Report</label><br>
            </div>
            <div class="col-sm-12"> <hr><br> </div>

            <div class="col-sm-10 col-sm-offset-1">
                <?php
                $url = 'edit-bug-report/' . $bug_report_edit_info->support_id;
                
                echo form_open_multipart($url, 'class="cmxform" id="formID2" name="updateidea"');
                ?>
                <div class="col-sm-12 form-group">
                    <div class="input-group">
                        <input type="type"
                               class="form-control validate[required]" 
                               name="bug_subject" 
                               id="bug_subject" 
                               value='<?php echo $bug_report_edit_info->support_title; ?>'
                               placeholder="Please Type Bug Report Subject" >
                        <span class="input-group-addon" id="basic-addon1"><i class="fa fa-lightbulb-o"></i></span>
                    </div>
                </div>
                <div class="col-sm-12 form-group">
                    <div class="input-group text-left" >
                        <label>Description</label>
                        <textarea name="bug_description" class="form-control  resoulation1280 " rows="4"   >
                        <?php echo $bug_report_edit_info->support_description; ?>
                        </textarea>
                        <input type="hidden" name="support_id" value="<?php echo $bug_report_edit_info->support_id; ?>">
                    </div>                   
                </div>
                <div class="form-group col-sm-8 ">
                    <script> $(":file").filestyle({icon: false});</script>
                    <input type="file"
                           id="update_bug_file"
                           name="update_bug_file"
                           onchange="getupdatebugfile(this)"
                           class="filestyle" 
                           data-icon="false">
                </div>
                <div class="form-group col-sm-4">
                    <span id="view_file" style="display: none">
                        <img id="src_file" src="" height="40" width="50">
                    </span>
                    <span class="text-left" 
                          id="upload_file">
                    </span>
                </div>
                <div class="col-sm-12 form-group">                    
                    <span id="view_image">
                        <?php
                        if ($bug_report_attachment) {

                            $file_name = explode('.', $bug_report_attachment->support_attachment_location);
                            switch ($file_name[1]) {
                                case $file_name[1] == 'jpg' || $file_name[1] == 'png' || $file_name[1] == 'gif':
                                    ?>
                                    <a href="">
                                        <img id="view" src="<?php echo base_url() . 'content-library/' . $bug_report_attachment->url . '/' . $bug_report_attachment->support_attachment_location ?>" height="40" width="50">

                                    </a>
                                    <?php
                                    break;
                                case $file_name[1] == 'doc' || $file_name[1] == 'docx' || $file_name[1] == 'zip':
                                    ?>         
                                    <a href="" id="view">
                                        <?php
                                        $file_name = explode('/', $bug_report_attachment->support_attachment_location);
                                        echo $file_name[1];
                                        ?>
                                    </a>                                             
                                    <?php
                                    break;
                                default:
                                    ?>
                                    <a href="" id="view">
                                        <img id="view" src="<?php echo base_url() . 'image/unknown.png'; ?>" height="40" width="50">
                                    </a>
                                <?php
                            }
                        }
                        ?>
                    </span> 
                    <span id="view_file_delete_icon">
                            <?php if ($bug_report_attachment) { ?>
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#deletebugfilealert<?php echo $bug_report_attachment->support_attachment_id ?>">
                                <i class="fa fa-times" title="Delete"></i>
                            </a>                       
                            <div class="modal" style="" id="deletebugfilealert<?php echo $bug_report_attachment->support_attachment_id ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content" style="top: 180px;border: 5px solid #80c12c;border-top: 20px solid #80c12c !important;margin: 0 auto;width: 450px">           
                                        <div class="modal-body">
                                            <h4 class="text-center">Are you sure want to Delete this attachment?</h4>
                                        </div>
                                        <div class="modal-footer">
                                            <div  class="col-sm-12">               
                                                <button onclick="deletebugattachment('<?php echo base_url(); ?>delete-bug-file', '<?php echo base_url(); ?>edit-bug-report/<?php echo $bug_report_edit_info->support_id; ?>', '<?php echo $bug_report_attachment->support_attachment_id ?>')" style="margin-left: 90px" type="button" class="btn btn-success  col-sm-2" data-dismiss="modal">Yes</button>
                                                <button type="button" style="margin-left: 20px" class="btn btn-danger col-sm-2 col-sm-offset-4" data-dismiss="modal">No</button>
                                            </div>
                                        </div>            
                                    </div>
                                </div>
                            </div> 
                        <?php }
                        ?>
                    </span>                    
                </div>
            </div>
            <div class="col-sm-12 form-group"><br></div>
            <div class="col-sm-12">
                <div class=" col-sm-6 col-sm-offset-3 form-group">
                    <input class="green-btn btn btn-default" value="Update Bug Report" type="submit">
                </div>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/support/support.js"></script>
