File size: 39,532 Bytes
0489775
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
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
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
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
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
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
# Bibliotecas
import streamlit as st
import openpyxl

################################################################################################################
def mopMantenimientos():

    workbook = openpyxl.load_workbook('MOP-CRQ.xlsx')
    sheets = workbook.sheetnames
    sheet = workbook.active

    nombreCRQ = st.text_input('Nombre del Mantenimiento:')
    sheet['B9'] = nombreCRQ
    sheet['C11'] = nombreCRQ
    CRQ = nombreCRQ[4:9]
    numCRQ = st.text_input('Numero de CRQ:', value=CRQ)
    if numCRQ.isdigit() == True:
        sheet['D10'] = numCRQ
    else:
        st.warning('Ingrese un numero valido')
    
    impacto = st.text_input('Impacto / Alcance', value='Ninguno')
    sheet['C13'] = impacto

    n2Responsable = st.selectbox('N2', ['Carlos Castillo','Cristhian Vallejo', 'Elizabeth Pe帽aloza', 'Fabricio Oleas','Luis Chumo', 'Washington Chuqui', 'Xavier Ortiz'])
    sheet['E18'] = n2Responsable
    if n2Responsable == 'Carlos Castillo':
        sheet['H18'] = 'carlos.castillocuenca@telefonica.com'
        sheet['G18'] = '0999586043'
    elif n2Responsable == 'Cristhian Vallejo':
        sheet['H18'] = 'cristhian.vallejovillalva@telefonica.com'
        sheet['G18'] = '0995386632'
    elif n2Responsable == 'Elizabeth Pe帽aloza':
        sheet['H18'] = 'julia.penaloza@telefonica.com'
        sheet['G18'] = '0998124791'
    elif n2Responsable == 'Fabricio Oleas':
        sheet['H18'] = 'luis.oleas@telefonica.com'
        sheet['G18'] = '0987537565'
    elif n2Responsable == 'Luis Chumo':
        sheet['H18'] = 'luis.chumo@telefonica.com'
        sheet['G18'] = '0999281697'
    elif n2Responsable ==  'Washington Chuqui':
        sheet['H18'] = 'washington.chuqui@telefonica.com'
        sheet['G18'] = '0995652744'
    elif n2Responsable ==  'Xavier Ortiz':
        sheet['H18'] = 'xavier.ortiz@telefonica.com'
        sheet['G18'] = '0998542986'

    menu = ['MOP DIA', 'MOP NOCHE']
    choice = st.selectbox('Menu', menu)

    if choice == 'MOP NOCHE':
        st.title('MOP NOCHE')
        st.subheader('Actividades')
        with st.expander('1'):
            act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
            sheet['B23'] = act1
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct1 = st.text_input('Hora I - 1', value='22:00')
                sheet['D23'] = horaInicioAct1
            with col2:
                horaFinAct1 = st.text_input('Hora F - 1', value='22:30')
                sheet['E23'] = horaFinAct1
            with col3:
                responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
                sheet['F23'] = responsableAct1
            with col4:
                afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
                sheet['G23'] = afectacionAct1

        with st.expander('2'):
            act2 = st.text_input('Actividad 2', value='N1 se contacta con N2 para el inicio de la ventana')
            sheet['B24'] = act2
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct2 = st.text_input('Hora I - 2', value='22:30')
                sheet['D24'] = horaInicioAct2
            with col2:
                horaFinAct2 = st.text_input('Hora F - 2', value='23:00')
                sheet['E24'] = horaFinAct2
            with col3:
                responsableAct2 = st.text_input('Responsable 2', value='N1/N2')
                sheet['F24'] = responsableAct2
            with col4:
                afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
                sheet['G24'] = afectacionAct2

        st.subheader('Inicio de Actividades')
        with st.expander('3'):
            act3 = st.text_input('Actividad 3', value='N2 inicia con las actividades de acuerdo a su Timeline')
            sheet['B26'] = act3
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct3 = st.text_input('Hora I - 3', value='00:00')
                sheet['D26'] = horaInicioAct3
            with col2:
                horaFinAct3 = st.text_input('Hora F - 3', value='03:00')
                sheet['E26'] = horaFinAct3
            with col3:
                responsableAct3 = st.text_input('Responsable 3', value='N2')
                sheet['F26'] = responsableAct3
            with col4:
                afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
                sheet['G26'] = afectacionAct3

        with st.expander('4'):
            act4 = st.text_input('Actividad 4', value='N1 solicita avances a N2')
            sheet['B27'] = act4
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct4 = st.text_input('Hora I - 4', value='03:00')
                sheet['D27'] = horaInicioAct4
            with col2:
                horaFinAct4 = st.text_input('Hora F - 4', value='04:00')
                sheet['E27'] = horaFinAct4
            with col3:
                responsableAct4 = st.text_input('Responsable 4', value='N1/N2')
                sheet['F27'] = responsableAct4
            with col4:
                afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
                sheet['G27'] = afectacionAct4
        
        with st.expander('5'):
            act5 = st.text_input('Actividad 5', value='N2 finaliza el mantenimiento')
            sheet['B28'] = act5
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct5 = st.text_input('Hora I - 5', value='03:00')
                sheet['D28'] = horaInicioAct5
            with col2:
                horaFinAct5 = st.text_input('Hora F - 5', value='04:00')
                sheet['E28'] = horaFinAct5
            with col3:
                responsableAct5 = st.text_input('Responsable 5', value='N2')
                sheet['F28'] = responsableAct5
            with col4:
                afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
                sheet['G28'] = afectacionAct5
        
        with st.expander('6'):
            act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
            sheet['B29'] = act6
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct6 = st.text_input('Hora I - 6', value='04:00')
                sheet['D29'] = horaInicioAct6
            with col2:
                horaFinAct6 = st.text_input('Hora F - 6', value='05:00')
                sheet['E29'] = horaFinAct6
            with col3:
                responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
                sheet['F29'] = responsableAct6
            with col4:
                afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
                sheet['G29'] = afectacionAct6

        st.subheader('Rollback')
        rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
        if rollback == 'Inicio de ROLLBACK':
            with st.expander('Rollback'):
                rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
                sheet['B31'] = rollbackAct1
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback = st.text_input('Hora I - RLB', value='04:00')
                    sheet['D31'] = horaInicioRollback
                with col2:
                    horaFinRollback = st.text_input('Hora F - RLB', value='04:30')
                    sheet['E31'] = horaFinRollback
                with col3:
                    responsableRollback = st.text_input('Responsable RLB', value='N1/N2')
                    sheet['F31'] = responsableRollback
                with col4:
                    afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
                    sheet['G31'] = afectacionRollback
                
                rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
                sheet['B32'] = rollbackAct2
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback2 = st.text_input('Hora I - RLB2', value='04:30')
                    sheet['D32'] = horaInicioRollback2
                with col2:
                    horaFinRollback2 = st.text_input('Hora F - RLB2', value='05:00')
                    sheet['E32'] = horaFinRollback2
                with col3:
                    responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
                    sheet['F32'] = responsableRollback2
                with col4:
                    afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
                    sheet['G32'] = afectacionRollback2

        st.subheader('Path de la documentacion')
        pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
        pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
        sheet['C34'] = pathDocu

        
        #if st.button('Guardar'):
        workbook.save('MOP-CRQ--NAME.xlsx')

        st.subheader('Descargar Archivo')
        if st.checkbox('Descargar:'):
            with open('MOP-CRQ--NAME.xlsx','rb') as fp:
                btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')

        st.write('All rights reserved. Developed by David Minango')    

    elif choice == 'MOP DIA':
        st.title('MOP DIA')

        st.subheader('Actividades')
        with st.expander('1'):
            act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
            sheet['B23'] = act1
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct1 = st.text_input('Hora I - 1', value='09:00')
                sheet['D23'] = horaInicioAct1
            with col2:
                horaFinAct1 = st.text_input('Hora F - 1', value='09:30')
                sheet['E23'] = horaFinAct1
            with col3:
                responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
                sheet['F23'] = responsableAct1
            with col4:
                afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
                sheet['G23'] = afectacionAct1

        with st.expander('2'):
            act2 = st.text_input('Actividad 2', value='N1 se contacta con N2 para el inicio de la ventana')
            sheet['B24'] = act2
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct2 = st.text_input('Hora I - 2', value='09:30')
                sheet['D24'] = horaInicioAct2
            with col2:
                horaFinAct2 = st.text_input('Hora F - 2', value='09:45')
                sheet['E24'] = horaFinAct2
            with col3:
                responsableAct2 = st.text_input('Responsable 2', value='N1/N2')
                sheet['F24'] = responsableAct2
            with col4:
                afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
                sheet['G24'] = afectacionAct2

        st.subheader('Inicio de Actividades')
        with st.expander('3'):
            act3 = st.text_input('Actividad 3', value='N2 inicia con las actividades de acuerdo a su Timeline')
            sheet['B26'] = act3
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct3 = st.text_input('Hora I - 3', value='09:45')
                sheet['D26'] = horaInicioAct3
            with col2:
                horaFinAct3 = st.text_input('Hora F - 3', value='14:00')
                sheet['E26'] = horaFinAct3
            with col3:
                responsableAct3 = st.text_input('Responsable 3', value='N2')
                sheet['F26'] = responsableAct3
            with col4:
                afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
                sheet['G26'] = afectacionAct3

        with st.expander('4'):
            act4 = st.text_input('Actividad 4', value='N1 solicita avances a N2')
            sheet['B27'] = act4
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct4 = st.text_input('Hora I - 4', value='14:00')
                sheet['D27'] = horaInicioAct4
            with col2:
                horaFinAct4 = st.text_input('Hora F - 4', value='15:00')
                sheet['E27'] = horaFinAct4
            with col3:
                responsableAct4 = st.text_input('Responsable 4', value='N1/N2')
                sheet['F27'] = responsableAct4
            with col4:
                afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
                sheet['G27'] = afectacionAct4
        
        with st.expander('5'):
            act5 = st.text_input('Actividad 5', value='N2 finaliza el mantenimiento')
            sheet['B28'] = act5
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct5 = st.text_input('Hora I - 5', value='15:00')
                sheet['D28'] = horaInicioAct5
            with col2:
                horaFinAct5 = st.text_input('Hora F - 5', value='17:00')
                sheet['E28'] = horaFinAct5
            with col3:
                responsableAct5 = st.text_input('Responsable 5', value='N2')
                sheet['F28'] = responsableAct5
            with col4:
                afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
                sheet['G28'] = afectacionAct5
        
        with st.expander('6'):
            act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
            sheet['B29'] = act6
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct6 = st.text_input('Hora I - 6', value='17:00')
                sheet['D29'] = horaInicioAct6
            with col2:
                horaFinAct6 = st.text_input('Hora F - 6', value='18:00')
                sheet['E29'] = horaFinAct6
            with col3:
                responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
                sheet['F29'] = responsableAct6
            with col4:
                afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
                sheet['G29'] = afectacionAct6

        st.subheader('Rollback')
        rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
        if rollback == 'Inicio de ROLLBACK':
            with st.expander('Rollback'):
                rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
                sheet['B31'] = rollbackAct1
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback = st.text_input('Hora I - RLB', value='17:00')
                    sheet['D31'] = horaInicioRollback
                with col2:
                    horaFinRollback = st.text_input('Hora F - RLB', value='17:30')
                    sheet['E31'] = horaFinRollback
                with col3:
                    responsableRollback = st.text_input('Responsable RLB', value='N1/N2')
                    sheet['F31'] = responsableRollback
                with col4:
                    afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
                    sheet['G31'] = afectacionRollback
                
                rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
                sheet['B32'] = rollbackAct2
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback2 = st.text_input('Hora I - RLB2', value='17:30')
                    sheet['D32'] = horaInicioRollback2
                with col2:
                    horaFinRollback2 = st.text_input('Hora F - RLB2', value='18:00')
                    sheet['E32'] = horaFinRollback2
                with col3:
                    responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
                    sheet['F32'] = responsableRollback2
                with col4:
                    afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
                    sheet['G32'] = afectacionRollback2


        st.subheader('Path de la documentacion')
        pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
        pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
        sheet['C34'] = pathDocu

        
        #if st.button('Guardar'):
        workbook.save('MOP-CRQ--NAME.xlsx')

        st.subheader('Descargar Archivo')
        if st.checkbox('Descargar:'):
            with open('MOP-CRQ--NAME.xlsx','rb') as fp:
                btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')
