-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.php
90 lines (84 loc) · 2.48 KB
/
payment.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
<?php
session_start();
include("header.php");
include("dbconnection.php");
if(isset($_POST[submit]))
{
$sql ="INSERT INTO payment(patientid,appointmentid,paiddate,paidtime,paidamount,status) values('$_GET[patientid]','$_GET[appointmentid]','$_POST[date]','$_POST[time]','$_POST[paidamount]','Active')";
if($qsql = mysqli_query($con,$sql))
{
echo "<script>alert('payment record inserted successfully...');</script>";
}
else
{
echo mysqli_error($con);
}
if($_POST[discountamount] != '0')
{
$sql ="UPDATE billing SET discount=$_POST[discountamount]+ discount, discountreason=CONCAT('$_POST[discountreason] , ', discountreason) WHERE appointmentid='$_GET[appointmentid]'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
}
}
if(isset($_SESSION[patientid]))
{
$sql="SELECT * FROM payment WHERE paymentid='$_GET[editid]' ";
$qsql = mysqli_query($con,$sql);
$rsedit = mysqli_fetch_array($qsql);
}
$billappointmentid = $_GET[appointmentid];
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">Payment Detail</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<form method="post" action="" name="frmpatprfl" onSubmit="return validateform()">
<table width="515" border="3">
<thead>
<tr>
<th colspan="2"> Add payment details.. </th>
</tr>
</thead>
<tbody>
<tr>
<td width="34%">Paid Date</td>
<td width="66%"><input type="date" value="<?php echo date("Y-m-d"); ?>" name="date" id="date"></td>
</tr>
<tr>
<td>Paid Time</td>
<td><input type="text" readonly="readonly" value="<?php echo date("H:i:s"); ?>" name="time" id="time"></td>
</tr>
<tr>
<td>Paid Amount</td>
<td><input name="paidamount" type="text" id="paidamount" value="0"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</tbody>
</table>
<p> </p>
</form>
<?php
include("viewpaymentreport.php");
?>
<table width="342" border="3">
<thead>
<tr>
<td colspan="2" align="center"><a href='patientreport.php?patientid=<?php echo $_GET[patientid]; ?>'><strong>View Patient Report>></strong></a></td>
</tr>
</thead>
</table>
<p> </p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>