<section class="panel">
    <header class="panel-heading clearfix panel-theame">
        <i class="fa fa-tasks"></i> Category wise Order Summary 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::dropdownList('categorywise_report_year',date('Y'),Order::getyear(),array('class' => '','data-label'=>'Year'));?>
                </li>
                <li class="col-sm-2">
                    <?php echo CHtml::dropdownList('categorywise_report_month', '', Order::getmonths(),array('class' => '','data-label'=>'Month'));?>
                </li>
                <li class="col-sm-2">
                    <?php echo CHtml::dropdownList('categorywise_report_type', 'Q', ['Q'=>'Quantity','A'=>'Amount'],array('class' => '','data-label'=>'Type'));?>
                </li>
            </ul>
        </div>
        <div class='btn-wrap text-center'> 
            <button onclick="excelcategorywise();return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-file-excel-o"></i> &nbsp;Current FY</button>
            <button onclick="excelcategorywisefuture();return false;" class='plan-save-btn btn btn-theme' target="_blank"><i class="fa fa-file-excel-o"></i> &nbsp;Next FY</button>
        </div>
        <div class="panel-body">
            <div style="display:none;" id="div_categorywise_load_content">
            </div>
        </div>
    </div>
</section>
<?php $cs = Yii::app()->getClientScript(); 

//Excel done by jisha on 25-6-2025
$cs->registerScript("excelcategorywise", "function excelcategorywise(){
    var us_year = $('#categorywise_report_year').val(); 
    var us_month = $('#categorywise_report_month').val();
    var us_type = $('#categorywise_report_type').val();
    if(us_year>0 && us_month >0){
        if(us_type=='Q')
        window.open($('#liveSite').val()+'index.php?r=ordertakingreport/ExcelCategoryWiseQty&future_type=0&us_year='+us_year+'&us_month='+us_month+'', '_blank');
        else
        window.open($('#liveSite').val()+'index.php?r=ordertakingreport/ExcelCategoryWiseAmt&future_type=0&us_year='+us_year+'&us_month='+us_month+'', '_blank');
        
    }else{
        t8.error('Please Select Month and Year');
    }
}", CClientScript::POS_HEAD);
$cs->registerScript("excelcategorywisefuture", "function excelcategorywisefuture(){
    var us_year = $('#categorywise_report_year').val(); 
    var us_month = $('#categorywise_report_month').val();
    var us_type = $('#categorywise_report_type').val();
    if(us_year>0 && us_month >0){
        if(us_type=='Q')
        window.open($('#liveSite').val()+'index.php?r=ordertakingreport/ExcelCategoryWiseQty&future_type=1&us_year='+us_year+'&us_month='+us_month+'', '_blank');
        else
        window.open($('#liveSite').val()+'index.php?r=ordertakingreport/ExcelCategoryWiseAmt&future_type=1&us_year='+us_year+'&us_month='+us_month+'', '_blank');
        
    }else{
        t8.error('Please Select Month and Year');
    }
}", CClientScript::POS_HEAD);