Blame view

src/pages/TimeTable/timeTable.vue 50.9 KB
76f4f9c78   Neeraj Sharma   all api add in se...
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
3
    <v-container fluid class="body-color">
      <!-- ****** EDIT TIME-TABLE****** -->
db965de89   Amber Dev   added dialog pers...
4
      <v-dialog v-model="dialog" max-width="600px" persistent>
68d742034   Neeraj Sharma   implement new des...
5
6
7
8
9
10
11
12
13
        <v-flex xs12 sm12>
          <v-card flat class="card-style pa-2" dark>
            <v-layout>
              <v-flex xs12>
                <label class="title text-xs-center">Edit Time Table</label>
                <v-icon size="24" class="right" @click="dialog = false">cancel</v-icon>
              </v-flex>
            </v-layout>
            <!-- <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
                  <v-flex
                    xs12
                    class="text-xs-center text-sm-center text-md-center text-lg-center"
                  >
                    <v-avatar size="100px">
                      <img src="/static/icon/user.png" v-if="!imageUrl" />
                    </v-avatar>
                    <input
                      type="file"
                      style="display: none"
                      ref="image"
                      accept="image/*"
                      @change="onFilePicked"
                    />
                    <img
                      :src="imageData.imageUrl"
                      height="150"
                      v-if="imageUrl"
                      style="border-radius:50%; width:200px"
                    />
                  </v-flex>
68d742034   Neeraj Sharma   implement new des...
35
36
37
38
            </v-layout>-->
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
8669ee94e   Shikha Mishra   show data of subj...
39
40
                  <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
                  <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
f4df757fe   Neeraj Sharma   responsive vie in...
41
                </v-flex>
68d742034   Neeraj Sharma   implement new des...
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
                <v-flex xs8 sm5 class="ml-3">
                  <v-select
                    :items="addclass"
                    label="Select Class"
                    v-model="editedItem.classNum"
                    item-text="classNum"
                    item-value="_id"
                    @change="getSections(editedItem.classNum)"
                  ></v-select>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right hidden-xs-only hidden-sm-only">Section Name:</label>
                  <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
                </v-flex>
                <v-flex xs8 sm5 class="ml-3">
                  <v-select
                    :items="addSection"
                    label="Select Section"
                    v-model="editedItem.selectSection"
                    item-text="name"
                    item-value="_id"
                  ></v-select>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-layout>
              <v-flex xs12 sm9 offset-sm1>
                <v-card-actions>
                  <v-spacer></v-spacer>
                  <v-btn round dark @click.native="close" class="clear-button">Cancel</v-btn>
                  <v-btn round dark @click="save" class="add-button">Save</v-btn>
                </v-card-actions>
              </v-flex>
            </v-layout>
          </v-card>
        </v-flex>
      </v-dialog>
  
      <!-- ****** ADD Dialog Schedule IN TIME-TABLE ******  -->
db965de89   Amber Dev   added dialog pers...
85
      <v-dialog v-model="dialogSchedule" max-width="600px" persistent>
68d742034   Neeraj Sharma   implement new des...
86
87
88
89
90
91
92
93
94
95
96
        <v-flex xs12 sm12>
          <v-card flat class="card-style pa-2" dark>
            <v-layout>
              <v-flex xs12>
                <label class="title text-xs-center">Add Schedule</label>
                <v-icon size="24" class="right" @click="dialogSchedule = false">cancel</v-icon>
              </v-flex>
            </v-layout>
            <v-form ref="formAddDay" v-model="validAddDay" lazy-validation>
              <v-container fluid>
                <v-flex xs12 sm12 class="py-3">
f4df757fe   Neeraj Sharma   responsive vie in...
97
98
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
68d742034   Neeraj Sharma   implement new des...
99
100
                      <label class="right hidden-xs-only hidden-sm-only">Select Day:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Day:</label>
f4df757fe   Neeraj Sharma   responsive vie in...
101
                    </v-flex>
68d742034   Neeraj Sharma   implement new des...
102
                    <v-flex xs12 sm5 class="pl-3">
f4df757fe   Neeraj Sharma   responsive vie in...
103
                      <v-select
68d742034   Neeraj Sharma   implement new des...
104
105
106
107
                        :items="addOneDay"
                        label="Select Day"
                        v-model="schedule.selectDay"
                        :rules="selecDayRule"
f4df757fe   Neeraj Sharma   responsive vie in...
108
109
110
111
112
                      ></v-select>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-layout>
68d742034   Neeraj Sharma   implement new des...
113
                  <v-flex xs12 sm8 offset-sm2>
f4df757fe   Neeraj Sharma   responsive vie in...
114
                    <v-card-actions>
f4df757fe   Neeraj Sharma   responsive vie in...
115
                      <v-spacer></v-spacer>
68d742034   Neeraj Sharma   implement new des...
116
117
                      <v-btn round dark @click="submitSchedule" class="add-button">Save</v-btn>
                      <v-spacer></v-spacer>
f4df757fe   Neeraj Sharma   responsive vie in...
118
119
120
                    </v-card-actions>
                  </v-flex>
                </v-layout>
68d742034   Neeraj Sharma   implement new des...
121
122
123
124
125
              </v-container>
            </v-form>
          </v-card>
        </v-flex>
      </v-dialog>
969cf1f94   Neeraj Sharma   something changes...
126

68d742034   Neeraj Sharma   implement new des...
127
      <!-- ****** ADD LECTURES IN TIME-TABLE ******  -->
969cf1f94   Neeraj Sharma   something changes...
128

be4bdd641   Amber Dev   time select issue...
129
      <v-dialog v-model="dialogAddLecture" max-width="600px" persistent>
68d742034   Neeraj Sharma   implement new des...
130
131
132
133
134
135
136
137
138
139
        <v-flex xs12 sm12>
          <v-card flat class="card-style pa-2" dark>
            <v-layout>
              <v-flex xs12>
                <label class="title text-xs-center">Add Lecture</label>
                <v-icon size="24" class="right" @click="dialogAddLecture = false">cancel</v-icon>
              </v-flex>
            </v-layout>
            <v-form ref="lectureForm" v-model="valid" lazy-validation>
              <v-container fluid>
f4df757fe   Neeraj Sharma   responsive vie in...
140
141
                <v-flex xs12 sm12>
                  <v-layout>
68d742034   Neeraj Sharma   implement new des...
142
                    <v-flex xs4 class="pt-4 subheading">
8669ee94e   Shikha Mishra   show data of subj...
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
                      <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
                      <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
                    </v-flex>
                    <v-flex xs5 class="ml-3">
                      <v-select
                        :items="addclass"
                        label="Select Class"
                        v-model="timeTable.select"
                        item-text="classNum"
                        item-value="_id"
                        @change="getClassSubject(timeTable.select)"
                        :rules="classRules"
                        required
                      ></v-select>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
                    <v-flex xs4 class="pt-4 subheading">
f4df757fe   Neeraj Sharma   responsive vie in...
163
                      <label class="right">Subject Name:</label>
969cf1f94   Neeraj Sharma   something changes...
164
                    </v-flex>
68d742034   Neeraj Sharma   implement new des...
165
                    <v-flex xs5 class="ml-3">
8669ee94e   Shikha Mishra   show data of subj...
166
167
168
169
170
171
172
173
174
175
                      <v-select
                        :items="subjectList.subjects"
                        label="Select Subject"
                        v-model="addlectures.subjectName"
                        item-text="subjectName"
                        item-value="subjectName"
                        :rules="subjectNameRules"
                        required
                      ></v-select>
                      <!-- <v-text-field
68d742034   Neeraj Sharma   implement new des...
176
177
                        v-model="addlectures.subjectName"
                        :rules="subjectNameRules"
f4df757fe   Neeraj Sharma   responsive vie in...
178
179
                        placeholder="fill your Subject Name"
                        type="text"
