php 实现复选框删除 15
这个是templates层<formmethod='post'id="form_goods"action="<?phpechourlAdmin('goods','good...
这个是templates层 <form method='post' id="form_goods" action="<?php echo urlAdmin('goods', 'goods_del');?>">
<input type="hidden" name="form_submit" value="ok" />
<table class="table tb-type2"> <td><input type="checkbox" name="id[]" value="<?php echo $v['mm_goods_id'];?>" class="checkitem"></td><a href="JavaScript:void(0);" class="btn" onclick="if(confirm('您确定要删除吗?')){$('#form_goods').submit();}"><span>删除</span></a>
<div class="pagination"> <?php echo $output['page'];?> </div></td>
</tr>
</tfoot>
</table>
</form>
</div>controller层public function goodsOp(){
echo "77777777777777777777777";
$Model_mmgoods = Model('mm_goods');
echo"123";
if (!empty($_POST['id'])){
if (is_array($_POST['id'])){
foreach ($_POST['id'] as $k => $v){
// $v = intval($v);
// $rs = true;
if ($k){
$mm_goods = $Model_mm_goods->getInfo(array(
'mm_goods_id'=>$v
));
//删除用户
$Model_mm_goods->del($v);
}
}
}
}
}
model层
public function wp_delGoods($goods_id) {
$condition['mm_goods_id']=$goods_id;
return $this->table('mm_goods')->where($condition)->find();
} 展开
<input type="hidden" name="form_submit" value="ok" />
<table class="table tb-type2"> <td><input type="checkbox" name="id[]" value="<?php echo $v['mm_goods_id'];?>" class="checkitem"></td><a href="JavaScript:void(0);" class="btn" onclick="if(confirm('您确定要删除吗?')){$('#form_goods').submit();}"><span>删除</span></a>
<div class="pagination"> <?php echo $output['page'];?> </div></td>
</tr>
</tfoot>
</table>
</form>
</div>controller层public function goodsOp(){
echo "77777777777777777777777";
$Model_mmgoods = Model('mm_goods');
echo"123";
if (!empty($_POST['id'])){
if (is_array($_POST['id'])){
foreach ($_POST['id'] as $k => $v){
// $v = intval($v);
// $rs = true;
if ($k){
$mm_goods = $Model_mm_goods->getInfo(array(
'mm_goods_id'=>$v
));
//删除用户
$Model_mm_goods->del($v);
}
}
}
}
}
model层
public function wp_delGoods($goods_id) {
$condition['mm_goods_id']=$goods_id;
return $this->table('mm_goods')->where($condition)->find();
} 展开
2015-07-25
展开全部
public GetLogicDisposedList()
{
PeccancyTimeL = "";
PeccancyTimeH = "";
DisposeTimeL = "";
DisposeTimeH = "";
PlateType = "";
PlateNumber = "";
PeccancyAdress = "";
Derection = "";
PeccancyType = "";
DisposedPerson = "";
}
这就是构造函数,析构函数C#很少用.你想了解这些可以看看C++
{
PeccancyTimeL = "";
PeccancyTimeH = "";
DisposeTimeL = "";
DisposeTimeH = "";
PlateType = "";
PlateNumber = "";
PeccancyAdress = "";
Derection = "";
PeccancyType = "";
DisposedPerson = "";
}
这就是构造函数,析构函数C#很少用.你想了解这些可以看看C++
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询