0

我尝试在更新记录后显示弹出成功消息框。这是我在控制器中编写的代码

           $status = $this->order_model->set_bookingByOrderID($id,$data);

           if($status ==1)
           {
            echo '<script>alert("You Have Successfully updated this Record!");</script>';
            redirect('orderManagement/index');
           }
           else{
            $this->session->set_flashdata("message","Record Not Updated!");
            redirect('orderManagement/index');
           }

但脚本不起作用。谁能帮我解决这个问题?

4

1 回答 1

2

我试过你的代码,只需要刷新重定向。请尝试以下代码:

if($status == 1)
           {
               echo '<script>alert("You Have Successfully updated this Record!");</script>';
               redirect('orderManagement/index', 'refresh');
           }
           else{
               $this->session->set_flashdata("message","Record Not Updated!");
               redirect('orderManagement/index', 'refresh');
           }

我希望这能帮到您。

于 2013-12-04T06:41:55.403 回答