<div class="row">
  <div class="col-lg-12 mt-3">
    <p><a title="Main Module" href="/coupon/list"><i class="fa fa-chevron-circle-left "></i> &nbsp; Zurück zur Liste der Daten Gutscheine verwalten</a></p>

    <div class="card card-info mt-3">
      <div class="card-header  align-items-center d-flex">
        <h4 class="card-title mb-0 flex-grow-1">   <%=sectionTitle%></h4>
        <div class="flex-shrink-0"></div>
      </div>
      <div class="card-body">
        <div class="row g-3">
          <div class="table-responsive">
            <table id="table-detail" class="table table-striped">
              <tbody>
                <tr>
                  <td width="20%">Titel	</td>
                  <td><%= dataInfo.title ? dataInfo.title : 'N/A' %></td>
                </tr>
                <tr>
                  <td width="20%">Gutscheincode</td>
                  <td><%= dataInfo.coupon_code ? dataInfo.coupon_code : 'N/A' %></td>

                </tr>
                <tr>
                  <td width="20%">Coupontype</td>
                 <td> <% if (dataInfo.coupon_type === 1) { %>
                  Fest
                <% } else if (dataInfo.coupon_type === 2) { %>
                  Prozentsatz
                <% } else { %>
                  Unknown
                <% } %></td>
                </tr>
                <tr>
                  <td width="20%">Coupon-Rabatt	</td>       

                  <td >
                    <% if (dataInfo?.coupon_type === 1) { %>
                      € <%= dataInfo?.coupon_discount %> 
                    <% } else if (dataInfo?.coupon_type === 2) { %>
                      <%= Math.round(dataInfo?.coupon_discount) %> %
                    <% } %>
                  </td>
                  
                </tr>
            
                <tr>
                  <td>Gültig ab	</td>
                  <td>
                    <%= dataInfo.valid_from  ? dataInfo.valid_from : 'N/A' %>
                  </td>
                </tr>

                <tr>
                  <td>Gültig bis	</td>
                  <td>
                    <%= dataInfo.valid_to  ? dataInfo.valid_to : 'N/A' %>
                  </td>
                </tr>

                <tr>
                  <td width="20%">Datum	</td>
                  <td><%= new Date(dataInfo.created_at).toLocaleDateString('en-GB') %></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <!-- /.box-body -->
      </div>
    </div>
  </div>
  <!--END AUTO MARGIN-->
</div>
