Guest User

Untitled

a guest
Jul 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. for ($i = 0; $i < 4; $i++) {
  2. <form id="TypeValidation" method="" enctype="multipart/form-data">
  3. <input type="hidden" id="pii_categoryid" name="pii_categoryid" value="<?php echo $i;?>" />
  4. <div>
  5. <span class="btn btn-rose btn-round btn-file">
  6. <span class="fileinput-new">Select File</span>
  7. <span class="fileinput-exists">Change</span>
  8. <input type="file" name="<?php echo $fileName;?>_attachment" id="<?php echo $fileName;?>_attachment" accept=".xlsx, .xls, .csv" />
  9. </span>
  10. <a href="#" class="btn btn-danger btn-round fileinput-exists" data-dismiss="fileinput"><i class="fa fa-times"></i> Remove</a>
  11. <button type="submit" name="add_file" id="add_file" value="<?php echo $fileName;?>_file" class="btn btn-success btn-round fileinput-exists">Upload</button>
  12. </div>
  13. </form>
  14. }
  15.  
  16. $("#TypeValidation").on('submit',(function(e)
  17. {
  18. var pii_categoryid = $(this).find('input[name="pii_categoryid"]').val();
  19. var fileUploadID = $(this).find('button[name="add_file"]').val();
  20. e.preventDefault();
  21. $.ajax({
  22. url: "fn_dsr_wizard_submit.php?submitid="+fileUploadID,
  23. type: "POST",
  24. data: new FormData(this),
  25. contentType: false,
  26. cache: false,
  27. processData:false,
  28. dataType: "html",
  29. success: function (result) {
  30. alert(result);
  31. //prompt("Copy to clipboard: Ctrl+C, Enter", result);
  32. location.reload();
  33. if(result=='1'){
  34. location.replace("ds_dashboard.php");
  35. }else {
  36. location.replace("ds_dashboard.php");
  37. }
  38. }
  39. });
  40. }
  41. ));
Add Comment
Please, Sign In to add comment