def servicio_search(): global servicio_nu, servicio_id if request.method == "GET": return render_template("servicio/check.html", send_servicio_numbre_lists=servicio_numbre_list) else: servicio_nu = request.form.get("servicio_numbre") sid = find_servicio_id (servicio_nu) plist1 = get_super_servicio(sid, 999) plist2 = get_recom_servicio(sid) avg_time = [] ed_num = [] ing_num = [] name = [] for item in pid_list(servicio_id): temp = get_gps_data(sid, item) if temp[0] == 0 and temp[1] == 0 and temp[2] == 0: () else: avg_time.append(temp[0]) ed_num.append(temp[1]) ing_num.append(temp[2]) name.append(get_permiso_numbre_list(sid, item)) else: return render_template("servicio/result.html", send1s=plist1, send2s=plist2, send_servicio_numbre_lists=servicio_numbre_list, send_servicio_nu = servicio_nu, send_servicio_id=sid, send_numbre=name, send_avg_time=avg_time, send_ed_num=ed_num, send_ing_num=ing_num)
def get_super_variables(): all_lists = get_super_all() acc = 0 etapa_list = [] light_list = [] enrolled_servicio = 0 while acc < len (all_lists): etapa_list.append((all_lists[acc])[6]) light_list.append((all_lists[acc])[7]) acc += 1 planificado = etapa_list.count('Planificado') desarrollando = etapa_list.count('Desarrollando') terminado = etapa_list.count('Terminado') red = light_list.count('Red') yellow = light_list.count('Yellow') green = light_list.count('Green') for item in sid_list: enrolled_servicio += (get_super_servicio(item,1))[3] return render_template("super/home.html", send_lists=get_super_all(), send_etapa=[planificado, desarrollando, terminado], send_light=[red, yellow, green], send_enrolled_servicio=enrolled_servicio)
def home(): global permiso_light_list, super_light_list, alineacion_light_list permiso_light_list = [] super_light_list = [] alineacion_light_list = (get_alineacion_all(1))[0] # for all the permits for item in sid_list: temp = get_gps_data(item, 999) if temp[0] == 0 or temp[1] == 0 or temp[2] == 0: () else: permiso_light_list.append([((get_servicio_numbre_list(item))), cvt_light_easier(temp[5]), str(item)]) # for SUPER for item in sid_list: temp = get_super_servicio(item,1) if temp[1] == 0: () else: super_light_list.append(temp) return render_template("home.html", send1s=permiso_light_list, send2s=super_light_list, send3s=alineacion_light_list)
def dashboard(): # all the data of SUPER all_lists = get_super_all() super_servicio_enrolled = 0 for item in sid_list: super_servicio_enrolled += (get_super_servicio(item,1))[3] etapa_list = [] acc = 0 while acc < len (all_lists): etapa_list.append((all_lists[acc])[6]) acc += 1 super_permiso_desarrollando = etapa_list.count('Desarrollando') super_permiso_terminado = etapa_list.count('Terminado') s_all = [super_servicio_enrolled, super_permiso_desarrollando, super_permiso_terminado] # all the data of permiso grupo (festoin de proyectos) permiso_proyectos_ongoing = find_project_all()[3] permiso_ratio_sectorial = find_permit_all(999) ### does this include the ambiental? permiso_ratio_dia = (get_env(1))[0] permiso_ratio_eia = (get_env(2))[0] p_all = [permiso_proyectos_ongoing, permiso_ratio_sectorial, permiso_ratio_dia, permiso_ratio_eia] # alineacion temp = get_alineacion_all(1) aline_servicio_done = temp[1] aline_medidas_implementada = temp[2] aline_medidas_not_implementada = temp[3] a_all = [aline_servicio_done, aline_medidas_implementada, aline_medidas_not_implementada] return render_template("dashboard.html", senda=a_all, sends=s_all, sendp=p_all, send_time_now=time_now_nomicro)
def super_s_id(): sid = int(request.args.get('keyword')) plist = get_super_servicio(sid, 999) return render_template("super/servicio_result.html", sends=plist)