• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

How Do I Add League members Username and Password

I will try to explain what I am looking forward to do.

I just build a page thata allow current members of the page, create their own League  ( Group of players, scores etc..)

So far I have the League Administartor done, so he can create his login an is inserted on League Page, this table is used to test user and password.

Now this admin has page that can add league members , and their username and password, now I dont know w=exactly do this, create a new Table use same one.

This is the add a new player page..

Thanks in advance.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../includes/common/KT_common.asp" -->
<!--#include file="../../includes/nxt/KT_back.asp" -->
<!--#include file="../../includes/tNG/tNG.inc.asp" -->
<%
P_League = request.QueryString("League")
'session ("P_LeagueID") =request.QueryString("LeagueID")
 
'Make a transaction dispatcher instance
Dim tNGs: Set tNGs = new tNG_dispatcher
tNGs.Init "../../"
%>
 
<%
' Start trigger
Dim formValidation: Set formValidation = new tNG_FormValidation
formValidation.Init
formValidation.addField "FirstName", true, "text", "", "", "", ""
formValidation.addField "UserName", true, "text", "", "", "", ""
formValidation.addField "Password", true, "text", "", "", "", ""
formValidation.addField "LastName", true, "text", "", "", "", ""
formValidation.addField "State", true, "text", "", "", "", ""
formValidation.addField "Email", true, "text", "email", "", "", ""
formValidation.addField "HomePhone", false, "text", "phone", "", "", ""
tNGs.prepareValidation formValidation
' End trigger
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
 
Repeat1__numRows = -1
Repeat1__index = 0
rsLeagueGolfers_numRows = rsLeagueGolfers_numRows + Repeat1__numRows
%>
<%
' Make an insert transaction instance 
Dim ins_LeagueGolfers: Set ins_LeagueGolfers = new tNG_multipleInsert
ins_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction ins_LeagueGolfers
' Register triggers
ins_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")
ins_LeagueGolfers.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
ins_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
ins_LeagueGolfers.setTable "LeagueGolfers"
ins_LeagueGolfers.addColumn "FirstName", "STRING_TYPE", "POST", "FirstName", ""
ins_LeagueGolfers.addColumn "UserName", "STRING_TYPE", "POST", "txtUsername", ""
ins_LeagueGolfers.addColumn "Password", "STRING_TYPE", "POST", "txtPassword", ""
ins_LeagueGolfers.addColumn "LastName", "STRING_TYPE", "POST", "LastName", ""
ins_LeagueGolfers.addColumn "LeagueID", "STRING_TYPE", "GET", "League", ""
ins_LeagueGolfers.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
ins_LeagueGolfers.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
ins_LeagueGolfers.addColumn "City", "STRING_TYPE", "POST", "txtCity", ""
ins_LeagueGolfers.addColumn "State", "STRING_TYPE", "POST", "State", ""
ins_LeagueGolfers.addColumn "ZipCode", "STRING_TYPE", "POST", "ZipCode", ""
ins_LeagueGolfers.addColumn "Email", "STRING_TYPE", "POST", "Email", ""
ins_LeagueGolfers.addColumn "HomePhone", "STRING_TYPE", "POST", "HomePhone", ""
ins_LeagueGolfers.addColumn "WorkPhone", "STRING_TYPE", "POST", "WorkPhone", ""
ins_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "", ""
%>
<%
' Make an update transaction instance
Dim upd_League: Set upd_League = new tNG_multipleUpdate
upd_League.init MM_sqlConn1_STRING
tNGs.addTransaction upd_League
' Register triggers
upd_League.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1")
upd_League.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
upd_League.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
upd_League.setTable "League"
upd_League.addColumn "LeagueName", "STRING_TYPE", "POST", "LeagueName"
upd_League.addColumn "SSN", "STRING_TYPE", "POST", "txtUsername"
upd_League.addColumn "Password", "STRING_TYPE", "POST", "txtPassword"
upd_League.addColumn "HostingClub", "STRING_TYPE", "POST", "HostingClub"
upd_League.addColumn "CourseId", "STRING_TYPE", "POST", "MemberCourseID"
upd_League.addColumn "PlayerName", "STRING_TYPE", "POST", "PlayerName"
upd_League.addColumn "LeagueAdmin", "NUMERIC_TYPE", "POST", "LeagueAdmin"
upd_League.addColumn "Email", "STRING_TYPE", "POST", "Email"
upd_League.setPrimaryKey "LeagueID", "STRING_TYPE", "GET", "League"
%>
<%
' Make a delete transaction instance
Dim del_LeagueGolfers: Set del_LeagueGolfers = new tNG_multipleDelete
del_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction del_LeagueGolfers
' Register triggers
del_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1")
del_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "../../includes/nxt/back.asp")
' Add columns
del_LeagueGolfers.setTable "LeagueGolfers"
del_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "GET", "LeagueID"
%>
<%
'Execute all the registered transactions
tNGs.executeTransactions
%><%
'Execute all the registered transactions
tNGs.executeTransactions
%><%
'Execute all the registered transactions
tNGs.executeTransactions
%>
<%
'Get the transaction recordset
Dim rsLeagueGolfers
Dim rsLeagueGolfers_numRows
 