################################################################################################################
################################################################################################################
def mopProveedor():

    workbook = openpyxl.load_workbook('MOP-CRQ_Prove.xlsx')
    sheets = workbook.sheetnames
    sheet = workbook.active

    nombreCRQ = st.text_input('Nombre del Mantenimiento:')
    sheet['B9'] = nombreCRQ
    sheet['C11'] = nombreCRQ
    CRQ = nombreCRQ[4:9]
    numCRQ = st.text_input('Numero de CRQ:', value=CRQ)
    if numCRQ.isdigit() == True:
        sheet['D10'] = numCRQ
    else:
        st.warning('Ingrese un numero valido')
    
    impacto = st.text_input('Impacto / Alcance', value='Ninguno')
    sheet['C13'] = impacto

    n2Responsable = st.selectbox('N2', ['Carlos Castillo','Cristhian Vallejo', 'Elizabeth Pe帽aloza', 'Fabricio Oleas','Luis Chumo', 'Washington Chuqui', 'Xavier Ortiz'])
    sheet['E18'] = n2Responsable
    if n2Responsable == 'Carlos Castillo':
        sheet['H18'] = 'carlos.castillocuenca@telefonica.com'
        sheet['G18'] = '0999586043'
    elif n2Responsable == 'Cristhian Vallejo':
        sheet['H18'] = 'cristhian.vallejovillalva@telefonica.com'
        sheet['G18'] = '0995386632'
    elif n2Responsable == 'Elizabeth Pe帽aloza':
        sheet['H18'] = 'julia.penaloza@telefonica.com'
        sheet['G18'] = '0998124791'
    elif n2Responsable == 'Fabricio Oleas':
        sheet['H18'] = 'luis.oleas@telefonica.com'
        sheet['G18'] = '0987537565'
    elif n2Responsable == 'Luis Chumo':
        sheet['H18'] = 'luis.chumo@telefonica.com'
        sheet['G18'] = '0999281697'
    elif n2Responsable ==  'Washington Chuqui':
        sheet['H18'] = 'washington.chuqui@telefonica.com'
        sheet['G18'] = '0995652744'
    elif n2Responsable ==  'Xavier Ortiz':
        sheet['H18'] = 'xavier.ortiz@telefonica.com'
        sheet['G18'] = '0998542986'

    proveedor = st.text_input('Proveedor')
    sheet['E19'] = proveedor
    proveedorNum = st.text_input('Proveedor Telefono')
    sheet['G19'] = proveedorNum
    proveedorEmail = st.text_input('Proveedor Correo')
    sheet['H19'] = proveedorEmail
    
    menu = ['MOP DIA', 'MOP NOCHE']
    choice = st.selectbox('Menu', menu)

    if choice == 'MOP NOCHE':
        st.title('MOP NOCHE')
        st.subheader('Actividades')
        with st.expander('1'):
            act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
            sheet['B23'] = act1
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct1 = st.text_input('Hora I - 1', value='22:00')
                sheet['D23'] = horaInicioAct1
            with col2:
                horaFinAct1 = st.text_input('Hora F - 1', value='22:30')
                sheet['E23'] = horaFinAct1
            with col3:
                responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
                sheet['F23'] = responsableAct1
            with col4:
                afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
                sheet['G23'] = afectacionAct1

        with st.expander('2'):
            act2 = st.text_input('Actividad 2', value='N1 se contacta con Proveedor para el inicio de la ventana')
            sheet['B24'] = act2
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct2 = st.text_input('Hora I - 2', value='22:30')
                sheet['D24'] = horaInicioAct2
            with col2:
                horaFinAct2 = st.text_input('Hora F - 2', value='23:00')
                sheet['E24'] = horaFinAct2
            with col3:
                responsableAct2 = st.text_input('Responsable 2', value='N1/Proveedor')
                sheet['F24'] = responsableAct2
            with col4:
                afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
                sheet['G24'] = afectacionAct2

        st.subheader('Inicio de Actividades')
        with st.expander('3'):
            act3 = st.text_input('Actividad 3', value='Proveedor inicia con las actividades de acuerdo a su Timeline')
            sheet['B26'] = act3
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct3 = st.text_input('Hora I - 3', value='00:00')
                sheet['D26'] = horaInicioAct3
            with col2:
                horaFinAct3 = st.text_input('Hora F - 3', value='03:00')
                sheet['E26'] = horaFinAct3
            with col3:
                responsableAct3 = st.text_input('Responsable 3', value='Proveedor')
                sheet['F26'] = responsableAct3
            with col4:
                afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
                sheet['G26'] = afectacionAct3

        with st.expander('4'):
            act4 = st.text_input('Actividad 4', value='N1 solicita avances a Proveedor')
            sheet['B27'] = act4
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct4 = st.text_input('Hora I - 4', value='03:00')
                sheet['D27'] = horaInicioAct4
            with col2:
                horaFinAct4 = st.text_input('Hora F - 4', value='04:00')
                sheet['E27'] = horaFinAct4
            with col3:
                responsableAct4 = st.text_input('Responsable 4', value='N1/Proveedor')
                sheet['F27'] = responsableAct4
            with col4:
                afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
                sheet['G27'] = afectacionAct4
        
        with st.expander('5'):
            act5 = st.text_input('Actividad 5', value='Proveedor finaliza el mantenimiento')
            sheet['B28'] = act5
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct5 = st.text_input('Hora I - 5', value='03:00')
                sheet['D28'] = horaInicioAct5
            with col2:
                horaFinAct5 = st.text_input('Hora F - 5', value='04:00')
                sheet['E28'] = horaFinAct5
            with col3:
                responsableAct5 = st.text_input('Responsable 5', value='Proveedor')
                sheet['F28'] = responsableAct5
            with col4:
                afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
                sheet['G28'] = afectacionAct5
        
        with st.expander('6'):
            act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
            sheet['B29'] = act6
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct6 = st.text_input('Hora I - 6', value='04:00')
                sheet['D29'] = horaInicioAct6
            with col2:
                horaFinAct6 = st.text_input('Hora F - 6', value='05:00')
                sheet['E29'] = horaFinAct6
            with col3:
                responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
                sheet['F29'] = responsableAct6
            with col4:
                afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
                sheet['G29'] = afectacionAct6

        st.subheader('Rollback')
        rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
        if rollback == 'Inicio de ROLLBACK':
            with st.expander('Rollback'):
                rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
                sheet['B31'] = rollbackAct1
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback = st.text_input('Hora I - RLB', value='04:00')
                    sheet['D31'] = horaInicioRollback
                with col2:
                    horaFinRollback = st.text_input('Hora F - RLB', value='04:30')
                    sheet['E31'] = horaFinRollback
                with col3:
                    responsableRollback = st.text_input('Responsable RLB', value='N1/Proveedor')
                    sheet['F31'] = responsableRollback
                with col4:
                    afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
                    sheet['G31'] = afectacionRollback
                
                rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
                sheet['B32'] = rollbackAct2
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback2 = st.text_input('Hora I - RLB2', value='04:30')
                    sheet['D32'] = horaInicioRollback2
                with col2:
                    horaFinRollback2 = st.text_input('Hora F - RLB2', value='05:00')
                    sheet['E32'] = horaFinRollback2
                with col3:
                    responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
                    sheet['F32'] = responsableRollback2
                with col4:
                    afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
                    sheet['G32'] = afectacionRollback2

        st.subheader('Path de la documentacion')
        pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
        pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
        sheet['C34'] = pathDocu

        
        #if st.button('Guardar'):
        workbook.save('MOP-CRQ--NAME2.xlsx')

        st.subheader('Descargar Archivo')
        if st.checkbox('Descargar:'):
            with open('MOP-CRQ--NAME2.xlsx','rb') as fp:
                btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')

        st.write('All rights reserved. Developed by David Minango')

    elif choice == 'MOP DIA':
        st.title('MOP DIA')

        st.subheader('Actividades')
        with st.expander('1'):
            act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
            sheet['B23'] = act1
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct1 = st.text_input('Hora I - 1', value='09:00')
                sheet['D23'] = horaInicioAct1
            with col2:
                horaFinAct1 = st.text_input('Hora F - 1', value='09:30')
                sheet['E23'] = horaFinAct1
            with col3:
                responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
                sheet['F23'] = responsableAct1
            with col4:
                afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
                sheet['G23'] = afectacionAct1

        with st.expander('2'):
            act2 = st.text_input('Actividad 2', value='N1 se contacta con Proveedor para el inicio de la ventana')
            sheet['B24'] = act2
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct2 = st.text_input('Hora I - 2', value='09:30')
                sheet['D24'] = horaInicioAct2
            with col2:
                horaFinAct2 = st.text_input('Hora F - 2', value='09:45')
                sheet['E24'] = horaFinAct2
            with col3:
                responsableAct2 = st.text_input('Responsable 2', value='N1/Proveedor')
                sheet['F24'] = responsableAct2
            with col4:
                afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
                sheet['G24'] = afectacionAct2

        st.subheader('Inicio de Actividades')
        with st.expander('3'):
            act3 = st.text_input('Actividad 3', value='Proveedor inicia con las actividades de acuerdo a su Timeline')
            sheet['B26'] = act3
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct3 = st.text_input('Hora I - 3', value='09:45')
                sheet['D26'] = horaInicioAct3
            with col2:
                horaFinAct3 = st.text_input('Hora F - 3', value='14:00')
                sheet['E26'] = horaFinAct3
            with col3:
                responsableAct3 = st.text_input('Responsable 3', value='Proveedor')
                sheet['F26'] = responsableAct3
            with col4:
                afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
                sheet['G26'] = afectacionAct3

        with st.expander('4'):
            act4 = st.text_input('Actividad 4', value='N1 solicita avances a Proveedor')
            sheet['B27'] = act4
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct4 = st.text_input('Hora I - 4', value='14:00')
                sheet['D27'] = horaInicioAct4
            with col2:
                horaFinAct4 = st.text_input('Hora F - 4', value='15:00')
                sheet['E27'] = horaFinAct4
            with col3:
                responsableAct4 = st.text_input('Responsable 4', value='N1/Proveedor')
                sheet['F27'] = responsableAct4
            with col4:
                afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
                sheet['G27'] = afectacionAct4
        
        with st.expander('5'):
            act5 = st.text_input('Actividad 5', value='Proveedor finaliza el mantenimiento')
            sheet['B28'] = act5
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct5 = st.text_input('Hora I - 5', value='15:00')
                sheet['D28'] = horaInicioAct5
            with col2:
                horaFinAct5 = st.text_input('Hora F - 5', value='17:00')
                sheet['E28'] = horaFinAct5
            with col3:
                responsableAct5 = st.text_input('Responsable 5', value='Proveedor')
                sheet['F28'] = responsableAct5
            with col4:
                afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
                sheet['G28'] = afectacionAct5
        
        with st.expander('6'):
            act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
            sheet['B29'] = act6
            col1,col2,col3,col4 = st.columns(4)       
            with col1:
                horaInicioAct6 = st.text_input('Hora I - 6', value='17:00')
                sheet['D29'] = horaInicioAct6
            with col2:
                horaFinAct6 = st.text_input('Hora F - 6', value='18:00')
                sheet['E29'] = horaFinAct6
            with col3:
                responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
                sheet['F29'] = responsableAct6
            with col4:
                afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
                sheet['G29'] = afectacionAct6

        st.subheader('Rollback')
        rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
        if rollback == 'Inicio de ROLLBACK':
            with st.expander('Rollback'):
                rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
                sheet['B31'] = rollbackAct1
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback = st.text_input('Hora I - RLB', value='17:00')
                    sheet['D31'] = horaInicioRollback
                with col2:
                    horaFinRollback = st.text_input('Hora F - RLB', value='17:30')
                    sheet['E31'] = horaFinRollback
                with col3:
                    responsableRollback = st.text_input('Responsable RLB', value='N1/Proveedor')
                    sheet['F31'] = responsableRollback
                with col4:
                    afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
                    sheet['G31'] = afectacionRollback
                
                rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
                sheet['B32'] = rollbackAct2
                col1,col2,col3,col4 = st.columns(4)       
                with col1:
                    horaInicioRollback2 = st.text_input('Hora I - RLB2', value='17:30')
                    sheet['D32'] = horaInicioRollback2
                with col2:
                    horaFinRollback2 = st.text_input('Hora F - RLB2', value='18:00')
                    sheet['E32'] = horaFinRollback2
                with col3:
                    responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
                    sheet['F32'] = responsableRollback2
                with col4:
                    afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
                    sheet['G32'] = afectacionRollback2


        st.subheader('Path de la documentacion')
        pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
        pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
        sheet['C34'] = pathDocu

        
        #if st.button('Guardar'):
        workbook.save('MOP-CRQ--NAME2.xlsx')

        st.subheader('Descargar Archivo')
        if st.checkbox('Descargar:'):
            with open('MOP-CRQ--NAME2.xlsx','rb') as fp:
                btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')

