<button ng-show="isChanges" class="btn btn-primary margin-left_13" id="send_mail" ng-click="setDownloadData()" role="button"  title="<?php echo $this->lang->line('tool_tip_download_report')?>">Export</button>
<a ng-show="!isChanges" class="btn btn-primary margin-left_13" id="send_mail" onclick="showDownloadForm(); return false;" role="button"  title="<?php echo $this->lang->line('tool_tip_download_report')?>" href="#">Export</a>
<script type="text/javascript">
    function showDownloadForm(title) {
        $(document).trigger('exportModal');
        var sql =  $('#angularSQLString').val(),
            sqlSortColumn =  $('#angularSQLSortColumn').val(),
            sqlSortColumnDesc =  $('#angularSQLSortDescending').val(),
            includes =  $('#angularhostsContextInclude').val(),
            excludes =  $('#angularhostsContextExclude').val(),
            category = $('#reportCategory').val(),
            csvdata = $('#csvArray').val(),
            dialogElement = $("#download-dialog");
        $('#sqlString').val(sql);
        $('#sqlSortColumn').val(sqlSortColumn);
        $('#sqlSortDescending').val(sqlSortColumnDesc);
        $('#includes').val(includes);
        $('#excludes').val(excludes);
        $('#category').val(category);
        $('#csv_data').val(csvdata);
        downloadForm(dialogElement).init(title);
        return false;
    };
</script>