Set rsLeagueGolfers = tNGs.getRecordset("LeagueGolfers")
rsLeagueGolfers_numRows = 0
%>
<%
'Get the transaction recordset
Dim rsLeague
Dim rsLeague_numRows
 
Set rsLeague = tNGs.getRecordset("League")
rsLeague_numRows = 0
%>
<%
Dim rsLeagueGolfers_total
rsLeagueGolfers_total = KT_getNumberOfRows(rsLeagueGolfers)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
<script src="../../includes/nxt/scripts/form.js" type="text/javascript"></script>
<script src="../../includes/nxt/scripts/form.js.asp" type="text/javascript"></script>
<script type="text/javascript">
$NXT_FORM_SETTINGS = {
  duplicate_buttons: false,
  show_as_grid: false,
  merge_down_value: false
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}
</script>
<link href="../Template/style.css" rel="stylesheet" type="text/css">
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
<style type="text/css">
<!--
.Estilo1 {font-size: 14px}
-->
</style>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<% Response.Write tNGs.displayValidationRules()%>
</head>
 
<body>
<p>&nbsp;</p>
<div onKeyPress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_CPH1_P_PatQuickAdd_btnAdd')" id="ctl00_CPH1_P_PatQuickAdd_pnlPatLookup">
  <%
	Response.Write tNGs.getErrorMsg()
%>
  <div class="KT_tng">
    <h1 class="Estilo1">Add a Golfer </h1>
    <table width="827" border="0" cellpadding="0" cellspacing="0" class="KT_tngtable">
      <tr>
        <td width="827"><span class="Estilo1">In this section you can add golfers into your league. This golfers are not members and have not access to entire functions.</span></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <div class="KT_tngform">
      <form method="post" id="form1" action="<%= KT_escapeAttribute(KT_getFullUri()) %>">
        <% cnt1 = 0 %>
        <% 
While ((Repeat1__numRows <> 0) AND (NOT rsLeagueGolfers.EOF)) 
%>
          <% cnt1 = cnt1 + 1 %>
          <% tNGs.SetCounter cnt1 %>
          <%
' Show IF Conditional region1 
  If rsLeagueGolfers_total > 1 Then
%>
            <h2><%=NXT_getResource("Record_FH")%> <%=cnt1%></h2>
            <%
  End If
