 <section class="panel">
    <header class="panel-heading">
       <?php $heading = ( $from == 'incoming' ) ?  'INBOUND COST REPORT' : 'OUTBOUND COST REPORT';  echo $heading; ?>
    </header>
    <div class="panel-body">
        <div id="div_master_report_leadlist">
                <ul class="clearfix form-ul material"> 
                    <li class="col-sm-2">
                        <?php echo CHtml::textField('from_date','',array('class' => 'datepicker','data-label'=>'From'));?>
                    </li>
                    <li class="col-sm-2">
                        <?php echo CHtml::textField('to_date', '',array('class' => 'datepicker','data-label'=>'To'));?>
                    </li>
                    <li class="col-sm-4">
                        <?php echo CHtml::textField('bill_of_entry', '',array('class' => 'tooltipster','data-label'=>'BOE'));?>
                    </li>
                </ul>
        </div>
        <div class='btn-wrap text-center'> 
            <button onclick="excel();return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-download"></i> Download</button>
        </div>
    </div>
</section>


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

$cs->registerScript("excel", "function excel(){
        
       
        var from_date = $('#from_date').val(); 
        var to_date = $('#to_date').val();
        var bill_of_entry = $('#bill_of_entry').val();
        var bill_from_date = $('#bill_from_date').val();
        var bill_to_date = $('#bill_to_date').val();
        
        window.open($('#liveSite').val()+'index.php?r=reports/generatecosteport&type=".$from."&from_date='+from_date+'&to_date='+to_date+'&bill_of_entry='+bill_of_entry, '_blank');
}", CClientScript::POS_HEAD);
