我需要在选中值为 0(非活动)和 1(活动)的复选框后立即更新我的数据库。如果我取消选中该复选框,用户将无法访问该页面意味着他/她被用户面板阻止。如果我再次选中该框,则用户可以访问整个网络,这意味着他/她将被解除阻止。我想知道我是否可以在codeigniter中做到这一点。我已经搜索过了,但我找不到它们。提前对不起它有一个愚蠢的。感谢您的任何帮助。
这是我的视图文件:
<div class="col-main">
<h1 class="page-title">All Users</h1>
<div class="admin_panel">
<ul class="form-fields">
<li class="full-row">
<table class="table demo">
<tr>
<td colspan="3"><a href="<?php echo base_url(); ?>admin/admin_control/add_users" class="add">Add New</a></td>
</tr>
<tr>
<td colspan="3"><label>Quick Search : </label>
<input id="filter" type="text"/></td>
</tr>
</table>
</li>
</ul>
<table class="table demo table-bordered product_grid" data-filter="#filter">
<thead>
<tr>
<th>S.No</th>
<th>First Name</th>
<th>last Name</th>
<th>Password</th>
<th>Username</th>
<th>Password</th>
<th>Status</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody> <tr>
<?php if(isset($pro_data) && $pro_data != false){ ;
foreach ($pro_data as $da) { ?>
<td><?php echo $da['reg_id']; ?></td>
<td><?php echo $da['reg_fname']; ?></td>
<td><?php echo $da['reg_lname']; ?></td>
<td><?php echo $da['reg_pass']; ?></td>
<td><?php echo $da['reg_email']; ?></td>
<td><?php echo $da['reg_pass']; ?></td>
<td><?php $data = array(
'name' => 'reg_fname',
'id' => 'reg_id',
'value' => 'accept',
'checked' => TRUE,
'style' => 'margin:10px',
);
echo form_checkbox($data);?></td>
<td class="edit"><a title="Edit" href="edit-user.php"><img title="Edit" alt="Edit" src="images/edit_icon.png"></a></td>
<td class="del"><a title="Remove" href="#"><img title="Remove" alt="Remove" src="images/delete_item_btn.png"></a></td>
</tr>
<?php }?>
<?php }?>
</tbody>