 <section class="panel">
    <header class="panel-heading">
        EXPORT SHIPMENT NEW REPORT
    </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>
                </ul>
        </div>
        <div class='btn-wrap text-center'> 
            <button onclick="excel(1);return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-download"></i> Excel</button>
            <!--<button onclick="excel(2);return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-download"></i> Invoice Wise</button>-->
        </div>
    </div>
</section>


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

$cs->registerScript("excel", "function excel(type){
        
       
        var from_date = $('#from_date').val(); 
        var to_date = $('#to_date').val();

        if( type == 1)
            window.open($('#liveSite').val()+'index.php?r=reports/export_shipment_new_excel&from_date='+from_date+'&to_date='+to_date, '_blank');
        else
            window.open($('#liveSite').val()+'index.php?r=reports/export_shipment_excel_invoice&from_date='+from_date+'&to_date='+to_date, '_blank');
}", CClientScript::POS_HEAD);
