Skip to content

Commit 888a3b5

Browse files
fixing the book return logic
1 parent 099b7c4 commit 888a3b5

File tree

4 files changed

+191
-188
lines changed

4 files changed

+191
-188
lines changed

penalty.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<?php
1313
include('config.php');
1414
if(isset($_GET['borrowid'])){
15-
16-
$q=mysql_query("select * from tblborrow where borrowid='".$_GET['borrowid']."'");
17-
15+
16+
$q=mysql_query("select * from book_loans where loan_id='".$_GET['borrowid']."'");
17+
1818
$name=mysql_fetch_array($q)or die(mysql_error());
1919

2020
}
@@ -31,10 +31,10 @@
3131
<input type="text" readonly="readonly" name="borrowersid" style="padding:4px; width:250px;" value="<?php echo $name['studentid']; ?>"><br/>
3232
</td></tr>
3333
<?php
34-
$q=mysql_query("select * from tblborrower where studentid='".$name['studentid']."'");
35-
34+
$q=mysql_query("select * from borrower where card_no='".$name['card_no']."'");
35+
3636
$id=mysql_fetch_array($q)or die(mysql_error());
37-
37+
3838
?>
3939
<tr><td>
4040
Borrowers Name:
@@ -50,7 +50,7 @@
5050
</td><td>
5151
<input type="text" readonly="readonly" name="datedue" style="padding:4px; width:250px;" value="<?php echo date_format(date_create($name['duedate']), 'F d Y'); ?>" />
5252
</td></tr>
53-
<?php
53+
<?php
5454

5555
include('config.php');
5656
$sql="SELECT * FROM tblpayment";
@@ -94,7 +94,7 @@
9494
</td></tr>
9595
<tr><td>
9696
Php
97-
</td>
97+
</td>
9898
<td><input type="text" readonly="readonly" value="<?php echo number_format($numberDays*$rowpay['amount'],2); ?>"></td></tr>
9999
</table>
100100

@@ -108,58 +108,58 @@
108108

109109
<?php
110110
if(isset($_POST['resibo'])){
111-
111+
112112
/*$borrowersid=$_POST['borrowersid'];
113113
$datedue=$_POST['datedue'];
114114
$datereturn=$_POST['datereturn'];
115115
$totaldays=$_POST['totaldays'];
116116
$total=$_POST['total'];
117-
117+
118118
$sql="insert into tblreciept (borrowersid,datedue,datereturn,totaldays,totalpay) values(
119119
'".$borrowersid."',
120120
'".$datedue."',
121121
'".$datereturn."',
122122
'".$totaldays."',
123123
'".$total."'
124124
)";
125-
125+
126126
$pay=mysql_query($sql) or die (mysql_error());
127-
if($pay){*/
128-
127+
if($pay){*/
128+
129129
?>
130130

131131
<script>
132-
$(document).ready(function(){
132+
$(document).ready(function(){
133133
$("#div5").fadeIn(1000);
134-
135134

136-
135+
136+
137137
});
138138
</script>
139-
<?php
139+
<?php
140140
// }
141141
?>
142-
143-
142+
143+
144144
<?php
145145
}
146146
if(isset($_GET['print/save'])){?>
147147
<script>
148-
$(document).ready(function(){
148+
$(document).ready(function(){
149149
$("#div5").fadeIn(1000);
150-
151150

152-
151+
152+
153153
});
154154
</script>
155155
<?php
156156
}
157157
?>
158158

159159

160-
<?php
160+
<?php
161161
/*if(isset($_POST['pay'])){
162-
include('config.php');
162+
include('config.php');
163163
$borrowersid=$_POST['borrowersid'];
164164
$datedue=$_POST['datedue'];
165165
$datereturn=$_POST['datereturn'];
@@ -174,7 +174,7 @@
174174
'".$totaldays."',
175175
'".$total."'
176176
)";
177-
177+
178178
$pay=mysql_query($sql) or die (mysql_error());
179179
if($pay){
180180
echo "success";

0 commit comments

Comments
 (0)