View file public_html/vipadz/adinvopay.php

File size: 2.32Kb
<?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 - Approve AD Invoice");

if($adminlog==1){

 $vid=formget("id");

$arshad = mysql_query("SELECT * FROM adinvoice WHERE id='$vid'");
$saifi = mysql_fetch_array($arshad);
$checkme=$saifi["status"];
if($checkme=="<font color='red'>Pending</font>")
{
 $doit=mysql_query("UPDATE adinvoice SET status='<font color=\'green\'>Approved</font>' WHERE id='$vid'");
}
else if($checkme=="<font color='red'>Rejected</font>")
{
echo "<div class='error'>This AD Invoice Is Already Rejected.</div>";
}
else
{
echo "<div class='error'>This AD Invoice Is Already Approved.</div>";
}


 if($doit){
   $get_use=mysql_query("SELECT * FROM adinvoice WHERE id='$vid'");
   $get_us=mysql_fetch_array($get_use);
   $user=$get_us["user"];
   $amount=$get_us["amount"];
   $method=$get_us["method"];
   $date=$get_us["date"];
   $get_u=mysql_query("SELECT * FROM userdata WHERE username='$user'");
   $get_user=mysql_fetch_array($get_u);
   $emailz=$get_user["email"];
   $mobile=$get_user["verimobile"];
   $newbal=$get_user["pubalance"];
   $adbal=($newbal+$get_us["amount"]);
   mysql_query("UPDATE userdata SET pubalance='$adbal' WHERE username='$user'");
   mysql_query("INSERT INTO notifications (user, news , other, stat)
   VALUES ('$user', 'Your ".$method." Deposit Request Of Amount ".$amount."$ Created On ".$date." Has Been Approved.', 'none', 'none')");
   echo '<div class="success">Successfully Approved!</div>';

if($mobile!='')
{
$msg = "Congratulations $user ,
Your $method Deposit Request Of Amount $amount$ Created On $date Has Been Approved.
Thanks For Using EarnBuzz.In";
Send_SMS($mobile,$msg);
}
echo"$file_contents";
       $to      = $emailz;
    $subject = 'Fund Request Approved';
    $body = 'Congratulations '.$user.' , <br/>
Your '.$method.' Deposit Request Of Amount '.$amount.'$ Created On '.$date.' Has Been Approved. <br/>
Thanks For Using EarnBuzz.In';
Send_Mail($to,$subject,$body);
 }
 else {
  echo 'Unknown Error';
 }
echo '<a href="adinvod.php?id='.$vid.'"><div class="ua">View Invoice</div></a>'; 
 include '../foot.php';

 }
 else {
 header('Location:login.php');
 }
?>