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
|
<!DOCTYPE html> <html> <head> <?php require_once '../include/head.php'; ?> <?php require_once '../include/checkuser.php'; ?> <?php require_once '../include/Nav_bar.php'; ?> <?php include_once '../include/DBConnect.php'; ?> <script> $(function() { $('.date-picker').datetimepicker({pickTime: false}); $('.stun').select2(); }); </script> </head> <?php $invoice_id; $startdate = date('Y-m-d'); $enddate = date('Y-m-d'); $today = date('Y-m-d'); ?> <body> <!-- line between nav bar and content --> <div class="text-right"> <ul class="breadcrumb"> <li class="active">Receipt</li> </ul> </div>
<div class="container-fluid pathways-container"> <div> <table border="0" width="100%"> <tr> <td><h2>Receipt</h2></td> <td><a href="receipt_search.php" class="btn pull-right"><i class="icon-plus"></i> Add</a></td> </tr> </table> </div> <div class="pathways-search"> <form id="search_form" class="form-inline" action="" method="POST"> <div class="pathways-inline-block"> <label class="">Date</label> <div class="input-append date-picker"> <input id="start_date" class="dateISO" type="text" maxlength="200" data-format="yyyy-MM-dd" name="startdate" value="<?php if (isset($_POST['go'])) echo $_POST['startdate']; else echo $startdate; ?>" style="width:90px" required> <span class="add-on"> <i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i> </span> </div>
<label class="" >To</label> <div class="input-append date-picker"> <input id="end_date" class="dateISO" type="text" maxlength="200" data-format="yyyy-MM-dd" name="enddate" value="<?php if (isset($_POST['go'])) echo $_POST['enddate']; else echo $enddate; ?>" style="width:90px" required> <span class="add-on"> <i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i> </span> </div> </div> <div class="pathways-inline-block"> <label>Receipt Code</label> <select name="searchreceipt" id="receipt" class="stun" style="width:230px"> <option value="ALL"> </option> <?php $sth = $dbh->query("SELECT `receipt_code` receipt_code,`receipt_id` receipt_id FROM `receipt` WHERE `actived`=1 and`deleted`=0"); ?> <?php while ($ResultSet = $sth->fetch(PDO::FETCH_ASSOC)) { ?> <option <?php if (isset($_POST['go'])) { if ($_POST['searchreceipt'] == $ResultSet['receipt_id']) { ?> selected <?php } } ?>value="<?= $ResultSet['receipt_id']; ?>"><?= $ResultSet['receipt_code'] ?></option> <?php } ?> </select> </div> <!--div class="pathways-inline-block"> <label>Campus</label> <select name="searchcampus"> <option value="ALL">ALL</option> <?php $query = "Select campus_id,campus_name from campus"; $result = $dbh->query($query); $result->setFetchMode(PDO::FETCH_OBJ); while ($row = $result->fetch()) { ?> <option <?php if(isset($_POST['go'])) { if ($_POST['searchcampus'] == $row->campus_id) { ?> selected <?php } } ?> value="<?=$row->campus_id ?>" ><?=$row->campus_name?></option>'; <?php } ?> </select> </div--> <div class="pathways-inline-block"> <button class="btn" name="go" value="go" style="margin-left:30px" type="submit">Search</button> </div> </form> </div> <?php if (isset($_POST['go'])) { $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $Tdata = false; $searchBycampus = NULL; // $searchcampus = $_POST['searchcampus']; $searchCode = $_POST['searchreceipt']; /* if($searchcampus != 'ALL'){ $searchBycampus = "campus_id = '$searchcampus' and "; }*/ ?> <form id="search_form" class="form-inline" action="" method="POST"> <table class="table table-striped table-bordered table-hover table-condensed" id="tablehead"> <thead> <tr> <th style="min-width:50px; width:5%"></th> <th style="min-width:50px; width:5%">Type</th> <th style="min-width:50px;">Receipt_Code</th> </tr> </thead> <tbody> <?php $query = "select receipt_id, receipt_code, is_normal from receipt where deleted = 0 and ". $searchBycampus ."receipt_date between '$startdate' and '$enddate' "; if ($searchCode != 'ALL') { $query = "select receipt_id, receipt_code, is_normal from receipt where deleted = 0 and ". $searchBycampus ." receipt_id = '$searchCode'"; } //$query = "select total_amount, invoice_code, event_code from invoice where deleted = 0 and stu_linking_id = '$studentid' "; $result = $dbh->query($query); $result->setFetchMode(PDO::FETCH_OBJ); while ($row = $result->fetch()) { $Tdata = true; ?> <tr> <td> <div class="btn-group" data-toggle="buttons"> <a href="receipt_View.php?id=<?= $row->receipt_id ?>" class="btn"><i class="icon-eye-open"></i> View</a> <!--a href="receipt_Edit.php?id=<?php // $row->receipt_id ?>" class="btn">Edit</a--> </div> </td> <td> <h5><?php if ($row->is_normal == 0) echo 'normal'; else echo'C C'; ?></h5> </td> <td> <h5><?= $row->receipt_code ?></h5> </td> </tr> <?php } if ($Tdata == FALSE) { ?> <tr><td colspan = "5"><h5>No Receipt searched</h5></td></tr> <?php } ?> </tbody> </table> </form> <?php } ?> </div> <!-- /container --> </body> </html>
|