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

        var table_id ="#tbl_view_backlog_details";
        var table = $(table_id).DataTable({
            scrollY         : "700px",
           // scrollX         : "true",
           // scrollCollapse  : true,
            pageLength      : 50,
			processing: true,
            ajax: {
                url: "' . Yii::app()->createUrl('uploadbacklog/GetbacklogviewList') . '",
                type: "POST",
                cache : false,
                "data": function ( params ) {
                    params.YII_CSRF_TOKEN = "'.Yii::app()->request->csrfToken.'";
                    params.upload_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 Backlogsales-<?php echo $model->id;  ?>
    </header>
    <div class="panel-body">
        <div class="tab-pane active">
            <ul class="clearfix form-ul material">
                    <?php
                    $arr_months=Order::getmonths();
                    ?>
                <li class="col-sm-4">
                    <?php echo CHtml::textField('added_date', date("d/m/Y", strtotime($model->added_date)), array('data-label' => 'Date <span style="color:red">*</span>','readonly'=>'true')); ?>
                </li>
                <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 echo CHtml::textField('month', $arr_months[(int)$model->month], array('data-label' => 'Month <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_backlog_details">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC Code</th>
                        <th>From</th>
                        <th>To</th>
                        <th>Total Quantity</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC Code</th>
                        <th>From</th>
                        <th>To</th>
                        <th>Total Quantity</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</section>    