-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpledgeProject.php
More file actions
171 lines (155 loc) · 8.06 KB
/
Copy pathpledgeProject.php
File metadata and controls
171 lines (155 loc) · 8.06 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
/**
* Created by PhpStorm.
* User: louis
* Date: 4/28/17
* Time: 10:28 AM
*/
session_start();
require_once('include/header.php');
require_once ('include/dbconfig.php');
$pdo = db_connect();
$pid = $_GET['pid'];
$username = $_SESSION['username'];
$stmt = $pdo -> prepare(
"select *
from Payment
where username = :username"
);
$stmt -> execute([':username' => $username]);
$existingPayments = $stmt -> fetchAll();
?>
<!-- Bootstrap Select CSS -->
<link rel="stylesheet" href="css/components/bs-select.css" type="text/css" />
<link rel="stylesheet" href="css/responsive.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<style>
.white-section {
background-color: #FFF;
padding: 25px 20px;
-webkit-box-shadow: 0px 1px 1px 0px #dfdfdf;
box-shadow: 0px 1px 1px 0px #dfdfdf;
border-radius: 3px;
}
.white-section label {
display: block;
margin-bottom: 15px;
}
.white-section pre { margin-top: 15px; }
.dark .white-section {
background-color: #111;
-webkit-box-shadow: 0px 1px 1px 0px #444;
box-shadow: 0px 1px 1px 0px #444;
}
</style>
<!-- Page Title
============================================= -->
<section id="page-title">
</section><!-- #page-title end -->
<script src="../bower_components/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="../bower_components/bootstrap-fileinput/css/fileinput.min.css">
<!-- Content
============================================= -->
<section id="CreateProject">
<div class="content-wrap">
<form id="project-basic" name="project-basic" class="nobottommargin" action="process_pledge.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="pid" value='<?php echo $pid;?>'/>
<div class="container clearfix">
<div class="col_full">
<div class="white-section">
<label>How much you would like to pledge</label>
<input type="text" id="pledgeAmount" name="pledgeAmount" value="" class="sm-form-control" />
<label>Select your exsiting payments</label>
<select class="selectpicker" id="card-number" name="card-number" data-width="75%" data-style="btn-primary">
<?php
if (sizeof($existingPayments) > 0) {
foreach ($existingPayments as $row) {
$num = $row['cardNum'];
echo "<option value='$num'>$num</option>";
}
} else {
echo "<option> No existing payment </option>";
}
?>
</select>
<?php
if (sizeof($existingPayments) > 0) {
echo "<button type='submit' class='button button-3d'>Pay with this card</button>";
} else {
echo "<button type='submit' class='button button-3d' disabled>Pay with this card</button>";
}
?>
</div>
</div>
</div>
</form>
<form id="project-basic" name="project-basic" class="nobottommargin" action="process_pledge.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="pid" value='<?php echo $pid;?>'/>
<div class="container clearfix">
<div class="col-md-6">
<div class="col_full">
<label for="name-on-card">Name on card:</label>
<input type="text" id="name-on-card" name="name-on-card" value="" class="sm-form-control" />
</div>
</div>
<div class="col-md-6">
<div class="col_full">
<label>How much you would like to pledge</label>
<input type="text" id="pledgeAmount" name="pledgeAmount" value="" class="sm-form-control" />
</div>
</div>
<div class="col-md-12">
<div class="col_three_fifth">
<label for="card-number">Card Number:</label>
<input type="text" id="card-number" name="card-number" value="" class="sm-form-control" />
</div>
</div>
<div class="col-mid-12">
<div class="col-md-6">
<div class="col_full">
<label for="expiration-date">Expiration date:</label>
<input type="text" id="expiration-date" name="expiration-date" placeholder="MM/YY" class="sm-form-control" />
</div>
</div>
<div class="col-md-6">
<div class="col_full">
<label for="cvv">CVV number:</label>
<input type="text" id="cvv" name="cvv" value="" class="sm-form-control" />
</div>
</div>
</div>
<div class="col-md-12">
<div class="col_full">
<label for="billingAdd">Billing Address</label>
<input type="text" id="billingAdd" name="billingAdd" value="" class="sm-form-control" />
</div>
</div>
<div class="col-md-12">
<div class="col_one_third">
<div class="col_full">
<label for="city">City:</label>
<input type="text" id="city" name="city" value="" class="sm-form-control" />
</div>
</div>
<div class="col_one_third">
<div class="col_full">
<label for="state">State:</label>
<input type="text" id="state" name="state" value="" class="sm-form-control" />
</div>
</div>
<div class="col_one_fourth">
<div class="col_full">
<label for="zip">Zip:</label>
<input type="text" id="zip" name="zip" value="" class="sm-form-control" />
</div>
</div>
<button type="submit" class="button button-3d fright">Pay with new card</button>
</div>
</div>
</form>
</div>
</section><!-- #content end -->
<?php
require_once ('include/footer.html');
?>