-
Notifications
You must be signed in to change notification settings - Fork 0
/
billing.php
189 lines (183 loc) · 4.76 KB
/
billing.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
include("header.php");
include("dbconnection.php");
if(isset($_POST['submit']))
{
$servicetypeid= $_POST['servicetypeid'];
$billtype = "Service Charge";
include("insertbillingrecord.php");
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">Add Service Charge</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<h1>Add new Service Charge records</h1>
<form method="post" action="" name="frmbill" onSubmit="return validateform()">
<table width="342" border="3">
<tbody>
<tr>
<td width="34%">Date </td>
<td width="66%"><input min="<?php echo date("Y-m-d"); ?>" value="<?php echo date("Y-m-d"); ?>" type="date" name="date" id="date"></td>
</tr>
<tr>
</select>
</td>
</tr>
<tr>
<td>Extra charges</td>
<td><input type="text" name="amount" id="amount"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" id="submit" value="Add Service charge" /></td>
</tr>
</tbody>
</table>
</form>
<?php
$billappointmentid = $_GET['appointmentid'];
include("viewbilling.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>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>
<script type="application/javascript">
var alphaExp = /^[a-zA-Z]+$/; //Variable to validate only alphabets
var alphaspaceExp = /^[a-zA-Z\s]+$/; //Variable to validate only alphabets and space
var numericExpression = /^[0-9]+$/; //Variable to validate only numbers
var alphanumericExp = /^[0-9a-zA-Z]+$/; //Variable to validate numbers and alphabets
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; //Variable to validate Email ID
function validateform()
{
if(document.frmbill.treatment.value == "")
{
alert("Treatment Type should not be empty..");
document.frmbill.treatment.focus();
return false;
}
else if(!document.frmbill.treatment.value.match(alphaspaceExp))
{
alert("Treatment Type not valid..");
document.frmbill.treatment.focus();
return false;
}
else if(document.frmbill.date.value == "")
{
alert("Billing Date should not be empty..");
document.frmbill.date.focus();
return false;
}
else if(document.frmbill.time.value == "")
{
alert("Billing Time should not be empty..");
document.frmbill.time.focus();
return false;
}
else if(document.frmbill.amount.value == "")
{
alert("Amount should not be empty..");
document.frmbill.amount.focus();
return false;
}
else if(!document.frmbill.amount.value.match(numericExpression))
{
alert("Amount not valid..");
document.frmbill.amount.focus();
return false;
}
else if(document.frmbill.discount.value == "")
{
alert("Discount should not be empty..");
document.frmbill.discount.focus();
return false;
}
else if(!document.frmbill.discount.value.match(numericExpression))
{
alert("Discount not valid..");
document.frmbill.discount.focus();
return false;
}
else if(document.frmbill.tax.value == "")
{
alert("Tax Amount should not be empty..");
document.frmbill.tax.focus();
return false;
}
else if(!document.frmbill.tax.value.match(numericExpression))
{
alert("Tax Amount not valid..");
document.frmbill.tax.focus();
return false;
}
else if(document.frmbill.bill.value == "")
{
alert("Bill Amount should not be empty..");
document.frmbill.bill.focus();
return false;
}
else if(!document.frmbill.bill.value.match(numericExpression))
{
alert("Bill Amount not valid..");
document.frmbill.bill.focus();
return false;
}
else if(document.frmbill.textarea.value == "")
{
alert("Discount Reason should not be empty..");
document.frmbill.textarea.focus();
return false;
}
else if(!document.frmbill.textarea.value.match(alphaspaceExp))
{
alert("Discount Reason not valid..");
document.frmbill.textarea.focus();
return false;
}
else if(document.frmbill.paid.value == "")
{
alert("Paid Amount should not be empty..");
document.frmbill.paid.focus();
return false;
}
else if(!document.frmbill.paid.value.match(numericExpression))
{
alert("Paid Amount not valid..");
document.frmbill.paid.focus();
return false;
}
else if(document.frmbill.Dtime.value == "")
{
alert("Discharge Time should not be empty..");
document.frmbill.Dtime.focus();
return false;
}
else if(document.frmbill.Ddate.value == "")
{
alert("Discharge Date should not be empty..");
document.frmbill.Ddate.focus();
return false;
}
else
{
return true;
}
}
</script>