<%- include('partials/adminCenterHead') %>
<%- include('partials/background') %>





<div class="row">
  <div class="col-md-6">
    <div class="card1">
    <h1>Order History:</h1>
  </div>
    <div class="card">
    <%= console.log(profileData) %>
    
    <% for (var i=0; i< profileData.length; i++ ) { %>
      <form method="POST">  
        <p> <b><%= profileData[i].CustomerName %>, <%= profileData[i].CustomerPhone %>, <%= profileData[i].CustomerCake %>,  <%= profileData[i].CustomerCustomize %></b></p>
        <input type="hidden" id="devId" name="devId" value="<%= profileData[i]._id %>"></input>
        <input type="text" id="custName" name="custName" value="<%= profileData[i].CustomerName %>, "></input>
        <input type="text" id="phone" name="phone" value="<%= profileData[i].CustomerPhone %>, "></input>
        <input type="text" id="optradio" name="optradio" value="<%= profileData[i].CustomerCake %>, "></input>
        <input type="text" id="customize" name="customize" value="<%= profileData[i].CustomerCustomize %>, "></input>

        <button class="btn btn-info" type="submit" formaction="/updateProfile">Update Order</button>
        <button class="btn btn-success" type="submit" formaction="/deleteProfile">Completed Order</button>
      
      </form>
      <br/>
      <% } %> 
  </div>
</div>


  <div class="col-md-4">
  <div class="card">
  <h2 style="color: olive"> Add a new customer:</h2>

    

        <form method="post" action="/addOrder">
        <div class="card">
          <h4 class="card-title">Pound Cake</h4>
          <div class="card-body">
            <p class="card-text">Cake Sizes:</p>
            <div class="form-check">
              <input type="radio" class="form-check-input" id="radio1" name="optradio" value="CakeSizeMedium" >Medium
              <label class="form-check-label" for="radio1"></label>
            </div>

            <div class="form-check">
              <input type="radio" class="form-check-input" id="radio1" name="optradio" value="CakeSizeLarge" >Large
              <label class="form-check-label" for="radio1"></label>
            </div>
            <div class="mb-3 mt-3">
              <label for="custName" class="form-label">Name:</label>
              <input type="textbox1" class="form-control" id="custName" placeholder="" name="custName">
            </div>
            <div class="mb-3">
              <label for="phone" class="form-label">Phone:</label>
              <input type="textbox" class="form-control" id="phone" placeholder="" name="phone">
            </div>
            <label for="textbox" > Explain how you would like your cake customized:</label> <br>
            <aside><textarea id="textarea" placeholder= "Place text here" name="customize" rows="4" cols="30"></textarea></aside>
            <button id="formSubmit" type="submit" class="btn btn-primary">Submit Request</button>
          </div>
        </div>

    </form>
  </div>
  </div>
</div>

<%- include('partials/footer') %>

</body>
</html>