8669ee94e   Shikha Mishra   show data of subj...
180
                      ></v-text-field>-->
969cf1f94   Neeraj Sharma   something changes...
181
                    </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
182
183
184
185
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
68d742034   Neeraj Sharma   implement new des...
186
                    <v-flex xs4 class="pt-4 subheading">
f4df757fe   Neeraj Sharma   responsive vie in...
187
                      <label class="right">Time In:</label>
969cf1f94   Neeraj Sharma   something changes...
188
                    </v-flex>
68d742034   Neeraj Sharma   implement new des...
189
                    <v-flex xs5 class="ml-3">
f4df757fe   Neeraj Sharma   responsive vie in...
190
                      <v-menu
68d742034   Neeraj Sharma   implement new des...
191
                        ref="menuD"
f4df757fe   Neeraj Sharma   responsive vie in...
192
                        :close-on-content-click="false"
68d742034   Neeraj Sharma   implement new des...
193
                        v-model="menu5"
f4df757fe   Neeraj Sharma   responsive vie in...
194
195
196
197
198
199
200
201
202
203
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        max-width="290px"
                        min-width="290px"
                      >
                        <v-text-field
                          slot="activator"
68d742034   Neeraj Sharma   implement new des...
204
205
                          v-model="addlectures.timeIn"
                          label="Select your Time In"
f4df757fe   Neeraj Sharma   responsive vie in...
206
                          append-icon="access_time"
68d742034   Neeraj Sharma   implement new des...
207
                          :rules="timeInRules"
d45ffc6fa   Neeraj Sharma   solve bugs and ad...
208
                          readonly
f4df757fe   Neeraj Sharma   responsive vie in...
209
                        ></v-text-field>
68d742034   Neeraj Sharma   implement new des...
210
                        <v-time-picker v-model="addlectures.timeIn" @change="menu5 = false"></v-time-picker>
f4df757fe   Neeraj Sharma   responsive vie in...
211
                      </v-menu>
969cf1f94   Neeraj Sharma   something changes...
212
                    </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
213
214
215
216
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
68d742034   Neeraj Sharma   implement new des...
217
                    <v-flex xs4 class="pt-4 subheading">
f4df757fe   Neeraj Sharma   responsive vie in...
218
219
                      <label class="right">Time Out:</label>
                    </v-flex>
68d742034   Neeraj Sharma   implement new des...
220
                    <v-flex xs5 class="ml-3">
f4df757fe   Neeraj Sharma   responsive vie in...
221
                      <v-menu
68d742034   Neeraj Sharma   implement new des...
222
                        ref="menuE"
f4df757fe   Neeraj Sharma   responsive vie in...
223
                        :close-on-content-click="false"
68d742034   Neeraj Sharma   implement new des...
224
                        v-model="menu6"
f4df757fe   Neeraj Sharma   responsive vie in...
225
226
227
228
229
230
231
232
233
234
                        :nudge-right="40"
                        lazy
                        transition="scale-transition"
                        offset-y
                        full-width
                        max-width="290px"
                        min-width="290px"
                      >
                        <v-text-field
                          slot="activator"
68d742034   Neeraj Sharma   implement new des...
235
236
237
                          :rules="timeOutRules"
                          v-model="addlectures.timeOut"
                          label="Select your Time Out"
f4df757fe   Neeraj Sharma   responsive vie in...
238
                          append-icon="access_time"
d45ffc6fa   Neeraj Sharma   solve bugs and ad...
239
                          readonly
f4df757fe   Neeraj Sharma   responsive vie in...
240
                        ></v-text-field>
68d742034   Neeraj Sharma   implement new des...
241
                        <v-time-picker v-model="addlectures.timeOut" @change="menu6 = false"></v-time-picker>
f4df757fe   Neeraj Sharma   responsive vie in...
242
243
244
245
246
247
                      </v-menu>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-flex xs12 sm12>
                  <v-layout>
68d742034   Neeraj Sharma   implement new des...
248
                    <v-flex xs4 class="pt-4 subheading">
f4df757fe   Neeraj Sharma   responsive vie in...
249
250
                      <label class="right">Select Teacher:</label>
                    </v-flex>
68d742034   Neeraj Sharma   implement new des...
251
                    <v-flex xs5 class="ml-3">
f4df757fe   Neeraj Sharma   responsive vie in...
252
253
                      <v-select
                        :items="addTeachers"
8669ee94e   Shikha Mishra   show data of subj...
254
                        label="Select Teacher"
68d742034   Neeraj Sharma   implement new des...
255
                        v-model="addlectures.teacherId"
8669ee94e   Shikha Mishra   show data of subj...
256
                        :rules="teacherRules"
f4df757fe   Neeraj Sharma   responsive vie in...
257
258
259
260
261
262
263
264
                        item-text="name"
                        item-value="_id"
                        required
                      ></v-select>
                    </v-flex>
                  </v-layout>
                </v-flex>
                <v-layout>
68d742034   Neeraj Sharma   implement new des...
265
                  <v-flex xs12 sm8 offset-sm2>
f4df757fe   Neeraj Sharma   responsive vie in...
266
                    <v-card-actions>
f4df757fe   Neeraj Sharma   responsive vie in...
267
                      <v-spacer></v-spacer>
68d742034   Neeraj Sharma   implement new des...
268
                      <v-btn round dark @click="AddLecture" class="add-button">Save</v-btn>
f4df757fe   Neeraj Sharma   responsive vie in...
269
270
271
                    </v-card-actions>
                  </v-flex>
                </v-layout>
68d742034   Neeraj Sharma   implement new des...
272
273
274
275
276
              </v-container>
            </v-form>
          </v-card>
        </v-flex>
      </v-dialog>
76f4f9c78   Neeraj Sharma   all api add in se...
277

68d742034   Neeraj Sharma   implement new des...
278
      <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ******  -->
76f4f9c78   Neeraj Sharma   all api add in se...
279

db965de89   Amber Dev   added dialog pers...
280
      <v-dialog v-model="dialogUpdateLectures" max-width="600px" persistent>
68d742034   Neeraj Sharma   implement new des...
281
282
283
284
285
286
        <v-flex xs12 sm12 class>
          <v-card flat class="card-style pa-2" dark>
            <v-layout>
              <v-flex xs12>
                <label class="title text-xs-center">Edit Lecture</label>
                <v-icon size="24" class="right" @click="dialogUpdateLectures = false">cancel</v-icon>
b39d2afd2   Neeraj Sharma   responsive dashboard
287
288
              </v-flex>
            </v-layout>
68d742034   Neeraj Sharma   implement new des...
289
290
            <v-flex xs12 sm12>
              <v-layout>
8669ee94e   Shikha Mishra   show data of subj...
291
292
293
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
                  <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
68d742034   Neeraj Sharma   implement new des...
294
295
                </v-flex>
                <v-flex xs7 sm6 class="ml-3">
8669ee94e   Shikha Mishra   show data of subj...
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
                  <v-select
                    :items="addclass"
                    label="Select Class"
                    v-model="updateLectures.select"
                    item-text="classNum"
                    item-value="_id"
                    @change="getClassSubject(updateLectures.select)"
                    required
                  ></v-select>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right hidden-xs-only hidden-sm-only">Select Subject:</label>
                  <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
                </v-flex>
                <v-flex xs7 sm6 class="ml-3">
                  <v-select
                    :items="subjectList.subjects"
                    label="Select Subject"
                    v-model="updateLectures.subjectName"
                    item-text="subjectName"
                    item-value="subjectName"
                    required
                  ></v-select>
                  <!-- <v-text-field
68d742034   Neeraj Sharma   implement new des...
324
325
326
                    v-model="updateLectures.subjectName"
                    placeholder="fill your Subject Name"
                    type="text"
8669ee94e   Shikha Mishra   show data of subj...
327
                  ></v-text-field>-->
