<%@ LANGUAGE="VBSCRIPT" %> :: INFOAMEC :: <% Dim mes_, ano, mes_nuevo, ano_nuevo, num, profesional, san_miguel Dim san_martin, hurlinghar, escobar, pilar, caseros, josecpaz Dim g_san_martin, g_hurlinghar, g_escobar, g_p, g_caseros, g_josecpaz dim ano_anterior meseleg = request.querystring ("meseleg") If meseleg = "" Then meseleg = Request.Form ("meseleg") End If ano ="" ano = request.querystring ("ano") If ano = "" Then ano = Request.Form ("ano") End If mes_nuevo = Request.Form ("mes_nuevo") ano_nuevo = Request.Form ("ano_nuevo") num = Request.Form("num") profesional = Request.Form("profesional") san_miguel = Request.Form("san_miguel") san_martin = Request.Form("san_martin") hurlinghar = Request.Form("hurlinghar") escobar = Request.Form("escobar") caseros = request.form("caseros") pilar = request.form("pilar") josecpaz = request.form("josecpaz") vprof = Request.Form("vprofesional") opcion = request.querystring ("Opcion") If opcion = "" Then opcion = Request.Form ("Opcion") End If g_profesional = Request.Form("g_profesional") g_san_miguel = Request.Form("g_san_miguel") If g_san_miguel = "" Then g_san_miguel = "0" End If g_san_martin = Request.Form("g_san_martin") If g_san_martin = "" Then g_san_martin = "0" End If g_hurlinghar = Request.Form("g_hurlinghar") If g_hurlinghar = "" Then g_hurlinghar = "0" End If g_escobar = Request.Form("g_escobar") If g_escobar = "" Then g_escobar = "0" End If g_caseros = Request.Form("g_caseros") If g_caseros = "" Then g_caseros = "0" End If g_josecpaz = Request.Form("g_josecpaz") If g_josecpaz = "" Then g_josecpaz = "0" End If g_p = Request.Form("g_p") If g_p = "" Then g_p = "0" End If %> <% 'CONEXION A BASE DE DATOS dim ruta, conecto ruta = Server.MapPath("base_infoamec/infoamec.mdb") 'response.write "ruta: "&ruta set conecto = server.createobject("ADODB.connection") conecto.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& ruta &";Persist Security Info = False" 'conn.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("./") & "/conurbano.mdb;User Id=admin;Password=;" %>
" id="vprofesional"> <%Case "insertar_medico"%> <% set medico = conecto.execute("INSERT INTO profesionales (profesional) VALUES ('"&g_profesional&"')") set sacar_medico = conecto.execute("SELECT id FROM profesionales WHERE profesional = '"&g_profesional&"'") with sacar_medico if not .eof and not .bof then .movefirst conecto.execute("INSERT INTO liqmens(NProfesional, mes, anio, smartin, smiguel, hurli, escobar, caseros, pilar, josecpaz) VALUES (" & sacar_medico("id") & "," & meseleg & "," & ano & "," & g_san_martin & "," & g_san_miguel & "," & g_hurlinghar & "," & g_escobar & "," & g_caseros & "," & g_josecpaz & "," & g_p & ")" ) Response.Write "INSERT INTO liqmens(NProfesional, mes, anio, smartin, smiguel, hurli, escobar, caseros, pilar) VALUES (" & sacar_medico("id") & "," & meseleg & "," & ano & "," & g_san_martin & "," & g_san_miguel & "," & g_hurlinghar & "," & g_escobar & "," & g_caseros & "," & g_josecpaz & "," & g_p & ")" .movenext end if end with %> <% Response.Redirect("liquidacion.asp?Opcion=actualizar_tabla&meseleg="&meseleg&"&ano="&ano&"")%> <%Case "ver_prof"%> <%Case "actualizar_medico"%> <% If vprof <> "" Then sql = "UPDATE liqmens SET smartin = " & san_martin & ", smiguel= " & san_miguel & ", hurli= " & Hurlinghar & ", escobar= " & escobar & " , caseros= " & caseros & " , josecpaz= " & josecpaz & " , pilar= " & pilar & " WHERE NProfesional = " & vprof & " AND mes =" & meseleg & " AND anio = " & ano Response.Write (Sql) ' response.end conecto.execute(sql )%> <%'Response.Write "UPDATE liqmens SET smartin = "&san_martin&", smiguel= "&san_miguel&", hurli= "&Hurlinghar&", escobar= "&escobar&" WHERE NProfesional = "&vprof&" AND mes ="&meseleg&" AND anio = "&ano&"" %> <% Response.Redirect("liquidacion.asp?Opcion=actualizar_tabla&meseleg="&meseleg&"&ano="&ano&"")%> <%End If%> <%Case "eliminar_medico"%> <% If vprof <> "" Then set eliminar_medico = conecto.execute("DELETE FROM profesionales WHERE Id = "&vprof&"") set eliminar_medico_liqmens = conecto.execute("DELETE FROM liqmens WHERE NProfesional = "&vprof&"")%> <% Response.Redirect("liquidacion.asp?Opcion=actualizar_tabla&meseleg="&meseleg&"&ano="&ano&"")%> <%End If%> <%Case "actualizar_tabla"%>
 