################################################################################################################
################################################################################################################
def mopPreaprobadas():

    workbook = openpyxl.load_workbook('MopsPreaprobadas.xlsx')
    sheets = workbook.sheetnames
    sheet = workbook.active

    objetivo = st.text_input('Objetivo:')
    sheet['C7'] = objetivo

    nomMantenimiento = st.text_input('Nombre de mantenimiento:')
    sheet['C8'] = nomMantenimiento

    descripcion = st.text_input('Descripci贸n de impacto:', value='No se Espera Afectaci贸n')
    sheet['C9'] = descripcion

    col1, col2 = st.columns(2)
    with col1:
        fechaIniciomtto = st.date_input('Fecha Inicio MTTO')
        sheet['F13'] = fechaIniciomtto.strftime('%d-%b-%Y')
        fechaFinmtto = st.date_input('Fecha Fin MTTO')
        sheet['F14'] = fechaIniciomtto.strftime('%d-%b-%Y')
        fechaInicioAfectacion = st.date_input('Fecha Inicio Afectaci贸n')
        sheet['F15'] = fechaInicioAfectacion.strftime('%d-%b-%Y')
        fechaFinAfectacion = st.date_input('Fecha Fin Afectaci贸n')
        sheet['F16'] = fechaFinAfectacion.strftime('%d-%b-%Y')
        fechaInicioRollback = st.date_input('Fecha Inicio Rollback')
        sheet['F17'] = fechaInicioRollback.strftime('%d-%b-%Y')
        fechaFinRollback = st.date_input('Fecha Fin Rollback')
        sheet['F18'] = fechaFinRollback.strftime('%d-%b-%Y')

    with col2:
        horaIniciomtto = st.text_input('Hora Inicio MTTO', value='00:00')
        sheet['G13'] = horaIniciomtto
        horaFinmtto = st.text_input('Hora Fin MTTO', value='05:00')
        sheet['G14'] = horaFinmtto
        horaInicioAfectacion = st.text_input('Hora Inicio Afectacion', value='00:00')
        sheet['G15'] = horaInicioAfectacion
        horaFinAfectacion = st.text_input('Hora Fin Afectacion',value='00:00')
        sheet['G16'] = horaFinAfectacion
        horaInicioRollback = st.text_input('Hora Inicio Rollback', value='03:30')
        sheet['G17'] = horaInicioRollback
        horaFinRollback = st.text_input('Hora Fin Rollback',value='04:30')
        sheet['G18'] = horaFinRollback

        sheet['C13'] = str(fechaIniciomtto.strftime('%d-%m-%Y')) +" "+ str(horaIniciomtto)
        sheet['C14'] = str(fechaFinmtto.strftime('%d-%m-%Y')) +" "+ str(horaFinmtto)
        sheet['C15'] = str(fechaInicioAfectacion.strftime('%d-%m-%Y')) +" "+ str(horaInicioAfectacion)
        sheet['C16'] = str(fechaFinAfectacion.strftime('%d-%m-%Y')) +" "+ str(horaFinAfectacion)
        sheet['C17'] = str(fechaInicioRollback.strftime('%d-%m-%Y')) +" "+ str(horaInicioRollback)
        sheet['C18'] = str(fechaFinRollback.strftime('%d-%m-%Y')) +" "+ str(horaFinRollback)

    ppmProyecto = st.text_input('PPM (Proyecto)',value='JIRA-')
    sheet['C19'] = ppmProyecto
    col12,col22 = st.columns(2)
    with col12:
        resOtecel = st.text_input('Responsable Otecel', value='N2 O&M')
        sheet['C20'] = resOtecel
        resProveedor = st.text_input('Responsable Proveedor', value='N1 PAP')
        sheet['C23'] = resProveedor
        

    with col22:
        tlfOtecel = st.text_input('Telefono Otecel', value='0999729993')
        if tlfOtecel.isdigit() == True:
            sheet['C21'] = tlfOtecel
        else:
            st.warning('Ingrese un numero valido')

        tlfProveedor = st.text_input('Telefono Proveedor', value='0999993070')
        if tlfProveedor.isdigit() == True:
            sheet['C24'] = tlfProveedor
        else:
            st.warning('Ingrese un numero valido')
        
        emailProveedor = st.text_input('Email Proveedor', value='n1pap.ec@telefonica.com')
        sheet['C25'] = emailProveedor

    if st.button('Guardar'):
        workbook.save('MOP_Preaprobadas.xlsx')

    st.subheader('Descargar Archivo')
    if st.checkbox('Descargar:'):
        with open('MOP_Preaprobadas.xlsx','rb') as fp:
            btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP_Preaprobadas.xlsx')
################################################################################################################

def mainMops():

    #st.image('proconty.png', use_column_width=True)
    st.title('Pasos a Producci贸n')
    
    #st.sidebar.image('proconty.png', width=300)
    
    menu = ['MOP Gesti贸n N2 - Generico','MOP Proveedor - Generico', 'MOP Preaprobadas']
    choice = st.sidebar.selectbox('Menu - MOPs', menu)

    if choice == 'MOP Gesti贸n N2 - Generico':
        st.subheader('MOP N2')
        mopMantenimientos()
    
    elif choice == 'MOP Proveedor - Generico':
        st.subheader('MOP Proveedores')
        mopProveedor()

    elif choice == 'MOP Preaprobadas':
        st.subheader('MOP Preaprobadas')
        mopPreaprobadas()


    #st.sidebar.markdown('[MENU PRINCIPAL](https://proconty-pap.herokuapp.com/)')