<?php 

$qrySt = mysqli_query($conn,"SELECT * FROM settings");
 $Getsit = mysqli_fetch_array($qrySt);
 
 $sitname = $Getsit['sitename'];
 $siturl = $_SERVER['SERVER_NAME'];
 $adminTel = $Getsit['mobile'];
 $adminemail = $Getsit['email'];
 $sitlogo = $Getsit['sitelogo'];


$from = "$sitename<support@$siturl>"; //the email address from which this is sent
$to = "$email"; //the email address you're sending the message to
$subject = "Wallet Credit"; //the subject of the message

// To send HTML mail, the Content-type header must be set
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "Return-Path: $sitename<info@$siturl>\r\n";
$headers .= "Organization: $sitename\r\n";
 
// Create email headers
$headers .= 'From: '.$from."\r\n".
    'Reply-To: '.$from."\r\n" .
    'X-Mailer: PHP/' . phpversion();

$message = "

<html>
<head>
<style>
.table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 50%;
}

td {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}


.button {
  background-color: #008CBA; /* Blue */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  
  -webkit-transition-duration: 0.4s; /* Safari */
  transition-duration: 0.4s;
}

.button:hover {
  background-color: #4CAF50; /* Green */
  color: white;
}

</style>
</head>

<body>


<img src='https://".$siturl."/portal/sitelogo/".$Getsit['sitelogo']."'>

<h3>Dear $fname $lname,</h3>

Your Wallet on $sitename has been Credited.  <br> <br>


<strong>The details of the Transaction are as follows:</strong> <p>

<table class='table' >
  
  <tr>
    <td>Service:</td>
    <td>Airtime2Cash</td>
  </tr>

 <tr>
    <td>User Email:</td>
    <td>$email</td>
  </tr>

 <tr>
    <td>Network:</td>
    <td>$network</td>
  </tr>

  <tr>
    <td>Amount Transferred</td>
    <td>$amount</td>
  </tr>

 <tr>
    <td>Charge</td>
    <td>$charge</td>
  </tr>

 <tr>
    <td>Amount Creditted</td>
    <td>$credit </td>
  </tr>

 <tr>
    <td>Balance Before</td>
    <td>$blc</td>
  </tr>

 <tr>
    <td>Balance After</td>
    <td>$balA</td>
  </tr>


  
</table> <p>

$sitename give you instant and automated recharge for Airtime, <br>
SME DATA, Direct Data, Gotv, Dstv, Startimes, Electric Token, Smile Internet, <br>
WAEC, JAMB, NECO, NABTEB Pins, Bulk SMS, Bank Transfer and lots more...<p>

<a href='https://$siturl'><button class='button'>Try it Now!</button></a> <br>


<p>
Our support team is standby to assist you wherever you need help.<p>
 

<p>Warm Regards, <p>

<strong>The Admin TEAM <br>
  $adminTel<br>
  $adminemail <br>
www.$siturl </strong>

</body><html>";

//now mail
$DoMail = mail($to,$subject,$message,$headers);

?>