
<div class="row hidden" id="alert-modal">
	<div class="col-lg-12" id="alert-modal-size">
		<div class="alert alert-secondary alert-dismissible show fade text-dark" role="alert" id="alert-modal-type">
			<button type="button" class="close" data-dismiss="alert" aria-label="Close">
				<span aria-hidden="true">&times;</span>
			</button>
			<div class="alert-body" id="alert-modal-body">
				
			</div>
		</div>
	</div>
</div>
<script>
function showAlertModal(type = 'danger', message = 'Halo!', timeOut = 5000, size = 'col-lg-12', redirect = '') {
	if (type == 'danger') {
		message = '<b><i class="fa fa-times-circle"></i> Gagal:</b> '+message;
	} else if (type == 'success') {
		message = '<b><i class="fa fa-check-circle"></i> Berhasil:</b> '+message;
	} else if (type == 'info') {
		message = '<b><i class="fa fa-info-circle"></i> Informasi:</b> '+message;
	} else if (type == 'primary') {
		message = '<b><i class="fa fa-info-circle"></i> Informasi:</b> '+message;
	}
    $('.modal').animate({ scrollTop: 0 }, 'slow');
	$('#alert-modal').removeClass('hidden'); 
	$('#alert-modal-body').html(message);
	document.getElementById('alert-modal-size').className = size;
	document.getElementById('alert-modal-type').className = 'text-white alert-dismissible show fade alert alert-'+ type +' bg-'+ type +' border-'+ type;
	setTimeout(() => {
		$('#alert-modal').addClass('hidden');
		if (redirect !== '') {
			window.location = redirect;
		}
	}, timeOut);
}
</script>
<?php /**PATH /home/glor5228/public_html/resources/views/admin/layouts/alert-modal.blade.php ENDPATH**/ ?>