<%- include("./static/header") %>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

<div class="jumbotron">
  Your Subscription : <img src="https://discordapp.com/assets/9ba64f1fa91ccde0eba506c1c33f3d1a.svg" style="width:40px;height:20px;"></img>   <%= abonelik || "Not Found?" %>
  </div>
<% if(abonelik == "premium"){ %>
<!--<form action="/user/subscriptions/delete/" method="POST">
--> <button class="btn btn-danger" onclick="sil();" > <img src="https://discordapp.com/assets/9ba64f1fa91ccde0eba506c1c33f3d1a.svg" style="width:40px;height:20px;"></img>  Cancel</button>
  <!--</form>-->
<script>
function aha()
  /*
  Swal.fire(

  'Succesfully!',

  'Canceled Your Subscription!',

  'succes'

) */
  Swal.fire({
  position: 'top-end',
  icon: 'success',
  title: 'Canceled! ',
  showConfirmButton: false,
  timer: 1500
})
 } 
</script>

    <script>
    
      function sil(){
        swal({
  title: "Are you sure?",
  text: "Are you sure to delete your subscription?",
  icon: "warning",
  buttons: true,
  dangerMode: true,
})
.then((willDelete) => {
  if (willDelete) {
    swal("Subscription Successfully Deleted!  You are being redirected....", {
      icon: "success",
    });
    window.location.href = '/user/subscriptions/delete'
  } else {
    swal("Transaction Canceled");
  }
});
      };
      
    </script>
    
<% } %>
<% if(abonelik == "free"){ %>
<button class="btn btn-danger">Not Cancel in Free Subscriptions! </button>

<%}%>

<!--<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
-->
<br>
<br>
<br>
<%- include("./static/footer") %>

 