<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/pranto007
Script is created and provided by Pranto (http://facebook.com/pranto007)
**************************************/
include '../db.php';
include '../functions.php';
headtag("$SiteName - Pay Invoice");
if($adminlog==1){
$vid=formget("id");
$date=date("d-m-Y");
$doit=mysql_query("UPDATE invoice SET status='Paid ($date)' WHERE id='$vid'");
if($doit){
$get_use=mysql_query("SELECT * FROM invoice WHERE id='$vid'");
$get_us=mysql_fetch_array($get_use);
$uid=$get_us["userid"];
$amt=$get_us["amount"];
$method=$get_us["method"];
$via=$get_us["via"];
$ope=$get_us["operator"];
$name=$get_us["name"];
$bank=$get_us["bankname"];
$ifsc=$get_us["ifsccode"];
$taka=$get_us["rs"];
$rs=$get_us["rs"];
$get_u=mysql_query("SELECT * FROM userdata WHERE id='$uid'");
$get_user=mysql_fetch_array($get_u);
$emailz=$get_user["email"];
$mobile=$get_user["verimobile"];
$username=$get_user["username"];
$apprbal=$get_user["approvedbal"];
$user=strtolower($username);
$apprbal=$get_user["approvedbal"];
$appr=$apprbal;
$ved=strpos($appr,'.');
$approvedbal=substr($appr,0,$ved+3);
echo '<div class="success">Successfully Paid!</div>';
if($method=="Recharge")
{
$a=$rs;
$pos=strpos($a,'.');
$at=substr($a,0,$pos+0);
if($mobile!='')
{
$msg = "Congratulation $user , Your mobile - $via of amount $at Rs has been successfully recharged. Approved Balance - $approvedbal $.-EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Your Mobile Recharged Successfully at EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Recharge Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
Your Mobile Has Been Recharged Successfully at EarnBuzz.In.<br/>
Amount- '.$at.' Rs<br/>
Mobile- '.$via.'<br/>
Operator- '.$ope.'</h3>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , Your Mobile Has Been Recharged Successfully.', 'none', 'none')");
}
if($method=="DTH Recharge")
{
$a=$rs;
$pos=strpos($a,'.');
$at=substr($a,0,$pos+0);
if($mobile!='')
{
$msg = "Congratulation $user , Your dth - $via of amount $at Rs has been successfully recharged. Approved Balance - $approvedbal $.-EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Your DTH Recharged Successfully at EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">DTH Recharge Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
Your DTH Has Been Recharged Successfully at EarnBuzz.In.<br/>
Amount- '.$at.' Rs<br/>
Subscriber ID- '.$via.'<br/>
Operator- '.$ope.'</h3>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , Your DTH Has Been Recharged Successfully.', 'none', 'none')");
}
else if($method=="AirtelMoney")
{
if($mobile!='')
{
$msg = "Congratulation $user , We have paid $rs Rs to your airtelmoney account.
Thanks for using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Money Paid To Your AirtelMoney Account- EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Payment Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
We Have Paid Money To Your AirtelMoney Account.<br/>
Amount- '.$rs.' Rs<br/>
Mobile- '.$via.'<br/>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , We Have Paid ".$rs." Rs To Your AirtelMoney Account.', 'none', 'none')");
}
else if($method=="Bank")
{
if($mobile!='')
{
$msg = "Congratulation $user , We have paid $rs Rs to your bank account. Please wait for 2-3 days for showing this amount in your bank account.
Thanks for using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Money Paid To Your Bank Account- EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Payment Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
We Have Paid Money To Your Bank Account.<br/>
Amount- '.$rs.' Rs<br/>
Name- '.$name.'<br/>
Acc.- '.$via.'<br/>
Bank- '.$bank.'<br/>
IFSC- '.$ifsc.'<br/>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , We Have Paid ".$rs." Rs To Your Bank Account.', 'none', 'none')");
}
else if($method=="MoneyBookers")
{
if($mobile!='')
{
$msg = "Congratulation $user , We have paid $amt$ to your moneybookers account.
Thanks for using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Money Paid To Your MoneyBookers Account- EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Payment Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
We Have Paid Money To Your MoneyBookers Account.<br/>
Amount- '.$amt.' $<br/>
Email- '.$via.'<br/>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , We Have Paid ".$amt." $ To Your MoneyBookers Account.', 'none', 'none')");
}
else if($method=="PayPal")
{
if($mobile!='')
{
$msg = "Congratulation $user , We have paid $amt$ to your paypal account.
Thanks for using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Money Paid To Your PayPal Account- EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Payment Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
We Have Paid Money To Your PayPal Account.<br/>
Amount- '.$amt.' $<br/>
Email- '.$via.'<br/>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , We Have Paid ".$amt." $ To Your PayPal Account.', 'none', 'none')");
}
else if($method=="Indo Recharge")
{
if($mobile!='')
{
$msg = "Congratulation $user , Your mobile - $via of amount $amt$ has been successfully recharged.
Thanks for using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Your Mobile Recharged Successfully at EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Recharge Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
Your Mobile Has Been Recharged Successfully at EarnBuzz.In.<br/>
Amount- '.$amt.' $<br/>
Mobile- '.$via.'<br/>
Operator- '.$ope.'</h3>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , Your Mobile Has Been Recharged Successfully.', 'none', 'none')");
}
else if($method=="BD Recharge")
{
if($mobile!='')
{
$msg = "Congratulation $user , Your mobile - $via of amount $taka Taka has been successfully recharged. Approved Balance - $approvedbal $.-EarnBuzz.In";
Send_SMS($mobile,$msg);
}
$to = $emailz;
$subject = 'Your Mobile Recharged Successfully at EarnBuzz.In';
$body = '<div style="max-width:650px;margin:3px auto;background:#fff;font:13px Helvetica;font-size:.9em;color:#3c3c3c;border-left-width:10px;border-right-width:10px;border-bottom-width:10px;border-top-width:10px;border-style:solid;border-color:#e3e4fa"><div style="color: #fffaee; background-color: #006100; background-repeat: repeat-x; background-position: 50% top; margin-bottom: 1px; padding: 3px; border-top: 1px solid #003000; border-bottom: 1px solid #003000; font-weight:bold"><div align="center">Recharge Details</div></div>
<table style="border-collapse:collapse;text-align:left" border="1" height="60" cellpadding="5">
<tbody><tr><td><h2>Hello <b>'.$user.'</h2></b>
<h3>
Your Mobile Has Been Recharged Successfully at EarnBuzz.In.<br/>
Amount- '.$taka.' Taka<br/>
Mobile- '.$via.'<br/>
Operator- '.$ope.'</h3>
<h4>
Thanks for using our service<br/>
For more details you can contact us at<br/>
'.$mailtemp.'
</div>';
Send_Mail($to,$subject,$body);
mysql_query("INSERT INTO notifications (user, news , other, stat)
VALUES ('$username', 'Congratulation , Your Mobile Has Been Recharged Successfully.', 'none', 'none')");
}
}
else {
echo 'Unknown error';
}
echo '<a href="unpayinvo.php"><div class="ua">HOME</div></a>';
include '../foot.php';
}
else {
header('Location:login.php');
}
?>