<!-- #include file ="inc\editinit.asp" -->
<% '
   '  StyleEntry
   '

   'Initialize Standard Information
   Index     = request("Index")           ' The last selected Index number
   RecId     = request("RecId")           ' If a record Id was passed
   RunReport = (request("RunReport")<>"") ' If run report was selected
   sTitle = "Style Entry"
%>

<% ' redirects must occur before any html output!
    If RunReport then
        Response.redirect ("StyleList.asp?RunReport=1&Index=" & Index & "&SessionID=" & SID)
    end if 
%>

<% response.write DocType %>
<html>

<head>
<% oSession.Call "msg_WriteHtmlHeadSection" %>
</head>
<body>

<div align=left>
<!-- #include file ="inc\umenutop.asp" -->

<!-- #include file ="inc\mmenuleft.asp" -->

<div class="PageContent">
<hr size="6">


<% CheckFieldChange=oStyleEntry.call("get_peFieldMultiUser") %>
<!-- #INCLUDE FILE="inc/SetChangedStates-script.inc" -->

<!-- #INCLUDE FILE="inc/ddValue_Constants.inc" -->

<% ' DebugMode =1 ' uncomment this for page get/post debug help %>
<!-- #INCLUDE FILE="inc/DebugHelp.inc" -->

<%
  oStyleEntry.call "set_pbReportErrors", 1 'normally show any errors that occur
  'We either find a record, or clear the WBO
  If RecId <> "" Then
      Err = oStyleEntry.RequestFindbyRecId( "Style", RecId)
  else 
      Err = oStyleEntry.RequestClear("Style",1)
  End if

  ' process various buttons that might have been pressed.
  ' only support Post submissions
  If request("Request_method")="POST" Then

      if Request("clear")<>"" then
          Err = oStyleEntry.RequestClear("Style",1)
      end if

      if Request("save")<>"" then
          oStyleEntry.call "set_pbReportErrors", 0
          err = oStyleEntry.RequestSave("Style")
          if err = 0 then
              Response.Write("<center> <h4>Style record saved</h4> </center>")
          else
              Response.Write("<font color=""red"">")
              Response.Write("<center> <h4>Could not save changes. Errors Occurred</h4> </center>")
              oStyleEntry.call "msg_ReportAllErrors"
              Response.Write("</font>")
          end if
      end if

      if Request("delete")<>"" then
          oStyleEntry.call "set_pbReportErrors", 0
          Err = oStyleEntry.RequestDelete("Style")
          if err = 0 then
             Response.Write("<center> <h4>The record has been deleted.</h4> </center>")
          else
             Response.Write("<font color=""red"">")
             Response.Write("<center> <h4>The record could not be deleted.</h4> </center>")
             oStyleEntry.call "msg_ReportAllErrors"
             Response.Write("</font>")
          end if
      end if

      ' note we use the Index variable we created above
      if Request("findprev") <>"" then  Err = oStyleEntry.RequestFind("Style", Index, LT)
      if Request("find")     <>"" then  Err = oStyleEntry.RequestFind("Style", Index, GE)
      if Request("findnext") <>"" then  Err = oStyleEntry.RequestFind("Style", Index, GT)
      if Request("findfirst")<>"" then  Err = oStyleEntry.RequestFind("Style", Index, FIRST_RECORD)
      if Request("findlast") <>"" then  Err = oStyleEntry.RequestFind("Style", Index, LAST_RECORD)

 end if

%>


<Form action="Style.asp" method="POST" name="Style" onsubmit="SetChangedStates(this)">

<% ' You MUST have a hidden recnum field for each DDO in your WBO %>
<input type="hidden" size="15" name="Style__Recnum" Value="<%=oStyleEntry.DDValue("Style.Recnum")%>" >
<input type="hidden" name="SessionID"  value="<%=SID%>">

<% ' This is needed if you need field level change state checking %>
<Input type="hidden" name="ChangedStates" value="">

<hr>
<p>
<input type="submit" name="save" value="Save">
<input type="submit" name="delete" value="Delete">
<input type="submit" name="clear" value="Clear">
<input type="reset"  value="Reset Form">
</p>
<p>
Find 
<input type="submit" name="findfirst" value="&lt;&lt;">
<input type="submit" name="findprev" value="&lt;">
<input type="submit" name="find" value="=">
<input type="submit" name="findnext" value="&gt;">
<input type="submit" name="findlast" value="&gt;&gt;">
 or 
<input type="submit" name="RunReport" value="List">
 by 
<% oStyleEntry.call "get_CreateFindIndexCombo", "Index", "Style", Index %>
</p>

<hr>

<blockquote>


<table border="0" Class="EntryTable">

  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Style_Id",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Style Id
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="20" title="" name="Style__Style_Id" value="<%=oStyleEntry.DDValue("Style.Style_Id") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Description",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Description
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="50" title="" name="Style__Description" value="<%=oStyleEntry.DDValue("Style.Description") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Type",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Type
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <% ' This is a VDF dynamic table created as a static combo in ASP 
         ' If you add values to the VDF table you need to add new options. %>
        <select name="Style__Type" size="1" >
          <option Value="101" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"101")%> >Images (Element)</option>
          <option Value="102" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"102")%> >HTML (Element)</option>
          <option Value="103" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"103")%> >Text (Element)</option>
          <option Value="201" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"201")%> >Menu</option>
          <option Value="301" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"301")%> >Menu Item</option>
          <option Value="401" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"401")%> >Content</option>
          <option Value="501" <%=oStyleEntry.DDValue("Style.Type",DDSEL,"501")%> >Page</option>
        </select>
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Pre_Html",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Pre Html
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="255" title="" name="Style__Pre_Html" value="<%=oStyleEntry.DDValue("Style.Pre_Html") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Post_Html",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Post Html
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="255" title="" name="Style__Post_Html" value="<%=oStyleEntry.DDValue("Style.Post_Html") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Classid",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Classid
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="40" title="" name="Style__Classid" value="<%=oStyleEntry.DDValue("Style.Classid") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Style",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Style
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="255" title="" name="Style__Style" value="<%=oStyleEntry.DDValue("Style.Style") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Revision",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Revision
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="4" title="" name="Style__Revision" value="<%=oStyleEntry.DDValue("Style.Revision") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Publish",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Publish
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="1" title="" name="Style__Publish" value="<%=oStyleEntry.DDValue("Style.Publish") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Created",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Created
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="12" title="" name="Style__Created" value="<%=oStyleEntry.DDValue("Style.Created") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Created_User",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Created User
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="12" title="" name="Style__Created_User" value="<%=oStyleEntry.DDValue("Style.Created_User") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>
  <tr>
      <%FieldError=oStyleEntry.DDValue("Style.Updated",DDFIELDERROR) %>
      <td Class="Label">
      <% If FieldError<>"" then response.write("<Font color=""red"">") %>
      Updated
      <% If FieldError<>"" then response.write("</Font>") %>
      </td>
      <td Class="Data">
      <input type="text" size="12" title="" name="Style__Updated" value="<%=oStyleEntry.DDValue("Style.Updated") %>" >
      </td>
      <% If FieldError<>"" then %>
      <td Class="Error"><%=FieldError%></td>
      <% end if %>
  </tr>

</table>

</blockquote>
</form>

<hr>

</div>

</div>
</body>
</html>
