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

        var table_id ="#tbl_view_inventoryupload_details";
        var table = $(table_id).DataTable({
            scrollY         : "700px",
           // scrollX         : "true",
           // scrollCollapse  : true,
            pageLength      : 50,
			processing: true,
            ajax: {
                url: "' . Yii::app()->createUrl('inventoryupload/GetinventoryviewList') . '",
                type: "POST",
                cache : false,
                "data": function ( params ) {
                    params.YII_CSRF_TOKEN = "'.Yii::app()->request->csrfToken.'";
                    params.inventory_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 Inventory Uploads-<?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('uploaded_date', date("d/m/Y", strtotime($model->uploaded_date)), array('data-label' => 'Uploaded 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 $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>
            </ul>
        </div>
        <div class="custom-data-table">
            <table class="table table-hover table-bordered personal-task" id="tbl_view_inventoryupload_details">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC Code</th>
                        <th>Model</th>
                        <th>Total Quantity</th>
                        <th>Year</th>
                        <th>Month</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>No</th>
                        <th>Category</th>
                        <th>GMC Code</th>
                        <th>Total Quantity</th>
                        <th>Inventory Quantity</th>
                        <th>Year</th>
                        <th>Month</th>
                        <th>Actions</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</section>