gpt4 book ai didi

php - Codeigniter 当我单击删除时,如果单击是或否,我想弹出通知

转载 作者:行者123 更新时间:2023-11-30 07:09:23 25 4
gpt4 key购买 nike

型号:

 function delete_exchange($ExchangeRateId) {
$this -> db -> where('ExchangeRateId', $ExchangeRateId);
$this -> db -> delete('exchange_rate');
}

Controller :

function delete($ExchangeRateId) {
$user_type = $this -> session -> userdata('user_type');
if ($user_type != "admin") {
redirect(base_url() . 'user_admin/login');
}
$this -> all -> delete_exchange($ExchangeRateId);
redirect(base_url() . 'exchange/index');
}

删除按钮很清楚,这里我想要一个通知,比如弹出是,或者必须运行我的意思是删除的操作

最佳答案

在 View 页面中

<script>
function doconfirm()
{
job=confirm("Are you sure to delete permanently?");
if(job!=true)
{
return false;
}
}
</script>

删除链接

<a href="<?php echo site_url();?>/mycontroller/delete/<?php print($data->auc_id);?>">
<img src='images/delete.gif' title="Delete" onClick="return doconfirm();" >
</a>

关于php - Codeigniter 当我单击删除时,如果单击是或否,我想弹出通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16891926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com