forked from monika-gautam/Bill-App-Latest-version
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
186 lines (163 loc) · 4.58 KB
/
index.html
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
<html>
<head>
<title> Bill Claims Management Application</title>
<link rel="stylesheet" type="text/css" media="all" href="/jsdate/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="/jsdate/jsDatePick.min.1.3.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<script language="javascript">
$('.g_l.DAYS_3').pickadate({
disable: [7]
});
function isAlpha(thefield)
{
var v=thefield.value;
l=v.length;
for(i=0;i<l;i++)
{
c=v.substring(i,i+1);
if(!(c>='A' && c<='Z' || c>='a' && c<='z' || c==' '))
{
thefield.focus();
return false;
}
}
return true;
}
function isEmpty(thefield){
var v=thefield.value;
l=v.length;
if(l==0){thefield.focus();
return true;
}
return false;
}
function f(){
new JsDatePick({
useMode:2,
target:"dateval",
dateFormat:"%Y/%m/%d"
});
}
function checkDt(thefield){
//alert("checking date");
var dt=thefield.value;
d=dt.substring(8,10);
m=dt.substring(5,7);
y=dt.substring(0,4);
//alert(""+d+m+y);
sep1=dt.substring(4,5);
sep2=dt.substring(7,8);
if(sep1!='/' || sep2!='/')
{
// alert("sep");
return false;
}
else if(d<1 || d>31 || m<1 || m>12|| y<1950 || y>2017)
{
return false;
}
else if((m==4 || m==6 || m==9 || m==11) && d>30)
{
return false;
}
else if(m==2)
{
if(y%4==0 && !(y%400!=0 && y%100==100) )
{
if(d>29)
return false;
}
else if(d>28)
return false;
}
return true;
}
function isId(thefield)
{
var s=thefield.value;
var i=s.substring(0,2);
if (i!="XI")
return false;
return true;
}
function validate(){
if (document.myForm.id.value=="XI"){
alert("Employee ID: Incomplete field value");
document.myForm.id.focus();
}
else if (!isId(document.myForm.id)){
alert("Employee ID: Invalid");
document.myForm.id.focus();
}
else if (isEmpty(document.myForm.name)){
alert("Name: Empty field");
document.myForm.name.focus();
}
else if (!isAlpha(document.myForm.name)){
alert("Employe Name: non-alphabetic");
document.myForm.name.focus();
}
else if (isEmpty(document.myForm.acc)){
alert("Bank A/C No. (UserId): Empty field");
document.myForm.acc.focus();
}
else if (isEmpty(document.myForm.mname)){
alert(" Manager: Empty field");
document.myForm.mname.focus();
}
else if (!isAlpha(document.myForm.mname)){
alert("Name: Non-alphabetic");
document.myForm.mname.focus();
}
else if(isEmpty(document.myForm.dateval))
{
alert("Date Field can't be left empty");
document.myForm.dateval.focus();
}
else if(!checkDt(document.myForm.dateval))
{
alert("Date : Invalid ");
document.myForm.dateval.focus();
}
else
{
document.myForm.action="feedData.php";
document.myForm.submit();
}
}
</script>
</head>
<form class="pure-form pure-form-stacked" name="myForm" method="post">
<fieldset>
<center>
<h2>Bill Claims Management Application</h2>
<h3><legend>Developed by Monika Gautam & Shashank Srivastava</legend></h3>
<label for="nature">Expenses Nature:</label>
<select name="exp">
<option selected value="Weekly">Weekly
<option value="15 days"> 15 days
<option value="Monthly">Monthly
</select>
<label for="dateval">Bill Submission Date: </label>
<input id="dateval" type="text" placeholder="Choose Date" name="dateval" onClick="f()">
<span class="pure-form-message">This is a required field.</span>
<label for="id">Employee ID : </label>
<input id="id" type="email" name="id" value="XI" autofocus>
<span class="pure-form-message">This is a required field.</span>
<label for="name">Employee Name : </label>
<input id="name" type="text" placeholder="Enter your Name"name="name">
<span class="pure-form-message">This is a required field.</span>
<label for="acc">Bank Account Number : </label>
<input id="acc" type="text" placeholder="Enter Bank Account Number" name="acc">
<span class="pure-form-message">This is a required field.</span>
<label for="manager">Manager : </label>
<input id="mname" type="text" placeholder="Enter Manager's Name" name="mname">
<span class="pure-form-message">This is a required field.</span>
<br>
<input type="button" class="pure-button pure-button-primary" value="Next" onClick="validate()">
<input type="reset" class="pure-button pure-button-primary" value="Cancel">
<input type="button" class="pure-button pure-button-primary" value="See History" onclick="location.href='billHistory.php';"">
</fieldset>
</form>
</body>
</html>