Admin > Adding Customer > Log Off
First Name
Last Name
Address
Address 2
City
State/Region
Zip/Postal Code
Country
Phone
Fax
Sign on information
Email
Password
Confirm Password
Miscellaneous Information
Notes
    
Removing a Customer is not reversible!
Turn ON/OFF Source Display (One Level deep include files are also shown)
<!-- #include file="../DatabaseInclude.asp" -->
This include file is NOT output to debug file.<%
on error resume next
eMsg = ""
CIfunction = Request.QueryString("Function")
Session("sFunction")=CIfunction
CustID = Request.QueryString("CustID")
eMsg = Request.QueryString("Msg")

if CIfunction = "ADD" then
  sql="SELECT max(CustID) from customers"
  set rs=dbc.Execute(sql)
  CustomID=rs(0)
  Set rsCustomers=Server.CreateObject ("ADODB.Recordset")
  rsCustomers.Open "customers", dbc, adOpenDynamic, adLockOptimistic, adCmdTable
  rsCustomers.addnew
  rsCustomers.Update
  rsCustomers.close
  set rsCustomers= nothing
  sql="SELECT max(CustID) from customers"
  set rs=dbc.Execute(sql)
  CustID=rs(0)
  Session("CustID")=CustID
  
end IF

If CustID = "" Then
  rsCustomers.close
  set rsCustomers= nothing
  dbc.close
  set dbc= nothing
  RESPONSE.REDIRECT "../error.asp?msg=" & Server.URLEncode ("Customer ID is blank.")
End If
    
Set rsCustomers = Server.CreateObject ("adodb.Recordset")
rsCustomers.Open "customers", dbc, adOpenForwardOnly, adLockReadOnly, adCmdTable
rsCustomers.Filter = "CustID = " & Clng(CustID)
Session("CustID")=CustID
%>


<form method="POST" action="CustomerWrite.asp?Function=<%=CIfunction%>&CustID=<%=CustID%>">
  
  <table class="TableSkins">
    <tr>
      <td class="TDHeader" colspan="2">
        <a href="Index.asp">Admin</a>
          <%if CIfunction = "ADD" then%>
            > Adding Customer
          <% else%>
            > Editing Customer
          <% end if %>
          >
          <a href="SessionClose.asp">Log Off</a>
      </td>
    </tr>
    <%if eMsg <> "" then%>
      <tr>
        <td class="TDSkins" colspan="2"><%=eMsg%>
        <img border="0" src="../images/MiniRedArrow.gif"> </font></td>
      </tr>
    <%end if%>
        <tr>
      <td class="TDSkins">First Name
      
      </td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cfirstname") %>" name="cfirstname" size="50" tabindex="1"></td>
    </tr>
    <tr>
      <td class="TDSkins">Last Name</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("clastname") %>" name="clastname" size="50" tabindex="2"></td>
    </tr>
    <tr>
      <td class="TDSkins">Address</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("caddress") %>" name="caddress" size="50" tabindex="3"></td>
    </tr>
    <tr>
      <td class="TDSkins">Address 2</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("caddress2") %>" name="caddress2" size="50" tabindex="4"></td>
    </tr>
    <tr>
      <td class="TDSkins">City</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("ctown") %>" name="ctown" size="47" tabindex="5">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">State/Region
      </td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cstate") %>" name="cstate" size="47" tabindex="6">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Zip/Postal Code
      </td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("czip") %>" name="czip" size="47" tabindex="7">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Country</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("ccountry") %>" name="ccountry" size="47" tabindex="8">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Phone</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cphone") %>" name="cphone" size="47" tabindex="9">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Fax</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cfax") %>" name="cfax" size="47" tabindex="10">
      </td>
    </tr>
    <tr>
      <td class="TDHeader" colspan="2">
      Sign on information
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Email</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cemail") %>" name="cemail" size="47" tabindex="14">
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Password</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cpass") %>" name="cpass" size="8" tabindex="12" maxlength="8">
      <%if eMsg <> "" then %>
      <img border="0" src="../images/MiniRedArrow.gif" width="12" height="12">
      <% end if %> </td>
    </tr>
    <tr>
      <td class="TDSkins">Confirm Password</td>
      <td class="TDSkins">
      <input class="InputSkins" type="text" value="<%= rsCustomers("cpass") %>" name="confirmpass" size="8" tabindex="13" maxlength="8">
      <%if eMsg <> "" then %>
      <img border="0" src="../images/MiniRedArrow.gif" width="12" height="12">
      <% end if %> </td>
    </tr>
    <tr>
      <td class="TDHeader" colspan="2">
        Miscellaneous Information
      </td>
    </tr>
    <tr>
      <td class="TDSkins">Notes</td>
      <td class="TDSkins">
      <textarea class="TextAreaSkins" rows="4" name="cnotes" cols="40" tabindex="15"><%=rsCustomers("cnotes")%></textarea></font>
      </td>
    </tr>
    
    <tr>
      <td class="TDHeader" colspan="2">
      
          <input class="InputSkins" type="submit" value="Apply" name="submit_changes" tabindex="16">    
        
        
          <input class="InputSkins" type="submit" value="Exit" name="submit_changes" tabindex="18"></td>
    </tr></form>
    
    </form>
    
    <tr><form method="POST" action="CustomerWrite.asp?Function=<%=CIfunction%>&CustID=<%=CustID%>">
      <td class="TDHeader" colspan="2">
        
          <font color="#FF0000">
          <input class="InputSkins" type="submit" value="Remove" name="submit_changes" style="font-family: Verdana; font-size: 8pt; color: #FF0000; font-weight: bold">
        
      Removing a Customer is not reversible!</td>
    
    </tr></form>
    
    
    
  </table>




<%
rsCustomers.close
  set rsCustomers= nothing
dbc.close
  set dbc= nothing
%>


</body>
</html><!-- #include file="../ReadFile.asp" -->
This include file is NOT output to debug file.