<?php
$cs = Yii::app()->getClientScript();
$cs->registerScript("loadNotes", '
        $(document).ready(function() {

        var table_id ="#tbl_notes_details";
         var cust_id=$("#hid_cust_id").val();
        var table = $(table_id).DataTable({
             scrollY         : "250px",
           // scrollX         : "true",
           // scrollCollapse  : true,
           // pageLength      : 50,
            
            ajax: {
             data : {"vendor_id":cust_id},
                url: "' . Yii::app()->createUrl('vendor/getNoteslist') . '",
                type: "POST",
                cache : false,
            },
             aoColumnDefs    : [
                { "bSortable": false, "aTargets": [1,2] }
                ],
                 bInfo : false,
               bPaginate: false,
           
            serverSide:     true,
            fixedColumns:   true,
			processing: true,
            fixedHeader: {
                headerOffset: $("header.main").outerHeight()
            }
        } );
        $(".dataTables_scrollFoot").hide();
    });', CClientScript::POS_HEAD);

  ?>
    <section class="panel">
        <header class="panel-heading clearfix panel-theame">
            <i class="fa fa-user"></i> Notes
            <?php // print_r(Yii::app()->user->havePermissionOn);?>
            <?php //if(isset(Yii::app()->user->havePermissionOn['customer_add_edit']) && Yii::app()->user->havePermissionOn['customer_add_edit'] == 1){?>
            <div class="pull-right">
                <button class="btn btn-sm btn-theme" id="add_popup" onclick="loadPopupModal('vendor/createNote&id=<?php echo $note_id ?>','Add Note','lg')"><i class="fa fa-plus"></i> ADD</button>
            </div>
            <?php // }?>
        </header>
        <div class="panel-body">
            <div class="custom-data-table">
                <table class="table table-hover table-bordered personal-task" id="tbl_notes_details">
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>Note</th>
                             <th>Created by</th>
                            <th>Created on</th>
                            
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                             <th>No</th>
                            <th>Note</th>
                             <th>Created by</th>
                              <th>Created on</th>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </section>
