forked from rao1219/olhandicrafts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurchasegroup.php
94 lines (73 loc) · 2.19 KB
/
purchasegroup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
session_start();
?> <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>标题 - Handicrafts</title>
<?php
include 'templete\header.html';
define('ACCESS','1');
// session_start();
include 'conn/connect.php';
include 'conn/operate.php';
$id = $_GET['id'];
$iteminfo[] = operate::getmuchlinesql("`groupchou`","where id=$id");
if(isset($_GET['id'])&&isset($_GET['money']))
{
$id = $_GET['id'];
$item = operate::getoneline("`groupchou`","id=$id");
// echo var_dump($item);
$item['hasChou'] = $item['hasChou']+$_GET['money'];
$item['participate_num'] = $item['participate_num']+1;
$money = $_GET['money'];
$user = $_SESSION['username'];
echo $money;
$judge = 1;
if(floor($judge)!=$judge||$money<=0)
{
$judge = 0;
}
echo 'judge = '.$judge ;
if($judge == 0)
{
?>
<script>
alert('请输入合理的金额!');
window.location.href="groupchou.php";
</script>
<?php
}
else{
?>
<script>
alert('参与成功!');
</script>
<?php
operate::updateonelinesql("`groupchou`","hasChou",$item['hasChou'],"id=$id");
operate::updateonelinesql("`groupchou`","participate_num",$item['participate_num'],"id=$id");
echo $id;
operate::insertoneline("`member_has_chou`",array("membername","groupid","money"),array($user,$id,$money));
}
}
//echo var_dump($iteminfo);
//echo var_dump($iteminfo);
?>
<script>
window.location.href="groupchou.php";
</script>
<div class="cover-page-list fl wfs bcf2">
<div class="place fz12" style="padding-left:20px;">
您现在的位置:<a href=".">首页</a> <code>></code> <a href="#">手工艺众筹 - <?=$iteminfo[0][0]['name']?></a></div>
<div class="regist-process-wrapper">
<div class="nearby-process-body fl wfs">
</div></div></div></div>
<div class="blank"></div>
<div class="cover-page-index fl wfs bcf2" style="padding-top:20px;">
<div class="cover-page-wrapper">
<?php
include 'templete/footer.html';
?>
</body>
</html>