-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.php
173 lines (142 loc) · 8.3 KB
/
index.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
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
172
173
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
include('./assets/helpers/functions.php');
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Title & Description: Change the title and description to suit your needs. -->
<title><?php if(isset($_GET['client']) && isset($_GET['invoice'])) { ?><?php if(get_client('client') && get_invoice('invoice')) { ?>Invoice <?php get_invoice('number'); ?> | <?php echo(get_invoice('status')); ?><?php } else { ?>Sorry, no invoices here.<?php } ?><?php } else { ?><?php echo($business_name); ?><?php } ?></title>
<meta name="description" content="<?php echo($business_name); ?>">
<!-- Viewport Meta: Just taming mobile devices like iPads and iPhones. -->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"/>
<!-- Styles: The primary styles for this template. -->
<link rel="stylesheet" type="text/css" href="assets/styles/normalize.css">
<link rel="stylesheet" type="text/css" href="assets/styles/main.css?ver=1.0">
<link rel="stylesheet" type="text/css" href="assets/styles/responsive.css?ver=1.0">
<!-- Favicon: Change to whatever you like within the “assets/images” folder. -->
<link rel="shortcut icon" type="" href="assets/images/favicon.png">
<!-- Required Scripts: Not too much needed for this template. -->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="https://js.stripe.com/v2/" type="text/javascript"></script>
<script type="text/javascript" src="assets/scripts/main.js"></script>
<?php include('./assets/scripts/stripe.php'); ?>
</head>
<body>
<?php if(isset($_GET['client']) && isset($_GET['invoice'])) { ?>
<?php if(get_client('client') && get_invoice('invoice')) { ?>
<section id="invoice" <?php if(get_invoice('status') != 'Not Paid') { ?>class="paid"<?php } ?>>
<div class="content">
<div class="row intro">
<?php if($avatar_image) { ?>
<img src="assets/images/profile.jpg" />
<?php } ?>
<h1><?php echo($business_name); ?><br><strong><a href="mailto:<?php echo($business_email); ?>"><?php echo($business_email); ?></a></strong></h1>
</div>
<div class="row details">
<div class="client">
<span>To: <?php get_client('name'); ?><br><strong><?php get_client('email'); ?></strong></span>
</div>
<div class="status">
<span>Invoice: <?php get_invoice('number'); ?><br><strong><?php if(get_invoice('status') == 'Not Paid') { ?>Not Paid<?php } else { ?>Paid<?php } ?></strong></span>
</div>
</div>
<div class="row title">
<h2>Work Completed</h2>
</div>
<ul class="row items">
<?php get_invoice('items'); ?>
</ul>
<div class="row title">
<h2>Tax & Total</h2>
</div>
<ul class="row items">
<li class="row item">
<h3>Subtotal</h3>
<span class="subtotal"><?php get_invoice('subtotal'); ?></span>
</li>
<li class="row item">
<h3>Tax</h3>
<span class="tax"><?php get_invoice('tax'); ?></span>
</li>
<li class="row item">
<h3><strong>Total <?php if(get_invoice('status') == 'Not Paid') { ?>Due<?php } else { ?>Paid<?php } ?></strong></h3>
<span class="total"><?php get_invoice('total'); ?></span>
</li>
</ul>
</div>
<?php if(get_invoice('status') == 'Not Paid') { ?>
<div class="actions">
<div class="content">
<span><?php get_invoice('due'); ?></span>
<a class="open button" href="#order">Make a <strong>Payment</strong></a>
</div>
</div>
<?php } ?>
</section>
<section class="panel closed" id="order">
<div class="processing">
<!-- Processing the Payment -->
</div>
<a class="icon close" href="#order"></a>
<div class="content centered">
<h2>Make a Payment<br><strong>Invoice: <?php get_invoice('number'); ?></strong></h2>
<p>Enter your payment information below to pay this invoice. A receipt for your records will be sent to you. Thank you very much!</p>
<form id="purchase-form" autocomplete="on" method="post" action="" novalidate>
<input type="hidden" id="invoice_number" name="invoice_number" value="<?php get_invoice('number'); ?>" />
<input type="hidden" id="invoice_subtotal" name="invoice_subtotal" value="<?php get_invoice('subtotal'); ?>" />
<input type="hidden" id="invoice_tax" name="invoice_tax" value="<?php get_invoice('tax'); ?>" />
<input type="hidden" id="invoice_total" name="invoice_total" value="<?php get_invoice('total'); ?>" />
<input type="hidden" id="stripe_total" name="stripe_total" value="<?php get_invoice('stripe'); ?>" />
<div class="row">
<input type="text" id="name" name="name" placeholder="Your Name *" required>
<input type="text" id="email" name="email" placeholder="Your Email *" required>
<input type="text" id="number" pattern="\d*" autocomplete="number" placeholder="Credit Card Number *" required>
<input type="text" id="expiration" pattern="\d*" autocomplete="expiration" placeholder="MM / YYYY *" required>
<input type="text" id="cvc" pattern="\d*" autocomplete="off" placeholder="CVC *" required>
<input type="text" id="zip" autocomplete="off" placeholder="Zip / Postal *" required>
</div>
<button type="submit" class="button">Pay <strong><?php get_invoice('total'); ?></strong></button>
</form>
</div>
</section>
<section class="panel status closed" id="errors">
<a class="icon close" href="#errors"></a>
<div class="content centered">
<span class="icon error"></span>
<h2>Oops!</h2>
<p></p>
</div>
</section>
<?php if(get_invoice('status') != 'Not Paid') { ?>
<section class="panel status opened" id="paid">
<a class="icon close" href="#paid"></a>
<div class="content centered">
<span class="icon paid"></span>
<h2><?php echo(get_invoice('status')); ?></h2>
<p>Thanks for your business.</p>
</div>
</section>
<?php } ?>
<?php } else { ?>
<section class="panel status opened" id="errors">
<div class="content centered">
<span class="icon error"></span>
<h2>Oops!</h2>
<p>Sorry, no invoices here.</p>
</div>
</section>
<?php } ?>
<?php } else { ?>
<section id="brand">
<div class="content centered">
<?php if($avatar_image) { ?>
<img src="assets/images/profile.jpg" />
<?php } ?>
<h1><?php echo($business_name); ?><br><strong><a href="mailto:<?php echo($business_email); ?>"><?php echo($business_email); ?></a></strong></h1>
</div>
</section>
<?php } ?>
</body>
</html>