<?php 
	session_start();
	ini_set('date.timezone', 'Asia/Calcutta');
	error_reporting(E_ERROR | E_WARNING);
	#error_reporting(E_ALL);  		 
	ini_set('memory_limit', '512M');
	error_reporting(E_ERROR | E_WARNING | E_PARSE); 	
	$server = $_SERVER['HTTP_HOST']; 
    $SITE_NAME = "Daily Pay";
    $server_url= str_replace("www.","",$server);
    /* // for netbuttrfly.com
    $mail_username="info@kalpanagauritech.com";
    $mail_password="f6!P0n,[S2!0"; 
    */     
	switch($server)
	{	 
	case "www.dailypayservices.in": 
		define("HST", "localhost"); 
		define("USR", "netbuttr_user1");
		define("PWD", "NetButterfly#@123");
		define("DBN", "netbuttr_dailypaydemo");				 
		define("MAIN_ROOTPATH", "https://www.dailypayservices.in");	
		define("ROOTPATH", "https://www.dailypayservices.in");	
		define("ADMINPATH", "https://www.dailypayservices.in/admin");
		define("ABS_PATH", $_SERVER['DOCUMENT_ROOT']); 
	break;	  
	case "dailypayservices.in": 
		header("Location: https://www.dailypayservices.in"); 
		die;
	break; 
   }   
   
    if(!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on") 
    {
	    header("Location: ".ROOTPATH."");  
	    die;
    }
	    
	$mail_username="admin@travelcreditmaster.com";
    $mail_password="y(E]wpqNk?fq";   
 
    	 
    $conn = new PDO('mysql:host='.HST.';dbname='.DBN.';charset=utf8mb4', USR, PWD);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
      
    $db_host = HST;
    $db_user = USR;
    $db_pass = PWD;
    $db_name = DBN;
    
    $con =  mysqli_connect($db_host,$db_user,$db_pass,$db_name);
    if(mysqli_connect_error())
    {
    echo 'connect to database failed';
    }
    	                          
	      
        if(isset($_SESSION['userCustId'] ))
        { 
          
            $stmt=$conn->prepare("select Mnnnt from   UI__Mnt where sId=:custId ");   
            $stmt->bindValue(':custId',$_SESSION['userCustId'], PDO::PARAM_STR);   
            $stmt->execute(); 
            $Mnnnt = $stmt->fetch(PDO::FETCH_OBJ);   
            
            $stmt=$conn->prepare("select nm from   UI__Rgst where custId=:custId ");   
            $stmt->bindValue(':custId',$_SESSION['userCustId'], PDO::PARAM_STR);   
            $stmt->execute(); 
            $userNam = $stmt->fetch(PDO::FETCH_OBJ);   
        }
        
        
         
        
        
                    function GetNBal()
                    {
                        global $conn;		          
                 
                        $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
                        $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $Tamnt = 0;
                        foreach($XUI__DailyROIGene as $xx)
                        {
                        $Tamnt +=$xx->amount;
                        }      
                        
                        
                        $stmt=$conn->prepare("select *  from UI__Bns    where Rid =:sId   ");   
                        $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        $LevelI = 0;
                        foreach($UI__Bns as $dddm)
                        {
                        $LevelI +=$dddm->Tamt;
                        }
                        
                        
                        $stmt=$conn->prepare("select Amt   from UI__Tpm where TopUpId=:refId   ");   
                        $stmt->bindValue(':refId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $MdirectB = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $directIncome = 0;
                        foreach($MdirectB as $dmm)
                        $directIncome += $dmm->Amt;                
                        
                        
                        
                        
                        $stmt=$conn->prepare("select *  from UI__WithDraw    where userid=:sId and (accept=1 ||accept=2)  ");   
                        $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        
                        $totalWithdrwa = 0;
                        foreach($UI__WithDraw as $tl)
                        {
                        $totalWithdrwa +=$tl->amt;
                        }  
                        
                        
                        $stmt=$conn->prepare("select availableFund from UI__Fundtransfer  where  userid=:userid  order by id desc  ");   
                        $stmt->bindValue(':userid',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ); 
                        
                        
                        
                        $stmt=$conn->prepare("select nm  from UI__Rgst    where cuurentId=:cuurentId     ");   
                        $stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__nm = $stmt->fetch(PDO::FETCH_OBJ);     
                        $BY = $UI__nm->nm;
                        
                        $PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund)-($totalWithdrwa);     
                        return $PAYWAllet;
                        
                    }
                    
                    function GetBalance($_SESSIONuserId)
                    { 
                        global $conn;	
                        
                        if($_SESSIONuserId=="DP841053")
                        { 
                            
                                $Tamnt = 0;  
                                $stmt=$conn->prepare("select *  from UI__DailyROIGeneForD    where custId=:sId     ");   
                                $stmt->bindValue(':sId', $_SESSIONuserId , PDO::PARAM_STR);  
                                $stmt->execute(); 
                                $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                                
                                 
                                foreach($XUI__DailyROIGene as $xx)
                                     $Tamnt +=$xx->amount; 
                                     
                                 
                                $stmt=$conn->prepare("select *  from UI__WithDrawForD    where userid=:sId and (accept=1 ||accept=2)  ");   
                                $stmt->bindValue(':sId',  $_SESSIONuserId , PDO::PARAM_INT);  
                                $stmt->execute(); 
                                $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                
                                
                                $totalWithdrwa = 0;
                                foreach($UI__WithDraw as $tl)
                                {
                                $totalWithdrwa +=$tl->amt;
                                }  
                                
                                
                                $stmt=$conn->prepare("select availableFund from UI__FundtransferForD  where  userid=:userid  order by id desc  ");   
                                $stmt->bindValue(':userid',  $_SESSIONuserId , PDO::PARAM_INT);  
                                $stmt->execute(); 
                                $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ);   
                                
                                
                                $PAYWAllet =  ($Tamnt+$UI__Fundtransfer->availableFund)-($totalWithdrwa);     
                                return $PAYWAllet;
                        
                            
                        }else  
                        {
                            
                         
                        $stmt=$conn->prepare("select *  from UI__DailyROIGeneAtw    where custId=:sId     ");   
                        $stmt->bindValue(':sId', $_SESSIONuserId , PDO::PARAM_STR);   
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $Tamnt = 0;
                        foreach($XUI__DailyROIGene as $xx)
                        {
                        $Tamnt +=$xx->amount;
                        }

                        $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
                        $stmt->bindValue(':sId', $_SESSIONuserId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                         
                        foreach($XUI__DailyROIGene as $xx)
                        {
                            $Tamnt +=$xx->amount;
                        }      
                          
                         
                        $stmt=$conn->prepare("select *  from UI__BnsAtw    where Rid =:sId   ");   
                        $stmt->bindValue(':sId',  $_SESSIONuserId , PDO::PARAM_STR);   
                        $stmt->execute(); 
                        $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        $LevelI = 0; 
                        foreach($UI__Bns as $dddm)
                        {
                        $LevelI +=$dddm->Tamt;
                        }

                        $stmt=$conn->prepare("select *  from UI__Bns    where Rid =:sId   ");   
                        $stmt->bindValue(':sId',  $_SESSIONuserId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        
                        foreach($UI__Bns as $dddm)
                        {
                        $LevelI +=$dddm->Tamt;
                        }
                        
                        
                        
                        $stmt=$conn->prepare("select Amt   from UI__Tpm where TopUpId=:refId   ");   
                        $stmt->bindValue(':refId',  $_SESSIONuserId  , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $MdirectB = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $directIncome = 0;
                        foreach($MdirectB as $dmm)
                        $directIncome += $dmm->Amt;                
                        
                        
                        
                        
                        $stmt=$conn->prepare("select *  from UI__WithDraw    where userid=:sId and (accept=1 ||accept=2)  ");   
                        $stmt->bindValue(':sId',  $_SESSIONuserId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        
                        $totalWithdrwa = 0;
                        foreach($UI__WithDraw as $tl)
                        {
                        $totalWithdrwa +=$tl->amt;
                        }  
                        
                        
                        $stmt=$conn->prepare("select availableFund from UI__Fundtransfer  where  userid=:userid  order by id desc  ");   
                        $stmt->bindValue(':userid',  $_SESSIONuserId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ); 
                        
                        
                        
                        
                        $PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund)-($totalWithdrwa);     
                        return $PAYWAllet;
                        
                        }  
                        
                    }
                    
                    
                    
            function LvBal_new($LPB,$CoinVal,$type,$msg,$byw)
            {
                
            global $conn;													
            $stmt=$conn->prepare("select *  from UI__DailyROIGeneAtw    where custId=:sId     ");   
            $stmt->bindValue(':sId', $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
            $Tamnt = 0;
            foreach($XUI__DailyROIGene as $xx)
            {
            $Tamnt +=$xx->amount;
            }
            
            $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
            $stmt->bindValue(':sId', $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
             
            foreach($XUI__DailyROIGene as $xx)
            {
            $Tamnt +=$xx->amount;
            }
            
            
            
            $stmt=$conn->prepare("select *  from UI__BnsAtw    where Rid =:sId   ");   
            $stmt->bindValue(':sId',  $LPB , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
            $LevelI = 0;
            foreach($UI__Bns as $dddm)
            {
            $LevelI +=$dddm->Tamt;
            }
            
            
            $stmt=$conn->prepare("select *  from UI__Bns    where Rid =:sId   ");   
            $stmt->bindValue(':sId',  $LPB , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
            
            foreach($UI__Bns as $dddm)
            {
            $LevelI +=$dddm->Tamt;
            }
            
            
            $stmt=$conn->prepare("select Amt   from UI__Tpm where TopUpId=:refId   ");   
            $stmt->bindValue(':refId',  $LPB , PDO::PARAM_INT);  
            $stmt->execute(); 
            $MdirectB = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
            $directIncome = 0;
            foreach($MdirectB as $dmm)
            $directIncome += $dmm->Amt;      
            
            
            $stmt=$conn->prepare("select *  from UI__WithDraw    where userid=:sId and (accept=1 ||accept=2)  ");   
            $stmt->bindValue(':sId',  $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
            
            $totalWithdrwa = 0;
            foreach($UI__WithDraw as $tl)
            {
            $totalWithdrwa +=$tl->amt;
            }
            
            
            
            
            $stmt=$conn->prepare("select availableFund from UI__Fundtransfer  where  userid=:userid  order by id desc  ");   
            $stmt->bindValue(':userid',  $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ); 
            
            
             
            
            $PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund)-($totalWithdrwa);        
            
            
            $stmt=$conn->prepare("insert into  UI__DebitCredit (custId,addDel,availableBal,Tdate,type,Intype,byw) values(:custId,:addDel,:availableBal,:Tdate,:type,:Intype,:byw)"); 
            $stmt->bindValue(':custId',$LPB, PDO::PARAM_STR); 
            $stmt->bindValue(':addDel',$CoinVal, PDO::PARAM_STR); 
            $stmt->bindValue(':availableBal',($PAYWAllet), PDO::PARAM_STR);  
            $stmt->bindValue(':Tdate', date("d-M-Y H:i") , PDO::PARAM_STR);  
            $stmt->bindValue(':Intype', $msg , PDO::PARAM_STR);    
            $stmt->bindValue(':type', $type , PDO::PARAM_STR);  
            $stmt->bindValue(':byw', $byw , PDO::PARAM_STR);    
            $stmt->execute();
            $_SESSION['LastIntId'] = $conn->lastInsertId();
            
            }
            
            function LvBal($LPB,$CoinVal,$type,$msg,$byw)
            {
            
            global $conn;													
            $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
            $stmt->bindValue(':sId', $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
            $Tamnt = 0;
            foreach($XUI__DailyROIGene as $xx)
            {
            $Tamnt +=$xx->amount;
            }      
            
            
            $stmt=$conn->prepare("select *  from UI__Bns    where Rid =:sId   ");   
            $stmt->bindValue(':sId',  $LPB , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
            $LevelI = 0;
            foreach($UI__Bns as $dddm)
            {
            $LevelI +=$dddm->Tamt;
            }
            
            
            $stmt=$conn->prepare("select Amt   from UI__Tpm where TopUpId=:refId   ");   
            $stmt->bindValue(':refId',  $LPB , PDO::PARAM_INT);  
            $stmt->execute(); 
            $MdirectB = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
            $directIncome = 0;
            foreach($MdirectB as $dmm)
            $directIncome += $dmm->Amt;                
            
            
            
            
            $stmt=$conn->prepare("select *  from UI__WithDraw    where userid=:sId and (accept=1 ||accept=2)  ");   
            $stmt->bindValue(':sId',  $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
            
            $totalWithdrwa = 0;
            foreach($UI__WithDraw as $tl)
            {
            $totalWithdrwa +=$tl->amt;
            }
            
            
            
            
            $stmt=$conn->prepare("select availableFund from UI__Fundtransfer  where  userid=:userid  order by id desc  ");   
            $stmt->bindValue(':userid',  $LPB, PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ); 
            
            
            
           
            
            $PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund)-($totalWithdrwa);        
            
            
            $stmt=$conn->prepare("insert into  UI__DebitCredit (custId,addDel,availableBal,Tdate,type,Intype,byw) values(:custId,:addDel,:availableBal,:Tdate,:type,:Intype,:byw)"); 
            $stmt->bindValue(':custId',$LPB, PDO::PARAM_STR); 
            $stmt->bindValue(':addDel',$CoinVal, PDO::PARAM_STR); 
            $stmt->bindValue(':availableBal',($PAYWAllet), PDO::PARAM_STR);  
            $stmt->bindValue(':Tdate', date("d-M-Y H:i") , PDO::PARAM_STR);  
            $stmt->bindValue(':Intype', $msg , PDO::PARAM_STR);    
            $stmt->bindValue(':type', $type , PDO::PARAM_STR);  
            $stmt->bindValue(':byw', $byw , PDO::PARAM_STR);    
            $stmt->execute();
            $_SESSION['LastIntId'] = $conn->lastInsertId();
            
            $stmt=$conn->prepare("select id from UI__Rgst  where  cuurentId=:cuurentId    ");   
            $stmt->bindValue(':cuurentId',  $LPB , PDO::PARAM_STR);  
            $stmt->execute(); 
            $UIid = $stmt->fetch(PDO::FETCH_OBJ);   
            
            $amount = password_hash(($PAYWAllet),PASSWORD_DEFAULT);  
            $stmt =  $conn->prepare("update _pkCc__ set bl1=:bl1,tm=:tm where Uxd=:Uxd "); 
            $stmt->bindValue(':bl1', $amount, PDO::PARAM_STR); 
            $stmt->bindValue(':tm', date("d-M-Y H:i"), PDO::PARAM_STR); 
            $stmt->bindValue(':Uxd', $UIid->id, PDO::PARAM_STR);  
            $stmt->execute(); 
            }           
            
            
                    function totalCredit($userId)
                    { 
                        
                        global $conn;		  
                        
                        if($userId=="DP841053")
                        {    
                                   

                        $stmt=$conn->prepare("select *  from UI__DailyROIGeneForD    where custId=:sId     ");   
                        $stmt->bindValue(':sId',  $userId, PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                         
                        foreach($XUI__DailyROIGene as $xx)
                        {
                            $Tamnt +=$xx->amount;
                        }                            
                        
                        $stmt=$conn->prepare("select availableFund from UI__FundtransferForD  where  userid=:userid  order by id desc  ");   
                        $stmt->bindValue(':userid',  $userId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ);    
                      
                        
                        $PAYWAllet =  ($Tamnt+$UI__Fundtransfer->availableFund);     
                        return $PAYWAllet;
                        
                        }else {
                          												
                        $stmt=$conn->prepare("select *  from UI__DailyROIGeneAtw    where custId=:sId     ");   
                        $stmt->bindValue(':sId',  $userId , PDO::PARAM_STR);   
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $Tamnt = 0;
                        foreach($XUI__DailyROIGene as $xx)
                        {
                        $Tamnt +=$xx->amount;
                        }
                        
                        

                        $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
                        $stmt->bindValue(':sId',  $userId, PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                         
                        foreach($XUI__DailyROIGene as $xx)
                        {
                            $Tamnt +=$xx->amount;
                        }       
                        
                        $stmt=$conn->prepare("select *  from UI__BnsAtw    where Rid =:sId   ");   
                        $stmt->bindValue(':sId',  $userId , PDO::PARAM_STR);   
                        $stmt->execute(); 
                        $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        $LevelI = 0; 
                        foreach($UI__Bns as $dddm)
                        {
                        $LevelI +=$dddm->Tamt;
                        }

                        $stmt=$conn->prepare("select *  from UI__Bns    where Rid =:sId   ");   
                        $stmt->bindValue(':sId',  $userId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                        
                        
                        foreach($UI__Bns as $dddm)
                        {
                        $LevelI +=$dddm->Tamt;
                        }
                        
                        
                        $stmt=$conn->prepare("select Amt   from UI__Tpm where TopUpId=:refId   ");   
                        $stmt->bindValue(':refId',  $userId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $MdirectB = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $directIncome = 0;
                        foreach($MdirectB as $dmm)
                        $directIncome += $dmm->Amt;          
                        
                          
                        
                        $stmt=$conn->prepare("select availableFund from UI__Fundtransfer  where  userid=:userid  order by id desc  ");   
                        $stmt->bindValue(':userid',  $userId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ);    
                      
                        
                        $PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund);     
                        return $PAYWAllet;
                        }
                        
                    } 
                    
                    
                    function totalDebit($userId)
                    {  
                               
                        global $conn;   
                        
                         if($userId=="DP841053")
                        {
                            
                        $stmt=$conn->prepare("select *  from UI__WithDrawForD    where userid=:sId and (accept=1 ||accept=2)  ");   
                        $stmt->bindValue(':sId',  $userId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $totalWithdrwa = 0;
                        foreach($UI__WithDraw as $tl)
                            $totalWithdrwa +=$tl->amt; 
                            
                        }else {
                        
                        $stmt=$conn->prepare("select *  from UI__WithDraw    where userid=:sId and (accept=1 ||accept=2)  ");   
                        $stmt->bindValue(':sId',  $userId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                        $totalWithdrwa = 0;
                        foreach($UI__WithDraw as $tl)
                            $totalWithdrwa +=$tl->amt; 
                        }
                        
                        return $totalWithdrwa;  
                    }
                    
                    if(isset($_POST['gtMybal']))
                    {
                        
                        $Bal = GetBalance($_POST['Id']);  
                        echo number_format($Bal,2); 
                        die;
                    } 
?>