' End Conditional region1
%>
          <table width="273" cellpadding="2" cellspacing="0" class="KT_tngtable">
            <tr>
              <td class="KT_th"><label for="FirstName_<%= cnt1 %>">First Name:</label></td>
              <td><input type="text" name="FirstName_<%= cnt1 %>" id="FirstName_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("FirstName").Value))%>" size="10" maxlength="20" />
                  <%=(tNGs.displayFieldHint("FirstName"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "FirstName"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="LastName_<%= cnt1 %>">Last Name:</label></td>
              <td><input type="text" name="LastName_<%= cnt1 %>" id="LastName_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("LastName").Value))%>" size="10" maxlength="20" />
                  <%=(tNGs.displayFieldHint("LastName"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "LastName"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Gender_<%= cnt1 %>">Gender:</label></td>
              <td><select name="Gender_<%= cnt1 %>" id="Gender_<%= cnt1 %>">
                  <option value="Male" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then If ("Male" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Male</option>
                  <option value="Female" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then If ("Female" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Gender").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Female</option>
                </select>
                  <%=(tNGs.displayFieldError("LeagueGolfers", "Gender"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Title_<%= cnt1 %>">Title:</label></td>
              <td><select name="Title_<%= cnt1 %>" id="Title_<%= cnt1 %>">
                  <option value="Dr." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Dr." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Mr.</option>
                  <option value="Mr." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Mr." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Dr.</option>
                  <option value="Mrs." <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Mrs." = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Mrs.</option>
                  <option value="Miss" <%If (Not isNull((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then If ("Miss" = CStr((KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Title").Value)))) Then Response.Write("SELECTED") : Response.Write("")%>>Miss</option>
                  <option value="" >Ms</option>
                </select>
                  <%=(tNGs.displayFieldError("LeagueGolfers", "Title"))%> </td>
            </tr>
            <%
' Show IF Conditional show_City_on_insert_only 
  If Request.QueryString("LeagueID") = "" Then
%>
              <tr>
                <td class="KT_th"><label for="City_<%= cnt1 %>">City:</label></td>
                <td><label>
                <input type="text" name="txtCity" id="txtCity" />
                </label>
                <%=(tNGs.displayFieldError("LeagueGolfers", "City"))%> </td>
              </tr>
              <%
  End If
' End Conditional show_City_on_insert_only
%>
            <tr>
              <td class="KT_th"><label for="State_<%= cnt1 %>">State:</label></td>
              <td><font face="Tahoma">
                <select name="State_<%= cnt1 %>" class="txtbox1" id="State_<%= cnt1 %>">
                    <option>Select State</option>
                  <option value="AL">Alabama</option>
                  <option value="AK">Alaska</option>
                  <option value="AZ">Arizona</option>
                  <option value="AR">Arkansas</option>
                  <option value="CA">California</option>
                  <option value="CO">Colorado</option>
                  <option value="CT">Connecticut</option>
                  <option value="DE">Delaware</option>
                  <option value="FL">Florida</option>
                  <option value="GA">Georgia</option>
                  <option value="HI">Hawaii</option>
                  <option value="ID">Idaho</option>
                  <option value="IL">Illinois</option>
                  <option value="IN">Indiana</option>
                  <option value="IA">Iowa</option>
                  <option value="KS">Kansas</option>
                  <option value="KY">Kentucky</option>
                  <option value="LA">Louisiana</option>
                  <option value="ME">Maine</option>
                  <option value="MD">Maryland</option>
                  <option value="MA">Massachusetts</option>
                  <option value="MI">Michigan</option>
                  <option value="MN">Minnesota</option>
                  <option value="MS">Mississippi</option>
                  <option value="MO">Missouri</option>
                  <option value="MT">Montana</option>
                  <option value="NE">Nebraska</option>
                  <option value="NV">Nevada</option>
                  <option value="NH">New Hampshire</option>
                  <option value="NJ">New Jersey</option>
                  <option value="NM">New Mexico</option>
                  <option value="NY">New York</option>
                  <option value="NF">Newfoundland</option>
                  <option value="NC">North Carolina</option>
                  <option value="ND">North Dakota</option>
                  <option value="OH">Ohio</option>
                  <option value="OK">Oklahoma</option>
                  <option value="OR">Oregon</option>
                  <option value="PA">Pennsylvania</option>
                  <option value="RI">Rhode Island</option>
                  <option value="SC">South Carolina</option>
                  <option value="SD">South Dakota</option>
                  <option value="TN">Tennessee</option>
                  <option value="TX">Texas</option>
                  <option value="UT">Utah</option>
                  <option value="VT">Vermont</option>
                  <option value="VA">Virginia</option>
                  <option value="WA">Washington</option>
                  <option value="DC">Washington, D.C.</option>
                  <option value="WV">West Virginia</option>
                  <option value="WI">Wisconsin</option>
                  <option value="WY">Wyoming</option>
                </select>
                  </font><%=(tNGs.displayFieldHint("State"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "State"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="ZipCode_<%= cnt1 %>">Zip Code:</label></td>
              <td><input type="text" name="ZipCode_<%= cnt1 %>" id="ZipCode_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("ZipCode").Value))%>" size="8" maxlength="5" />
                  <%=(tNGs.displayFieldHint("ZipCode"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "ZipCode"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="Email_<%= cnt1 %>">Email:</label></td>
              <td><input type="text" name="Email_<%= cnt1 %>" id="Email_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("Email").Value))%>" size="15" maxlength="25" />
                  <%=(tNGs.displayFieldHint("Email"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "Email"))%> </td>
            </tr>
            <tr>
              <td class="KT_th"><label for="HomePhone_<%= cnt1 %>">Home Phone:</label></td>
              <td><input type="text" name="HomePhone_<%= cnt1 %>" id="HomePhone_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("HomePhone").Value))%>" size="10" maxlength="15" />
                  <%=(tNGs.displayFieldHint("HomePhone"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "HomePhone"))%> </td>
            </tr>
            <tr>
              <td class="KT_th">Work Phone:</td>
              <td><input type="text" name="WorkPhone_<%= cnt1 %>" id="WorkPhone_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("WorkPhone").Value))%>" size="10" maxlength="15" />
                <%=(tNGs.displayFieldHint("WorkPhone"))%> <%=(tNGs.displayFieldError("LeagueGolfers", "WorkPhone"))%></td>
            </tr>
            <tr bgcolor="#339900">
              <td colspan="2" class="KT_th">Login Information</td>
            </tr>
            <tr>
              <td class="KT_th">Username:</td>
              <td><label>
                <input type="text" name="txtUsername" id="txtUsername" />
              </label></td>
            </tr>
            <tr>
              <td class="KT_th">Password:</td>
              <td><input type="password" name="txtPassword" id="txtPassword" /></td>
            </tr>
            <tr>
              <td class="KT_th"><label for="WorkPhone_<%= cnt1 %>">Confirm Password:</label></td>
              <td><label>
                <input type="password" name="txtpassconfirm" id="txtpassconfirm" />
              </label></td>
            </tr>
          </table>
          <input type="hidden" name="kt_pk_LeagueGolfers_<%=cnt1%>" class="id_field" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("kt_pk_LeagueGolfers").Value))%>" />
          <input type="hidden" name="LeagueID_<%= cnt1 %>" id="LeagueID_<%= cnt1 %>" value="<%=(KT_escapeAttribute(rsLeagueGolfers.Fields.Item("LeagueID").Value))%>" />
          <%
		  Repeat1__index=Repeat1__index+1
		  Repeat1__numRows=Repeat1__numRows-1
		  rsLeagueGolfers.MoveNext()
		Wend
		%>
        <div class="KT_bottombuttons">
          <div>
            <%
		' Show IF Conditional region1 
		  If Request.QueryString("LeagueID") = "" Then
		%>
              <input name="KT_Insert1" type="submit" id="KT_Insert1" onClick="YY_checkform('form1','txtPassword','txtpassconfirm','6','Confirmed Password does not Match');return document.MM_returnValue" value="<%=NXT_getResource("Insert_FB")%>" />
              <%
		' else Conditional region1
		  Else %>
              <input type="submit" name="KT_Update1" value="<%=NXT_getResource("Update_FB")%>" />
              <input type="submit" name="KT_Delete1" value="<%=NXT_getResource("Delete_FB")%>" onClick="return confirm('<%=NXT_getResource("Are you sure?")%>');" />
              <%
			  End If
			' End Conditional region1
			%>
            <input type="button" name="KT_Cancel1" value="<%=NXT_getResource("Cancel_FB")%>" onClick="return UNI_navigateCancel(event, '../../includes/nxt/back.asp')" />
          </div>
        </div>
      </form>
    </div>
    <br class="clearfixplain" />
  </div>
  <p>&nbsp;</p>
</div>
</body>
</html>

Open in new window

0
RickyGtz
Asked:
RickyGtz
  • 21
  • 12
  • 7
  • +1
2 Solutions
 
BrandonGalderisiCommented:
If your question is whether or not to create a new table to hold users, then I say no.  A league owner is a user as well but it just has different permissions.  You should have a table that defines the ROLE of a user within a league.  That way the same user can be a part of multiple leagues but have different roles within each league.
0
 
RickyGtzAuthor Commented:
Hmm , that sounds logic. Can you give a bettter Idea , be more specific.  This are my current table structures:

Table League
LeagueID      int      Unchecked
LeagueName      varchar(50)      Checked
SeasonDescription      varchar(50)      Checked
SeasonLenght      varchar(50)      Checked
LeagueMembers      varchar(50)      Checked
DateCreated      datetime      Checked
CourseID      int      Checked
HostingClub      varchar(50)      Checked
PlayerName      varchar(50)      Checked
LeagueAdmin      bit      Checked
Email      varchar(50)      Checked
PlayType      varchar(50)      Checked
Id      int      Checked
SSN      nvarchar(50)      Checked
Password      nvarchar(200)      Checked
Active_Usr      bit      Checked
Level_User      int      Checked
MatchType      varchar(50)      Checked
MaxMenHandicap      int      Checked
MaxWomenHandicap      int      Checked
UseGhost      bit      Checked
AutoStrokePoints      bit      Checked
TeamGhostedType      varchar(50)      Checked
LeagueSeason      varchar(50)      Checked
SeasonStart      varchar(50)      Checked
SeasonEnd      varchar(50)      Checked
GolferID      nchar(10)      Checked



Table League Golfers
 
GolferID	int	Unchecked
LeagueID	int	Checked
FirstName	varchar(50)	Checked
LastName	varchar(50)	Checked
Gender	varchar(50)	Checked
Title	varchar(50)	Checked
City	varchar(50)	Checked
State	varchar(50)	Checked
ZipCode	varchar(50)	Checked
Email	varchar(50)	Checked
HomePhone	varchar(50)	Checked
WorkPhone	varchar(50)	Checked
LeagueAdministrator	bit	Checked
UserName	varchar(50)	Checked
Password	varchar(50)	Checked
CurrentIndex	int	Checked
EventsPlayed	nchar(10)	Checked
TotalPoints	nchar(10)	Checked
AvgGross	nchar(10)	Checked
AvgNet	nchar(10)	Checked
BestGross	nchar(10)	Checked
BestNet	nchar(10)	Checked

Open in new window

0
 
RickyGtzAuthor Commented:
Oh just notice a bug
GolferID      nchar(10)      Checked

Changes now to
GolferID      INT      Checked
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
BadotzCommented:
Can you do this yourself, or are you asking someone here to do it for you?
0
 
RickyGtzAuthor Commented:
I would like to know if someone has done something similar to what I am trying to do. So I can have feedback on how do I do this.. Meabe an example.
0
 
BrandonGalderisiCommented:
That's a single table?????
0
 
RickyGtzAuthor Commented:
Two tables
Table League
Table LeagueGolfers
0
 
BrandonGalderisiCommented:
Ok.  I'll start with the LeagueGolfers table and point out some things that will help you.  There's a lot of things that are not ideal about your design.  But a lot of it would probably require changing a LOT of things to make it more normalized.
--Rename table to Golfer
GolferID	int	Unchecked
--removed: this will allow a golfer to be affiliated with more than one league.
--replaced with an intersection table mapping golfers to leagues
--LeagueID	int	Checked
FirstName	varchar(50)	Checked
LastName	varchar(50)	Checked
--reduce to 6
Gender	varchar(6)	Checked
Title	varchar(50)	Checked
City	varchar(50)	Checked
State	varchar(50)	Checked
ZipCode	varchar(50)	Checked
Email	varchar(50)	Checked
HomePhone	varchar(50)	Checked
WorkPhone	varchar(50)	Checked
--removed:  This is a property of the golfer in a league and should be stored in the intersection table.
--LeagueAdministrator	bit	Checked
UserName	varchar(50)	Checked
Password	varchar(50)	Checked
--What is currentindex?
CurrentIndex	int	Checked
--Change to INT/numeric data types
EventsPlayed	int	Checked
TotalPoints	int	Checked
AvgGross	numeric(6,3)	Checked
AvgNet	numeric(6,3)	Checked
BestGross	int	Checked
BestNet	int	Checked
 
 
--NEW Table
create table league_golfers
(league_golfers_id    int identity(1,1) not null primary key clustered
,league_id            int not null -- FK to leagues table
,golfer_id            int not null -- FK to golfers table
,LeagueAdministrator  bit not null -- defines whether the golfer is a league administrator in this league.
)

Open in new window

0
 
RickyGtzAuthor Commented:
Which tabela I rename?
League?
or League GOlfers?

I also just created another table called LeagueTeamGolfers
with

ID      int      Checked
TeamID      int      Checked
GolferID      varchar(50)      Checked
GolferName      varchar(50)      Checked
GolferLastName      varchar(50)      Checked
City      varchar(50)      Checked
State      varchar(50)      Checked
Handicap      varchar(50)      Checked
Admin      bit      Checked

What you think?
0
 
BrandonGalderisiCommented:
Why are you looking to store golfer id and names all over the place?
0
 
RickyGtzAuthor Commented:
Ok made changes as well on Golfers
0
 
RickyGtzAuthor Commented:
I erase those fields from LeagueTeams already
0
 
RickyGtzAuthor Commented:
Picture here
layout.jpg
0
 
BrandonGalderisiCommented:
So TeamGolfers should only have team_id, golfer_id and a surrogate key team_golfer_id.  You map one or more golfers to one or more teams.


"Which tabela I rename?"
The one right below that I modified.  LeagueGolfers
0
 
RickyGtzAuthor Commented:
yes that one I modified did you look screen shot.
0
 
RickyGtzAuthor Commented:
ok how about this,.
waht is missing or unnesary?
leaguediagram.jpg
0
 
BrandonGalderisiCommented:
To me....

Teams
Team_ID PK int identity PK
Team_Name nvarchar(50)
Num_Players smallint --POSSIBLY, but this can be inferred.

Team_Golfers
Team_Golfer_ID int identity PK
Team_Id int not null FK to Teams
Golfer_ID int not null FK to Golfers



The principal is that each table should contain an object or collection of objects (golfers, teams, leagues).  And if an object needs to be related to one or more object of another type, then an intersection table (mapping table) should exist between those two objects to define the relationship.
0
 
RickyGtzAuthor Commented:
Not Sure what you mean by instersection table, but , back to  original question. How do I add current League golfers username and password to let them log in on a league. Give them access, of course , not as admin. ?
0
 
BrandonGalderisiCommented:
In post http:#a23652215 the Team_Golfers table is an example of an intersection table.  The same is true for league_golfers in http:#a23651682 .
0
 
Wayne BarronCommented:
are you referring to:

In the Admin Section you have a <FORM> where you can add "UserName & Password"
For those that you want to allow access to the site?

Are these users Existing? Or are they New Members?

I am really a little confused as to what you are asking really.
If you can better explain what it is that you are wanting, it might be easier to help.

Carrzkiss
0
 
RickyGtzAuthor Commented:
Sure. Yes you are right, thats what I want to do. Add players, and give them an usernam and password to access a section on the website.

These players are not members so they only will be having access to this feature .

0
 
Wayne BarronCommented:
You will need to do an INSERT Statement for the Players.
And in the page(s) that are going to be accessed by these Players, you will do something like this:
(PlayerGroup = Made as example)

<% if <%=rs("PlayerGroup")="My Group" Then %>
Allow Access to the page
<% else %>
You do not have access to this page
<% end if %>

Something like that should do it.
0
 
RickyGtzAuthor Commented:
I am having problems in the INSERT statement. Since I am using different tables on database. Can you take a look on this table structures. And if is possible this be done as it is?
<%
' Make an insert transaction instance 
Dim ins_LeagueGolfers: Set ins_LeagueGolfers = new tNG_multipleInsert
ins_LeagueGolfers.init MM_sqlConn1_STRING
tNGs.addTransaction ins_LeagueGolfers
' Register triggers
ins_LeagueGolfers.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")
ins_LeagueGolfers.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)
ins_LeagueGolfers.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "loggedmain.asp")
' Add columns
ins_LeagueGolfers.setTable "LeagueGolfers"
ins_LeagueGolfers.addColumn "FirstName", "STRING_TYPE", "POST", "FirstName", ""
ins_LeagueGolfers.addColumn "UserName", "STRING_TYPE", "POST", "txtUsername", ""
ins_LeagueGolfers.addColumn "Password", "STRING_TYPE", "POST", "txtPassword", ""
ins_LeagueGolfers.addColumn "LastName", "STRING_TYPE", "POST", "LastName", ""
ins_LeagueGolfers.addColumn "LeagueID", "STRING_TYPE", "GET", "League", ""
ins_LeagueGolfers.addColumn "Gender", "STRING_TYPE", "POST", "Gender", ""
ins_LeagueGolfers.addColumn "Title", "STRING_TYPE", "POST", "Title", ""
ins_LeagueGolfers.addColumn "City", "STRING_TYPE", "POST", "txtCity", ""
ins_LeagueGolfers.addColumn "State", "STRING_TYPE", "POST", "State", ""
ins_LeagueGolfers.addColumn "ZipCode", "STRING_TYPE", "POST", "ZipCode", ""
ins_LeagueGolfers.addColumn "Email", "STRING_TYPE", "POST", "Email", ""
ins_LeagueGolfers.addColumn "HomePhone", "STRING_TYPE", "POST", "HomePhone", ""
ins_LeagueGolfers.addColumn "WorkPhone", "STRING_TYPE", "POST", "WorkPhone", ""
ins_LeagueGolfers.setPrimaryKey "LeagueID", "NUMERIC_TYPE", "", ""
%>

Open in new window

0
 
Wayne BarronCommented:
Is this the only table that you are wanting to INSERT into:  LeagueGolfers ?

You need to learn how to code on your own, and get away from DW's code.
As it really, really sucks and is not good programming.
It is actually pretty messy.

Get back with me on the if this is the only Table: LeagueGolfers
And I will demostrate how it SHOULD be done.
0
 
Wayne BarronCommented:
What is this for:         <input type="text" name="FirstName_<%= cnt1 %>" id="FirstName_<%= cnt1 %>">
all of these       _<%= cnt1 %>"

What are they used for?
They should not be to Number your fields, as this should not be a Dynamic Form.
0
 
RickyGtzAuthor Commented:
Yes , Let me change it to

name="FirstName
id="FirstName
0
 
RickyGtzAuthor Commented:
Please go here, http://www.playerscores.net/Leagues/addGolfer.asp?League=57

I have to simmilar question , and was mistake
but this one I need  how to use the login and password to , login extra users ( league members)

0
 
Wayne BarronCommented:
How do you know what Group to add these Players to?
In your Table, you do not have a GroupID?
You need to have a GroupID that relationships with a GroupTable.

Please give this information, so that I can make a decent demo.
And if possible.
If the demo is what you are needing. You may need to raise your points.

Please let me know about the Table Group... Or let me know how you plain on grouping these users.
0
 
RickyGtzAuthor Commented:
I want to group this Users by Team ,

LeagueTeams

LeagueTeamGolfers

currently I have this info : username and password stored at
LeagueGolfers Table

I know, this is too many tables, but dont really how to simplify this.  I increase the points and I will do it on the other simmilar question. If you can help me out
0
 
Wayne BarronCommented:
Well.
I am working on these one right now and it is just the LeagueGolfers table

--------
This will add the Special Users to the LeagueGolfers Table
http://www.pcitdad.com/Test/EE/Q_24146866/Get.asp

OK.
Are you going to be looking at the QueryString of:   ?League=57
And inserting the User into that LeagueID ?

Is the LeagueID that is in the LeagueGolfers Table, is that suppose to be the ID for the Group?
If so, then where is the ID for the LeagueGolfers? What is it's ID?
Once I know that, I will be able to complete this part of the project here.
0
 
RickyGtzAuthor Commented:
Thanks for your help so far.

>>Is the LeagueID that is in the LeagueGolfers Table, is that suppose to be the ID for the Group?>>
No, The Id should be  GolferID .

0
 
Wayne BarronCommented:
OK, I am lost here.
1 ID's tell me where they go?

GolferID
LeagueID

And what they are used for?
0
 
RickyGtzAuthor Commented:
GolferID is the ID for table LeagueGOlfers  , is used to identify , separate each golfer registered on any league..


LeagueID ,, this is the most important one, everytime someone creates a League an auto increment LeagueId is created.

I am actually using leagueID for all the request queries on the mini sections of this section of web site.
I might need also GolferID on some cases , i think

0
 
Wayne BarronCommented:
OK.

So: LeagueID is used for the QueryString?
That lets the User that you insert know what Group he/she is with.

No Problem.
Will add that, and send you over the "Easier Code" For "INSERT" Statements.

Trust me, you will enjoy this code a lot better.
I will also add in some information so that you will know what it does, and how it does it.

Give me about 5 minutes to add in the
GolferID, and implement the LeagueID into the scripts.
0
 
Wayne BarronCommented:
OK
Here we go

http://www.pcitdad.com/Test/EE/Q_24146866/Get.asp?LeagueID=57
Fill it out.
Once you do, you will be redirected to the Site that is Security set for just that Group of LeagueID-57

Get.asp  --> Form to fill out
Insert.asp --> Write information to the database.
Special.asp --> This is the page that the Users get to go to once they are Registered.
(This depends on the QueryString of LeagueID (You can change the LeagueID to League if you wish, just read the comments and you will know what to do. You have 3 places to change it at))

Have a good One.... Going to bed now.
Carrzkiss
0
 
Wayne BarronCommented:
Sorry, forgot to add in the URL to the Souce Code.....

http://www.pcitdad.com/Test/EE/Q_24146866/Get.asp?LeagueID=57
http://www.pcitdad.com/Test/EE/Q_24146866/Q_24146866.zip

Now, I am going to bed.
Catch you sometime tomorrow if you shall have any questions regarding the code.

Carrzkiss
0
 
RickyGtzAuthor Commented:
Ill give it a Try, you rock, Thanks!
0
 
Wayne BarronCommented:
how did it work out for you?
0
 
Wayne BarronCommented:
Ricky.
Did this work out for you?
Please let me know, if it is working for you, then lets finalize this one and move on to the next.

Carrzkiss
0
 
RickyGtzAuthor Commented:
Hi, I am still making changes based on the solution you provided. i will close soon, or i will ask you any  doubt, if I have any while finishing this .
0
 
RickyGtzAuthor Commented:
nice , thanks
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 21
  • 12
  • 7
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now