68d742034   Neeraj Sharma   implement new des...
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
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs5 sm4 class="pt-4 subheading">
                  <label class="right">Time In:</label>
                </v-flex>
                <v-flex xs7 sm6 class="ml-3">
                  <v-menu
                    ref="menuC"
                    :close-on-content-click="false"
                    v-model="menu4"
                    :nudge-right="40"
                    lazy
                    transition="scale-transition"
                    offset-y
                    full-width
                    max-width="290px"
                    min-width="290px"
                  >
                    <v-text-field
                      slot="activator"
                      v-model="updateLectures.timeIn"
                      placeholder="Select your Time In"
                      append-icon="access_time"
                      readonly
                    ></v-text-field>
                    <v-time-picker v-model="updateLectures.timeIn" @change="menu4= false"></v-time-picker>
                  </v-menu>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs5 sm4 class="pt-4 subheading">
                  <label class="right">Time Out:</label>
                </v-flex>
                <v-flex xs7 sm6 class="ml-3">
                  <v-menu
                    ref="menuB"
                    :close-on-content-click="false"
                    v-model="menu3"
                    :nudge-right="40"
                    lazy
                    transition="scale-transition"
                    offset-y
                    full-width
                    max-width="290px"
                    min-width="290px"
                  >
                    <v-text-field
                      slot="activator"
                      v-model="updateLectures.timeOut"
                      placeholder="Select your Time Out"
                      append-icon="access_time"
                      readonly
                    ></v-text-field>
                    <v-time-picker v-model="updateLectures.timeOut" @change="menu3 = false"></v-time-picker>
                  </v-menu>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs5 sm4 class="pt-4 subheading">
                  <label class="right">Select Teacher:</label>
                </v-flex>
                <v-flex xs7 sm6 class="ml-3">
                  <v-select
                    :items="addTeachers"
                    label="Select Teacher"
                    v-model="updateLectures.teacherId"
                    item-text="name"
                    item-value="_id"
                    required
                  ></v-select>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-layout>
              <v-flex xs12 sm10 offset-sm1>
                <v-card-actions>
                  <!-- <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> -->
                  <v-spacer></v-spacer>
                  <v-btn
                    round
                    dark
                    class="add-button"
                    @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)"
                  >Save</v-btn>
                </v-card-actions>
b39d2afd2   Neeraj Sharma   responsive dashboard
420
421
              </v-flex>
            </v-layout>
969cf1f94   Neeraj Sharma   something changes...
422
          </v-card>
68d742034   Neeraj Sharma   implement new des...
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
        </v-flex>
      </v-dialog>
      <!-- ****** EXISTING-USERS TIME-TABLE ****** -->
  
      <!-- <v-card flat>
        <v-card-actions class="hidden-xs-only hidden-sm-only">
          <v-layout>
            <label class="right mt-4 ml-5">Select Class:</label>
            <v-select
              :items="addclass"
              label="Select Class"
              v-model="selectTimeTable.select"
              item-text="classNum"
              item-value="_id"
              name="Select Class"
              @change="getSections(selectTimeTable.select)"
              class="px-4"
              required
            ></v-select>
            <label class="right mt-4">Select Section:</label>
            <v-select
              :items="addSection"
              label="Select Section"
              v-model="selectTimeTable.selectSection"
              item-text="name"
              item-value="_id"
              name="Select Section"
              class="pl-3"
              required
            ></v-select>
          </v-layout>
          <v-spacer></v-spacer>
          <v-btn @click="findTimeTable()" round dark :loading="loadingFindData" class="left">Find</v-btn>
        </v-card-actions>
        <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
          <v-flex xs4 sm2 class="mt-4 ml-2">
            <label>Select Class:</label>
          </v-flex>
          <v-flex xs6 sm9>
            <v-select
              :items="addclass"
              label="Select Class"
              v-model="selectTimeTable.select"
              item-text="classNum"
              item-value="_id"
              name="Select Class"
              @change="getSections(selectTimeTable.select)"
              required
            ></v-select>
          </v-flex>
        </v-layout>
        <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
          <v-flex xs4 sm2 class="mt-4 ml-2">
            <label>Select Section:</label>
          </v-flex>
          <v-flex xs6 sm9>
            <v-select
              :items="addSection"
              label="Select Section"
              v-model="selectTimeTable.selectSection"
              item-text="name"
              item-value="_id"
              name="Select Section"
              required
            ></v-select>
          </v-flex>
        </v-layout>
        <v-layout class="hidden-xl-only hidden-lg-only hidden-md-only">
969cf1f94   Neeraj Sharma   something changes...
491
          <v-flex xs12>
68d742034   Neeraj Sharma   implement new des...
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
            <v-btn @click="findTimeTable()" round dark :loading="loading" class="right mr-4 mb-2">Find</v-btn>
          </v-flex>
        </v-layout>
      </v-card>-->
      <v-flex xs12>
        <v-toolbar color="transparent" flat>
          <v-btn
            fab
            dark
            class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
            small
            @click="addTimeTableDialog = true"
          >
            <v-icon dark>add</v-icon>
          </v-btn>
          <v-btn
            round
            class="open-dialog-button hidden-sm-only hidden-xs-only"
            dark
            @click="addTimeTableDialog = true"
          >
            <v-icon class="white--text pr-1" size="20">add</v-icon>Add Time Table
          </v-btn>
          <v-flex xs4 md2>
            <v-select
              :items="addclass"
              label="Select Class"
              v-model="selectTimeTable.select"
              item-text="classNum"
              item-value="_id"
              name="Select Class"
              @change="getSections(selectTimeTable.select)"
              required
            ></v-select>
          </v-flex>
          <v-flex xs4 md2 class="ml-4">
            <v-select
              :items="addSection"
              label="Select Section"
              v-model="selectTimeTable.selectSection"
              item-text="name"
              item-value="_id"
              name="Select Section"
              required
            ></v-select>
          </v-flex>
          <v-spacer></v-spacer>
          <v-btn
            @click="findTimeTable()"
            round
            dark
            :loading="loading"
            class="right mb-2 open-dialog-button"
          >Find</v-btn>
          <v-card-title class="body-1" v-show="show">
            <v-btn icon large flat @click="displaySearch">
              <v-avatar size="27">
aa310d61a   Shikha Mishra   added functionali...
549
                <img src="/static/icon/search.png" alt="icon" />
68d742034   Neeraj Sharma   implement new des...
550
551
552
              </v-avatar>
            </v-btn>
          </v-card-title>
612b79bb4   Amber Dev   made serch auto f...
553
          <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
68d742034   Neeraj Sharma   implement new des...
554
555
            <v-layout>
              <v-text-field
8e8d14254   Shikha Mishra   Cleared data whil...
556
                autofocus
68d742034   Neeraj Sharma   implement new des...
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
                v-model="search"
                label="Search"
                prepend-inner-icon="search"
                color="primary"
              ></v-text-field>
              <v-icon @click="closeSearch" color="error">close</v-icon>
            </v-layout>
          </v-flex>
        </v-toolbar>
        <v-data-table
          :headers="headers"
          :items="desserts"
          :pagination.sync="pagination"
          :search="search"
          item-key="_id"
        >
          <template slot="items" slot-scope="props">
            <tr
              style="cursor: pointer;"
              class="tr"
              @click="getTimeTable(props.item), props.expanded = !props.expanded"
            >
              <td class="td td-row">{{ props.index + 1}}</td>
              <td class="text-xs-center td td-row">{{ props.item.classData.classNum}}</td>
              <td class="text-xs-center td td-row">{{ props.item.sectionData.name }}</td>
              <td class="text-xs-center td td-row">
                <span>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:20px; "
                      class="mr-3"
                      @click="editItem(props.item)"
080d88547   Shikha Mishra   issues solved
590
                      src="/static/icon/edit.png"
