duafagm1066 2018-12-03 12:24
浏览 26

使用jquery响应codeigniter更新值

<script type="text/javascript">
    function deactiveItemByID(ID, URL) {
        swal({
            title: "Are you sure?",
            text: "You will not be able to recover this item!",
            type: "warning",
            showCancelButton: true,
            confirmButtonText: "Yes, delete it",
            cancelButtonText: "No, cancel",
            allowOutsideClick: false,
            allowEscapeKey: false,
            allowEnterKey: false,
        }).then(function (isConfirm) {
            if (isConfirm) {
                $.post(URL,
                        {
                            ID: ID,
                        },
                        function (data, status) {
                            location.reload();
                        });
            }
        });
    }
</script>
<button onclick="deactiveItemByID('<?php  echo $employees->fldUserID; ?>', '<?php echo base_url($deactive_link); ?>');" type="button" class="btn btn-default btn-circle"></button>

model

function deactive_employee() {
    $fldUserID = $this->input->post('ID');
    $data = array(
        'fldUserActive' => '0' 
    );
    $this->db->where('fldUserID',$fldUserID);
    if($this->db->update('tblUser', $data)) {
        $this->session->set_flashdata('success_msg', 'Employee is deleted');
    }
}

controller

how to update the database using jquery respond... it is not displaying any error but also it is not inserting the value in the database Please help me solve my code

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 八爪鱼爬数据为什么自己停了
    • ¥15 交替优化波束形成和ris反射角使保密速率最大化
    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率