<%@ page import="com.fenalco.utilities.lists.ListView" %>
<%@ page import="com.fenalco.entities.User" %>
<%@ page import="com.fenalco.entities.DataAccess"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel='stylesheet' style='text/css' href='../css/tablas.css'>
<title>Par&aacute;metros de facturaci&oacute;n</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type='text/javascript' language='javascript' src='../js/library.js'></script>
<script>
function validateForm(formName){
          
            var flag = true;
            
            var message = "Han ocurrido los siguientes errores:\n";
             for(var i  = 0 ; i< formName.elements.length-1 && flag  ; i++){
                if(isEmpty(formName.elements[i])){
                    message = message + "- Uno de los parametros es vacio.\n";
                    flag = false;
                }
                else if(!isNumber(formName.elements[i])){
                    message = message + "-Los parametros deben ser de tipo numerico .\n";
                    flag = false;
                }
            }
            
            if(!flag){
                    window.alert(message);
            }
            
            return flag;
    }
	
</script>


<body bgcolor="#ffffff" background="../images/sysmanager/general/fondo.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- 
-->
<table border="0" cellpadding="0" cellspacing="0" width="780">
        <%
            String helpId = "12";
        %>
        <%@ include file="encabezado.jsp" %>
</table>

<table width="760">
	<tr>
		<td width="152" valign='top'>
			<%@ include file="menuadministrador.jsp" %>
		</td>
		<td valign='top'>
            <%
                String tittle = "Par&aacute;metros de Facturaci&oacute;n";
            %>
            <%@ include file="/titulo.jsp" %>

			<table width="603">
				<tr><td align="center"><%= request.getAttribute("message")%></td></tr>
				<tr><td></td></tr>
                                <tr>
				<form name="parameterList" method="post" action="/administrador/administrarparametrosfacturacion" onSubmit="return validateForm(document.parameterList);">
				<table align="center">
					<tr class="tableheader">
						<!-- Encabezado del listado -->
						<td align="center"><b>Nombre</b></td>
						<td align="center"><b>Valor</b></td>
						<td align="center"><b>Actualizar</b></td>
					</tr>
			<% 
					ListView view = (ListView)request.getAttribute("view");
					String data;
					while(view.move()){
						int i=0;
						String id="";
				%>
						<tr>
						<% while((data=(String)view.nextElement()) != null){
							if(i>0 && i!=2){
						%>
                                                            <td><%= data %></td>
						<%      }else if(i==0){ 
                                                            id=data;
                                                        }else if(i==2){
                                                 %>
                                                            <td><input type="text" name="<%= "value"+id%>" maxlength="30" size='20' value="<%=data%>"></td>
                                                 <% 
                                                        }
                                                        i++;
						   }
						%>
							<!-- Columnas para las opciones -->
							<td align="center"><a href="#"><input type='image'  src="/images/buttons/sysmanager/actualizar.gif" border="0" onclick="key.value='<%=id%>';"></a></td>
                                                        
                                                </tr>
					<% } %>
				</table>
				<input type='hidden' name='key'>
				</form>
			</tr>
			</table>
		</td>
	</tr>
	
</table>
<table width="760">
	<tr>
		<td><%@ include file="/piepagina.jsp" %></td>
	</tr>
</table>

</body>
</html>