<?php
$cs = Yii::app()->getClientScript();
$cs->registerScript("downloadOTExcel", "function downloadOTExcel(){
    var ot_report_id = $('#OT_ot_report_id').val();
    var distributer_id = $('#OT_distributer_id').val();
    var region_id = $('#OT_region_id').val();
    var product_cat_id = $('#OT_product_cat_id').val();
    window.open($('#liveSite').val()+'index.php?r=Ordertakingreport/DownloadOrderTakingReport&ot_report_id='+ot_report_id+'&distributer_id='+distributer_id+'&region_id='+region_id+'&product_cat_id='+product_cat_id, '_blank');   
}", CClientScript::POS_HEAD);
?>
<div class="tab-content">
    <div class="tab-pane active">
        <ul class="clearfix form-ul material">
            <?php echo CHtml::hiddenField('OT_ot_report_id', $ot_report_id); ?>
            <li class="col-sm-4">
                <?php echo CHtml::dropDownList('OT_distributer_id','', Distributers::getDistributers(), array('data-label' => 'Distributor', 'empty'=>'-Select-','data-search'=>'true')); ?>
            </li>
            <li class="col-sm-4">
            <?php echo CHtml::dropDownList('OT_product_cat_id','', MasProductCategory::getProductCategory(), array('data-label' => 'Product category', 'empty' => '-Select-')); ?>
            </li>
            <li class="col-sm-4">
                <?php echo CHtml::dropDownList('OT_region_id','', MasRegion::getRegions(), array('data-label' => 'Region','empty'=>'-Select-')); ?>
            </li>
            
        </ul>
    </div>
</div>
<div class= "modal-footer">
<button type="button"  class="btn btn-sm btn-theme" onclick="downloadOTExcel();"><i class="fa fa-download"></i>Excel</button>
</div>