Año <% =ano%> Mes Mes Año    
Actualizar Tabla
Agregar Profesional

<%Select Case Opcion%> <%Case "agregar_medico"%>
Profesional San Martin San Miguel Hurlingham Escobar Caseros Pilar José C. Paz  
Guardar
<% sql = "SELECT profesionales.profesional, liqmens.NProfesional, liqmens.smartin, liqmens.smiguel, liqmens.hurli, liqmens.escobar, liqmens.caseros , liqmens.josecpaz , liqmens.pilar FROM profesionales, liqmens WHERE liqmens.mes = " & meseleg & " AND liqmens.anio =" & ano & " AND liqmens.NProfesional= " & vprof & " AND profesionales.id = liqmens.NProfesional" set profe = conecto.execute(sql) with profe if not .eof and not .bof then .movefirst%> <%.movenext%> <%end if end with%>
Agregue la información del médico:
No. Profesional San Martin San Miguel Hurlingham Escobar Caseros Pilar José C. Paz
"> "> "> "> "> "> "> "> " size="10"> Guardar Datos Borrar Medico
<% 'response.write "SELECT profesionales.profesional, liqmens.NProfesional, liqmens.smartin, liqmens.smiguel, liqmens.hurli, liqmens.escobar, liqmens.caseros FROM profesionales, liqmens WHERE liqmens.mes = "&meseleg&" AND liqmens.anio ="&ano&" AND profesionales.id = liqmens.NProfesional ORDER BY profesionales.profesional" 'response.end SQL = "SELECT distinct profesionales.profesional, liqmens.NProfesional, liqmens.smartin, liqmens.smiguel, liqmens.hurli, liqmens.escobar, liqmens.caseros, liqmens.pilar, liqmens.josecpaz " sql = sql & " FROM profesionales, liqmens WHERE liqmens.mes = " & meseleg & " AND liqmens.anio =" & ano & " AND profesionales.id = liqmens.NProfesional ORDER BY profesionales.profesional" set liq = conecto.execute(SQL) with liq if not .eof and not .bof then .movefirst%> <%do while not .eof%> <%sumatoria = liq("smartin")+liq("smiguel")+liq("hurli")+liq("escobar") + liq("caseros") + liq("pilar")+ liq("josecpaz")%> <%sumatoria_smartin = sumatoria_smartin + liq("smartin")%> <%sumatoria_smiguel = sumatoria_smiguel + liq("smiguel")%> <%sumatoria_hurli = sumatoria_hurli + liq("hurli")%> <%sumatoria_escobar = sumatoria_escobar + liq("escobar")%> <%sumatoria_caseros = sumatoria_caseros + liq("caseros")%> <%sumatoria_pilar = sumatoria_pilar + liq("pilar")%> <%sumatoria_josecpaz = sumatoria_josecpaz + liq("josecpaz")%> <%sumatoria_total = sumatoria_total + sumatoria%> <%.movenext%> <%loop%> <%end if end with%>
Liquidación del mes de <%=nombre_mes(meseleg)%>
No. Profesional San Martin San Miguel Hurlingham Escobar Caseros Pilar José C. Paz TOTAL
<%=liq("NProfesional")%> )"><%=liq("profesional")%> <%=liq("smartin")%> <%=liq("smiguel")%> <%=liq("hurli")%> <%=liq("escobar")%> <%=liq("caseros")%> <%=liq("pilar")%> <%=liq("josecpaz")%>$<%=formatnumber(sumatoria,2)%>
GRAN TOTAL:  $<%=sumatoria_smartin%> $<%=sumatoria_smiguel%> $<%=sumatoria_hurli%> $<%=sumatoria_escobar%> $<%=sumatoria_caseros%> $<%=sumatoria_pilar%> $<%=sumatoria_josecpaz%> $<%=formatnumber(sumatoria_total,2)%>
<%Case "nuevo_mes"%> <%set nuevo = conecto.execute("SELECT id FROM profesionales ORDER BY id") with nuevo if not .eof and not .bof then .movefirst do while not .eof 'response.write "INSERT INTO liqmens (NProfesional, mes, anio, smartin, smiguel, hurli, escobar, caseros) VALUES (" & nuevo("id") & ", " & mes_nuevo & ", " & ano_nuevo & ", 0, 0, 0, 0, 0)" 'response.end set agregar_mes = conecto.execute("INSERT INTO liqmens (NProfesional, mes, anio, smartin, smiguel, hurli, escobar, caseros, pilar, josecpaz) VALUES (" & nuevo("id") & ", " & mes_nuevo & ", " & ano_nuevo & ", 0, 0,0, 0, 0, 0,0)") .movenext loop end if end with%> <%End Select%>