<?php
	include_once('../config.php');    
	include_once(ABS_PATH.'/custom_function/default.php');  
	       
 
            $set = 0;
            if(date("H:i")=="01:30")
            $set = 1;     
 							
           function sendMl($eml,$amount)
           {
               /* 
			     $subject = "Level income generated on ".$SITE_NAME;  
                $template_type = 1;
                $attachment = '';  
                $message="
                <tr>
                <td align='left' valign='top'>
                <h4 style='font-weight:bold; padding:2px 2px; margin:3px; text-align:left; color:#002368;'>Dear user,</h4>
                <h5 style='font-weight:bold; padding:2px 2px; margin:0px; text-align:center; color:#002368;'>Your daily income generated. Details are as follows </h5> 
                <h5 style='font-weight:bold; padding:2px 2px; margin:0px; text-align:center; color:#002368;'>Amount: $amount   </h5>
                
                </td>
                </tr>";   
                SendMail($Str->eml,$subject,$message,$template_type,$attachment);  
			*/
               
           }
            
             
           
                      
                
  
	           if(($_REQUEST['Ffnvwvbv']=='NEUIEUBNDDOUIOEIONKLV6897634fnfvBVKV34') && ($set==1)) 
	           { 
                    $stmt=$conn->prepare("select  cuurentId from  UI__Rgst  order by id");   
                    $stmt->execute(); 
                    $Repoints = $stmt->fetchAll(PDO::FETCH_OBJ); 
                    $sr = 1;
                    foreach($Repoints as $usersFetch)
                    { 
                         
                    }
			        
								       
                    $stmt=$conn->prepare("select  *   from  UI__DChstr where typ=1  and Rid!='DP112233' and specialUser=0 ");   
                    $stmt->execute();  
                    $UI__DailyROIGeneCt = $stmt->fetchAll(PDO::FETCH_OBJ);  
                    //echo '<pre>'; print_r($UI__DailyROIGeneCt); die; 
                    
                    
                    foreach($UI__DailyROIGeneCt as $dmt)
                    {      
						
						$stmt=$conn->prepare("select   is_active,id  from  UI__Rgst where  cuurentId=:cuurentId   ");
						$stmt->bindValue(':cuurentId', $dmt->Rid , PDO::PARAM_STR);   								
						$stmt->execute();  
						$is_active = $stmt->fetch(PDO::FETCH_OBJ); 
						$MyctId = $is_active->id; 
							
                        
								$stmt=$conn->prepare(" select phm  from  UI__Rgst where  cuurentId=:cuurentId   ");
								$stmt->bindValue(':cuurentId', $dmt->Rid , PDO::PARAM_STR);   								
								$stmt->execute();  
								$phm = $stmt->fetch(PDO::FETCH_OBJ);     

                                    
                                $abb[] = $dmt->Rid;  
                                 
                                       
                                
                        if($dmt->id > 5256)        
                        {
                            $levelDays = 120;      
                            $leftdays = 118;      
                        }else
                        {
                            $levelDays = 60;      
                            $leftdays = 58; 
                        }
						
						$NewLevel = 0; 		
						
						if($MyctId>932)
						 $NewLevel = 1; 		
                        
                        if($dmt->bnsStatus==0) // level cond staRT
                        {
                
                				$_POST['cuurentId'] = $dmt->Rid;    
                				$MrefId= $dmt->id;
                				$stmt=$conn->prepare("select refId,custId   from UI__Rgst where cuurentId =:cuurentId ");   
                				$stmt->bindValue(':cuurentId',  $_POST['cuurentId'] , PDO::PARAM_INT);  
                				$stmt->execute();  
                                if($stmt->rowCount() > 0)
                                {     
                                    $ard = null;
                                    $ard = [];
                                    $Result = $stmt->fetch(PDO::FETCH_OBJ);   
                                    $CC = $Result->refId;
                                    $MyCust =  $Result->custId;
                                    $ard[] = $CC;
                                    for($i=0;$i<=9;$i++)
                                    {
                                        $stmt=$conn->prepare("select refId from UI__Rgst where cuurentId =:cuurentId ");   
                                        $stmt->bindValue(':cuurentId',$CC, PDO::PARAM_INT);  
                                        $stmt->execute();  
                                        if($stmt->rowCount() > 0)
                                        { 
                                            $Result = $stmt->fetch(PDO::FETCH_OBJ);   
                                            $CC = $Result->refId;
                                            $ard[] = $CC;
                                        }
                                    }  
                                }
				
				
				     
				                
				 $data['Data'] = $dmt->amt;   
				 if(end($ard)==0)
                 {
 
                    for($j1=0;$j1<(count($ard)-1);$j1++)
                    {
                       
						$mylevelAmt = 100000;
						if($NewLevel==1)
						{
    						$stmt=$conn->prepare("select amt from UI__Rgst where refId=:refId  ");   
    						$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
    						$stmt->execute();  
    						$MYtotalCt = $stmt->rowCount();
    
    						if($MYtotalCt>0) 
    						{
    						    $ICtm = $stmt->fetchAll(PDO::FETCH_OBJ);    
                                foreach($ICtm as $amp)
                                    $mylevelAmt +=$amp->amt;
    						}
						}

                      
                        $Ssprcl100 = 1; 
                        if (strpos($ard[$j1], 'SP') !== false)   
                            $Ssprcl100=0;     
                        
                        if( ($j1==0) && ($Ssprcl100==1))
                        {       
                                
								$MYtotalCt=1;
								if($NewLevel==1)
								{
										$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
										$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
										$stmt->execute();  
										$MYtotalCt = $stmt->rowCount();
								}
									
								$CoinVal = ($data['Data']*0.1)/100;    
                                $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                if( ($stmt->rowCount() > 0) && ($MYtotalCt>0) && ($mylevelAmt>=10000) ) 
                                {     
                                    
                                    $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                    $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                    $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                    $stmt->execute(); 
                                    $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                    if($IeerCt->cct <= $levelDays) 
                                    {    
                                        $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                        $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                        $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                        $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                        $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                        $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                        $stmt->bindValue(':level', 1  , PDO::PARAM_STR); 
                                        $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                        
                                        $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                        $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                        $stmt->execute();  
                                        $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                        
                                        sendMl($Str->eml,$CoinVal);
                                        
                                        $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                        $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                        $stmt->execute();  
                                        $custId = $stmt->fetch(PDO::FETCH_OBJ); 
                                        
                                        if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
										{
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        } 
										
                                        $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                        $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                        $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                        $stmt->execute();  
                                    }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                                    
                                }
                        }
                        else if( ($j1==1) && ($Ssprcl100==1))
                        { 
                            
							$MYtotalCt=2;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
								
							$CoinVal = ($data['Data']*0.05)/100;    
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1  and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>1)  && ($mylevelAmt>=20000) ) 
                            {
                                
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 2  , PDO::PARAM_STR);      
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                               if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                               {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                         
                                                                 
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					    }else if( ($j1==2) && ($Ssprcl100==1))
                        { 
                            $MYtotalCt=3;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							
							$CoinVal = ($data['Data']*(0.03))/100;   
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1  and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>2)  && ($mylevelAmt>=30000) ) 
                            {
                               
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 3  , PDO::PARAM_STR);
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                                if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                                {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                         
                                                                        
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					    }else if( ($j1==3) && ($Ssprcl100==1))
                        { 
                            $MYtotalCt=4;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.02))/100;       
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1  and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>3)  && ($mylevelAmt>=40000) ) 
                            {
                                
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 4  , PDO::PARAM_STR);   
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                            
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                    
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                                if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                                {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                        
                                
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					    }else if( ($j1==4) && ($Ssprcl100==1))
                        { 
                            $MYtotalCt=5;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.01))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>4)  && ($mylevelAmt>=50000) ) 
                            {
                                
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 5 , PDO::PARAM_STR);  
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                               if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                               {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                         
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            } 
 					      }else if( ($j1==5) && ($Ssprcl100==1))
                        { 
                            $MYtotalCt=6;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.01))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>5)  && ($mylevelAmt>=60000) ) 
                            {
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 6 , PDO::PARAM_STR);    
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                            
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                                if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                                {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                        
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					      }else if( ($j1==6) && ($Ssprcl100==1))
                        { 
                           
							$MYtotalCt=7;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}

							$CoinVal = ($data['Data']*(0.01))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>6)  && ($mylevelAmt>=70000) ) 
                            {
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 7 , PDO::PARAM_STR); 
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                            
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                                if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                                {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                        
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					      }else if( ($j1==7) && ($Ssprcl100==1))
                        { 
                            
							$MYtotalCt=8;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.01))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>7)  && ($mylevelAmt>=80000) ) 
                            {
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 8 , PDO::PARAM_STR);
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                            
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                               if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                               {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                                 
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					      }else if( ($j1==8) && ($Ssprcl100==1))
                        { 
                            
							$MYtotalCt=9;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.005))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>8)  && ($mylevelAmt>=90000) ) 
                            {
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 9 , PDO::PARAM_STR);  
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                            
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                               if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                               {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                                 
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                            }
                             
 					      }else if( ($j1==9) && ($Ssprcl100==1))
                        { 
                            $MYtotalCt=10;
							if($NewLevel==1)
							{
									$stmt=$conn->prepare("select cuurentId from UI__Rgst where refId=:refId  ");   
									$stmt->bindValue(':refId', $ard[$j1] , PDO::PARAM_STR);   
									$stmt->execute();  
									$MYtotalCt = $stmt->rowCount();
							}
							
							$CoinVal = ($data['Data']*(0.005))/100;     
                            $stmt=$conn->prepare("select id from UI__DChstr where Rid=:Rid and typ=1 and status=0 ");   
                            $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR);   
                            $stmt->execute();  
                            if( ($stmt->rowCount() > 0) && ($MYtotalCt>9)  && ($mylevelAmt>=100000) ) 
                            {
                                $stmt=$conn->prepare("select  cct  from UI__LevlCt where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute(); 
                                $IeerCt = $stmt->fetch(PDO::FETCH_OBJ); 
                                if($IeerCt->cct <= $levelDays) 
                                {
                                $stmt=$conn->prepare("insert into  UI__Bns (Rid,Brid,Tdate,Tamt,BAmt,level,DaysLeft) values(:Rid,:Brid,:Tdate,:Tamt,:BAmt,:level,:DaysLeft) ");   
                                $stmt->bindValue(':Rid', $ard[$j1] , PDO::PARAM_STR); 
                                $stmt->bindValue(':Brid', $_POST['cuurentId'], PDO::PARAM_STR); 
                                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR); 
                                $stmt->bindValue(':Tamt', $CoinVal , PDO::PARAM_STR);   
                                $stmt->bindValue(':BAmt', $data['Data'] , PDO::PARAM_STR);      
                                $stmt->bindValue(':level', 10 , PDO::PARAM_STR);        
                                $stmt->bindValue(':DaysLeft', ($leftdays-$IeerCt->cct) , PDO::PARAM_STR);    
                                $stmt->execute();   
                                
                                
                                
                                $stmt=$conn->prepare("select eml from UI__Rgst where cuurentId =:cuurentId ");   
                                $stmt->bindValue(':cuurentId', $ard[$j1], PDO::PARAM_STR);  
                                $stmt->execute();  
                                $Str = $stmt->fetch(PDO::FETCH_OBJ); 
                                
                                sendMl($Str->eml,$CoinVal);
                                
                                $stmt=$conn->prepare("select  * from  UI__Rgst where cuurentId=:cuurentId  ");   
                                $stmt->bindValue(':cuurentId',  $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                $custId = $stmt->fetch(PDO::FETCH_OBJ);
                                
                               if( ($ard[$j1]!='DP112233') && ($ard[$j1]!='DP212871')) 
                               {
                                            LvBal_new($ard[$j1],$CoinVal,1,"Level Balance",$_POST['cuurentId']);  
                                            unset($_SESSION['LastIntId']);
                                        }
                                        
                                                 
                                $stmt=$conn->prepare("update   UI__LevlCt set cct=cct+1 where tblId=:tblId and custId=:custId  ");   
                                $stmt->bindValue(':tblId', $MrefId , PDO::PARAM_STR);   
                                $stmt->bindValue(':custId', $ard[$j1] , PDO::PARAM_STR);   
                                $stmt->execute();  
                                }else
                                    {
                                        $stmt=$conn->prepare("update   UI__DChstr set  bnsStatus=1  where id=:id ");   
                                        $stmt->bindValue(':id', $MrefId , PDO::PARAM_STR);    
                                        $stmt->execute();   
                                    }
                                
                               } 
 					        }
 					        
                                $stmt=$conn->prepare("insert test   (name) values(:Rname) ");   
                                $stmt->bindValue(':Rname', $_POST['cuurentId']."::".$ard[$j1] , PDO::PARAM_STR);  
                                $stmt->execute();   
                         }  
                      
					  }
					  
					 }	//level condotion end 
                     
                       
					}// for end     
					      
        			$stmt=$conn->prepare("insert test   (name) values(:Rname) ");   
        			$stmt->bindValue(':Rname', "Completed..".date("d-M-Y H:i") , PDO::PARAM_STR);  
        			$stmt->execute();  
	            }
	            
	                    
	                    $stmt=$conn->prepare("select  Rid,id   from  UI__DChstr where typ=1  and Rid!='DP112233' group by Rid  ");   
                        $stmt->execute();  
                        $UI__DailyROIGeneCt = $stmt->fetchAll(PDO::FETCH_OBJ);   
                    
                    
                        
                        foreach($UI__DailyROIGeneCt as $ky=>$dmt)
                        {      
                            
                            $LPB = $dmt->Rid;
                             
							$stmt=$conn->prepare("select *  from UI__DailyROIGeneAtw    where custId=:sId     ");   
    						$stmt->bindValue(':sId',  $LPB , 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',  $LPB , 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',  $LPB , 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',  $LPB , 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',  $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); 
    						
    						
    						
    						$stmt=$conn->prepare("select nm  from UI__Rgst    where cuurentId=:cuurentId     ");   
    						$stmt->bindValue(':cuurentId',  $LPB , PDO::PARAM_INT);  
    						$stmt->execute(); 
    						$UI__nm = $stmt->fetch(PDO::FETCH_OBJ);     
    						$BY = $UI__nm->nm;
    						
    						$PAYWAllet =  ($Tamnt+$LevelI+$directIncome+$UI__Fundtransfer->availableFund)-($totalWithdrwa);     
    						  
                        
                            $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("select id from _pkCc__  where  Uxd=:Uxd    ");   
                            $stmt->bindValue(':Uxd', $UIid->id, PDO::PARAM_STR);   
                            $stmt->execute();  
                            
                            
                            if( ($stmt->rowCount()>0) && ($amount!='') )  
                            {    
                                
                                $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();
                            }
                        }
                               