 <section class="panel">
    <header class="panel-heading">
       Balance Quantity
    </header>
    <div class="panel-body">
        <div id="div_master_report_leadlist">
                <ul class="clearfix form-ul material"> 
                    
                    <li class="col-sm-4">
                        <?php echo CHtml::textField('part_number', '',array('class' => 'tooltipster','data-label'=>'Part Number'));?>
                    </li>
                    <li class="col-sm-4">
                        <?php echo CHtml::textField('bill_of_entry', '',array('data-mask' => '999-99999999-99', 'class' => 'tooltipster','data-label'=>'BOE'));?>
                    </li>
                    <li class="col-sm-4">
                        <?php echo CHtml::dropdownlist('warehouse','',Warehouses::getWarehouses(), array('prompt' => 'All', 'class' => 'tooltipster', 'data-label' => 'Warehouse')); ?>
                    </li>
                   
                </ul>
        </div>
        <div class='btn-wrap text-center'> 
            <!-- <button onclick="loadTable();return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-eye"></i> VIEW</button> -->
            <button onclick="excel();return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-download"></i> CSV</button>
        </div>
    </div>
</section>

<section class="panel">
    <div class="panel-body" id="details_div" style="display : none">
    </div>
</section>


<?php $cs = Yii::app()->getClientScript(); 

$cs->registerScript("excel", "function excel(){
    var part_number = $('#part_number').val();
    var boe = $('#bill_of_entry').val();
    var warehouse = $('#warehouse').val();
    window.open($('#liveSite').val()+'index.php?r=reports/exportBalanceqty&part_number='+part_number+'&boe='+boe+'&warehouse='+warehouse, '_blank');
}", CClientScript::POS_HEAD);

$cs->registerScript("loadTable",  "function loadTable(){
        
        var part_number = $('#part_number').val();

        $('#loader').show();
        
        $.ajax({
            type: 'POST',
            url: '" . Yii::app()->createUrl('reports/viewBalanceqty') . "',
            data: {'part_number' : part_number},
            success: function(data)
            {
                $('#details_div').html(data);
                $('#details_div').show();
                $('#loader').hide();
            }
        });

};", CClientScript::POS_HEAD);