Display alert message and redirect after click on accept

后端 未结 7 1986
星月不相逢
星月不相逢 2020-12-09 11:23

Well, I have a page with links to reports. Whenever somebody clicks on one report, they can download the excel file. However, sometimes there are no fields to make a report;

相关标签:
7条回答
  • 2020-12-09 12:14

    This way it works`

       if ($result_array)
        to_excel($result_array->result_array(), $xls,$campos);
    else {
        echo "<script>alert('There are no fields to generate a report');</script>";
        echo "<script>redirect('admin/ahm/panel'); </script>";
    }`
    
    0 讨论(0)
提交回复
热议问题