二手交易网站课程设计说明书Word下载.docx

上传人:b****5 文档编号:16193326 上传时间:2022-11-21 格式:DOCX 页数:47 大小:1.35MB
下载 相关 举报
二手交易网站课程设计说明书Word下载.docx_第1页
第1页 / 共47页
二手交易网站课程设计说明书Word下载.docx_第2页
第2页 / 共47页
二手交易网站课程设计说明书Word下载.docx_第3页
第3页 / 共47页
二手交易网站课程设计说明书Word下载.docx_第4页
第4页 / 共47页
二手交易网站课程设计说明书Word下载.docx_第5页
第5页 / 共47页
点击查看更多>>
下载资源
资源描述

二手交易网站课程设计说明书Word下载.docx

《二手交易网站课程设计说明书Word下载.docx》由会员分享,可在线阅读,更多相关《二手交易网站课程设计说明书Word下载.docx(47页珍藏版)》请在冰豆网上搜索。

二手交易网站课程设计说明书Word下载.docx

清华大学出版社,2006

(7)BruceEckel,JAVA编程思想,北京:

机械工业出版社,2005

(8)孙晓龙、赵莉,JSP动态网站技术入门与提高,北京:

人民邮电出版社,2001

(9)张孝祥、徐明华,JSP基础与案例开发详解,北京:

清华大学出版社,2009

(10)唐爱国,杭志等,JSP技术详解与应用实践,北京:

2总体设计

2.1需求规定

输入

处理

输出

用户名、密码、确认密码、qq、手机号码、昵称

将用户注册信息存放到数据库

注册成功信息

用户名、密码

查询数据库处理登陆信息

返回登陆结果

出售商品信息

将商品信息添加到数据库

将物品信息显示到列表

评价信息

保存评论内容及时间信息

评论信息及评论人

2.2运行环境

a.硬件环境要求:

PentiumⅡ或更高的微机。

b.内存要求:

容量至少64M。

c.必要环境:

JDK1.6及以上

d.安装所需硬盘:

10G以上

2.3基本设计概念和处理流程

图2-1组织结构图

图2-2交易通信图

图2-3发布商品通信图

图2-4系统用例图

2.4结构设计

2.4.1结构

图2-5系统功能结构图

2.4.2人工处理过程

●用户注册用户信息

●搜索商品

●登陆发布商品信息

●超级管理员添加普通管理员

3数据库设计

3.1概念结构设计

表3-1商品表(goods)

字段

类型

NULL

默认值

说明

其他

id

int

商品id

主键,自动增长

userid

用户编号

外键

name

varchar(100)

商品名称

category

vrachar(50)

分类

cgrade

varchar(50)

成色

全新、9成新、8成新

sellingprice

float

0.0

转卖价

专卖价必须不高于原价

costprice

原价

desc

mediumtext

描述

location

char(100)

所在地

conphone

char(11)

联系电话

conqq

char(15)

QQ

state

商品状态

上架/下架

edittime

最近编辑时间

表3-2用户表(user)

varchar(32)

用户名

只能是字母和数字

密码

md5加密后的字符串

reg_email

char(30)

注册邮箱

reg_cardid

char(20)

身份证号

reg_ip

注册ip

reg_time

int(11)

注册时间

last_time

上次登录时间

last_ip

上次登录ip

image

默认头像

个人头像

exp

1

经验值

购买商品会增加

表3-3评论表(comments)

评论id

用户id

user表外键

goodsid

goods表外键

content

char(500)

评论内容

uptime

评论时间

表3-4分类表(category)

分类id

father_id

其上级id

分类名称

表3-5等级经验表(rank_exp)

rank

等级

新注册用户经验值默认值为1

rank_name

等级名称

表3-6公告表(notice)

文章id

title

varchar(200)

标题

内容

author

char(50)

作者

日期

hits

点击量

每点击一次标题,点击量加1

表3-7关键字表(kword)

keyword

关键字

num

被搜索次数

3.2逻辑结构设计

图3-1系统E-R图

3.4安全保密设计

在数据库我们对密码进行了二次的SHA1加密,而且还使用了密钥。

即使我们的数据库信息被泄露,也不会被轻易地破解。

4系统出错处理设计

4.1出错信息

1.用户可能通过在浏览器中直接输入地址进入个人中心。

我们会通过session来控制会员是否已经登录,如果用户没有登录会直接跳转到“首页”或者“登录界面”。

2.展示的商品是通过获取URL中的参数来查询数据库的,如果用户恶意地或无意地修改了URL参数,我们会首先查询是否存在该商品,如果不存在直接跳转到首页,否则显示相应的信息。

