-
Notifications
You must be signed in to change notification settings - Fork 1
/
menuManager.c
261 lines (247 loc) · 6.32 KB
/
menuManager.c
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
#include <iostream>
#include <python2.7/Python.h>
#include "utils.h"
#include <stdlib.h>
using namespace std;
void menuPendientes()
{
int opc = 0;
system("clear");
while(opc != 6)
{
cout << endl << endl;
cout << " Menu de las Tareas Pendientes Por Ejecutar" << endl <<endl;
cout << " 1.- Insertar Pendiente" << endl;
cout << " 2.- Ingresar Pendiente.txt" << endl;
cout << " 3.- Listar pendientes por realizarse" << endl;
cout << " 4.- Informacion de Ayuda" <<endl;
cout << " 5.- Link del Mapa de vallas" <<endl;
cout << " 6.- Volver al menu anterior" << endl<<endl;
cout << " Opcion: "; cin >> opc;
cout << endl;
switch(opc)
{
case 1:
cout << " Insertar nuevo pendiente" << endl;
insert_new_pendiente();
break;
case 2:
cout << " Ingresar Pendientes.txt" << endl;
upload_txt_pendientes();
break;
case 3:
cout << " Listar pendientes por realizarse" << endl <<endl;
listar_pendientes_nuevo();
break;
case 4:
menuAyuda();
break;
case 5:
cout << " Mapa de vallas en GoogleMaps" << endl;
cout << " https://www.google.co.ve/maps/@10.4289125,-66.9390113,12z/data=!4m2!6m1!1s10jHVhp5HVlOwpTqFppdtcSMouGI?authuser=1" <<endl;
break;
case 6:
cout << " Volver al menu anterior" << endl;
break;
default:
cout << " ERROR: OPCION INCORRECTA" << endl;
break;
}
}
}
void menuReportes()
{
int opc = 0;
system("clear");
while(opc != 7)
{
cout << endl << endl;
cout << " Menu para Reportar Actividades" << endl << endl;
cout << " 1.- Listar actividades planificadas" << endl;
cout << " 2.- Ingresar Actividad Realizada" << endl;
cout << " 3.- Ingresar Actividad No Realizada" << endl;
cout << " 4.- Suspendida la Jornada Laboral" << endl;
cout << " 5.- Listar actividades pendientes" << endl;
cout << " 6.- Listar actividades realizadas" << endl;
cout << " 7.- Volver al menu anterior" << endl;
cout << " Opcion: "; cin >> opc;
switch(opc)
{
case 1:
cout << " Actividades Planificadas para el Dia: " << endl;
listar_realizandose();
cout << endl << endl;
break;
case 2:
cout << endl;
cout << " Insertar ID de Actividad Realizada --> " ;
cambiar_estado_realizandose();
cout << endl << endl;
break;
case 3:
cout << endl;
cout << " Insertar ID de Actividad No Realizada --> " ;
cambiar_estado_inicial();
cout << endl << endl;
break;
case 4:
cout << endl;
cout << " --> ELIMINADA LA PLANIFICACION DIARIA <--" << endl;
all_to_inicial();
cout << endl << endl;
break;
case 5:
system("clear");
cout << " Actividades pendientes por realizar: " << endl;
listar_pendientes_nuevo();
cout << endl << endl;
break;
case 6:
system("clear");
cout << " Actividades Realizadas: " << endl;
listar_listos();
cout << endl << endl;
break;
case 7:
cout << " Volver al menu anterior" << endl;
verifica();
cout << endl << endl;
break;
default:
cout << "ERROR: OPCION INCORRECTA" << endl;
cout << endl << endl;
break;
}
}
}
void menuBD()
{
system("clear");
int opc = 0;
while(opc != 6)
{
cout << endl << endl;
cout << " Gestion de Base de Datos" << endl<<endl;
cout << " 1.- Insertar Valla" << endl;
cout << " 2.- Listar Vallas" << endl;
cout << " 3.- Insertar Actividad" << endl;
cout << " 4.- Listar Actividades" << endl;
cout << " 5.- Llenado de BD con archivos (vallas.txt y actividades.txt)" << endl;
cout << " 6.- Volver al menu anterior" << endl<<endl;
cout << " Opcion: "; cin >> opc;
switch(opc)
{
case 1:
cout << " Insertar nueva valla" << endl;
insert_new_valla();
break;
case 2:
cout << " Listado de Vallas" << endl;
getAllTableDataVallas();
break;
case 3:
cout << " Insertar nueva Actividad" << endl;
insert_new_actividad();
break;
case 4:
cout << " Listado de Actividades" << endl;
getAllTableDataActividades();
break;
case 5:
create_table_vallas();
create_table_actividades();
create_table_pendientes();
upload_txt_vallas();
upload_txt_actividades();
break;
case 6:
cout << endl<< endl;
break;
default:
cout << "ERROR: OPCION INCORRECTA" << endl;
break;
}
}
}
void menuPrincipal()
{
int opc = 0;
while(opc != 6)
{
system("clear");
cout << endl << endl;
cout << " Gestion Operativa de Vallas [GTM 2014 C.A.]" << endl<<endl;
cout << " 1.- Gestion de BD" << endl;
cout << " 2.- Gestion de Tareas Pendientes" << endl;
cout << " 3.- Planificacion de Actividades" << endl;
cout << " 4.- Imprimir Planificacion" << endl;
cout << " 5.- Reportar Actividades" <<endl;
cout << " 6.- Salir" << endl<<endl;
cout << " Opcion: "; cin >> opc;
switch(opc)
{
case 1:
menuBD();
break;
case 2:
menuPendientes();
break;
case 3:
system("clear");
cout << " -----> Generar Planificacion Diaria <-----" << endl<<endl;
modelo_general_correrlo();
break;
case 4:
system("geany OC.txt");
break;
case 5:
menuReportes();
break;
case 6:
cout << endl<< endl;
break;
default:
cout << "ERROR: OPCION INCORRECTA" << endl;
break;
}
}
}
int main(int argc, char *argv[])
{
/*create_table_vallas();
create_table_actividades();
create_table_pendientes();
upload_txt_vallas();
upload_txt_actividades();
//listar_pendientes_test();
/*Py_SetProgramName(argv[0]);
Py_Initialize();
PyRun_SimpleString("execfile(\"test.py\")");
Py_Finalize();*/
//test_create_data_model();
/*read_matrix_distance();
list<string> codes;
int num_vallas;
int ** matriz;
read_matrix_distance_getALLVALUES(num_vallas,codes,matriz);
cout << num_vallas << endl;
for (std::list<string>::iterator it=codes.begin(); it != codes.end(); ++it)
cout << *it << endl;
cout << matriz[0][0] << endl;
for(int i = 0 ; i < num_vallas; i++)
{
for(int j = 0 ; j < num_vallas; j++)
{
cout << matriz[i][j] << " ";
}
cout << endl;
}*/
//std::cout << timestamp_to_seconds("2013-07-05") << std::endl;
//listar_pendientes_nuevo();
//test_obtener_vallas_no_repetidas();
//test_obtener_vallas_no_repetidas_para_usar();
//probar_obtener_matriz_de_distancia();
menuPrincipal();
//int numVehi = test_create_data_model1(false);
return 0;
}