-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincomeAdd.html
153 lines (136 loc) · 5.7 KB
/
incomeAdd.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./internet/jquery.mobile-1.3.2.min.css">
<script src="./internet/jquery-1.8.3.min.js"></script>
<script src="./internet/jquery.mobile-1.3.2.min.js"></script>
<link rel="stylesheet" href="css/styles.css" />
<script src="./js/incomeAdd.js"></script>
<script>
$(document).ready(function() {
addAccountsDropDown();
addCategoriesDropDown();
$(".repeatPeriod").hide();
$('#repeat').value == "off";
$('#repeat').change(
function(){//*/
if(this.value == "on") {
$(".repeatPeriod").show();
} else {
$(".repeatPeriod").hide();
}
}
);
$("#save").on("click", function(event){
var condition;
if($('#repeat').val() == "on") {
condition = (($('#incomeName').val().length > 0) && ($('#incomeAmmount').val().length > 0) && ($('#drop-down-list-account').val().length > 0) && ($('#drop-down-list-account').val() != "points") && ($('#drop-down-list-category').val().length > 0) && (parseFloat($('#incomeAmmount').val()) != 0) && (parseFloat($('#incomeAmmount').val()) > 0) && ($('#drop-down-list-cycle').val().length > 0) && ($('#incomeRepeatEndDate').val().length > 0));
} else {
condition = (($('#incomeName').val().length > 0) && ($('#incomeAmmount').val().length > 0) && ($('#drop-down-list-account').val().length > 0) && ($('#drop-down-list-account').val() != "points") && ($('#drop-down-list-category').val().length > 0) && (parseFloat($('#incomeAmmount').val()) != 0) && (parseFloat($('#incomeAmmount').val()) > 0));
}
if(condition == true) {
if(confirm("Are you sure you want to create this income?")){
funcIncomeAdd();
} else {
event.preventDefault();
return false;
}
} else {
alert('Please fill all fields with corresponding values!');
return false;
}
});
});
</script>
</head>
<body>
<div data-role="page" id="incomeAdd">
<div data-role="header" id="header" class="header">
<h1><span class="titleTXT">Home Budget Manager</span></h1>
<a href="#" data-role="button" data-icon="back" data-rel="back" data-theme="c">Go Back</a>
<div data-role="navbar" id="navBarGoUP" data-iconpos="left">
<ul>
<li><a href="main.html" data-icon="home">Home</a></li>
<li><a href="incomesList.html" data-icon="bars" data-transition="slide" rel="external">Incomes</a></li>
</ul>
</div>
</div>
<div data-role="content">
<form id="formDetails">
<div data-role="fieldcontain">
<table width="100%">
<tr>
<td width="40%"><label for="incomeName" class="accTexStyle"><b>Income Name:</b></label></td>
<td><input type="text" name="incomeName" id="incomeName" value="" placeholder="Enter name..."></td>
</tr>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td><label for="incomeAmmount" class="accTexStyle">Income Amount (MKD):</label></td>
<td><input type="number" name="incomeAmmount" id="incomeAmmount" value="" placeholder="Enter amount..."></td>
</tr>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td><label for="drop-down-list-account" class="accTexStyle select">Choose Account:</label></td>
<td><select name="drop-down-list-account" id="drop-down-list-account" data-native-menu="false">
<option value="">Choose account</option>
<option value="Cash on hand">Cash on hand</option>
<option value="Credit Card">Credit Card</option>
<option value="Bank Account">Bank Account</option>
<option value="points" disable> . . . </option>
</select></td>
</tr>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td><label for="drop-down-list-category" class="accTexStyle select">Choose Category:</label></td>
<td><select name="drop-down-list-category" id="drop-down-list-category" data-native-menu="false">
<option value="">Choose category</option>
<option value="" disable> . . . </option>
</select></td>
</tr>
<tr><td colspan="2"><hr></td></tr>
</table>
<label for="repeat" class="accTexStyle">Repeat:</label>
<div id="leftRadioIncome">
<select name="repeat" id="repeat" data-role="slider" data-mini="true">
<option value="on">Yes</option>
<option value="off" selected="">No</option>
</select>
</div>
<table width="100%">
<tr class="repeatPeriod"><td colspan="2"><hr></td></tr>
<tr class="repeatPeriod">
<td><label for="drop-down-list-cycle" class="accTexStyle">Choose Repeat Cycle:</label></td>
<td><select name="incomeRepeatCycle" id="drop-down-list-cycle" data-native-menu="false">
<option value="">Cycle</option>
<option value="Hourly">Hourly</option>
<option value="Dayly">Dayly</option>
<option value="Weekly">Weekly</option>
<option value="Monthly">Monthly</option>
<option value="Yearly">Yearly</option>
</select></td>
</tr>
<tr class="repeatPeriod"><td colspan="2"><hr></td></tr>
<tr class="repeatPeriod">
<td><label for="incomeRepeatEndDate" class="accTexStyle">Repeat Until:</label></td>
<td><input type="date" name="incomeRepeatEndDate" id="incomeRepeatEndDate" value=""></td>
</tr>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td width="40%">   </td>
<td><input type="submit" id="save" data-inline="true" value="Create the income"></td>
</tr>
</table>
</div>
<div id="resultLog"></div>
</form>
<div id="busy">Loading...</div>
<hr>
<br>
<p class="fantasyStyle" align="right">Current Date: <span id="currentDate"></span></p>
</div>
<div data-role="footer" class="footer">
<h1><span class="titleTXT">Add Income</span></h1>
</div>
</div>
</body>
</html>