<%@LANGUAGE="VBSCRIPT"%> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="ADMIN" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (false Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% ' *** Edit Operations: declare variables MM_editAction = CStr(Request("URL")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Request.QueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Update Record: set variables If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then MM_editConnection = MM_entradas_STRING MM_editTable = "NIVEL_ACCESO" MM_editColumn = "IDACCESS" MM_recordId = "" + Request.Form("MM_recordId") + "" MM_editRedirectUrl = "nivel.asp" MM_fieldsStr = "DESCR|value|COMENTARIO|value|EXTERNO|value|ACTIVO|value" MM_columnsStr = "DESCR|',none,''|COMENTARIO|',none,''|EXTERNO|none,1,0|ACTIVO|none,1,0" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(i+1) = CStr(Request.Form(MM_fields(i))) Next End If %> <% ' *** Delete Record: declare variables if (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then MM_editConnection = MM_entradas_STRING MM_editTable = "NIVEL_ACCESO" MM_editColumn = "IDACCESS" MM_recordId = "" + Request("MM_recordId") + "" MM_editRedirectUrl = "nivel.asp" End If %> <% ' *** Insert Record: set variables If (CStr(Request("MM_insert")) <> "") Then MM_editConnection = MM_entradas_STRING MM_editTable = "NIVEL_ACCESO" MM_editRedirectUrl = "" MM_fieldsStr = "DESCR|value|COMENTARIO|value|EXTERNO|value|ACTIVO|value" MM_columnsStr = "DESCR|',none,''|COMENTARIO|',none,''|EXTERNO|none,1,0|ACTIVO|none,1,0" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(i+1) = CStr(Request.Form(MM_fields(i))) Next End If %> <% ' *** Update Record: construct a sql update statement and execute it If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then ' create the sql update statement MM_editQuery = "update " & MM_editTable & " set " For i = LBound(MM_fields) To UBound(MM_fields) Step 2 FormVal = MM_fields(i+1) MM_typeArray = Split(MM_columns(i+1),",") Delim = MM_typeArray(0) If (Delim = "none") Then Delim = "" AltVal = MM_typeArray(1) If (AltVal = "none") Then AltVal = "" EmptyVal = MM_typeArray(2) If (EmptyVal = "none") Then EmptyVal = "" If (FormVal = "") Then FormVal = EmptyVal Else If (AltVal <> "") Then FormVal = AltVal ElseIf (Delim = "'") Then ' escape quotes FormVal = "'" & strreplace(FormVal,"'","''") & "'" Else FormVal = Delim + FormVal + Delim End If End If If (i <> LBound(MM_fields)) Then MM_editQuery = MM_editQuery & "," End If MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal Next MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the update Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% ' *** Delete Record: construct a sql delete statement and execute it If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then ' create the sql delete statement MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the delete Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% ' *** Insert Record: construct a sql insert statement and execute it If (CStr(Request("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For i = LBound(MM_fields) To UBound(MM_fields) Step 2 FormVal = MM_fields(i+1) MM_typeArray = Split(MM_columns(i+1),",") Delim = MM_typeArray(0) If (Delim = "none") Then Delim = "" AltVal = MM_typeArray(1) If (AltVal = "none") Then AltVal = "" EmptyVal = MM_typeArray(2) If (EmptyVal = "none") Then EmptyVal = "" If (FormVal = "") Then FormVal = EmptyVal Else If (AltVal <> "") Then FormVal = AltVal ElseIf (Delim = "'") Then ' escape quotes FormVal = "'" & strreplace(FormVal,"'","''") & "'" Else FormVal = Delim + FormVal + Delim End If End If If (i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End if MM_tableValues = MM_tableValues & MM_columns(i) MM_dbValues = MM_dbValues & FormVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% set nv = Server.CreateObject("ADODB.Recordset") nv.ActiveConnection = MM_entradas_STRING nv.Source = "SELECT * FROM NIVEL_ACCESO " nv.CursorType = 0 nv.CursorLocation = 2 nv.LockType = 3 nv.Open() nv_numRows = 0 %> <% Dim Repeat1__numRows Repeat1__numRows = -1 Dim Repeat1__index Repeat1__index = 0 nv_numRows = nv_numRows + Repeat1__numRows %> www.promad.com.mx
 
Creacion de Perfiles de Acceso al Sistema de pedidos
En esta ventana usted podrá crear perfiles para el acceso al Sistema de Libro de Entradas.

a)Para crear un nuevo perfil Escriba una Corta Descripción, un Comentario que detalle el tipo de acceso que representa este tipo de Usuario. Seleccione la casilla de Externo y Activo para Mostrar el Tipo de usuario que accesa y si el perfil esta Activo Actualmente. Una vez seleccionadas las opciones deseadas presione el botón de "Nuevo"

Para seleccionar los campos de la base de datos presione sobre el botón de "Campos->", en la siguiente ventana usted seleccionará las columnas que el perfil peude ver y que tipo de acceso tendra (Consulta o Edición)

b)Para Editar un Perfil Existente corriga en esta ventana las casillas que desea cambiar en el Renglon correspondiente y presione "Cambiar". Si desea editar los campos de acceso de un perfil existente presione sobre el Botón de "Campos ->"

c)Para Eliminar un Perfil de Accesion Presione sobre "x"

**Nuevos Registros: Permite al usuario agregar nuevos resgistros
 DESCR  COMENTARIO  EXTERNO Nuevos
Registros**

 

<% While ((Repeat1__numRows <> 0) AND (NOT nv.EOF)) %> "> "> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 nv.MoveNext() Wend %>
Descripción Comentario Externo Nuevos
Registros
 
" size="20" class="arialsmall" maxlength="50"> type="checkbox" name="EXTERNO" value="1"> type="checkbox" name="ACTIVO" value="1"> ');return document.MM_returnValue">
');return document.MM_returnValue">

 

 
 

  
 
 
<% nv.Close() %>