利用thinkphp实现 批量删除
来源:互联网 发布:bi工程师和数据分析 编辑:程序博客网 时间:2024/05/22 08:29
勾选相应选项 进行批量删除
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript">function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;}//全选function a(){ var checkObj = document.all("cheboxId"); var cid=document.all("cid"); var flag=true; for(var i = 0;i<checkObj.length;i++){ if (checkObj[i].checked==false) flag=false; } if (flag==true) { for(var i = 0;i<checkObj.length;i++) checkObj[i].checked = false; } else if(flag==false){ for(var i = 0;i<checkObj.length;i++) if (checkObj[i].checked==false) checkObj[i].checked = true; } if(!flag) cid.checked=true; else cid.checked=false; } function CommandConfirm1(){ if(window.confirm("你确定修改吗?")){ return true; }else{ return false; } } function CommandConfirm2(){ if(window.confirm("你确定删除吗?")){ return true; }else{ return false; } }</script><link href="__PUBLIC__/css/body.css" rel="stylesheet" type="text/css" /><!-- <link href="__PUBLIC__/css/table_b.css" rel="stylesheet" type="text/css" /> --><link href="__PUBLIC__/css/tablecloth.css" rel="stylesheet" type="text/css" /><script type="text/javascript" href="__PUBLIC__/js/right.js"></script></head><body><!-- <input type="checkbox" id="cheboxId" name="checkName" /> 11111 <input type="checkbox" id="cheboxId" name="checkName" /> 2222 <input type="checkbox" id="cheboxId" name="checkName" /> 3333 <input type="button" value="全选" onClick="a()" /> <input type="button" value="反选" onClick="b()" /> --><form method='post' method="post" action="__URL__/delete"> <table width="70%" border="1" align="center"> <thead> <th width="10%"> <input type="checkbox" name="all" onclick="a()" id='cid'></th> <th width="30%">用户名</th> <th width="20%">用户ID</th> <th width="50%">部门编号</th> </thead> <volist name="list" id="vo"> <tr> <td><input type="checkbox" name="user[]" id='cheboxId' value='{$vo.USER_ID}'></td> <td>{$vo.username}</td> <td>{$vo.USER_ID}</td> <td>{$vo.DEPT_ID}</td> </tr> </volist> </table> <!-- <a href="{:U("Index/delete?id=$vo[USER_ID]")}" name="id" target="_self">; --> <input type="button" name="bt1" value="修改" onclick="CommandConfirm1()" > <input type="submit" name="bt2" value="删除" > </form><!-- <table width="60%" border="1" align="center"> <tr> <td width="33%">用户名</td> <td width="38%">权限</td> <td width="16%"> </td> <td width="13%"> </td> </tr> <tr> <td> </td> <td>用户</td> <td><form id="form1" name="form1" method="post" action=""> <input type="submit" name="button" id="button" value="修改" /> </form></td> <td><form id="form2" name="form2" method="post" action=""> <input type="submit" name="button2" id="button2" value="删除" /> </form></td> </tr> <tr> <td> </td> <td>档案馆工作人员</td> <td><input type="submit" name="button3" id="button3" value="修改" /></td> <td><input type="submit" name="button10" id="button10" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button4" id="button4" value="修改" /></td> <td><input type="submit" name="button11" id="button11" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button5" id="button5" value="修改" /></td> <td><input type="submit" name="button12" id="button12" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button6" id="button6" value="修改" /></td> <td><input type="submit" name="button13" id="button13" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button7" id="button7" value="修改" /></td> <td><input type="submit" name="button14" id="button14" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button8" id="button8" value="修改" /></td> <td><input type="submit" name="button15" id="button15" value="删除" /></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="button9" id="button9" value="修改" /></td> <td><input type="submit" name="button16" id="button16" value="删除" /></td> </tr></table><table width="60%" border="0" align="center"> <tr> <td width="70%"> </td> <td width="30%"><form name="form" id="form"> <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> </select> 页 </form></td> </tr></table> --></body></html>
<?php// 本类由系统自动生成,仅供测试用途class IndexAction extends Action{ public function index(){ $this->display('index'); } public function login(){ if(!IS_POST) halt('页面错误');$username=I('username');$pwd=I('pwd');$db=new Model('user');$user=$db->where(array('username'=>I('username')))->find();$list=$db->select();if(!$user||$user['password']!=$pwd){$this->error('密码错误');//dump($list);}$_SESSION['username']=$username;$this->success("登陆成功","force"); } public function force(){$this->display('force'); }public function top(){$this->display('top'); }public function left(){$this->display('left'); }public function right(){$this->display('right'); }public function RightsList(){$db=new Model('user');$user=$db->select();$this->assign('list',$user);$this->display('RightsList');}public function delete(){$id = I('post.user');$ids = implode(',',$id);$user = M('user');if($user->where(array('USER_ID' => array('in',$ids)))->delete()){$this->success("删除成功");}// $user=$this->getActionName();// $id=$this->_request("id");// $db=M($user);// $result=$db->where(array("USER_ID"=>$id))->find();// dump($user);// if($result)// $this->success('删除成功');// else// $this->error('删除失败');}}
0 0
- 利用thinkphp实现 批量删除
- ThinkPHP 批量删除功能
- 利用yii2 gridview实现批量删除案例
- ThinkPHP中ajax实现批量删除,,以…
- thinkphp中如何利用checkbox批量删除数据
- 行式填报表利用JS函数实现批量删除功能
- 利用协处理器endpoint实现批量删除功能
- [php] 基于ThinkPHP的批量删除
- 利用ListView批量删除item
- 利用ListView批量删除item .
- 利用API批量删除资产
- 利用ListView批量删除item
- 利用python批量删除文件
- thinkphp 文章列表批量删除 / 批量修改排序
- DataGrid 实现批量删除
- Repeater实现批量删除
- winform 实现批量删除
- Mybatis实现批量删除
- 2014年去哪网算法笔试题
- 我和权威的故事——王垠
- 详细了解BIOS中的英文意思
- 【概率DP】 LightOJ 1027 A Dangerous Maze
- 5、spring之mvc原理及应用
- 利用thinkphp实现 批量删除
- 不要让经验禁锢你的编程思想
- 协议传值
- Checkbox Text 重影问题的解决办法
- 10个鲜为人知的编程真相
- zjut_1187 五位以内的对称素数
- 【Java.JDBC/ORM】JPA
- 为什么 C++ 成员函数指针是 16 字节宽的
- Mac OS X下安装Java 7及配置Eclipse JDK