1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

profiles approvement

Discussion in 'Web Design & Development' started by staso, Sep 30, 2008.

Thread Status:
Not open for further replies.
  1. staso

    staso Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    11
    hi, i have registration form and customers approving page on admin side, but i can not see any customers to approve, and the users approved automaticly...i know, that in past, the option have worked (the admin approving).how to switch on this option?(the email messages are not sent too,and the customers have to be wait,for approving, before they will appear on the site)
    this is the registration procced :
    <%

    Function randomMemberID(length)
    dim i, RandomNumber
    randomMemberID = ""
    for i = 1 to length
    Randomize
    if i = 1 then
    RandomNumber = Int(Rnd * 9) + 1
    else
    RandomNumber = Int(Rnd * 10)
    end if
    randomMemberID = randomMemberID & RandomNumber
    next
    End Function
    function GenerateMemberID()
    foundMemberID = false
    Set rsValidMemberID = Server.CreateObject("ADODB.Recordset")
    do while not foundMemberID
    tmpMemberID = randomMemberID(9)
    sSQL = "Select * from tbl_customers where customer_memberID = '" & tmpMemberID & "'"
    rsValidMemberID.open sSQL,objConn,adOpenStatic, adLockReadOnly, adCmdText
    if rsValidMemberID.EOF then
    foundMemberID = true
    end if
    rsValidMemberID.Close
    loop
    Set rsValidMemberID = nothing
    GenerateMemberID = tmpMemberID
    end function
    action = DBText(Trim(Request.Form("action")))
    customer_username = DBText(Trim(Request.Form("customer_username")))
    customer_password = DBText(Trim(Request.Form("customer_password")))
    customer_fname = DBText(Trim(Request.Form("customer_fname")))
    customer_email = DBText(Trim(Request.Form("customer_email")))
    customer_birthdate = cdate(Request.Form("customer_birthdate_day") & "/" & Request.Form("customer_birthdate_month") & "/" & Request.Form("customer_birthdate_year"))
    customer_gender = Trim(Request.Form("customer_gender"))
    customer_nickname = Trim(Request.Form("customer_nickname"))
    customer_area = Trim(Request.Form("customer_area"))
    customer_preferences = DBText(Trim(Request.Form("customer_preferences")))
    customer_country = DBText(Trim(Request.Form("customer_country")))

    customer_username_legit = True
    customer_email_legit = True
    call open_connection

    'Check Username and email - in case the action is "register"
    if action = "register" then
    CustomerID = 0
    Set rsValidateUsername = Server.CreateObject("ADODB.Recordset")
    sSQL = "Select * from tbl_customers where customer_username ='" & customer_username & "'"
    rsValidateUsername.open sSQL,objConn,adOpenStatic, adLockReadOnly, adCmdText
    if not rsValidateUsername.eof then
    customer_username_legit = False
    end if
    rsValidateUsername.close
    Set rsValidateUsername = Nothing
    else
    CustomerID = Request.Form("CustomerID")
    end if
    if action = "register" or old_customer_email <> customer_email and customer_username_legit then
    sSQL = " Select * from tbl_customers where customer_email ='" & customer_email & "' " &_
    " and CustomerID <> " & CustomerID
    Set rsValidateEmail = Server.CreateObject("ADODB.Recordset")
    rsValidateEmail.Open sSQL,objConn,adOpenStatic, adLockReadOnly, adCmdText
    if not rsValidateEmail.eof then
    customer_email_legit = False
    else
    customer_email_legit = True
    end if
    rsValidateEmail.Close
    Set rsValidateEmail = Nothing
    end if
    if customer_username_legit = false then
    call close_connection
    Response.Write "<script>alert('this username already taken,please choose another');window.history.go(-1);</script>"
    Response.End
    elseif customer_email_legit = false then
    call close_connection
    Response.Write "<script>alert('this e-mail already exist,please choose another');window.history.go(-1);</script>"
    Response.End
    end if

    sSQL = "Select * from tbl_customers where customerID = " & CustomerID
    Set rsCustomer = Server.CreateObject("ADODB.Recordset")
    rsCustomer.CursorLocation = adUseClient
    Set rsCustomer = Server.CreateObject("ADODB.Recordset")
    rsCustomer.open sSQL,objConn, adOpenDynamic, adLockPessimistic, adCmdText
    if action = "register" and rsCustomer.EOF then
    rsCustomer.AddNew
    rsCustomer("customer_username") = customer_username
    rsCustomer("customer_memberID") = GenerateMemberID()
    rsCustomer("customer_password") = customer_password
    end if
    if not rsCustomer.EOF then ' just to make sure there wasnt any problem
    rsCustomer("customer_area") = customer_area
    rsCustomer("customer_nickname") = customer_nickname
    rsCustomer("customer_email") = customer_email
    rsCustomer("customer_gender") = customer_gender
    rsCustomer("customer_birthdate") = customer_birthdate
    rsCustomer("customer_preferences") = customer_preferences
    rsCustomer("customer_fname") = customer_fname
    ' rsCustomer("customer_country") = customer_country

    end if
    rsCustomer.Update
    if action = "register" then
    sSQL = "Select top 1 * from tbl_customers order by CustomerID desc"
    Set rsGetCustomerID = Server.CreateObject("ADODB.Recordset")
    rsGetCustomerID.open sSQL,objConn, adOpenDynamic, adLockPessimistic, adCmdText
    CustomerID = rsGetCustomerID("CustomerID")
    Customer_memberID = rsGetCustomerID("Customer_memberID")
    rsGetCustomerID.Close
    Set rsGetCustomerID = Nothing
    else
    CustomerID = rsCustomer("CustomerID")
    Customer_memberID = rsCustomer("customer_memberID")
    end if
    rsCustomer.Close
    Set rsCustomer = Nothing

    redirectTo = Request.Form("register_continue")
    if redirectTo = "" then redirectTo ="myprofile2.asp"



    if customer_username_legit = true and action = "register" then

    '================= Send Message To Customer Inbox ======================

    message_content = message_content & "Welcome to" & SITE_NAME
    message_content = message_content & "<BR><BR>Be fruitful and multiply ! " & SITE_NAME & " <BR><BR>"
    message_content = message_content & "<BR>" & SITE_TEAM_NAME & "<BR><BR>"
    message_content = message_content & "<a href=""" & SITE_URL & """>www." & SITE_NAME & "</a>"
    sSQL = " insert into tbl_messages(message_type,message_subject,message_ content,message_from,message_to) " &_
    " values('sys',N'welcome','" & message_content & "',0, " & CustomerID & ")"
    objConn.execute sSQL
    '================================================= ===========


    body = "<html>" &_
    "<head>" &_
    "<meta http-equiv=""Content-Language"" content=""en"">" &_
    "</head>"&_
    "<body bgcolor=GhostWhite>" &_
    "<style>" &_
    "table,a,td{font-size:14px;font-color:white;font-family:arial};" & vbNewLine &_
    "fieldset{font-size:14px;}" & vbNewLine &_
    ".mailHead1{font-size:26;color:black;font-weight:bold} " & vbNewLine &_
    "</style>" & vbNewLine &_
    "<table cellpadding='0' cellspacing='1' bgcolor=gray align='center' width='600' height='100%'><tr><td bgcolor=whitesmoke>" & vbNewLine &_
    "<table cellpadding='0' cellspacing='0' align='center' width='600' height='100%'>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td height='64' align='center' class='mailHead1' bgcolor='white'><img align='absbottom' src='http://www.pruurvu.com/img/logo.jpg'></td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td background='http://www.pruurvu.com/img/back_mustard.jpg' valign='top'>" & vbNewLine &_
    " <BR>" & vbNewLine &_
    " <table cellpadding='0' cellspacing='0' align='center' width='95%'>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td align=right dir=rtl>" & vbNewLine &_
    bodyText &_
    " </td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    " </table><BR><BR>" & vbNewLine &_
    " </td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    "</table>" & vbNewLine &_
    "</td></tr></table><BR><BR>"& vbNewLine &_
    "</body></html>"


    '============== tmp =============
    emailAns = true
    '================================



    '================== Create the folders =====================
    Set objFso = Server.CreateObject("Scripting.FileSystemObject")
    if not objFso.FolderExists(Server.mappath(CUSTOMERS_CONTE NTS_FOLDER) & "/" & customer_memberID) then
    objFso.CreateFolder(Server.mappath(CUSTOMERS_CONTE NTS_FOLDER) & "/" & customer_memberID )
    objFso.CreateFolder(Server.mappath(CUSTOMERS_CONTE NTS_FOLDER) & "/" & customer_memberID & "/pictures")
    end if
    Set objFso = nothing
    '================================================= ==========

    'call SendMail(MailwFromName,MailwFromAddress,customer_f name,customer_email,"Thank you for registering",body)


    if SITE_VIPLUS_ENABLED then


    '============ Viplus add ==============
    viplus_str_conn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../../db/" & SITE_VIPLUS_DB_NAME)
    Set viplus_conn = Server.CreateObject("ADODB.Connection")
    viplus_conn.open viplus_str_conn

    if true or email_subscriber = 1 then
    sSQL = "Select * from tbl_contacts where contact_email='" & contact_email & "'"
    Set rsCheckEmail = Server.CreateObject("ADODB.Recordset")
    rsCheckEmail.open sSQL,viplus_conn,adOpenStatic, adLockReadOnly, adCmdText
    'if rsCheckEmail.eof then


    sSQL = "select * from tbl_contacts_groups where groupID = (Select max(groupID)from tbl_contacts_groups where group_name LIKE '%" & SITE_NAME & "%')"

    set rsCheckGroups = Server.CreateObject("ADODB.Recordset")
    rsCheckGroups.open sSQL,viplus_conn,adOpenStatic, adLockReadOnly, adCmdText
    if not rsCheckGroups.eof then

    sSQL = "Select count(*) as recCounter from tbl_contacts where contact_groups = '0,"&rsCheckGroups("groupID")&"'"
    set rsCountUsers = Server.CreateObject("ADODB.Recordset")
    rsCountUsers.open sSQL,viplus_conn,adOpenStatic, adLockReadOnly, adCmdText
    if rsCountUsers("recCounter") >= 1000 then
    sSQL = "insert into tbl_contacts_groups(group_name) values('" & SITE_NAME & "_" & day(now) & "_" & month(now) & "_" & year(now) & "_" & "');"
    viplus_conn.execute sSQL

    sSQL = "select * from tbl_contacts_groups where groupID = (Select max(groupID)from tbl_contacts_groups where group_name LIKE '%" & SITE_NAME & "%')"
    set rsCheckGroups2 = Server.CreateObject("ADODB.Recordset")
    rsCheckGroups2.open sSQL,viplus_conn,adOpenStatic, adLockReadOnly, adCmdText
    groupID = rsCheckGroups2("groupID")
    rsCheckGroups2.close
    set rsCheckGroups2 = nothing

    else
    groupID= rsCheckGroups("groupID")
    end if
    rsCountUsers.close
    Set rsCountUsers = Nothing
    else
    sSQL = "insert into tbl_contacts_groups(group_name) values('" & SITE_NAME & "_" & day(now) & "_" & month(now) & "_" & year(now) & "');"
    viplus_conn.execute sSQL

    sSQL = "select * from tbl_contacts_groups where groupID = (Select max(groupID)from tbl_contacts_groups where group_name LIKE '%" & SITE_NAME & "%')"
    set rsCheckGroups2 = Server.CreateObject("ADODB.Recordset")
    rsCheckGroups2.open sSQL,viplus_conn,adOpenStatic, adLockReadOnly, adCmdText
    groupID = rsCheckGroups2("groupID")
    rsCheckGroups2.close
    set rsCheckGroups2 = nothing
    end if
    rsCheckGroups.close
    set rsCheckGroups = nothing

    contact_groups = "0,"&groupID


    sSQL = " insert into tbl_contacts "&_
    " (contact_username,contact_password,contact_f_name, contact_l_name," &_
    " contact_email, contact_phone, contact_address, contact_city, contact_groups, contact_receive_mail)"&_
    " values " &_
    " ('" & contact_username & "','" & customer_password & "','" & customer_nickname & "',''," &_
    " '" & customer_email & "', '" & customer_phone & "', '" & customer_address & "', '" & customer_city & "','" & contact_groups & "','y')"
    viplus_conn.execute sSQL
    'end if
    rsCheckEmail.close
    Set rsCheckEmail = nothing
    else
    sSQL = "delete from tbl_contacts where contact_email='" & contact_email & "'"
    viplus_conn.execute sSQL
    end if
    viplus_conn.close
    Set viplus_conn = nothing
    '================================================= ======
    end if




    end if
    call commitLogin(1,CustomerID,,,false)
    call close_connection
    '======== customer's first entry ========
    session("new_registered_customer") = true
    if action = "register" then
    Response.Redirect "myprofile2.asp?action=register"
    else
    Session("profileUpdateReport") = "your details have update (<span dir=ltr>" & FormatDateTime(now,vbShortDate) & " " & FormatDateTime(now,vbShortTime) & "</span>)"
    Response.Redirect "myprofile1.asp"
    end if
    %>
    and this is the admin side , that not working :

    <%
    call open_connection
    if Request.Form("action") = "delete" then
    'Foldertodelete = Server.mappath(CUSTOMERS_CONTENTS_FOLDER &Request.Form("customer_username") &"/pictures")

    'Set objFSO = server.CreateObject("Scripting.FileSystemObject")
    'if objFSO.FolderExists(Foldertodelete) then
    ' objFSO.deletefile(Foldertodelete & "/*.*")
    'objFSO.DeleteFolder Foldertodelete 'need to see why cant delete
    sSQL = "Update tbl_customers set customer_deleted = 1 where customerID= " & Request.Form("customerID")
    objConn.execute sSQL
    'end if
    'Set objFSO = nothing

    elseif Request.Form("action") = "approve" then
    sSQL = " Update tbl_customers set customer_confirmed = 1 " &_
    " where customerID= " & Request.Form("customerID")
    objConn.execute sSQL
    end if

    sSQL = " Select * from tbl_customers where customer_deleted = 0 and customer_confirmed = 0 "
    set rsCustomer = server.createobject("adodb.recordset")
    rsCustomer.open sSQL,objConn,adOpenStatic, adLockReadOnly, adCmdText
    if not rsCustomer.eof then
    rsCustomer.PageSize = 50
    iPageCount = rsCustomer.PageCount
    iRecordsShown = 0
    rsCustomer.AbsolutePage = 1
    ipagecount = rsCustomer.pagecount
    NumOfRecords=rsCustomer.RecordCount
    '</a>
    '&nbsp;<img src="../img/asc.gif" border="0">
    %>
    <table border=0 cellspacing=1 align="center" dir="rtl" width=750>
    <tr bgcolor="white">
    <td align="center"><B>?????</B></td>
    <td align="center"><B>?? ????</B></td>
    <td align="center"><B>???"?</B></td>
    <td align="center"><B>???? ??????</B></td>
    <td align="center"><B>???</B></td>
    <td align="center"><B>???</B></td>
    <td align="center"><B>??????</B></td>
    <td align="center"><B>?????</B></td>
    <!--<td align="center" width="50">??? ??????</td>-->
    <td align="center" width="50"><B>??º ??????</B></td>
    </tr>
    <%
    recordCount = 0
    do while not rsCustomer.eof and recordCount<50
    recordCount = recordCount + 1
    if recordCount mod 2 = 0 then RowCol = "whitesmoke" else RowCol = "ivory"
    %>
    <form method="post" name="customerUpdate<%=rsCustomer("customerID")%>" >
    <input type="hidden" name="action">
    <input type="hidden" name="customerID" value="<%=rsCustomer("customerID")%>">
    <input type="hidden" name="customer_username" value="<%=rsCustomer("customer_username")%>">

    <tr bgcolor="<%=RowCol%>" height="25">
    <td align="center" valign="middle">
    <%= rsCustomer("customer_nickname") %>
    </td>
    <td align="center" valign="middle">
    <%= rsCustomer("customer_fname") %>
    </td>
    <td align="center" valign="middle">
    <a href="mailto:<%= rsCustomer("customer_email") %>"><%= rsCustomer("customer_email") %></a>
    </td>
    <td align="center" valign="middle" dir="ltr">
    <%= rsCustomer("customer_memberID") %>
    </td>
    <td align="center" valign="middle">
    <%= replace(replace(rsCustomer("customer_gender"),"m","?"),"f","?") %>
    </td>
    <td align="center" valign="middle">
    <%= datediff("yyyy",rsCustomer("customer_birthdate"),now) %>
    </td>
    <td align="center" valign="middle" dir=ltr>
    <a href="customers_profile.asp?action=update&id=<%=rsCustomer("customerID") %>">??????</a>
    </td>
    <td align="center" valign="middle">
    <a href="javascript:viewProfile(<%= rsCustomer("customerID") %>)">?????</a>
    </td>
    <!--
    <td class="topmenu" nowrap align="center">
    <a href="javascript:approveCustomer(document.customerUpdate <%=rsCustomer("customerID")%>,'<%=rsCustomer("customer_username")%>')"><font color=green><b>???</b></font></a>
    </td>
    -->
    <td class="topmenu" nowrap align="center">
    <a href="javascript:deleteCustomer(document.customerUpdate<%=rsCustomer("customerID")%>,'<%=rsCustomer("customer_username")%>')"><font color=red><b>??º</b></font></a>
    </td>
    </tr>
    </form>
    <%
    rsCustomer.MoveNext
    loop

    rsCustomer.close
    set rsCustomer = nothing
    %>
    </table>
    <script>
    function deleteCustomer(inForm,username){
    if(confirm('? ??? ??? ???? ?????? ????º ?? ????? ???? ' + username)){
    inForm.action.value = 'delete';
    inForm.submit();
    }
    }
    function approveCustomer(inForm,username){
    if(confirm('? ??? ??? ???? ?????? ???? ?????? ???? ' + username)){
    inForm.action.value = 'approve';
    inForm.submit();
    }
    }
    </script>
    <%else%>
    <BR><BR>
    <div align="center" ><B>?? ????? ????????</B></div>
    <%end if%>
    <%call close_connection%>
    --------------------------------------------------------------------------------
     
  2. chiliwormeater45

    chiliwormeater45

    Joined:
    Jul 2, 2007
    Messages:
    454
    This might be in the wrong forum though. I don't have any idea about this. I don't know Visual Basic so I have no idea what your code is doing.

    Anyways use code tags, to make it easier to read. :)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/754749

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice