php window.onload,tp_window.onload+相应操作

[php]代码库

window.οnlοad=function(){

if(==0){

document.getElementsByName('sex')[1].checked='checked';

}else{

document.getElementsByName('sex')[0].checked='checked';

}

}

class UserAction extends Action{

public function index(){

$m=M('User');

$arr=$m->select();

//var_dump($arr);

$this->assign('data',$arr);

$this->display();

}

public function del(){

$m=M('User');

$id=$_GET['id'];

$count=$m->delete($id);

if($count>0){

$this->success('数据删除成功');

}else{

$this->error('数据删除失败');

}

}

/*

* 显示修改页面

* */

public function modify(){

$id=$_GET['id'];

$m=M('User');

$arr=$m->find($id);

$this->assign('data',$arr);

$this->display();

}

public function update(){

$m=M('User');

$data['id']=$_POST['id'];

$data['username']=$_POST['username'];

$data['sex']=$_POST['sex'];

$count=$m->save($data);

if($count>0){

$this->success('数据修改成功','index');

}else{

$this->error('数据修改失败');

}

}

/*

* 添加页面

* */

public function add(){

$this->display();

}

public function create(){

$m=M('User');

$m->username=$_POST['username'];

$m->sex=$_POST['sex'];

$idNum=$m->add();

if($idNum>0){

$this->success('数据添加成功','index');

}else{

$this->error('数据添加失败');

}

}

}

?>

-------------------------------------------------------------------

添加用户

function jump(){

window.location="/thinkphp/index.php/User/add";

}

694748ed64b9390909c0d88230893790.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/547618.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Openshift 4.4 静态 IP 离线安装系列:初始安装

