 <section class="panel">
    <header class="panel-heading">
       Transaction History
    </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('from_date', date('01/m/Y'),array('class' => 'datepicker','data-label'=>'From'));?>
                    </li>
                    <li class="col-sm-4">
                        <?php echo CHtml::textField('to_date', date('d/m/Y'),array('class' => 'datepicker','data-label'=>'To'));?>
                    </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 from_date = $('#from_date').val();
    var to_date = $('#to_date').val();

    window.open($('#liveSite').val()+'index.php?r=reports/export_transaction&part_number='+part_number+'&from_date='+from_date+'&to_date='+to_date, '_blank');
}", CClientScript::POS_HEAD);
