forked from SecareLupus/fc_pos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbounties.php
83 lines (71 loc) · 2.09 KB
/
bounties.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
<?php
/**
* @file bounties.php
* @brief bounties.php is a page for posting and claiming Hedon Bounties
*
* This file includes:
* funcs.inc:
* - Used for the config.inc include
* - displayError()
*
* credits.inc:
* - displayAllBounties()
* - claimBounty()
*
* Possible Arguments:
* POST:
* - submit - Indicates a button was pushed, and which one.
*
* @link http://www.worldsapartgames.org/fc/bounties.php @endlink
*
* @author Desmond Duval
* @copyright 2009-2014 Pioneer Valley Gaming Collective
* @version 1.8d
* @since Project has existed since time immemorial.
*/
$title = "Unclaimed Bounties";
$version = "1.8d";
require_once 'funcs.inc' ;
require_once 'credits.inc';
if (isset($_POST['submit'])) {
extract($_POST);
if ($_POST['submit'] == 'submit bounty') {
$cxn = open_stream();
$note = strip_tags($bountyNote);
if (
$stmt = $cxn->prepare(
"INSERT INTO bounties
(daytime, hedons, notes)
VALUES
(NOW(), ?, ?)"
)
) {
$stmt->bind_param("ds", $bountyAmount, $note);
$stmt->execute();
} else {
displayError("Error Binding Query. Bounty not created. Contact your local High Programmer.");
}
}
if ($_POST['submit'] == 'submit claim') {
for ($i=0; $i<count($selectedBounties); $i++) {
claimBounty($selectedBounties[$i]);
sleep(1);
}
}
}
require_once 'header.php';
$cxn = open_stream();
$message .= '';
echo"<hr>";
if ($_SESSION['mem'] == 1) {
echo "<b>Create Bounty</b><br>
<form action='bounties.php' method='POST'>
Amount offered: <input type='text' maxlength=4 size=4 name='bountyAmount'><br>
Description: <input type='text' maxlength=50 size=12 name='bountyNote'>
<input type='submit' name='submit' value='submit bounty'></form><hr>";
}
echo "<form action='bounties.php' method='post'>";
displayAllBounties();
echo "<button name='submit' value='submit claim'>Claim</button><p></form>";
require_once 'footer.php';
?>