68d742034   Neeraj Sharma   implement new des...
591
592
593
594
595
596
597
598
599
                    />
                    <span>Edit</span>
                  </v-tooltip>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:20px; "
                      class="mr-3"
                      @click="deleteItem(props.item)"
aa310d61a   Shikha Mishra   added functionali...
600
                      src="/static/icon/delete.png"
68d742034   Neeraj Sharma   implement new des...
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
                    />
                    <span>Delete</span>
                  </v-tooltip>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:20px; "
                      class="mr-3"
                      src="/static/icon/add1.png"
                      @click="addSchedule(props.item._id)"
                    />
                    <span>Add</span>
                  </v-tooltip>
                </span>
              </td>
            </tr>
          </template>
          <template slot="expand" slot-scope="props">
969cf1f94   Neeraj Sharma   something changes...
619
            <v-data-table
68d742034   Neeraj Sharma   implement new des...
620
621
622
623
              :items="timeTableList.schedule"
              hide-actions
              item-key="title"
              style="width: auto;"
969cf1f94   Neeraj Sharma   something changes...
624
625
            >
              <template slot="items" slot-scope="props">
68d742034   Neeraj Sharma   implement new des...
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
                <tr class="tr">
                  <td class="text-xs-left subheading table-td td td-row">
                    <b>{{ props.item.day }}</b>
                  </td>
                  <td class="table-td td td-row">
                    <b>Subject</b>
                    <br />
                    <b>Time In</b>
                    <br />
                    <b>Time Out</b>
                  </td>
                  <td v-for="list in props.item.lectures" class="table-td td td-row">
                    <b>{{ list.subjectName }}</b>
                    <img
                      style="cursor:pointer; width:20px; height:18px; "
                      class="mr-2 ml-2"
                      src="/static/icon/edit1.png"
109a6218c   Neeraj Sharma   solve issue/bugs ...
643
                      @click="updateTimeTable(list, timeTableList,props.item._id)"
68d742034   Neeraj Sharma   implement new des...
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
                    />
                    <img
                      style="cursor:pointer; width:20px; height:20px; "
                      src="/static/icon/delete1.png"
                      @click="deleteTimeTable(list,props.item.lectures)"
                    />
                    <br />
                    {{list.timeIn}}
                    <br />
                    {{list.timeOut}}
                  </td>
                  <td class="td td-row">
                    <v-tooltip top>
                      <v-icon
                        slot="activator"
                        color="black"
                        @click="addLecture(props.item._id, timeTableList._id)"
                      >add_circle_outline</v-icon>
                      <span>Add</span>
                    </v-tooltip>
969cf1f94   Neeraj Sharma   something changes...
664
665
666
                  </td>
                </tr>
              </template>
969cf1f94   Neeraj Sharma   something changes...
667
            </v-data-table>
68d742034   Neeraj Sharma   implement new des...
668
669
670
671
672
673
674
675
676
677
678
          </template>
          <v-alert
            slot="no-results"
            :value="true"
            color="error"
            icon="warning"
          >Your search for "{{ search }}" found no results.</v-alert>
        </v-data-table>
        <br />
        <br />
      </v-flex>
76f4f9c78   Neeraj Sharma   all api add in se...
679

68d742034   Neeraj Sharma   implement new des...
680
      <!-- ****** ADD  TIME-TABLE ****** -->
db965de89   Amber Dev   added dialog pers...
681
      <v-dialog v-model="addTimeTableDialog" max-width="600px" v-if="addTimeTableDialog" persistent>
68d742034   Neeraj Sharma   implement new des...
682
683
684
685
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">Add Time Table</label>
8e8d14254   Shikha Mishra   Cleared data whil...
686
              <v-icon size="24" class="right" @click="closeAddTimeTableModel">cancel</v-icon>
969cf1f94   Neeraj Sharma   something changes...
687
            </v-flex>
68d742034   Neeraj Sharma   implement new des...
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
          </v-layout>
          <v-form ref="form" v-model="valid" lazy-validation>
            <v-container fluid class="pt-3">
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
                    <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-select
                      :items="addclass"
                      label="Select Class"
                      v-model="timeTable.select"
                      item-text="classNum"
                      item-value="_id"
                      @change="getSections(timeTable.select)"
                      :rules="classRules"
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right hidden-xs-only hidden-sm-only">Select Section:</label>
                    <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Section:</label>
                  </v-flex>
                  <v-flex sm6 xs8 class="ml-3">
                    <v-select
                      :items="addSection"
                      label="Select Section"
                      v-model="timeTable.selectSection"
                      item-text="name"
                      item-value="_id"
                      :rules="sectionRules"
8669ee94e   Shikha Mishra   show data of subj...
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
                      @change="getClassSubject(timeTable.select)"
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
                    <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-select
                      :items="subjectList.subjects"
                      label="Select Subject"
                      v-model="timeTable.subjectName"
                      item-text="subjectName"
                      item-value="subjectName"
                      :rules="subjectNameRules"
68d742034   Neeraj Sharma   implement new des...
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right hidden-xs-only hidden-sm-only">Select Teacher:</label>
                    <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Teacher:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-select
                      :items="addTeachers"
                      label="Select Teacher"
                      v-model="timeTable.selectTeacher"
                      item-text="name"
                      item-value="_id"
                      :rules="teacherRules"
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Select Day:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-select
                      :items="addOneDay"
                      label="Select Day"
                      v-model="timeTable.selectDay"
                      :rules="dayRules"
                      item-text="name"
                      item-value="_id"
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
8669ee94e   Shikha Mishra   show data of subj...
785
              <!-- <v-flex xs12>
68d742034   Neeraj Sharma   implement new des...
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right hidden-xs-only hidden-sm-only">Subject Name:</label>
                    <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Subject:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-text-field
                      placeholder="fill your Subject Name"
                      :rules="subjectNameRules"
                      v-model="timeTable.subjectName"
                      type="text"
                      required
                    ></v-text-field>
                  </v-flex>
                </v-layout>
8669ee94e   Shikha Mishra   show data of subj...
801
              </v-flex>-->
68d742034   Neeraj Sharma   implement new des...
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Time In:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-menu
                      ref="menuA"
                      :close-on-content-click="false"
                      v-model="menu2"
                      :nudge-right="40"
                      :return-value.sync="timeTable.timeIn"
                      lazy
                      transition="scale-transition"
                      offset-y
                      full-width
                      max-width="290px"
                      min-width="290px"
                    >
                      <v-text-field
                        slot="activator"
                        v-model="timeTable.timeIn"
                        label="Select your timeIn"
                        append-icon="access_time"
                        :rules="timeInRules"
                        readonly
                      ></v-text-field>
                      <v-time-picker
                        v-model="timeTable.timeIn"
                        @change="$refs.menuA.save(timeTable.timeIn)"
                      ></v-time-picker>
                    </v-menu>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Time Out:</label>
                  </v-flex>
                  <v-flex xs8 sm6 class="ml-3">
                    <v-menu
                      ref="menu"
                      :close-on-content-click="false"
                      v-model="menu1"
                      :nudge-right="40"
                      :return-value.sync="timeTable.timeOut"
                      lazy
                      transition="scale-transition"
                      offset-y
                      full-width
                      max-width="290px"
                      min-width="290px"
                    >
                      <v-text-field
                        slot="activator"
                        v-model="timeTable.timeOut"
                        label="Select your Time Out"
                        append-icon="access_time"
                        :rules="timeOutRules"
                        readonly
                      ></v-text-field>
                      <v-time-picker
                        v-model="timeTable.timeOut"
                        @change="$refs.menu.save(timeTable.timeOut)"
                      ></v-time-picker>
                    </v-menu>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-layout>
                <v-flex xs12 sm11>
                  <v-layout>
                    <v-spacer></v-spacer>
                    <v-btn @click="clear" round class="clear-button" dark>clear</v-btn>
                    <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-form>
        </v-card>
      </v-dialog>
