<?php
session_start();
date_default_timezone_set('PRC');
require('db/mysqlDb.php');
$db=DbMySql::get_instancetns('officewj');
$category = isset($_REQUEST['category'])?$_REQUEST['category']:1;
$username = isset($_SESSION['username'])?$_SESSION['username']:'';
?>
<meta charset="utf-8">
<title>办公用品在线预订系统</title>
<link href="css/index.css" rel="stylesheet" type="text/css">
<link href="css/login2.css" rel="stylesheet" type="text/css" />
<script src='js/jquery.min.js'></script>
<script>
//
jQuery(document).ready(function($) {
$('#theme-login').click(function(){
$('.theme-popover-mask').fadeIn(100);
$('.theme-popover').slideDown(200);
})
$('.theme-poptit .close').click(function(){
$('.theme-popover-mask').fadeOut(100);
$('.theme-popover').slideUp(200);
})
$('#userreg').click(function(){
$('.theme-popover-maskreg').fadeIn(100);
$('.theme-popover-reg').slideDown(200);
})
$('.theme-poptit-reg .close').click(function(){
$('.theme-popover-maskreg').fadeOut(100);
$('.theme-popover-reg').slideUp(200);
})
})
$("#user_login").live("click",function(){
var user = $("#usernameid").val();
var pass = $("#userpassword").val();
if(user==""){
alert("用户名不能为空!");
return false;
}
if(pass==""){
alert("用户名不能为空!");
return false;
}
$.ajax({
type: "POST",
url: "userlogin.php",
dataType: "json",
data: {"user":user,"pass":pass,"action":"login"},
beforeSend: function(){
},
success: function(json){
if(json.success==1){
var div = "<p style=\"color:#00FF40;display:inline\"><strong>"+json.truename+"</strong>,欢迎登录!</p> ";
div +="<a href='#' id='user_logout' class=\"loginandreg\">【退出】</a>";
$("#banner").html(div);
//登录成功后,关闭窗口
$('.theme-popover-mask').fadeOut(100);
$('.theme-popover').slideUp(200);
}else{
alert("登录失败!");
return false;
}
}
});
});
$("#reguser").live("click",function(){
var username = $("#username").val();
var pwd = $("#pwd").val();
var truename = $("#truename").val();
var depid = $("#depid").val();
var ghid = $("#ghid").val();
var email = $("#email").val();
var mobile = $("#mobile").val();
if(username=="" || ghid ==""){
alert("用户名或工号不能为空!");
return false;
}
if(pwd==""){
alert("密码不能为空!");
return false;
}
$.ajax({
type: "POST",
url: "userreg.php",
dataType: "json",
data: {"username":username,"pwd":pwd,"truename":truename,"depid":depid,"ghid":ghid,"email":email,"mobile":mobile,"action":"reguser"},
beforeSend: function(){
},
success: function(json){
if(json.success==1){
var div = "<p style=\"color:#00FF40;display:inline\"><strong>"+json.truename+"</strong>,注册成功!</p> ";
div +="<a href='#' id='user_logout' class=\"loginandreg\">【退出】</a>";
$("#banner").html(div);
//注册成功后,关闭窗口
$('.theme-popover-maskreg').fadeOut(100);
$('.theme-popover-reg').slideUp(200);
}else{
alert("注册失败!");
return false;
}
}
});
});
$("#user_logout").live("click",function(){
$.ajax({
type: "POST",
url: "userlogin.php",
dataType: "json",
data: {"action":"logout"},
success: function(json){
if(json.success==1){
var div = '<a class="loginandreg" id="userreg" href="javascript:;">注册 </a>';
div +='<a class="loginandreg" id="theme-login" href="javascript:;">登录</a>';
$("#banner").html(div);
}
}
});
});
function addnum(nid){
var num =parseInt($("#addnum_"+nid).val()) +1;
$("#addnum_"+nid).val (num);
}
function delnum(nid){
var num =parseInt($("#addnum_"+nid).val()) -1 ;
if( num <0) return ;
$("#addnum_"+nid).val (num);
}
function addshopping(sid)
{
var num = $("#addnum_"+sid).val();
var price = $("#price_"+sid).html();
if(num<=0) return;
$.ajax({
type: "POST",
url: "addshopping.php",
dataType: "json",
data: {"productid":sid,"num":num,"price":price,"action":"addshopping"},
success: function(json){
if(json.success==1){
location.reload("index.php");
} else{
//alert(json.msg);
popmsg('tt');
}
}
});
}
function delshopping(sid)
{
$.ajax({
type: "POST",
url: "addshopping.php",
dataType: "json",
data: {"sid":sid,"action":"delshopping"},
success: function(json){
if(json.success==1){
location.reload("index.php");
} else{
alert(json.msg);
}
}
});
}
function popmsg(msg){
$("#BgDiv").css({ display: "block", height: $(document).height()});
var yscroll = document.documentElement.scrollTop;
$("#DialogDiv").css("top", "100px");
$("#DialogDiv").css("display", "block");
document.documentElement.scrollTop = 0;
}
$(function() {
$("#btnClose").click(function() {
$("#BgDiv").css("display", "none");
$("#DialogDiv").css("display", "none");
});
});
</script>
<body>
<div id="container">
<div id="header">
<div id="banner" >
<?php
if(isset($_SESSION['username']))
{
?>
<p style="color:#00FF40;display:inline"><strong><?php echo $_SESSION['username'] ?></strong>,<?php echo $_SESSION['truename'] ?> 欢迎登录!</p>
<a href="#" id="user_logout" name="user_logout" class="loginandreg\">【退出】</a>
<?php } else{?>
<a class="loginandreg" id="userreg" href="javascript:;">注册 </a>
<a class="loginandreg" id="theme-login" href="javascript:;">登录</a>
<?php } ?>
</div>
</div>
<div id="titleimage">
<img src="images/bor.png" alt="alt" title="title" />
</div>
<div id="menu">
<ul id="tab">
<?php
$rs = $db->select("select * from t_producttype order by f_pid");
foreach($rs as $v)
{
?>
<li><a class="loginandreg" href="index.php?category=<?php echo $v['f_pid']?>" ><?php echo $v['f_typename']; ?></a></li>
<?php } ?>
</ul>
</div>
<div id="pageBody">
<table class="stripe">
<tr>
<th width="25%">产品图片</th>
<th width="35%">产品说明</th>
<th width="15%">价格</th>
<th width="15%">订购数量</th>
<th width="20%">订购</th>
</tr>
<?php
$rs = $db->select("select * from t_productinfo where f_category=$category");
foreach($rs as $v)
{
?>
<tr>
<td><img src="<?php echo $v['f_impagepath']; ?>" alt="alt" title="title" class="pic1" /> </td>
<td> <p><strong><?php echo $v['f_productname']; ?></strong></p><?php echo $v['f_productdetail']; ?></td>
<td style="font-family:Arial;color:ff0000"><span>¥</span><span id="price_<?php echo $v['f_id'];?>"><?php echo $v['f_price']; ?></span></td>
<td> <input type="button" id="denum" value=" - " style="font-size:12px" onclick="delnum(<?php echo $v['f_id'];?>)"/>
<input type="text" size="5" style="text-align:center;height:20px" id="addnum_<?php echo $v['f_id'];?>" value="0" />
<input type="button" id="addnum" value=" + " style="font-size:12px" onclick="addnum(<?php echo $v['f_id'];?>)"/>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
officewj.tar.gz (53个子文件)
officewj.boss.com
css
adminlogin.css 2KB
login2.css 8KB
select.css 5KB
login.css 1KB
index.css 4KB
admin_report.php 2KB
userlogin.php 2KB
index.php 13KB
admin_dep.php 4KB
images
p-bg.png 146B
base_bg.png 67KB
cglc.png 41KB
bg5.png 965B
bor.png 64KB
pro1.jpg 2KB
bor-admin.png 74KB
main.php 658B
right.php 26B
db
mysqlDb.php 4KB
officewj.sql 10KB
productimage
01.jpg 14KB
05.jpg 13KB
15.jpg 22KB
07.jpg 23KB
14.jpg 20KB
04.jpg 6KB
11.jpg 11KB
08.jpg 14KB
10.jpg 10KB
13.jpg 19KB
16.jpg 13KB
12.jpg 39KB
03.jpg 36KB
06.jpg 11KB
02.jpg 12KB
09.jpg 14KB
admin_shoppingcar.php 2KB
left.php 2KB
admin_ajax.php 3KB
js
jquery.js 95KB
jquery.min.js 93KB
jQuery-shopping.js 4KB
login.js 68B
top.php 393B
adminlogin.php 0B
addshopping.php 1KB
admin_reg.php 2KB
userreg.php 1KB
admin.php 3KB
test.php 25B
admin_producttype.php 4KB
index11.html 1013B
admin_product.php 5KB
共 53 条
- 1
资源评论
- winbaby0072018-08-02怎么没有个说明呢 都不知道怎么用。。。
problem2050
- 粉丝: 22
- 资源: 67
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功