$(document).ready(function(){
  $('.archiveData').hide();

  $('.archive').click(function(){
    event.preventDefault();
    $('.archiveData').slideToggle();	
  });
  
$("#plexmagazineformid").on("submit",function(e){
    e.preventDefault();
   //alert(1)
    $(".error").html("");
    $(".error").css("display", "none");
    
    var t = new FormData(this);
      $.ajax({
          type: "POST",
          data: t,
          url: CI_ROOT+"plexmagazine/createInvoice",
          dataType: "json",
          mimeType: "multipart/form-data",
          processData: false,
          contentType: false,
          success: function(result){
              alert(result);
            if(result.status == "success"){
                window.location.href = CI_ROOT + "plexmagazine/sendtopaymentgateway/"+result.data;
            }
          }
      });
  });
});