4.2补救措施

重启服务器、数据库

5模块详细设计

5.1MODELS设计

<

?

php

classMyDBextendsCI_Model{

protected$res;

publicfunction__construct(){

parent:

:

__construct();

$this->

load->

database();

}

//使用query方式执行SQL语句

publicfunctionquery($sql){

$res=$this->

db->

query($sql);

if($res){

$this->

res=$res;

}

publicfunctionget($table){

get($table);

//返回结果集一个对象数组

publicfunctionresult_object(){

return$this->

res->

result();

//返回结果的关联数组

publicfunctionresult_array(){

result_array();

//返回当前请求的行数

publicfunctionnum_rows(){

num_rows();

//返回当前请求的列数

publicfunctionnum_fields(){

num_fields();

/**返回结果集的第$num条数据,object类型

*注意是第$num条,而不是一共$num条,functionrow_array()一样

**/

publicfunctionrow_object($num){

row($num);

//返回结果集的第$num条数据,array类型

publicfunctionrow_array($num){

row_array($num);

//返回结果集第一条记录,默认为object类型,可传参'

array'

则返回array类型

publicfunctionfirst_row($type='

object'

){

//if($type=='

)return$this->

first_row('

);

first_row($type);

//返回结果集最后一条记录,默认为object类型,可传参'

publicfunctionlast_row($type='

last_row($type);

//返回最后插入记录的id,适用于主键自增的表

publicfunctioninsert_id(){

insert_id();

//返回insert/update/delete操作影响的条目数

publicfunctionaffected_rows(){

affected_rows();

//设置查询的返回

publicfunctionlimit($start=0,$offset=10){

limit($offset,$start);

//查询的排序方式,默认为id降序

publicfunctionorder_by($field='

id'

$order='

desc'

order_by($field,$order);

//查询某个字段的和

publicfunctionselect_sum($field){

dn->

select_sum($field);

//GROUPBY字句

publicfunctiongroup_by($field){

group_by($field);

publicfunctionhaving($hav){

having($hav);

publicfunctionwhere_in($field,$in){

where_in($field,$in);

/**

*参数说明

*int$mode返回类型

*0返回多条记录

*1返回单条记录

*2返回记录的数目

*3返回limit,limit=array(start,end)

*string/array$table数据库表,两种传值模式

*普通模式:

*'

tb_member,tb_money'

*数组模式:

*array('

tb_member'

'

tb_money'

*string/array$fields需要查询的数据库字段,允许为空,默认为查找全部,两种传值模式

username,password'

username'

password'

*string/array$where查询条件,允许为空,两种传值模式

andtype=1andusernamelike"

%os%"

'

type=1'

usernamelike"

*string$orderby排序,默认为id倒序

*/

publicfunctionq_select($mode,$table,$fields='

*'

$where,$orderby='

iddesc'

$limit){

//参数处理

if(is_array($table)){

$table=implode('

$table);

if(is_array($fields)){

$fields=implode('

$fields);

if(is_array($where)){

$where=implode('

$where);

if(is_array($limit)){

$limit=implode('

$limit);

if($mode==2){

query("

SELECTidFROM{$table}WHERE1=1{$where}"

$return=$this->

}elseif($mode==1){

SELECT{$fields}FROM{$table}WHERE1=1{$where}ORDERBY{$orderby}"

first_row();

}else{

result_object();

return$return;

*string$table数据库表

*string/array$where查询条件,允许为空

array('

=>

test'

publicfunctionselect($mode,$table,$fields,$where=array('

id>

-1)){

where($where);

select($fields);

res=$this->

return$this->

*0无返回值

*1返回影响的条目数

*2返回最后插入的id值

*array$set插入的字段和值

*数组模式:

array('

publicfunctioninsert($mode,$table,$set){

$t=count($set);

foreach($setas$key=>

$value){

//$set[$key]=$this->

escape($value);

insert($table,$set);

returnnull;

*array$set要修改的字段和值

*array$where限制条件

age'

20,'

usernamelike'

%li%'

publicfunctionupdate($mode,$table,$set,$where){

update($table,$set);

if($mode==1){

}elseif($mode==0){

publicfunctiondelete($mode,$table,$where){

delete($table);

*多表连接查询

*int$mode0返回所有结果

*1返回第一条结果

*2返回结果数目

*array$field要查询的字段

*string$table1

*string$table2连接的两个表

*array$join连接条件

publicfunctionjoin_select($mode,$field,$table1,$table2,$where,$join){

select($field);

from($table1);

join($table2,$join);

get();

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 表格类模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1