<?php
    $fname = $row['fname'];
    $loginTime = date('Y-m-d H:i:s'); // Current date and time of login
    $ipAddress = $_SERVER['REMOTE_ADDR']; // User's IP address

    $message = "
				<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  <title>[SUBJECT]</title>
  <style type='text/css'>
  body {
   padding-top: 0 !important;
   padding-bottom: 0 !important;
   padding-top: 0 !important;
   padding-bottom: 0 !important;
   margin:0 !important;
   width: 100% !important;
   -webkit-text-size-adjust: 100% !important;
   -ms-text-size-adjust: 100% !important;
   -webkit-font-smoothing: antialiased !important;
 }
 .tableContent img {
   border: 0 !important;
   display: block !important;
   outline: none !important;
 }
 a{
  color:#382F2E;
}

p, h1{
  color:#382F2E;
  margin:0;
}

div,p,ul,h1{
  margin:0;
}
p{
font-size:13px;
color:#99A1A6;
line-height:19px;
}
h2,h1{
color:#444444;
font-weight:normal;
font-size: 22px;
margin:0;
}
a.link2{
padding:15px;
font-size:13px;
text-decoration:none;
background:#2D94DF;
color:#ffffff;
border-radius:6px;
-moz-border-radius:6px;
-webkit-border-radius:6px;
}
.bgBody{
background: #f6f6f6;
}
.bgItem{
background: #2C94E0;
}

@media only screen and (max-width:480px)
		
{
		
table[class='MainContainer'], td[class='cell'] 
	{
		width: 100% !important;
		height:auto !important; 
	}
td[class='specbundle'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		
	}
	td[class='specbundle1'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:20px !important;
		
	}	
td[class='specbundle2'] 
	{
		width:90% !important;
		float:left !important;
		font-size:14px !important;
		line-height:18px !important;
		display:block !important;
		padding-left:5% !important;
		padding-right:5% !important;
	}
	td[class='specbundle3'] 
	{
		width:90% !important;
		float:left !important;
		font-size:14px !important;
		line-height:18px !important;
		display:block !important;
		padding-left:5% !important;
		padding-right:5% !important;
		padding-bottom:20px !important;
	}
	td[class='specbundle4'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:20px !important;
		text-align:center !important;
		
	}
		
td[class='spechide'] 
	{
		display:none !important;
	}
	    img[class='banner'] 
	{
	          width: 100% !important;
	          height: auto !important;
	}
		td[class='left_pad'] 
	{
			padding-left:15px !important;
			padding-right:15px !important;
	}
		 
}
	
@media only screen and (max-width:540px) 

{
		
table[class='MainContainer'], td[class='cell'] 
	{
		width: 100% !important;
		height:auto !important; 
	}
td[class='specbundle'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		
	}
	td[class='specbundle1'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:20px !important;
		
	}		
td[class='specbundle2'] 
	{
		width:90% !important;
		float:left !important;
		font-size:14px !important;
		line-height:18px !important;
		display:block !important;
		padding-left:5% !important;
		padding-right:5% !important;
	}
	td[class='specbundle3'] 
	{
		width:90% !important;
		float:left !important;
		font-size:14px !important;
		line-height:18px !important;
		display:block !important;
		padding-left:5% !important;
		padding-right:5% !important;
		padding-bottom:20px !important;
	}
	td[class='specbundle4'] 
	{
		width: 100% !important;
		float:left !important;
		font-size:13px !important;
		line-height:17px !important;
		display:block !important;
		padding-bottom:20px !important;
		text-align:center !important;
		
	}
		
td[class='spechide'] 
	{
		display:none !important;
	}
	    img[class='banner'] 
	{
	          width: 100% !important;
	          height: auto !important;
	}
		td[class='left_pad'] 
	{
			padding-left:15px !important;
			padding-right:15px !important;
	}
		
	.font{
		font-size:15px !important;
		line-height:19px !important;
		
		}
}

</style>