969cf1f94   Neeraj Sharma   something changes...
885
886
887
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
68d742034   Neeraj Sharma   implement new des...
888
889
890
891
892
893
894
895
896
      <v-snackbar
        :timeout="timeout"
        :top="y === 'top'"
        :right="x === 'right'"
        :vertical="mode === 'vertical'"
        v-model="snackbar"
        :color="color"
      >{{ text }}</v-snackbar>
    </v-container>
506be6fd7   Neeraj Sharma   implemet dyamic i...
897
898
  </template>
  <script>
969cf1f94   Neeraj Sharma   something changes...
899
900
  import http from "@/Services/http.js";
  import Util from "@/util";
76f4f9c78   Neeraj Sharma   all api add in se...
901

969cf1f94   Neeraj Sharma   something changes...
902
903
904
905
906
907
908
909
  export default {
    data: () => ({
      y: "top",
      x: "right",
      mode: "",
      timeout: 3000,
      text: "",
      search: "",
68d742034   Neeraj Sharma   implement new des...
910
      color: "",
969cf1f94   Neeraj Sharma   something changes...
911
912
913
914
      snackbar: false,
      loading: false,
      showLoader: false,
      dialog: false,
68d742034   Neeraj Sharma   implement new des...
915
916
      show: true,
      showSearch: false,
969cf1f94   Neeraj Sharma   something changes...
917
918
      dialogAddLecture: false,
      dialogUpdateLectures: false,
46db0a3b5   Neeraj Sharma   add sunbject and ...
919
      dialogSchedule: false,
969cf1f94   Neeraj Sharma   something changes...
920
921
      dialog1: false,
      valid: true,
68d742034   Neeraj Sharma   implement new des...
922
      addTimeTableDialog: false,
aa63ee55a   Neeraj Sharma   fixed validation ...
923
      validAddDay: true,
aa63ee55a   Neeraj Sharma   fixed validation ...
924
      loadingFindData: false,
969cf1f94   Neeraj Sharma   something changes...
925
926
      addclass: [],
      addSection: [],
8669ee94e   Shikha Mishra   show data of subj...
927
      subjectList: [],
969cf1f94   Neeraj Sharma   something changes...
928
929
      addTeachers: [],
      gender: ["Male", "Female"],
969cf1f94   Neeraj Sharma   something changes...
930
      pagination: {
8e8d14254   Shikha Mishra   Cleared data whil...
931
        rowsPerPage: 15,
969cf1f94   Neeraj Sharma   something changes...
932
933
934
935
936
      },
      imageData: {},
      imageName: "",
      imageUrl: "",
      imageFile: "",
8e8d14254   Shikha Mishra   Cleared data whil...
937
938
939
940
941
942
943
944
945
946
      timeInRules: [(v) => !!v || "Time In is required"],
      timeOutRules: [(v) => !!v || "Time Out is required"],
      lectureRules: [(v) => !!v || "Lecture No is required"],
      subjectNameRules: [(v) => !!v || "Subject Name is required"],
      classRules: [(v) => !!v || "Class Name is required"],
      sectionRules: [(v) => !!v || "Section Name is required"],
      sectionRules: [(v) => !!v || "Section Name is required"],
      teacherRules: [(v) => !!v || "Teacher Name is required"],
      selecDayRule: [(v) => !!v || "Day is required"],
      dayRules: [(v) => !!v || "Day is required"],
b39d2afd2   Neeraj Sharma   responsive dashboard
947
      getParticulerLecture: "",
969cf1f94   Neeraj Sharma   something changes...
948
949
950
      headers: [
        {
          text: "No",
68d742034   Neeraj Sharma   implement new des...
951
          align: "",
969cf1f94   Neeraj Sharma   something changes...
952
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
953
          value: "No",
969cf1f94   Neeraj Sharma   something changes...
954
955
956
957
958
        },
        {
          text: "Class Name",
          value: "classData.classNum",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
959
          align: "center",
969cf1f94   Neeraj Sharma   something changes...
960
961
962
963
964
        },
        {
          text: "Section Name",
          value: "sectionData.name",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
965
          align: "center",
969cf1f94   Neeraj Sharma   something changes...
966
        },
8e8d14254   Shikha Mishra   Cleared data whil...
967
        { text: "Action", value: "", sortable: false, align: "center" },
969cf1f94   Neeraj Sharma   something changes...
968
969
970
971
972
973
974
      ],
      daysHeaders: [
        { text: "Day", value: "dayday", sortable: false, align: "center" },
        {
          text: "Subject Name",
          value: "subjectName",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
975
          align: "center",
969cf1f94   Neeraj Sharma   something changes...
976
977
        },
        { text: "Time In", value: "timeIn", sortable: false, align: "center" },
8e8d14254   Shikha Mishra   Cleared data whil...
978
        { text: "Time Out", value: "timeOut", sortable: false, align: "center" },
969cf1f94   Neeraj Sharma   something changes...
979
980
981
982
983
984
985
986
      ],
      addOneDay: [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
8e8d14254   Shikha Mishra   Cleared data whil...
987
        "Sunday",
969cf1f94   Neeraj Sharma   something changes...
988
      ],
46db0a3b5   Neeraj Sharma   add sunbject and ...
989
      schedule: {
8e8d14254   Shikha Mishra   Cleared data whil...
990
        selectDay: "",
46db0a3b5   Neeraj Sharma   add sunbject and ...
991
      },
969cf1f94   Neeraj Sharma   something changes...
992
993
994
995
996
      desserts: [],
      timeTableList: [],
      editedIndex: -1,
      selectTimeTable: {
        select: "",
8e8d14254   Shikha Mishra   Cleared data whil...
997
        selectSection: "",
969cf1f94   Neeraj Sharma   something changes...
998
999
1000
1001
1002
1003
1004
1005
      },
      timeTable: {
        select: "",
        selectSection: "",
        selectDay: "",
        timeIn: null,
        timeOut: null,
        subjectName: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1006
        selectTeacher: "",
969cf1f94   Neeraj Sharma   something changes...
1007
1008
1009
      },
      editedItem: {
        classNum: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1010
        selectSection: "",
969cf1f94   Neeraj Sharma   something changes...
1011
1012
1013
1014
1015
1016
1017
      },
      addlectures: {
        timeIn: null,
        timeOut: null,
        subjectName: "",
        teacherId: "",
        scheduleId: "",
8669ee94e   Shikha Mishra   show data of subj...
1018
        timeTableId: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1019
        select: "",
969cf1f94   Neeraj Sharma   something changes...
1020
1021
1022
1023
1024
      },
      updateLectures: {
        timeIn: null,
        timeOut: null,
        subjectName: "",
8669ee94e   Shikha Mishra   show data of subj...
1025
        teacherId: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1026
        select: "",
969cf1f94   Neeraj Sharma   something changes...
1027
1028
1029
      },
      updateLecturesId: {
        lectureId: "",
8e8d14254   Shikha Mishra   Cleared data whil...
1030
        scheduleId: "",
969cf1f94   Neeraj Sharma   something changes...
1031
1032
1033
1034
1035
1036
1037
      },
      menu1: false,
      menu2: false,
      menu3: false,
      menu4: false,
      menu5: false,
      menu6: false,
8e8d14254   Shikha Mishra   Cleared data whil...
1038
      scheduleDayId: "",
2f9211c74   Shikha Mishra   done one round of...
1039
      showData: false,
969cf1f94   Neeraj Sharma   something changes...
1040
    }),
8e8d14254   Shikha Mishra   Cleared data whil...
1041
1042
1043
1044
1045
1046
1047
    watch: {
      addTimeTableDialog: function (val) {
        if (!val) {
          this.timeTable = [];
        }
      },
    },
969cf1f94   Neeraj Sharma   something changes...
1048
1049
    methods: {
      findTimeTable() {
aa63ee55a   Neeraj Sharma   fixed validation ...
1050
        this.loadingFindData = true;
969cf1f94   Neeraj Sharma   something changes...
1051
1052
1053
1054
        http()
          .get("/getParticularClassTimeTable", {
            params: {
              sectionId: this.selectTimeTable.selectSection,
8e8d14254   Shikha Mishra   Cleared data whil...
1055
1056
              classId: this.selectTimeTable.select,
            },
969cf1f94   Neeraj Sharma   something changes...
1057
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1058
          .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1059
            this.desserts = response.data.data;
2f9211c74   Shikha Mishra   done one round of...
1060
1061
1062
1063
1064
1065
1066
1067
            if (this.desserts.length === 0) {
              this.showLoader = false;
              this.snackbar = true;
              this.text = "Data not found!";
              this.color = "error";
              return;
            }
            this.showData = true;
aa63ee55a   Neeraj Sharma   fixed validation ...
1068
            this.loadingFindData = false;
969cf1f94   Neeraj Sharma   something changes...
1069
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1070
          .catch((error) => {
aa63ee55a   Neeraj Sharma   fixed validation ...
1071
1072
1073
1074
            this.loadingFindData = false;
            this.snackbar = true;
            this.text = error.response.data.message;
            this.text = error.response.data.statusText;
969cf1f94   Neeraj Sharma   something changes...
1075
1076
1077
1078
          });
      },
      getSections(_id) {
        var token = this.$store.state.token;
7014df603   Shikha Mishra   Improve placehold...
1079
        this.desserts = [];
969cf1f94   Neeraj Sharma   something changes...
1080
1081
1082
1083
1084
        http()
          .get(
            "/getSectionsList",
            { params: { classId: _id } },
            {
8e8d14254   Shikha Mishra   Cleared data whil...
1085
              headers: { Authorization: "Bearer " + token },
969cf1f94   Neeraj Sharma   something changes...
1086
1087
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1088
          .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1089
            this.addSection = response.data.data;
969cf1f94   Neeraj Sharma   something changes...
1090
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1091
          .catch((err) => {
969cf1f94   Neeraj Sharma   something changes...
1092
1093
1094
            // console.log("err====>", err);
          });
      },
8669ee94e   Shikha Mishra   show data of subj...
1095
1096
1097
1098
1099
1100
1101
1102
      getClassSubject(_id) {
        this.showLoader = true;
        //   this.classId = this.classId;
        http()
          .get(
            "/getParticularClass",
            { params: { classId: _id } },
            {
8e8d14254   Shikha Mishra   Cleared data whil...
1103
              headers: { Authorization: "Bearer " + this.token },
8669ee94e   Shikha Mishra   show data of subj...
1104
1105
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1106
          .then((response) => {
8669ee94e   Shikha Mishra   show data of subj...
1107
1108
1109
            this.subjectList = response.data.data;
            this.showLoader = false;
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1110
          .catch((err) => {
8669ee94e   Shikha Mishra   show data of subj...
1111
1112
1113
            this.showLoader = false;
          });
      },
969cf1f94   Neeraj Sharma   something changes...
1114
1115
      getTimeTable(item) {
        this.showLoader = true;
b39d2afd2   Neeraj Sharma   responsive dashboard
1116
        this.getParticulerLecture = item._id;
aa63ee55a   Neeraj Sharma   fixed validation ...
1117
1118
1119
        this.getTimeTableDayData();
      },
      getTimeTableDayData() {
969cf1f94   Neeraj Sharma   something changes...
1120
1121
1122
1123
        var token = this.$store.state.token;
        http()
          .get(
            "/getParticularTimeTable",
aa63ee55a   Neeraj Sharma   fixed validation ...
1124
            { params: { timeTableId: this.getParticulerLecture } },
969cf1f94   Neeraj Sharma   something changes...
1125
            {
8e8d14254   Shikha Mishra   Cleared data whil...
1126
              headers: { Authorization: "Bearer " + token },
969cf1f94   Neeraj Sharma   something changes...
1127
1128
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1129
          .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1130
1131
            this.timeTableList = response.data.data;
            this.showLoader = false;
969cf1f94   Neeraj Sharma   something changes...
1132
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1133
          .catch((err) => {
969cf1f94   Neeraj Sharma   something changes...
1134
1135
1136
1137
1138
1139
1140
1141
1142
            this.showLoader = false;
            // console.log("err====>", err);
          });
      },
      pickFile() {
        this.$refs.image.click();
      },
  
      onFilePicked(e) {
969cf1f94   Neeraj Sharma   something changes...
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
        const files = e.target.files;
        this.imageData.upload = e.target.files[0];
        if (files[0] !== undefined) {
          this.imageName = files[0].name;
          if (this.imageName.lastIndexOf(".") <= 0) {
            return;
          }
          const fr = new FileReader();
          fr.readAsDataURL(files[0]);
          fr.addEventListener("load", () => {
            this.imageUrl = fr.result;
            this.imageFile = files[0]; // this is an image file that can be sent to server...
            this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
969cf1f94   Neeraj Sharma   something changes...
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
          });
        } else {
          this.imageName = "";
          this.imageFile = "";
          this.imageUrl = "";
        }
      },
      // getTimeTableList() {
      //   this.showLoader = true;
      //   var token = this.$store.state.token;
      //   http()
      //     .get("/getTimeTablesList", {
      //       headers: { Authorization: "Bearer " + token }
      //     })
      //     .then(response => {
      //       this.desserts = response.data.data;
      //       this.showLoader = false;
      //       // console.log("getTimeTableList=====>", response.data.data);
      //     })
      //     .catch(err => {
      //       // console.log("err====>", err);
      //       this.showLoader = false;
      //       this.$router.replace({ path: "/" });
      //     });
      // },
      editItem(item) {
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog = true;
      },
109a6218c   Neeraj Sharma   solve issue/bugs ...
1186
1187
1188
1189
      updateTimeTable(timeToUpdate, classToUpdate, scheduleId) {
        this.updateLecturesId.scheduleId = scheduleId;
        this.updateLecturesId.lectureId = timeToUpdate._id;
        this.updateLectures = timeToUpdate;
969cf1f94   Neeraj Sharma   something changes...
1190
1191
1192
        this.dialogUpdateLectures = true;
      },
      addLecture(scheduleId, timeTableId) {
969cf1f94   Neeraj Sharma   something changes...
1193
1194
1195
1196
1197
        this.addlectures.scheduleId = scheduleId;
        this.addlectures.timeTableId = timeTableId;
        this.dialogAddLecture = true;
      },
      AddLecture() {
1159d4f6d   Neeraj Sharma   clear form after ...
1198
        if (this.$refs.lectureForm.validate()) {
b39d2afd2   Neeraj Sharma   responsive dashboard
1199
1200
          http()
            .post("/addLecture", this.addlectures)
8e8d14254   Shikha Mishra   Cleared data whil...
1201
            .then((response) => {
0551a0f15   Neeraj Sharma   implemnet functio...
1202
1203
              this.snackbar = true;
              this.text = "New Add Lecture successfully";
969cf1f94   Neeraj Sharma   something changes...
1204
1205
              var token = this.$store.state.token;
              http()
b39d2afd2   Neeraj Sharma   responsive dashboard
1206
1207
1208
1209
                .get(
                  "/getParticularTimeTable",
                  { params: { timeTableId: this.getParticulerLecture } },
                  {
8e8d14254   Shikha Mishra   Cleared data whil...
1210
                    headers: { Authorization: "Bearer " + token },
b39d2afd2   Neeraj Sharma   responsive dashboard
1211
1212
                  }
                )
8e8d14254   Shikha Mishra   Cleared data whil...
1213
                .then((response) => {
b39d2afd2   Neeraj Sharma   responsive dashboard
1214
                  this.timeTableList = response.data.data;
68d742034   Neeraj Sharma   implement new des...
1215
1216
1217
                  this.snackbar = true;
                  this.text = response.data.message;
                  this.color = "green";
b39d2afd2   Neeraj Sharma   responsive dashboard
1218
1219
                  this.showLoader = false;
                })
8e8d14254   Shikha Mishra   Cleared data whil...
1220
                .catch((err) => {
b39d2afd2   Neeraj Sharma   responsive dashboard
1221
1222
                  this.showLoader = false;
                  // console.log("err====>", err);
68d742034   Neeraj Sharma   implement new des...
1223
1224
1225
                  this.snackbar = true;
                  this.color = "error";
                  this.text = error.response.data.message;
b39d2afd2   Neeraj Sharma   responsive dashboard
1226
1227
1228
1229
                });
              this.closedialogLecture();
              this.clearLeactureData();
            })
8e8d14254   Shikha Mishra   Cleared data whil...
1230
            .catch((error) => {
0551a0f15   Neeraj Sharma   implemnet functio...
1231
1232
1233
              this.snackbar = true;
              this.text = error.response.data.message;
              this.text = error.response.data.statusText;
b39d2afd2   Neeraj Sharma   responsive dashboard
1234
            });
1159d4f6d   Neeraj Sharma   clear form after ...
1235
        }
969cf1f94   Neeraj Sharma   something changes...
1236
1237
1238
1239
1240
1241
1242
1243
1244
      },
      updateParticularTable() {
        let EditLecture = {
          lectureId: this.updateLecturesId.lectureId,
          scheduleId: this.updateLecturesId.scheduleId,
          updatedLecture: {
            timeIn: this.updateLectures.timeIn,
            timeOut: this.updateLectures.timeOut,
            subjectName: this.updateLectures.subjectName,
8e8d14254   Shikha Mishra   Cleared data whil...
1245
1246
            teacherId: this.updateLectures.teacherId,
          },
969cf1f94   Neeraj Sharma   something changes...
1247
1248
1249
        };
        http()
          .put("/updateLecture", EditLecture)
8e8d14254   Shikha Mishra   Cleared data whil...
1250
          .then((response) => {
860da881d   Shikha Mishra   comment all consoles
1251
            //   console.log("updateLecture", EditLecture);
68d742034   Neeraj Sharma   implement new des...
1252
1253
1254
            this.snackbar = true;
            this.text = response.data.message;
            this.color = "green";
969cf1f94   Neeraj Sharma   something changes...
1255
1256
            this.closeUpdateLectures();
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1257
          .catch((error) => {
969cf1f94   Neeraj Sharma   something changes...
1258
            // console.log(error);
68d742034   Neeraj Sharma   implement new des...
1259
1260
1261
1262
1263
  
            this.snackbar = true;
            this.color = "error";
            this.text = error.response.data.message;
            if (error.response.data.statusText) {
969cf1f94   Neeraj Sharma   something changes...
1264
1265
1266
1267
1268
1269
              this.text = error.response.data.statusText;
            }
          });
      },
      deleteItem(item) {
        let deleteTimeTable = {
8e8d14254   Shikha Mishra   Cleared data whil...
1270
          timeTableId: item._id,
969cf1f94   Neeraj Sharma   something changes...
1271
1272
1273
1274
1275
        };
        http()
          .delete(
            "/deleteTimeTable",
            confirm("Are you sure you want to delete this?") && {
8e8d14254   Shikha Mishra   Cleared data whil...
1276
              params: deleteTimeTable,
969cf1f94   Neeraj Sharma   something changes...
1277
1278
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1279
          .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1280
            // console.log("deleteUers",deleteTimeTable)
0551a0f15   Neeraj Sharma   implemnet functio...
1281
            this.snackbar = true;
68d742034   Neeraj Sharma   implement new des...
1282
1283
            this.text = response.data.message;
            this.color = "green";
969cf1f94   Neeraj Sharma   something changes...
1284
1285
            this.findTimeTable();
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1286
          .catch((error) => {
969cf1f94   Neeraj Sharma   something changes...
1287
1288
1289
            // console.log(error);
          });
      },
969cf1f94   Neeraj Sharma   something changes...
1290
1291
      close() {
        this.dialog = false;
969cf1f94   Neeraj Sharma   something changes...
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
      },
      close1() {
        this.dialog1 = false;
      },
      closedialogLecture() {
        this.dialogAddLecture = false;
      },
      closeUpdateLectures() {
        this.dialogUpdateLectures = false;
      },
8e8d14254   Shikha Mishra   Cleared data whil...
1302
1303
1304
1305
1306
      closeAddTimeTableModel() {
        this.addTimeTableDialog = false;
        this.timeTableList = [];
        this.timeTable = [];
      },
969cf1f94   Neeraj Sharma   something changes...
1307
1308
1309
1310
      submit() {
        if (this.$refs.form.validate()) {
          let imageData = new FormData();
          imageData.append("upload", this.imageFile);
969cf1f94   Neeraj Sharma   something changes...
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
          let addTimeTable = {
            sectionId: this.timeTable.selectSection,
            classId: this.timeTable.select,
            schedule: [
              {
                day: this.timeTable.selectDay,
                lectures: [
                  {
                    timeIn: this.timeTable.timeIn,
                    timeOut: this.timeTable.timeOut,
                    subjectName: this.timeTable.subjectName,
8e8d14254   Shikha Mishra   Cleared data whil...
1322
1323
1324
1325
1326
                    teacherId: this.timeTable.selectTeacher,
                  },
                ],
              },
            ],
969cf1f94   Neeraj Sharma   something changes...
1327
1328
1329
1330
          };
          this.loading = true;
          http()
            .post("/createTimeTable", addTimeTable)
8e8d14254   Shikha Mishra   Cleared data whil...
1331
            .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1332
1333
1334
1335
              // console.log("addTimeTable=====>", addTimeTable);
              if ((this.snackbar = true)) {
                this.text = "New Time Table added successfully";
              }
8669ee94e   Shikha Mishra   show data of subj...
1336
              this.color = "green";
9d0f43805   Shikha Mishra   show list of adde...
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
              // this.clear();
              http()
                .get("/getParticularClassTimeTable", {
                  params: {
                    classId: this.timeTable.select,
                    sectionId: this.timeTable.selectSection,
                  },
                })
                .then((response) => {
                  this.desserts = response.data.data;
                  this.showData = true;
                  this.loadingFindData = false;
                })
                .catch((error) => {
                  this.loadingFindData = false;
                  this.snackbar = true;
                  this.text = error.response.data.message;
                  this.text = error.response.data.statusText;
                });
68d742034   Neeraj Sharma   implement new des...
1356
              this.addTimeTableDialog = false;
969cf1f94   Neeraj Sharma   something changes...
1357
1358
              this.loading = false;
            })
8e8d14254   Shikha Mishra   Cleared data whil...
1359
            .catch((error) => {
969cf1f94   Neeraj Sharma   something changes...
1360
1361
1362
1363
1364
1365
1366
1367
              // console.log(error);
              if ((this.snackbar = true)) {
                this.text = error.response.data.message;
              }
              this.loading = false;
            });
        }
      },
969cf1f94   Neeraj Sharma   something changes...
1368
1369
1370
      clear() {
        this.$refs.form.reset();
      },
b39d2afd2   Neeraj Sharma   responsive dashboard
1371
      clearLeactureData() {
1159d4f6d   Neeraj Sharma   clear form after ...
1372
1373
        this.$refs.lectureForm.reset();
      },
969cf1f94   Neeraj Sharma   something changes...
1374
1375
1376
1377
1378
1379
1380
      save() {
        let imageData = new FormData();
        imageData.append("upload", this.imageFile);
        // console.log(imageData);
        let editTimeTable = {
          timeTableId: this.editedItem._id,
          classId: this.editedItem.classNum,
8e8d14254   Shikha Mishra   Cleared data whil...
1381
          sectionId: this.editedItem.selectSection,
969cf1f94   Neeraj Sharma   something changes...
1382
1383
1384
1385
          // imageData
        };
        http()
          .put("/updateTimeTable", editTimeTable)
8e8d14254   Shikha Mishra   Cleared data whil...
1386
          .then((response) => {
d10c26632   Shikha Mishra   Improve updateBoo...
1387
            //   console.log("editTimeTable", editTimeTable);
969cf1f94   Neeraj Sharma   something changes...
1388
1389
            if ((this.snackbar = true)) {
              this.text = "Successfully Edit Existing Time Table";
d10c26632   Shikha Mishra   Improve updateBoo...
1390
              this.color = "success";
969cf1f94   Neeraj Sharma   something changes...
1391
            }
947636880   Shikha Mishra   show list of cour...
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
            http()
              .get("/getParticularClassTimeTable", {
                params: {
                  classId: this.editedItem.classNum,
                  sectionId: this.editedItem.selectSection,
                },
              })
              .then((response) => {
                this.desserts = response.data.data;
                this.showData = true;
                this.loadingFindData = false;
              })
              .catch((error) => {
                this.loadingFindData = false;
                this.snackbar = true;
                this.text = error.response.data.message;
                this.text = error.response.data.statusText;
              });
969cf1f94   Neeraj Sharma   something changes...
1410
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1411
          .catch((error) => {
969cf1f94   Neeraj Sharma   something changes...
1412
1413
1414
1415
1416
1417
1418
            // console.log(error);
            if ((this.snackbar = true)) {
              this.text = error.response.data.message;
            }
          });
        this.close();
      },
969cf1f94   Neeraj Sharma   something changes...
1419
1420
      deleteTimeTable(timeToDelete, deleteLectures) {
        let deleteLecture = {
8e8d14254   Shikha Mishra   Cleared data whil...
1421
          lectureId: timeToDelete._id,
969cf1f94   Neeraj Sharma   something changes...
1422
1423
1424
1425
1426
        };
        http()
          .delete(
            "/deleteLecture",
            confirm("Are you sure you want to delete this?") && {
8e8d14254   Shikha Mishra   Cleared data whil...
1427
              params: deleteLecture,
969cf1f94   Neeraj Sharma   something changes...
1428
1429
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
1430
          .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1431
            if ((this.snackbar = true)) {
d45ffc6fa   Neeraj Sharma   solve bugs and ad...
1432
              this.text = "Successfully delete Existing Time Table";
969cf1f94   Neeraj Sharma   something changes...
1433
1434
1435
1436
1437
1438
            }
            const index = this.timeTableList.schedule.indexOf(deleteLectures);
            for (let i = 0; i < this.timeTableList.schedule.length; i++) {
              this.timeTableList.schedule[i].lectures.splice(index, 1);
            }
          })
8e8d14254   Shikha Mishra   Cleared data whil...
1439
          .catch((error) => {
860da881d   Shikha Mishra   comment all consoles
1440
1441
1442
1443
            //   console.log(error);
            this.snackbar = true;
            this.color = "error";
            this.text = error.response.data.message;
969cf1f94   Neeraj Sharma   something changes...
1444
          });
46db0a3b5   Neeraj Sharma   add sunbject and ...
1445
1446
1447
1448
1449
1450
      },
      addSchedule(id) {
        this.scheduleDayId = id;
        this.dialogSchedule = true;
      },
      submitSchedule() {
aa63ee55a   Neeraj Sharma   fixed validation ...
1451
1452
1453
        if (this.$refs.formAddDay.validate()) {
          let scheduleDayData = {
            timeTableId: this.scheduleDayId,
8e8d14254   Shikha Mishra   Cleared data whil...
1454
            day: this.schedule.selectDay,
aa63ee55a   Neeraj Sharma   fixed validation ...
1455
1456
1457
          };
          http()
            .post("/addSchedule", scheduleDayData)
8e8d14254   Shikha Mishra   Cleared data whil...
1458
            .then((response) => {
aa63ee55a   Neeraj Sharma   fixed validation ...
1459
              this.snackbar = true;
46db0a3b5   Neeraj Sharma   add sunbject and ...
1460
              this.text = "New Schedule Day added successfully";
aa63ee55a   Neeraj Sharma   fixed validation ...
1461
1462
1463
1464
              this.dialogSchedule = false;
              this.loading = false;
              this.getTimeTableDayData();
            })
8e8d14254   Shikha Mishra   Cleared data whil...
1465
            .catch((error) => {
aa63ee55a   Neeraj Sharma   fixed validation ...
1466
1467
              // console.log(error);
              this.snackbar = true;
46db0a3b5   Neeraj Sharma   add sunbject and ...
1468
              this.text = error.response.data.message;
aa63ee55a   Neeraj Sharma   fixed validation ...
1469
1470
1471
              this.loading = false;
            });
        }
68d742034   Neeraj Sharma   implement new des...
1472
1473
1474
1475
1476
1477
1478
1479
      },
      displaySearch() {
        (this.show = false), (this.showSearch = true);
      },
      closeSearch() {
        this.showSearch = false;
        this.show = true;
        this.search = "";
8e8d14254   Shikha Mishra   Cleared data whil...
1480
      },
969cf1f94   Neeraj Sharma   something changes...
1481
1482
1483
1484
1485
1486
    },
    mounted() {
      // this.getTimeTableList();
      var token = this.$store.state.token;
      http()
        .get("/getClassesList", {
8e8d14254   Shikha Mishra   Cleared data whil...
1487
          headers: { Authorization: "Bearer " + token },
969cf1f94   Neeraj Sharma   something changes...
1488
        })
8e8d14254   Shikha Mishra   Cleared data whil...
1489
        .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1490
1491
1492
          this.addclass = response.data.data;
          // console.log("getClassesList=====>",this.addclass)
        })
8e8d14254   Shikha Mishra   Cleared data whil...
1493
        .catch((error) => {
00e4bc4e1   Neeraj Sharma   fixed auntentication
1494
1495
1496
1497
1498
1499
1500
          this.showLoader = false;
          if (error.response.status === 401) {
            this.$router.replace({ path: "/" });
            this.$store.dispatch("setToken", null);
            this.$store.dispatch("Id", null);
            this.$store.dispatch("Role", null);
          }
969cf1f94   Neeraj Sharma   something changes...
1501
1502
1503
1504
        });
  
      http()
        .get("/getTeachersList", {
8e8d14254   Shikha Mishra   Cleared data whil...
1505
          headers: { Authorization: "Bearer " + token },
969cf1f94   Neeraj Sharma   something changes...
1506
        })
8e8d14254   Shikha Mishra   Cleared data whil...
1507
        .then((response) => {
969cf1f94   Neeraj Sharma   something changes...
1508
1509
1510
          this.addTeachers = response.data.data;
          // console.log("getClassesList=====>",this.addTeachers)
        })
8e8d14254   Shikha Mishra   Cleared data whil...
1511
        .catch((error) => {
00e4bc4e1   Neeraj Sharma   fixed auntentication
1512
1513
1514
1515
1516
1517
1518
          this.showLoader = false;
          if (error.response.status === 401) {
            this.$router.replace({ path: "/" });
            this.$store.dispatch("setToken", null);
            this.$store.dispatch("Id", null);
            this.$store.dispatch("Role", null);
          }
969cf1f94   Neeraj Sharma   something changes...
1519
        });
8e8d14254   Shikha Mishra   Cleared data whil...
1520
    },
969cf1f94   Neeraj Sharma   something changes...
1521
  };
68d742034   Neeraj Sharma   implement new des...
1522
  </script>