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

        var table_id ="#tbl_view_sales_details";
        var table = $(table_id).DataTable({
            scrollY         : "700px",
           // scrollX         : "true",
           // scrollCollapse  : true,
            pageLength      : 50,
			processing: true,
            ajax: {
                url: "' . Yii::app()->createUrl('uploadsales/GetviewList') . '",
                type: "POST",
                cache : false,
                "data": function ( params ) {
                    params.YII_CSRF_TOKEN = "'.Yii::app()->request->csrfToken.'";
                    params.order_id="'.$model->id.'";
                }
            },
            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-tasks"></i> View Sales-<?php echo $model->id;  ?>
    </header>
    <div class="panel-body">
        <div class="tab-pane active">
            <ul class="clearfix form-ul material">
                
                <li class="col-sm-4">
                    <?php echo CHtml::textField('year', $model->year,array('data-label' => 'Year <span style="color:red">*</span>','readonly'=>'true')); ?>
                </li>
                <li class="col-sm-4">
                    <?php
                    $arr_months=Order::getmonths();
                    ?>
                    <?php echo CHtml::textField('month', $arr_months[(int)$model->month], array('data-label' => 'Month <span style="color:red">*</span>','readonly'=>'true')); ?>
                </li>
                <li class="col-sm-4">
                    <?php //echo CHtml::textField('order_date', date("d/m/Y", strtotime($model->order_date)), array('data-label' => 'Order Date <span style="color:red">*</span>','readonly'=>'true')); ?>
                </li>
            </ul>
        </div>
        <div class="custom-data-table">
            <table class="table table-hover table-bordered personal-task" id="tbl_view_sales_details">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC</th>
                        <th>Distributer</th>
                        <th>Qty</th>
                        <th>Amt</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC</th>
                        <th>Distributer</th>
                        <th>Qty</th>
                        <th>Amt</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</section>    
        
        
        
        
        
        
        