Openshift 4.4 静态 IP 离线安装系列:初始安装 上篇文章准备了离线安装 OCP 所需要的离线资源,包括安装镜像、所有样例 Image Stream 和 OperatorHub 中的所有 RedHat Operators。本文就开始正式安装 OCP(Openshift Container Platform&…

【JavaScript学习】JavaScript对象创建

1.最简单的方法,创建一个对象,然后添加属性 1 var person new Object();2 person.age 23;3 person.name "David";4 person.job "student";5 person.sayName function ()6 {7 alert(this.name);8 };9 10 //类似于定义键…

C# ArrayList 与 string、string[] 的转换

1、ArrarList 转换为 string[] ArrayList list new ArrayList(); list.Add("aaa"); list.Add("bbb"); //转换成数组 string[] arrString (string[])list.ToArray(typeof( string)); 2、string[] 转换为 ArrarList ArrayList list new ArrayList(new st…

oracle不能访问管理页面,Oracle Grid Control CONSOLE无法打开9i数据库的管理维护页面...

今天在Solaris平台的测试环境上安装了Oracle Grid control 10.2.0.1,安装及配置完成后,发现在登录9i数据库的tablespace维护页面时,页面处于长时间的等待状况。最终返回错误信息。该页面在打开其他较小的数据库的页面时,均能正常访…

(转)在Myeclipse中查看android源码就是这么easy

http://byandby.iteye.com/blog/814277转载于:https://www.cnblogs.com/hyzhou/p/3217022.html

SQL Server 不同数据库导入指定数据解决方案

1 use 待导入DB 2 go 3 4 /*启动Ad Hoc Distributed Queries*/ 5 exec sp_configure show advanced options,1 6 reconfigure 7 exec sp_configure Ad Hoc Distributed Queries,1 8 reconfigure 9 10 insert into 待导入DB.dbo.表名11 select top 10 sid from opendatasource(…

Vue + Element UI 实现 登陆注册基本demo实例

Vue Element UI 实现权限管理系统 前端篇(二):Vue Element 案例 导入项目 打开 Visual Studio Code,File --> add Folder to Workspace,导入我们的项目。 安装 Element 安装依赖 Element 是国内饿了么公司提供…

oracle first_rows怎么用,优化模式区别(all_rows first_rows_n)

Why is my index not used?* The table is indexed isn’t it? 🙂* Why SHOULD the index be used?* Are the indexed columns/leading column of the index supplied in the where clause of the query (predicate list) as a single table (non-join) predicat…

svn 客户端批量备份数据(图+文)

缘由 商业用途的规则,数据与谨慎便成了不可替代的王道,我今天也说svn,在客户端批量备份数据。 前提 考虑跨平台与易用性,选择批处理(.bat),既然是批处理,少不了的便是命令和执行命…

Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The “path“ argument must be of type string

# Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The “path“ argument must be of type string 卡了半天,原来是sassloader版本过高导致的, 解决方法: 回退7.版本npm uninstall sass-loader(卸载当前版本) npm install sass…

使用python来访问Hadoop HDFS存储实现文件的操作

在调试环境下,咱们用hadoop提供的shell接口测试增加删除查看,但是不利于复杂的逻辑编程查看文件内容www.xiaorui.cc用python访问hdfs是个很头疼的事情。。。。这个是pyhdfs的库import pyhdfs fs pyhdfs.connect("192.168.1.1", 9000) pyhdfs.…

Jquery取得iframe中元素的几种方法Javascript Jquery获取Iframe的元素、内容或者ID,反之也行!

jquery取得iframe中元素的几种方法 在iframe子页面获取父页面元素 代码如下:$(#objId, parent.document);// 搞定...在父页面 获取iframe子页面的元素代码如下:$("#objid",document.frames(iframename).document) $(document.getElementById(iframeId).contentWind…

oracle中trunc x-1,oracle中trunc函数的说明

一、oracle trunc()函数的用法TRUNC(for dates)精确到天 select trunc(sysdate,dd) from dual 结果为:2010-9-17精确到月 select trunc(sysdate,mm) from dual 结果为:2010-9-1精确到年 select trunc(sysdate,yy) from dual 结果为:2010-1-1T…

Html去掉链接虚线边框

html去除图片链接边框及其链接虚线οnfοcus"this.blur();"用图片做为链接后&#xff0c;在图片的周围出现了一个带颜色边框用<a href"#"><img src"" border"0"></a>就去掉了边框当点击图片时&#xff0c;又出现了虚…

vue+axios请求时设置request header请求头(带上token)

vueaxios请求时设置请求头&#xff08;带上token&#xff09; 1.在vue中&#xff0c;向后台发送请求&#xff0c;不管是get或post&#xff0c;url要带上userId&#xff0c;headers要带上token值&#xff08;本地存储的token&#xff0c;window.localStorage[‘token’]&#x…

LINQ能不能用系列(一)LINQ to Object 效率比对

前言 简介&#xff1a;LINQ&#xff0c;语言集成查询&#xff08;Language INtegrated Query&#xff09;是一组用于c#和Visual Basic语言的扩展。 分类&#xff1a;LINQ to Object, LINQ to XML, LINQ to SQL, LINQ to DataSet&#xff0c;LINQ to ADO.NET。 相关&#xff…

oracle应收模块核销点不上,详解EBS接口开发之应收款处理

(一)应收款常用标准表简介1.1常用标准表如下表中列出了与应收款处理相关的表和说明&#xff1a;表名说明其他信息AR_BATCHES_ALLAR收款批表AR_BATCH_SOURCES_ALLAR收款类型表对应视图AR_CASH_RECEIPTS_ALLAR收款表对应视图AR_CASH_RECEIPT_HISTORY_ALLAR收款历史表对应视图AR_M…

防雷避险手册

为什么80%的码农都做不了架构师&#xff1f;>>> 防雷避险手册 防雷避险手册.pdf 转载于:https://my.oschina.net/tadcat/blog/148504

OpenCV调用YOLOv4进行目标检测

目标检测就是对目标进行动态实时跟踪定位&#xff0c;常见的目标检测算法有 R-CNN、Fast R-CNN、Faster R-CNN、SSD、Yolo 等&#xff0c;其中 Yolo 的速度和精确度都比较高&#xff0c;且只需训练一次&#xff0c;使用起来比较方便。 这里我们就使用官方现成的模型来检测图片…

2024年3月电子学会青少年编程等级考试时间安排

1考试方式 1. 在线居家考试&#xff08;全国&#xff09;&#xff1b; 2. 对于符合线下考试要求的考试服务网点&#xff0c;经地方实地调研报学会总部批准后&#xff0c;可组织线下考试。 2报名时间 报名时间&#xff1a;2023年12月21日-2024年3月12日16:00&#xff1b; 考…