<script type='colorScheme' class='swatch active'>
  {
    'name':'Default',
    'bgBody':'f6f6f6',
    'link':'ffffff',
    'color':'99A1A6',
    'bgItem':'2C94E0',
    'title':'444444'
  }
</script>

</head>
<body paddingwidth='0' paddingheight='0' bgcolor='#d1d3d4'  style=' margin-left:5px; margin-right:5px; margin-bottom:0px; margin-top:0px;padding-top: 0; padding-bottom: 0; background-repeat: repeat; width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;' offset='0' toppadding='0' leftpadding='0'>
  <table width='100%' border='0' cellspacing='0' cellpadding='0' class='tableContent bgBody' align='center'  style='font-family:Helvetica, Arial,serif;'>
  
    <!-- =============================== Header ====================================== -->

  <tr>
    <td class='movableContentContainer' >
    	<div class='movableContent' style='border: 0px; padding-top: 0px; position: relative;'>
  <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' valign='top'>
    <tr><td height='2'></td></tr>
    <tr>
      <td height='200' bgcolor='#fdfefe'>
        <table align='center' border='0' cellspacing='0' cellpadding='0' class='MainContainer'>
          <tr><td></td></tr>
          <tr>
            <td></td>
            <td valign='top'>
              <table width='300' border='0' cellspacing='0' cellpadding='0' align='center' valign='top'>
                <tr>
                  <td valign='top'>
                    <div class='contentEditableContainer contentTextEditable'>
                      <div class='contentEditable'>
                        <h1 style='font-size:20px;font-weight:normal;color:blue;line-height:19px;'>Dear $fname,</h1>
                      </div>
                    </div>
                  </td>
                </tr>
                <tr><td height='18'></td></tr>
                <tr>
                  <td valign='top'>
                    <div class='contentEditableContainer contentTextEditable'>
                      <div class='contentEditable'>
                        <p style='font-size:13px;color:blue;line-height:19px;'>
                          We are notifying you that your account has been successfully logged in. <br><br>
                          <strong>Login Details:</strong><br>
                          Date & Time: $loginTime<br>
                          IP Address: $ipAddress<br><br>
                          If this was not you, please secure your account immediately by resetting your password and contacting our support team.
                        </p>
                      </div>
                    </div>
                  </td>
                </tr>
                <tr><td height='1'></td></tr>
              </table>
            </td>
            <td></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr><td height='0'></td></tr>
  </table>
</div>

<div class='movableContent' style='border: 0px; padding-top: 0px; position: relative;'>
  <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' valign='top'>
    <tr>
      <td>
        <table width='600' border='0' cellspacing='0' cellpadding='0' align='center' valign='top' class='MainContainer'>
          <tr>
            <td>
              <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' valign='top'>
                <tr><td></td></tr>
                <tr>
                  <td valign='top' align='center'>
                    <div class='contentEditableContainer contentTextEditable'>
                      <div class='contentEditable'>
                        <p style='font-weight:bold;font-size:13px;line-height:30px;'>AlphaEdge Online Banking</p>
                      </div>
                      <br>
                      <div class='contentEditableContainer contentTextEditable'>
                        <div class='contentEditable'>
                          <p style='font-size:13px;line-height:15px;'>
                            <b>How Do I Know This is a Legitimate Email?</b><br><br>
                            Emails from us will address you by your registered <b>first and last name</b> or <b>business name</b>.
                            We will <b>never ask</b> for sensitive information such as your password, bank account, or credit card details.<br><br>
                            Remember not to click any links in suspicious-looking emails.
                          </p>
                        </div>
                      </div>
                    </div>
                    <div class='contentEditableContainer contentTextEditable'>
                      <div class='contentEditable'>
                        <p style='color:#A8B0B6;font-size:13px;line-height:15px;'>&nbsp;</p>
                      </div>
                    </div>
                  </td>
                </tr>
                <tr><td height='28'>&nbsp;</td></tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>
    </td>
  </tr>
</table>


</body>
  </html>


";

 $subject = "Login Notification";
$reg_user->send_mail($row['email'], $message, $subject);