-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathadmin_user_receipt.php
More file actions
182 lines (166 loc) · 5.6 KB
/
admin_user_receipt.php
File metadata and controls
182 lines (166 loc) · 5.6 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
172
173
174
175
176
177
178
179
180
181
182
<br>
<?php
session_start();
if(isset($_SESSION["sess_username"]))
{
echo '<h6>Your session is currently ACTIVE '.$_SESSION["sess_username"].'</h6>';
}
else
{
header("location:index.php");
}
if( $_SESSION['sess_user_type'] == "U" || $_SESSION['sess_user_type'] == "A") {
}
else {
header('Location: index.php');
}
require 'database.php';
$rec_receipt_no = null;
if ( !empty($_GET['rec_receipt_no'])) {
$rec_receipt_no = $_REQUEST['rec_receipt_no'];
}
if ( null==$rec_receipt_no ) {
header("Location: index.php");
}
else {
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT *
FROM receipts a
LEFT JOIN general_ledger b ON a.rec_gen_led_id=b.gen_led_id
LEFT JOIN member c ON b.gen_led_users_mem_no=c.mem_no
WHERE rec_receipt_no = ?";
$q = $pdo->prepare($sql);
$q->execute(array($rec_receipt_no));
$data = $q->fetch(PDO::FETCH_ASSOC);
Database::disconnect();
}
?>
<!-- INSTRUCTIONS: this is the header and footer template for the primary USER pages. Code your forms, tables, etc., below the navigation tags. Placeholders have been included where variables will be displayed based on session login information for the user. Leave these "AS IS" for now. To maintain consistency, please do not change the header information other than where indicated with additional comments. -->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css">
<link rel="stylesheet" type="text/css" href="css/new_master_stylesheet.css">
<title>Membership and Accounting System (MAS)</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="main-heading">
<h1>Yokota Sportsmen's Club</h1>
</div>
<div class="logininfo">
</div>
<!-- this redirects the user to a signout page where the variables will be reset and the session terminated -->
<br>
<div class="ReceiptDate">
<?php
echo date("Y/m/d");
?>
</div>
<br>
<br>
<br>
<!-- IMPORTANT #2: change the H3 tag to match the title of YOUR specific wireframe -->
<div class="individual-page-title">
<h3>Receipt</h3>
</div><br><br>
<label class="receipt-label">Member #:</label>
<label class="receipt-info">
<?php echo $data['mem_no'];?>
</label><br><br>
<label class="receipt-label">Member First Name:</label>
<label class="receipt-info">
<?php echo $data['mem_fname'];?><br>
</label><br><br>
<label class="receipt-label">Member Last Name:</label>
<label class="receipt-info">
<?php echo $data['mem_lname'];?>
</label><br><br>
<label class="receipt-label">Installation:</label>
<label class="receipt-info">
<?php echo $data['mem_installation'];?>
</label><br><br>
<label class="receipt-label">Street Address:</label>
<label class="receipt-info">
<?php echo $data['mem_add_street'];?><br>
<?php echo $data['mem_add_city'];?>
<?php echo $data['mem_add_state'];?>
<?php echo $data['mem_add_zip'];?>
</label>
<!-- IMPORTANT #3: insert/paste YOUR code below to create the table, form, etc. -->
<br><br>
<table class="user-table">
<thead>
<th>Transaction<br>Date/Time</th>
<th>General<br>Ledger <br> ID</th>
<th>Receipt #</th>
<th>Description</th>
<th>Transaction</th>
<th>Income Type</th>
<th>Expense Type</th>
<th>Serial #</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Amount<br>($)</th>
<th>Received By</th>
</thead>
<tbody>
<br>
<?php
$sql = "SELECT *
FROM general_ledger a
LEFT JOIN receipts b ON a.gen_led_id=b.rec_gen_led_id
LEFT JOIN ref_gen_led_transaction_type c ON a.gen_led_transaction_type=c.ref_gen_led_transaction_typ
LEFT JOIN ref_gen_led_expense_type d ON a.gen_led_expense_type=d.ref_gen_led_expense_typ
LEFT JOIN ref_gen_led_income_type e ON a.gen_led_income_type=e.ref_gen_led_income_typ
LEFT JOIN atf f ON a.gen_led_id=f.atf_gen_led_id
LEFT JOIN price_list g ON f.atf_serial_no=g.pri_li_serial_no
WHERE rec_receipt_no = $rec_receipt_no
ORDER BY gen_led_id DESC";
foreach ($pdo->query($sql) as $row) {
echo '<tr>';
echo '<td>'. $row['gen_led_trans_date'] . '</td>';
echo '<td>'. $row['gen_led_id'] . '</td>';
echo '<td>'. $row['rec_receipt_no'] . '</td>';
echo '<td>'. $row['gen_led_description'] . '</td>';
echo '<td>'. $row['ref_gen_led_transaction_desc'] . '</td>';
echo '<td>'. $row['ref_gen_led_income_desc'] . '</td>';
echo '<td>'. $row['ref_gen_led_expense_desc'] . '</td>';
echo '<td>'. $row['pri_li_serial_no'] . '</td>';
echo '<td>'. $row['pri_li_manufacturer'] . '</td>';
echo '<td>'. $row['pri_li_model'] . '</td>';
echo '<td>$'. $row['gen_led_amount'] . '</td>';
echo '<td>'. $row['gen_led_add_by'] . '</td>';
echo ' ';
echo '</tr>';
}
Database::disconnect();
?>
</tbody>
</table>
</center>
<br><br><br><br><br><br><br><br>
<div id="button-one">
<SCRIPT LANGUAGE="JavaScript">
if (window.print) {
document.write('<form><input type="button" name="print" value="Print Receipt"onClick="window.print()"></form>');
}
</script>
</div><br><br>
<div class="back">
<ul>
<li><button onclick="goBack()">Go Back</button></li>
<script>
function goBack() {
window.history.back();
}
</script>
</ul>
</div>
<!-- Page footer; please do not change. Footer should always be on the bottom of the page but not fixed. -->
<footer>
<p>This site is intended for personal use by the members of the Yokota Sportsmen's Club specifically for conducting club business. All rights reserved. Yokota Sportsmen's Club, Fussa-shi, Tokyo, Japan | Yokota Air Base, Tokyo, Japan</p>
</body>
</html>