-
Notifications
You must be signed in to change notification settings - Fork 1
/
form.trailer.php
340 lines (337 loc) · 9.89 KB
/
form.trailer.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<script type = "text/javascript" >
function validateTrailer(){
var uid = document.forms["frmTrailer"]["uid"].value;
var make = document.forms["frmTrailer"]["make"].value;
var yr_model = document.forms["frmTrailer"]["yr_model"].value;
var yr_first_sold = document.forms["frmTrailer"]["yr_first_sold"].value;
var vlf_class = document.forms["frmTrailer"]["vlf_class"].value;
var type_veh = document.forms["frmTrailer"]["type_veh"].value;
var type_lic = document.forms["frmTrailer"]["type_lic"].value;
var license_num = document.forms["frmTrailer"]["license_num"].value;
var body_type_model = document.forms["frmTrailer"]["body_type_model"].value;
var mp = document.forms["frmTrailer"]["mp"].value;
var mo = document.forms["frmTrailer"]["mo"].value;
var ax = document.forms["frmTrailer"]["ax"].value;
var wc = document.forms["frmTrailer"]["wc"].value;
var unladen_g_cgw = document.forms["frmTrailer"]["unladen_g_cgw"].value;
var vehicle_id_num = document.forms["frmTrailer"]["vehicle_id_num"].value;
var type_vehicle_use = document.forms["frmTrailer"]["type_vehicle_use"].value;
var date_issued = document.forms["frmTrailer"]["date_issued"].value;
var cc_alco = document.forms["frmTrailer"]["cc_alco"].value;
var dt_fee_recvd = document.forms["frmTrailer"]["dt_fee_recvd"].value;
var pic = document.forms["frmTrailer"]["pic"].value;
var registered_owner = document.forms["frmTrailer"]["registered_owner"].value;
var amount_due = document.forms["frmTrailer"]["amount_due"].value;
var amount_recvd = document.forms["frmTrailer"]["amount_recvd"].value;
var amount_paid = document.forms["frmTrailer"]["amount_paid"].value;
if(uid == null || uid == ""){
alert("uid can't be empty");
return false;
}
if(make == null || make == ""){
alert("make can't be empty");
return false;
}
if(yr_model == null || yr_model == ""){
alert("yr_model can't be empty");
return false;
}
if(yr_first_sold == null || yr_first_sold == ""){
alert("yr_first_sold can't be empty");
return false;
}
if(vlf_class == null || vlf_class == ""){
alert("vlf_class can't be empty");
return false;
}
if(type_veh == null || type_veh == ""){
alert("type_veh can't be empty");
return false;
}
if(type_lic == null || type_lic == ""){
alert("type_lic can't be empty");
return false;
}
if(license_num == null || license_num == ""){
alert("license_num can't be empty");
return false;
}
if(body_type_model == null || body_type_model == ""){
alert("body_type_model can't be empty");
return false;
}
if(mp == null || mp == ""){
alert("mp can't be empty");
return false;
}
if(mo == null || mo == ""){
alert("mo can't be empty");
return false;
}
if(ax == null || ax == ""){
alert("ax can't be empty");
return false;
}
if(wc == null || wc == ""){
alert("wc can't be empty");
return false;
}
if(unladen_g_cgw == null || unladen_g_cgw == ""){
alert("unladen_g_cgw can't be empty");
return false;
}
if(vehicle_id_num == null || vehicle_id_num == ""){
alert("vehicle_id_num can't be empty");
return false;
}
if(type_vehicle_use == null || type_vehicle_use == ""){
alert("type_vehicle_use can't be empty");
return false;
}
if(date_issued == null || date_issued == ""){
alert("date_issued can't be empty");
return false;
}
if(cc_alco == null || cc_alco == ""){
alert("cc_alco can't be empty");
return false;
}
if(dt_fee_recvd == null || dt_fee_recvd == ""){
alert("dt_fee_recvd can't be empty");
return false;
}
if(pic == null || pic == ""){
alert("pic can't be empty");
return false;
}
if(registered_owner == null || registered_owner == ""){
alert("registered_owner can't be empty");
return false;
}
if(amount_due == null || amount_due == ""){
alert("amount_due can't be empty");
return false;
}
if(amount_recvd == null || amount_recvd == ""){
alert("amount_recvd can't be empty");
return false;
}
if(amount_paid == null || amount_paid == ""){
alert("amount_paid can't be empty");
return false;
}
return true;
}
</script>
<?php
include("header.php");
include("class.trailer.dao.php");
?>
<center>
<h3>Add Trailer</h3>
<form name = "frmTrailer" method="POST" action="save.trailer.php" onsubmit = "return validateTrailer();">
<table cellspacing="5" cellpadding="5">
<?php
if(isset($_GET["id"])){
$dao = new DAOtrailer();
$vo = $dao->get($_GET["id"]);
?>
<tr>
<td> Make </td>
<td><input type = "text" name = "make" value= "<?=$vo->make?> "/></td>
</tr>
<tr>
<td> Year Model </td>
<td><input type = "text" name = "yr_model" value= "<?=$vo->yr_model?> "/></td>
</tr>
<tr>
<td> Year First Sold </td>
<td><input type = "text" name = "yr_first_sold" value= "<?=$vo->yr_first_sold?> "/></td>
</tr>
<tr>
<td> Vlf Class </td>
<td><input type = "text" name = "vlf_class" value= "<?=$vo->vlf_class?> "/></td>
</tr>
<tr>
<td> Vehicle Type </td>
<td><input type = "text" name = "type_veh" value= "<?=$vo->type_veh?> "/></td>
</tr>
<tr>
<td> License Type </td>
<td><input type = "text" name = "type_lic" value= "<?=$vo->type_lic?> "/></td>
</tr>
<tr>
<td> License Num </td>
<td><input type = "text" name = "license_num" value= "<?=$vo->license_num?> "/></td>
</tr>
<tr>
<td> Model Body Type </td>
<td><input type = "text" name = "body_type_model" value= "<?=$vo->body_type_model?> "/></td>
</tr>
<tr>
<td> MP </td>
<td><input type = "text" name = "mp" value= "<?=$vo->mp?> "/></td>
</tr>
<tr>
<td> MO </td>
<td><input type = "text" name = "mo" value= "<?=$vo->mo?> "/></td>
</tr>
<tr>
<td> AX </td>
<td><input type = "text" name = "ax" value= "<?=$vo->ax?> "/></td>
</tr>
<tr>
<td> WC </td>
<td><input type = "text" name = "wc" value= "<?=$vo->wc?> "/></td>
</tr>
<tr>
<td> Unladen G Cgw </td>
<td><input type = "text" name = "unladen_g_cgw" value= "<?=$vo->unladen_g_cgw?> "/></td>
</tr>
<tr>
<td> Vehicle Id Num </td>
<td><input type = "text" name = "vehicle_id_num" value= "<?=$vo->vehicle_id_num?> "/></td>
</tr>
<tr>
<td> Vehicle Use Type </td>
<td><input type = "text" name = "type_vehicle_use" value= "<?=$vo->type_vehicle_use?> "/></td>
</tr>
<tr>
<td> Date Issued </td>
<td><input type = "text" name = "date_issued" value= "<?=$vo->date_issued?> "/></td>
</tr>
<tr>
<td> Cc Alco </td>
<td><input type = "text" name = "cc_alco" value= "<?=$vo->cc_alco?> "/></td>
</tr>
<tr>
<td> Date Fee Recieved </td>
<td><input type = "text" name = "dt_fee_recvd" value= "<?=$vo->dt_fee_recvd?> "/></td>
</tr>
<tr>
<td> Picture </td>
<td><input type = "text" name = "pic" value= "<?=$vo->pic?> "/></td>
</tr>
<tr>
<td> Registered Owner </td>
<td><input type = "text" name = "registered_owner" value= "<?=$vo->registered_owner?> "/></td>
</tr>
<tr>
<td> Amount Due </td>
<td><input type = "text" name = "amount_due" value= "<?=$vo->amount_due?> "/></td>
</tr>
<tr>
<td> Amount Recieved </td>
<td><input type = "text" name = "amount_recvd" value= "<?=$vo->amount_recvd?> "/></td>
</tr>
<tr>
<td> Amount Paid </td>
<td><input type = "text" name = "amount_paid" value= "<?=$vo->amount_paid?> "/></td>
</tr>
<tr colspan = "2">
<th><input type = "submit" value= "EDIT" /></th>
</tr>
<input type = "hidden" name = "trailer_id" value= "<?=$vo->trailer_id?> "/>
<?}else{?>
<tr>
<td> Make </td>
<td><input type = "text" name = "make" /></td>
</tr>
<tr>
<td> Year Model </td>
<td><input type = "text" name = "yr_model" /></td>
</tr>
<tr>
<td> Year First Sold </td>
<td><input type = "text" name = "yr_first_sold" /></td>
</tr>
<tr>
<td> Vlf Class </td>
<td><input type = "text" name = "vlf_class" /></td>
</tr>
<tr>
<td> Vehicle Type </td>
<td><input type = "text" name = "type_veh" /></td>
</tr>
<tr>
<td> License Type </td>
<td><input type = "text" name = "type_lic" /></td>
</tr>
<tr>
<td> License Number </td>
<td><input type = "text" name = "license_num" /></td>
</tr>
<tr>
<td> Model Body Type </td>
<td><input type = "text" name = "body_type_model" /></td>
</tr>
<tr>
<td> MP </td>
<td><input type = "text" name = "mp" /></td>
</tr>
<tr>
<td> MO </td>
<td><input type = "text" name = "mo" /></td>
</tr>
<tr>
<td> AX </td>
<td><input type = "text" name = "ax" /></td>
</tr>
<tr>
<td> WC </td>
<td><input type = "text" name = "wc" /></td>
</tr>
<tr>
<td> Unladen G Cgw </td>
<td><input type = "text" name = "unladen_g_cgw" /></td>
</tr>
<tr>
<td> Vehicle Id Num </td>
<td><input type = "text" name = "vehicle_id_num" /></td>
</tr>
<tr>
<td> Vehicle Use Type </td>
<td><input type = "text" name = "type_vehicle_use" /></td>
</tr>
<tr>
<td> Date Issued </td>
<td><input type = "text" name = "date_issued" /></td>
</tr>
<tr>
<td> Cc Alco </td>
<td><input type = "text" name = "cc_alco" /></td>
</tr>
<tr>
<td> Date Fee Recieved </td>
<td><input type = "text" name = "dt_fee_recvd" /></td>
</tr>
<tr>
<td> Picture </td>
<td><input type = "text" name = "pic" /></td>
</tr>
<tr>
<td> Registered Owner </td>
<td><input type = "text" name = "registered_owner" /></td>
</tr>
<tr>
<td> Amount Due </td>
<td><input type = "text" name = "amount_due" /></td>
</tr>
<tr>
<td> Amount Recieved </td>
<td><input type = "text" name = "amount_recvd" /></td>
</tr>
<tr>
<td> Amount Paid </td>
<td><input type = "text" name = "amount_paid" /></td>
</tr>
<tr colspan = "2">
<th><input type = "submit" class="btn btn-info" value= "ADD" /></th>
</tr>
<?}?>
</table>
</form>
</center>
<?
include("footer.php");
?>