-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·603 lines (568 loc) · 28.6 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
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=0.8">
<meta charset="UTF-8">
<title>Addi's Egg Incubator</title>
<link rel="stylesheet" href="css/mat.css">
<link rel="stylesheet" href="css/datatables.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700,800" rel="stylesheet">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/batch.css">
<link rel="stylesheet" href="css/workersAndTasks.css">
<link rel="stylesheet" href="css/tasksTables.css">
<link rel="stylesheet" href="css/workersTables.css">
<link rel="stylesheet" href="css/stats.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
</head>
<body>
<div id="loader">
<img src="images/loader.gif">
<p class="flow-text">A moment please</p>
</div>
<div class="nav-wrapper">
<p><img src="images/logo.jpg" height="54" width="54">Addi</p>
</div>
<div class="header">
<div id="signin">
<div class="signin">#</div>
<div class="signin-text">Hello! # and start managing your incubator.</div>
<div class="form">
<div class="input-field">
<input id="email" type="text" value="aminov@esi.dz">
<label for="email">Email </label>
</div>
<div class="input-field">
<input id="password" type="password" value="aminov@esi.dz">
<label for="password">Password</label>
</div>
<button id="signin-submit" class="btn waves-effect waves-light purple accent-1" type="submit" name="action">
#
</button>
</div>
<div class="signin-footer">
<span class="fpwd">Forgot Password?</span>
<span class="#-btn">#!</span>
</div>
</div>
<div id="#">
<div class="signin">#</div>
<div class="signin-text">Hello! Lets get started</div>
<div class="form">
<div class="input-field">
<input id="mail" type="text">
<label for="mail">Email*</label>
</div>
<p id="error_email"></p>
<div class="input-field">
<input id="name" type="text">
<label for="name">Name*</label>
</div>
<div class="input-field">
<input id="mobile" type="text">
<label for="mobile">Mobile*</label>
</div>
<div class="input-field">
<input id="mobile2" type="text">
<label for="mobile2">Other Mobile</label>
</div>
<div class="input-field">
<input id="reg" type="text">
<label for="reg">Address* </label>
</div>
<div class="input-field">
<input id="pwd" type="password">
<label for="pwd">Password*</label>
</div>
<p id="message_pwd"></p>
<div class="input-field">
<input id="cpwd" type="password">
<label for="cpwd">Confirm Password*</label>
</div>
<p id="message_cpwd"></p>
<div class="buttons">
<button class="btn waves-effect waves-light purple accent-1" type="submit" id="#-submit"
name="action">SIGn
up
</button>
</div>
<p class="signin-link">Already signed up? # <span id="signInHere">here.</span></p>
<div class="upload">
<img src="images/account-logo.png" id="img-preview" height="120" width="120"><br>
<input type="file" name="pic" id="pic" onchange="loadFile(event)" accept="image/*">
<p id="filepath"></p>
</div>
</div>
</div>
</div>
<div id="splash">
<div class="splash-wrapper">
<img class="image" src="images/doc.png" height="160" width="160">
<div class="hello">Hello, <br>Mr . <span id="drname">Debpritam</span></div>
<div class="welcome">Welcome to</div>
<img class="logo" src="images/company-logo.png" height="100" width="200">
</div>
</div>
<div id="dashboard">
<div class="container-fluid">
<div class="row" style="margin-bottom: 0px!important;">
<div class="col s2 sidebar">
<h4 id="navigation">Navigation</h4>
<button class="normal-btn actv" id="dashboard-nav">Dashboard</button>
<button class="collapse-btn" id="batch-nav">Batch Database</button>
<div class="content">
<ul>
<li id="add-batch-btn">Add A Batch</li>
<li id="view-batch-btn">View All Batches</li>
<li id="view-batch17-btn">Batches in First step</li>
<li id="view-batch21-btn">Batches in Second step</li>
</ul>
</div>
<button class="collapse-btn" id="usersAndTasks-nav">Workers && Tasks</button>
<div class="content">
<ul>
<li id="add-worker-btn">Add A Worker</li>
<li id="add-task-btn">Add Task</li>
<li id="view-workers-btn">Workers list</li>
<li id="view-tasks-btn">Tasks list</li>
</ul>
</div>
<button class="collapse-btn" id="contacts-nav">Quick Statistics</button>
<div class="content">
<ul>
<li id="show-stats-btn">Stats</li>
</ul>
</div>
</div>
<div class="col s10 side-main">
<div class="side-header z-depth-1">
<img class="logo-img" src="images/company-logo.png" height="60" width="180">
<div class="hello-img"><img class="" id="user-image" height="50" width="50"></div>
<div class="hello-name">Hello, Mr. <span class="doc-name"></span></div>
</div>
<!----------------------------------------BATCH----------------------------------------------->
<div id="add-batch">
<div id="batch-wrap" class="z-depth-2">
<div class="batch-title">Add new batch</div>
<div class="batch-form">
<div class="input-field">
<input id="incubator_id" type="number">
<label for="incubator_id">Incubator Id</label>
</div>
<div class="input-field">
<input id="container_id" type="text">
<label for="container_id">Containers :</label>
</div>
<!--to enter the date-->
<div>
<label for="batch_start_date">Select the starting Date</label>
<div class="input-field">
<input id="batch_start_date" type="datetime-local" onchange="changeDate(0)"/>
</div>
</div>
<!--set the date after 17 days-->
<div>
<label for="batch_17_date">The Date After 17 days </label>
<div class="input-field">
<input id="batch_17_date" type="datetime-local" readonly>
</div>
</div>
<!--set the date after 21 days-->
<div>
<label for="batch_4_date">The Date After 21 days</label>
<div class="input-field">
<input id="batch_4_date" type="datetime-local" readonly>
</div>
</div>
<div>
<label for="responsible">The Responsible</label>
<div class="input-field">
<select id="responsible">
<option value="0" disabled selected>Choose</option>
<option value="Addi Fouaz">Addi Fouaz</option>
<option value="The Owner">Other</option>
<option value="Other">Others</option>
</select>
</div>
</div>
<div class="input-field">
<input id="NoFailedHatching" type="number">
<label for="NoFailedHatching">No failed hatching</label>
</div>
<div class="input-field">
<input id="egg_number" type="number">
<label for="egg_number">Total Egg Number</label>
</div>
<div class="input-field">
<input id="broken_egg_number" type="number">
<label for="broken_egg_number">Broken Egg Number</label>
</div>
<div class="input-field">
<input id="notes" type="text">
<label for="notes">notes to add !</label>
</div>
<img id="loader_batch_add" class="loader-small" src="images/loader-small.gif" height="100"
width="100">
<button id="batch-add-submit" class="btn waves-effect waves-light blue">Save</button>
</div>
</div>
</div>
<div id="edit-batch">
<div id="edit-batch-wrap" class="z-depth-2">
<div class="batch-title">Edit this batch</div>
<div class="batch-form">
<div class="input-field">
<input id="edit-incubator_id" type="text">
<label for="edit-incubator_id">Incubator Id</label>
</div>
<div class="input-field">
<input id="edit-containers_id" type="text">
<label for="edit-containers_id">containers :</label>
</div>
<!--to enter the date-->
<div>
<label for="edit-batch_start_date">Select the starting Date</label>
<div class="input-field">
<input id="edit-batch_start_date" type="datetime-local" onchange="changeDate(1)"/>
</div>
</div>
<!--set the date after 17 days-->
<div>
<label for="edit-batch_17_date">The Date After 17 days </label>
<div class="input-field">
<input id="edit-batch_17_date" type="datetime-local" readonly>
</div>
</div>
<!--set the date after 21 days-->
<div>
<label for="edit-batch_4_date">The Date After 21 days</label>
<div class="input-field">
<input id="edit-batch_4_date" type="datetime-local" readonly>
</div>
</div>
<div>
<label for="edit-responsible">The Responsible</label>
<div class="input-field">
<select id="edit-responsible">
<option value="0" disabled selected>Choose</option>
<option value="Addi Fouaz">Addi Fouaz</option>
<option value="Mahamdi Amine">Mahamdi Amine</option>
<option value="Other">Other</option>
<option value="Others">Others</option>
</select>
</div>
</div>
<div class="input-field">
<input id="edit-NoFailedHatching" type="text">
<label for="edit-NoFailedHatching">No Failed Hatching</label>
</div>
<div class="input-field">
<input id="edit-egg_number" type="text">
<label for="edit-egg_number">Total Egg Number</label>
</div>
<div class="input-field">
<input id="edit-broken_egg_number" type="text">
<label for="edit-broken_egg_number">Broken Egg Number</label>
</div>
<div class="input-field">
<input id="edit-notes" type="text">
<label for="edit-notes">notes to add !</label>
</div>
<img id="edit-loader_batch_add" class="loader-small" src="images/loader-small.gif"
height="100"
width="100">
<button id="batch-update" class="btn waves-effect waves-light blue">Update</button>
<!---->
</div>
</div>
</div>
<div id="view-batch" class="z-depth-2">
<div class="section-title">View Batches</div>
<div class="table_wrap">
<table id="tableAll" class="display" data-page-length='15'>
<thead>
<tr>
<th>Batch Id</th>
<th>Incubator Id</th>
<th>Containers</th>
<th class="dates">StartingDate</th>
<th class="dates">DateAfter 17 days</th>
<th class="dates">DateAfter 21 days</th>
<th>Responsible</th>
<th>No Failed Hatching</th>
<th>Total Egg Number</th>
<th>Broken Egg Number</th>
<th>Notes</th>
<th id="actionCell">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="view-batch17" class="z-depth-2">
<div class="section-title">Batches in FIRST STEP</div>
<div class="table_wrap">
<table id="table17" class="display" data-page-length='15'>
<thead>
<tr>
<th>Batch Id</th>
<th>Incubator Id</th>
<th>Containers</th>
<th>Starting Date</th>
<th>DateAfter 17 days</th>
<th>DateAfter 21 days</th>
<th>Responsible</th>
<th>No Failed Hatching</th>
<th>Total Egg Number</th>
<th>Broken Egg Number</th>
<th>Notes</th>
<th id="remainingTime">Remaining Time</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="view-batch21" class="z-depth-2">
<div class="section-title"> Batches in SECOND STEP</div>
<div class="table_wrap">
<table id="table21" class="display" data-page-length='15'>
<thead>
<tr>
<th>Batch Id</th>
<th>Incubator Id</th>
<th>Containers</th>
<th>Starting Date</th>
<th>DateAfter 17 days</th>
<th>DateAfter 21 days</th>
<th>Responsible</th>
<th>No Failed Hatching</th>
<th>Total Egg Number</th>
<th>Broken Egg Number</th>
<th>Notes</th>
<th id="remainingTime1">Remaining Time</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<!---------------------------Users and Tasks----------------------------------------->
<div id="add-worker">
<div id="worker-wrap" class="z-depth-2">
<div class="worker-title">Add new Worker</div>
<div class="worker-form">
<div class="input-field">
<input id="workerName_id" type="text">
<label for="workerName_id">Worker's Full name </label>
</div>
<div class="input-field">
<input id="workerAddress_id" type="text">
<label for="workerAddress_id">Worker's Address</label>
</div>
<div class="input-field">
<input id="workerMobile_id" type="text">
<label for="workerMobile_id">Worker's Mobile 1</label>
</div>
<div class="input-field">
<input id="workerMobile2_id" type="text">
<label for="workerMobile2_id">worker's Mobile 2</label>
</div>
<!--to enter the date-->
<div>
<label for="worker_start_date">Select the starting Date</label>
<div class="input-field">
<input id="worker_start_date" type="datetime-local"/>
</div>
</div>
<img id="loader_worker_add" class="loader-small" src="images/loader-small.gif" height="100"
width="100">
<button id="worker-add-submit" class="btn waves-effect waves-light blue">Save</button>
</div>
</div>
</div>
<div id="add-task">
<div id="task-wrap" class="z-depth-2">
<div class="task-title">Add new Task</div>
<div class="task-form">
<div>
<label for="taskWorker">Task for the Worker</label>
<div class="input-field">
<input id="taskWorker" type="text"/>
</div>
</div>
<!--to enter the date-->
<div>
<label for="task_date">Task Date</label>
<div class="input-field">
<input id="task_date" type="datetime-local"/>
</div>
</div>
<div>
<label for="taskInfo">Task's details</label>
<div class="input-field">
<input id="taskInfo" type="text"/>
</div>
</div>
<div>
<label for="task_cost">Task Cost</label>
<div class="input-field">
<input id="task_cost" type="number"/>
</div>
</div>
<div>
<label for="paid">Paid or Not</label>
<div class="input-field">
<select id="paid">
<option value="0" disabled selected>Is It A Paid Task ?</option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select>
</div>
</div>
<img id="loader_task_add" class="loader-small" src="images/loader-small.gif" height="100"
width="100">
<button id="task-add-submit" class="btn waves-effect waves-light blue">Save</button>
</div>
</div>
</div>
<div id="workersList" class="z-depth-2">
<div class="section-title">Workers List</div>
<div class="table_wrap">
<table id="workerTable" class="display" data-page-length='15'>
<thead>
<tr>
<th>Worker Id</th>
<th>Worker's Full name</th>
<th>Worker's Starting Date</th>
<th>Worker's Starting Address</th>
<th>Worker's Phone Number</th>
<th>Worker's Phone Number 2</th>
<th>Worker's All Costs</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="tasksList" class="z-depth-2">
<div class="section-title">Tasks List</div>
<div class="table_wrap">
<table id="tasksTable" class="display" data-page-length='15'>
<thead>
<tr>
<th>Task Id</th>
<th>Task's Worker</th>
<th>Task's date</th>
<th>Tasks's details</th>
<th>Tasks's cost</th>
<th>Paid ?</th>
<th>Paid Date</th>
<th>Pay This Task</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<!-------------------------------------Stats----------------------------------------->
<section id="counter-stats" class="wow fadeInRight" data-wow-duration="1.4s">
<div class="container">
<div class="row">
<div class="col-lg-3 stats">
<i class="fa fa-code" aria-hidden="true"></i>
<div class="counting" id="total"></div>
<h5>Total Eggs</h5>
</div>
<div class="col-lg-3 stats">
<i class="fa fa-check" aria-hidden="true"></i>
<div class="counting" id="rate"></div>
<h5>Success rate </h5>
</div>
<div class="col-lg-3 stats">
<i class="fa fa-user" aria-hidden="true"></i>
<div class="counting" id="workers"></div>
<h5>Workers</h5>
</div>
</div>
<!-- end row -->
</div>
<!-- end container -->
</section>
</div>
</div>
</div>
</div>
<script> window.$ = window.jQuery = require("./js/required/jquery.js");</script>
<script src="js/required/jquery.js"></script>
<script src="js/required/mat.js"></script>
<script src="js/required/datatables.js"></script>
<script src="js/index.js"></script>
<script src="js/utils/date-utils.js"></script>
<script src="js/utils/batch-utils.js"></script>
<script src="js/utils/task-utils.js"></script>
<script src="js/utils/stats.js"></script>
<script src="js/database/db.js"></script>
<script src="js/authentication/authentication.js"></script>
<script src="js/controls/addBatch.js"></script>
<script src="js/controls/viewBatch.js"></script>
<script src="js/controls/editBatch.js"></script>
<script src="js/controls/printBatch.js"></script>
<script src="js/controls/addWorker.js"></script>
<script src="js/controls/workersList.js"></script>
<script>
// global vars
const fs = require('fs');
const isDev = require('electron-is-dev');
const remote = require('electron').remote;
const {dialog} = require('electron').remote;
const app = remote.app;
let appPath = app.getAppPath();
let db_path = '';
let mode = '';
const daysForStep1 = 17;
const daysForStep2 = 21;
if (isDev) {
mode = "dev";
db_path = './db/frloum.db';
} else {
mode = "prod";
// db_path = './resources/db/frloum.db';
db_path = './db/frloum.db';
}
console.log("Mode = " + mode);
console.log("app path = " + appPath);
require('./js/authentication/authentication.js');
require('./js/database/db');
$(document).ready(function () {
$('select').formSelect();
});
$(document).ready(function () {
$('.collapsible').collapsible();
});
$(document).ready(function () {
// createDB();
document.getElementById("add-batch").classList.add("hidden");
document.getElementById("edit-batch").classList.add("hidden");
document.getElementById("view-batch").classList.add("hidden");
document.getElementById("view-batch17").classList.add("hidden");
document.getElementById("view-batch21").classList.add("hidden");
document.getElementById("add-worker").classList.add("hidden");
document.getElementById("add-task").classList.add("hidden");
document.getElementById("workersList").classList.add("hidden");
document.getElementById("tasksList").classList.add("hidden");
document.getElementById("counter-stats").classList.add("hidden");
});
</script>
</body>
</html>