PHP-MYSQL电商购物管理系统(附源码)
麻了秃头 2024-07-09 09:35:02 阅读 78
环境配置
本系统采用phpstudy开发平台,采用PHP和MySQL数据库进行开发,开发工具为HBuilder。phpStudy是一个PHP调试环境的程序集成最新的
Apache+PHP+MySQL+phpMyAdmin,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。(其他平台均可)@@@文末有获取方式
————————————————
含sq文件
主要功能
————————————————
管理员功能:
数据统计面板、修改密码
品牌管理(增删改)
商品管理(增删改查)
新闻管理(增删改查)
订单管理(查删)
用户管理(查删改)
用户功能:
密码修改、信息修改
订单管理(查删)
购买、付款、登录、注册
运行截图
前台首页
<code> <div class="container">code>
<div class="col-xs-12 col-sm-12 col-md-12">code>
<h1>推荐运动鞋</h1>
<span></span>
<a class="rightMore" href="goodst.php">>></a>code>
</div>
<div class="list">code>
<?php $new_art1 = db_get_all("select * from goods where status=0 order by cishu desc limit 6");foreach($new_art1 as $row) { ?>
<div class="col-xs-6 col-sm-3 col-md-2 col-mm-6 productImg">code>
<a href='goodsshow.php?id=<?php echo $row['id'];?>'>code>
<span class="imgLink-hover"><span class="hover-link"></span></span>code>
<img src="<?php echo __PUBLIC__;?>/Upload/<?php echo $row["img"];?>" />code>
</a>
<a class="productTitle" href="goodsshow.php?id=<?php echo $row['id'];?>">code>
<?php echo $row['title'];?>
</a>
<center>¥ <?php echo $row['sprice'];?></center>
</div>
<?php }?>
</div>
</div>
</div>
</div>
</div>
商品详情
<code> <div class="col-sm-12 col-md-6 pad">code>
<div class="detailTitle">code>
<?php echo $row["title"];?>
</div>
<div class="detailParameter" style="line-height:1.8em;">code>
分类:<?php echo $catA["title"];?><br />
编号:<?php echo $row["pnumber"];?><br />
库存:<?php echo $row["amount"];?><br />
购买价:<font color="#FF0000">¥<?php echo $row["mprice"];?></font><br />code>
拼团价:<font color="#FF0000">¥<?php echo $row["sprice"];?></font><br />code>
上架时间:<?php echo $row["addtime"];?><br />
</div>
<div class="detailUrl"><a href="javascript:void(0);" onClick="window.location.href='cart1.php?goodsid=<?php echo $row["id"];?>'">去拼团</a> <button type="button" class="btn btn-danger" onClick="window.location.href='cart2.php?goodsid=<?php echo $row["id"];?>'">直接购买</button> </div>code>
</div>
<div class="col-sm-12 col-md-12 pad">code>
<div class="detailTitleTxt">code>
详情
</div>
<div class="detailContent" style="line-height:1.8em;">code>
<?php echo $row["content"];?>
</div>
</div>
<div class="col-sm-12 col-md-12 pad">code>
<div class="detailTitleTxt">code>
正在拼团
</div>
<div class="detailContent" style="line-height:1.8em;">code>
<?php
$new_art1 = db_get_all("select * from ordersta where zt='拼团中' and goodsid=".$row["id"]." order by id desc limit 6");code>
foreach($new_art1 as $rowo) {
$start_time = strtotime(date("Y-m-d h:i:s"));
$end_time = strtotime($rowo['begintime']);
$days = abs(($start_time - $end_time));
if($days>86400&&$rowo['zt']=='拼团中'){
db_query("update orders set zt='拼团失败' where id=".$rowo["ordersid"]);code>
db_query("update ordersta set zt='拼团失败' where id=".$rowo["id"]);code>
db_query("update goods set cishu=cishu-1 ,amount=amount+1 where id=".$rowo["goodsid"]."");code>
}
?>
<div class="list-group-item">code>
<h5>团长:<font color="#FF0000"><?php echo db_get_val("user",$rowo["userid"],"nickname");?></font> 提交时间:<span class="badge"> <?php echo $rowo['addtime']?></span><?php if($rowo["userid"]!=$_SESSION["id"]){ ?><button type="button" class="btn btn-danger" onClick="window.location.href='cart3.php?goodsid=<?php echo $rowo["goodsid"];?>&ordersid=<?php echo $rowo["ordersid"];?>'">加入拼团</button><?php }?> </h5>code>
</div>
订单信息
<code><?php
include_once("header.php");
check_loginuser();
$cat_title = "收货人信息";
$gooda=db_get_row("select * from goods where id=".$_REQUEST["goodsid"]."");code>
if($gooda["amount"]<1){ goBakMsg("此运动鞋无货");die;}
?>
<script language="javascript">code>
function check(form){
if(form.receiver.value==""){
alert("请输入收货人姓名!");
form.receiver.select();
return(false);
}
if(form.tel.value==""){
alert("请输入收货人联系电话!");
form.tel.select();
return(false);
}
if(form.email.value==""){
alert("请输入收货人E-mail地址!");
form.email.select();
return(false);
}
if(form.email.value.indexOf("@")<0){
alert("收货人E-mail地址格式输入错误!");
form.email.select();
return(false);
}
return(true);
}
提交付款
<code><?php
include_once("header.php");
check_loginuser();
?>
<?php
$cat_title = "支付订单";
if ($_POST){
if(db_get_val("goods",$_REQUEST["goodsid"],"amount")<$_REQUEST["nums"]){ goBakMsg("数量不足");die;}
db_query("update orders set zt='已付款' where id=".$_REQUEST["ordersid"]);code>
db_query("update ordersta set zt='已付款' where id=".$_REQUEST["orderstaid"]);code>
db_query("update goods set cishu=cishu+".$_REQUEST["nums"]." ,amount=amount-".$_REQUEST["nums"]." where id=".$_REQUEST["goodsid"]."");code>
urlMsg("付款成功", "admin/user/index.php");
die;
}
?>
个人信息
<code><div id="container">code>
<div class="hd-wrap ue-clear">code>
<div class="top-light"></div>code>
<h1 class="logo"><?php echo $CONFIG["webname"];?></h1>code>
<div class="login-info ue-clear">code>
<div class="welcome ue-clear"><span>欢迎您,</span><a href="javascript:void(0)" class="user-name"><?php echo $_SESSION['nickname'];?></a></div>code>
</div>
<div class="toolbar ue-clear">code>
<a class="home-btn"><?php echo "今天是 " . date("Y-m-d");?></a>code>
<a href="../../index.php" target="_blank" class="home-btn">首页</a>code>
<a href="password.php" target="right" class="home-btn">修改密码</a>code>
<a href="../../login.php?type=logout" class="home-btn" target="_top">退出</a>code>
<a style="display: none" href="<?php echo __ADMIN__;?>/logincheck.php?type=logout" class="home-btn" target="_top">退出</a>code>
</div>
</div>
</div>
<div id="bd">code>
<div class="wrap ue-clear">code>
<h2 class="sidebar-header"><p>功能导航</p></h2>code>
<ul class="nav">code>
<li class="office current"><div class="nav-header"><a href="main.php" target="right" class="ue-clear"><span>首页</span><i class="icon"></i></a></div></li>code>
<?php $i = 1;$class_art = db_get_all("select * from menu where pid=0 and isno=0 and type=0 and auth=3 order by grade asc limit 12");foreach($class_art as $row4) { ?>
<li <?php if($i==1){ ?>class="land"<?php }else{ ?>class="train"<?php }?>><div class="nav-header"><a href="JavaScript:;" class="ue-clear" ><span><?php echo $row4['title'];?></span><i class="icon hasChild"></i></a></div>code>
<ul class="subnav">code>
<?php $class1_art = db_get_all("select * from menu where pid=".$row4["id"]." and isno=0 order by grade asc limit 18");foreach($class1_art as $row5) { ?>code>
<li><a href='<?php echo $row5['url'];?>' target='right'><?php echo $row5['title'];?></a></li>code>
<?php }?>
</ul>
</li>
<?php $i=$i+1; }?>
</ul>
</div>
<div class="content">code>
<iframe src="main.php" id="iframe" width="100%" height="100%" frameborder="0" name="right" style="min-width: 1000px"></iframe>code>
</div>
</div>
</div>
</div>
后台首页
商品管理
用户管理
使用说明
此系统功能完善可作为课程设计、毕业设计学习资料,系统的功能运行均测试正常,读者可以根据的的需求进行完善。
如需要完整的源码和数据库可以关注公主号—麻了秃头,也可直接私信博主。
免费福利:一键三连+评论“麻了秃头”,随机抽一名幸运读者赠送10套任选系统资料
声明
本文内容仅代表作者观点,或转载于其他网站,本站不以此文作为商业用途
如有涉及侵权,请联系本站进行删除
转载本站原创文章,请注明来源及作者。