<?php

function notify($msg="success",$x=1){  
$note_err =$x;
if($note_err==1){
($note_color ='green'); 
 ($note_msg =$msg); 
 ($note_type ='success'); 
  ($note_logo ='  <svg fill="none" viewBox="1 3 16 8" stroke="currentColor" class="x w-5 h-5">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.707 4.293a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 1.414-1.414L7 9.586l5.293-5.293a1 1 0 0 1 1.414 0Z"></path>
                                </svg>');
}elseif($note_err==2){

($note_color ='red'); 
 ($note_msg =$msg); 
 ($note_type ='error'); 
  ($note_logo =' <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="x w-5 h-5">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
                                </svg> ');
}else{

($note_color ='yellow'); 
 ($note_msg =$msg); 
 ($note_type ='Pending'); 
  ($note_logo = '
  
  <svg width="25" height="25" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="M14.9 13.4 8.5.6C8.1-.2 7-.2 6.6.6L.1 13.4c-.4.7.2 1.6 1 1.6h12.8c.8 0 1.3-.9 1-1.6zM7.5 13c-.8 0-1.5-.7-1.5-1.5S6.6 10 7.5 10s1.5.7 1.5 1.5c0 .9-.7 1.5-1.5 1.5zm1-4h-2L6 5.5c0-.3.2-.5.5-.5h2c.3 0 .5.2.5.5L8.5 9z"/></svg>

 ');

}								
?>
<div class="notify fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">
        <div x-data="{ show:  true  }" x-show="show" x-description="Notification panel, show/hide based on alert state." x-transition:enter="transform ease-out duration-300 transition" x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2" x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0" x-transition:leave="transition ease-in duration-100" x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0" class="max-w-sm w-full  bg-white  shadow-lg rounded-lg pointer-events-auto border-l-4     border-<?php echo trim($note_color); ?>-600 ">
            <div class="relative rounded-lg shadow-xs overflow-hidden">
                <div class="p-4">
                    <div class="flex items-start">
                          
						  <div class="inline-flex items-center bg-<?php echo trim($note_color); ?>-600 p-2 text-white text-sm rounded-full flex-shrink-0">
                              
								<?php 
									echo trim($note_logo);
								?>
                            </div>
                                                <div class="ml-4 w-0 flex-1">
                            <p class="text-base leading-5 font-medium capitalize     text-<?php echo trim($note_color); ?>-600 ">
                                <?php echo ucfirst($note_type); ?>
                            </p>
                            <p class="mt-1 text-sm leading-5  text-gray-500 ">
                                <?php echo ucwords($note_msg); ?>
                            </p>
                        </div>
                        <div class="ml-4 flex-shrink-0 flex">
                            <button @click="show = false;" class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 transition ease-in-out duration-150">
                                <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
                                   <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path>
                                </svg>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
	
	<?php  
	unset($_SESSION['notice_msg']);
	unset($_SESSION['notice_type']);
	}   
	if(isset($_SESSION['notice_msg'])){
		if(isset($_SESSION['notice_type'])){
		$note_msg = $_SESSION['notice_msg'];
		$note_type = $_SESSION['notice_type'];
			notify($note_msg,$note_type);
		}
	}
	 ?>