
<form action="<?php echo e(route('source_data.recocile')); ?>" method="post" class="mt-2" id="addSourceDataForm" novalidate="novalidate"  enctype="multipart/form-data">
    <?php echo e(csrf_field()); ?>

    <div class="row align-items-center justify-content-center">
        
        <div class="col-md-12">
            <div class="form-group">
                <label>ATM File</label>
                <input type="file" name="recon" class="w-100 p-1 border-primary" title="Select ATM File" data-rule-required="true" data-msg-required="ATM File is required" data-rule-extension="xls|xlsx" data-msg-extension="Only file with extension xls or xlsx allowed" data-rule-accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" data-msg-accept="Only Excel file allowed" data-rule-maxsize="15728640" data-msg-maxsize="File Size must not exceed 15 MB (15360 KB).">
            </div>
        </div>

        <div class="w-100"></div>

        <div class="col-auto">
            <div class="form-group text-right my-1">
                <button type="submit" name="upload" class="btn btn-dark">Upload</button>
            </div>
        </div>
    </div>
</form>


	
	<script type="text/javascript">
		$(document).ready(function() {
			$.validator.addMethod('maxsize', function(value, element, params) {
				if ($(element).attr('type') === 'file') {
					if (element.files && element.files.length) {
						console.log(element.files);
						for (var c = 0; c < element.files.length; c++) {
							if (element.files[c].size > params) {
								return false;
							}
						}
					}
				}

				return true;
			}, $.validator.format("File Size must not exceed {0} bytes."));

			$('#addSourceDataForm').validate({
				errorClass: 'danger',
				successClass: 'success',
				normalizer: function(value) {
					return $.trim(value);
				},
				errorPlacement: function(error, element) {
					error.addClass('w-100').appendTo(element.parent('.form-group'));
				},
				submitHandler: function(form) {
					$(form).find('button[type=submit]').attr('disabled', 'disabled');

					swal({
						title: 'Please Wait!',
						text: 'Your data will be converted shortly!',
						icon: 'info',
						buttons: false,
						closeOnClickOutside: false,
						closeOnEsc: false
					});

					form.submit();
				}
			});
            
        
		});
	</script>
<?php /**PATH C:\laragon\www\catalyst\resources\views/source_data/reconcile_data/add_atm_file_form.blade.php ENDPATH**/ ?>