<?php
	include_once('../config.php');   
	             
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    } 
     
    if(isset($_POST['submit']))
    {
        
            $CustId = substr(str_shuffle('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'),0, 8);  
            $stmt=$conn->prepare("insert into  UI__Rgst (nm,phm,eml,pwd,custId,is_active) values(:nm,:phm,:eml,:pwd,:custId,:is_active) ");   
            $stmt->bindValue(':nm', $_POST['Fname'] , PDO::PARAM_STR); 
            $stmt->bindValue(':phm',  $_POST['ph_no'] , PDO::PARAM_INT); 
            $stmt->bindValue(':eml', $_POST['email'] , PDO::PARAM_STR); 
            $stmt->bindValue(':pwd', $_POST['passwprd'] , PDO::PARAM_STR); 
            $stmt->bindValue(':custId', $CustId, PDO::PARAM_STR);  
            $stmt->bindValue(':is_active', 1, PDO::PARAM_STR);    
            $stmt->execute(); 
            $_SESSION['Regis'] = "Registration Done";
            header("Location: registration.php");
            die;  
    }
            

 
 
            $stmt=$conn->prepare("select *  from UI__WithDraw    where userid =:sId   ");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__WithDraw = $stmt->fetchAll(PDO::FETCH_OBJ);     

               
            $stmt=$conn->prepare("select *   from UI__DChstr where Rid =:sId  and typ=1");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_STR);  
            $stmt->execute(); 
            if($stmt->rowCount() > 0)
                $UI__DChstr = 1;
            else
                $UI__DChstr = 0;
                
            $UI__DChstrP = $stmt->fetchAll(PDO::FETCH_OBJ);   
            
            
            $stmt=$conn->prepare("select *   from UI__Droi where Cid =:sId  order by id desc");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $DailyROI = $stmt->fetch(PDO::FETCH_OBJ);   
            
            
            $stmt=$conn->prepare("select *   from UI__DChstr where sId =:sId  and typ=2");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__DChstrTy2 = $stmt->fetchAll(PDO::FETCH_OBJ);   
            
            foreach($UI__DChstrTy2 as $dm)
             $dreictRef += $dm->amt;
             
             
            
            $stmt=$conn->prepare("select *   from UI__DChstr where sId =:sId  and typ=4");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__DChstrTyB = $stmt->fetchAll(PDO::FETCH_OBJ);   
            
            foreach($UI__DChstrTyB as $dm)
             $binary += $dm->amt; 
             
               
               
            
       
            $stmt=$conn->prepare("select *   from  UI__DebitCredit  where custId =:userid and type!=1 ");   
            $stmt->bindValue(':userid',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__DebitCredit = $stmt->fetchAll(PDO::FETCH_OBJ);   
            
            $UsedBal = 0;
            foreach($UI__DebitCredit as $dm)
             $UsedBal += $dm->addDel; 
               
                  
            $stmt=$conn->prepare("select *   from UI__DChstr where sId =:sId  and typ=6");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__DChstrTyrOI = $stmt->fetchAll(PDO::FETCH_OBJ);   
            
            foreach($UI__DChstrTyrOI as $dm)
             $rOIoNroI += $dm->amt; 
               
            
            //$stmt=$conn->prepare("select *   from UI__TotalDirectIncome where refId =:userid   ");   
            //$stmt->bindValue(':userid',  $_SESSION['userid'] , PDO::PARAM_INT);  
            //$stmt->execute(); 
            //$UI__TotalDirectIncome = $stmt->fetchAll(PDO::FETCH_OBJ); 
            $TotalIncome = 0; 
              
            
                   
            //foreach($UI__TotalDirectIncome as $dm) 
                $TotalIncome = 0;//(($dm->package)*5)/100;  
                
                
            
                    $myspTopup = 0;
             
            if($UI__DChstr > 0)
            {
                foreach($UI__DChstrP as $pckAmm) 
                {
                    $PckAmt += $pckAmm->amt;   
                }
                
                if($PckAmt>=10000)
                    $rewardPoints = 1;
                else  if($PckAmt>=1000)
                    $rewardPoints = 2;
                else    
                    $rewardPoints = 0;    
                
                if($Ssprcl100==0)
                {
                    $PckAmt *=2;
                    
                }
                else{
                    
                    if($PckAmt > 10) 
                    {
                        $myspTopup = 100000;
                        $PckAmt = 150000;
                    }
                     else 
                     {   
                        $myspTopup = 0;
                        //$PckAmt = 150000;
                     }
                }
            }
            else
                $PckAmt = "NA";
                
            
            
            $totalTrade = 0;
            $totalDirect = 0;
            $totalBinary = 0;
            $totalBooster = 0;
            foreach($UI__DailyROIGene as $mmt)
            {
                
                if($mmt->type==1)
                    $totalTrade += $mmt->amt;  
                else if($mmt->type==2)
                    $totalBinary += $mmt->amt;
                else if($mmt->type==3)
                    $totalBooster += $mmt->amt;
                else if($mmt->type==4)
                    $totalDirect += $mmt->amt;     
            } 
            
            
            $stmt=$conn->prepare("select Mnnnt  from UI__Mnt    where sId =:sId   ");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $Mnnnt = $stmt->fetch(PDO::FETCH_OBJ); 
            
          
            
            $stmt=$conn->prepare("select Mnnnt  from UI__Mnt    where sId =:sId   ");   
            $stmt->bindValue(':sId',  $_SESSION['CustId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $Mnnnt = $stmt->fetch(PDO::FETCH_OBJ); 
  
            
             
            $stmt=$conn->prepare("select  Tamt  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 *  from UI__Bns    where Rid =:sId  and paidStatus=1  ");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__BnsPaids = $stmt->fetchAll(PDO::FETCH_OBJ); 
            
             $UI__BnsPaidsR = 0;
             foreach($UI__BnsPaids as $dddm)
             {
                 $UI__BnsPaidsR +=$dddm->Tamt;
             }
             
             
          
             
            $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId   and paidStatus=1    ");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $XUI__DailyROIGenePaids = $stmt->fetchAll(PDO::FETCH_OBJ);  
            
            $TamntPaidsR = 0;
            foreach($XUI__DailyROIGenePaids as $xx)
            {
                $TamntPaidsR +=$xx->amount;
            }
            
             
            
             
            $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 *  from UI__Fundtransfer    where userid =:sId  order by id desc  ");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $UI__Fundtransfer = $stmt->fetch(PDO::FETCH_OBJ); 
             
             $stmt=$conn->prepare("select RegOn,phm,rewardPoints,idtoid,utilities from UI__Rgst    where cuurentId =:sId    ");   
            $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
            $stmt->execute(); 
            $user = $stmt->fetch(PDO::FETCH_OBJ);   
            $phm = $user->phm;  
            $idtoid = $user->idtoid;  
              
             
            if($user->utilities=="")
            {
                $UpiA = 0;
                $Bkn = 0;
                $IdToId = 0;
                $Utili = 0;
            }else
            {
                $expln =  explode(",",$user->utilities);  
                $UpiA = $expln[0];
                $Bkn = $expln[1];
                $IdToId = $expln[2];
                $Utili = $expln[3];
            }   
            
            
             
            $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;
            }
            
            
             function Refcall($ref)
            {
                global $conn;
                $stmt=$conn->prepare("select cuurentId   from UI__Rgst where refId =:cuurentId ");   
                $stmt->bindValue(':cuurentId', $ref , PDO::PARAM_INT);  
                $stmt->execute(); 
                $Result = $stmt->fetchAll(PDO::FETCH_OBJ);   
                return $Result;
            }
            
            $stmt=$conn->prepare("select cuurentId,news,marchant from UI__Rgst where custId =:custId ");   
            $stmt->bindValue(':custId', $_SESSION['userCustId']  , PDO::PARAM_STR);  
            $stmt->execute(); 
            $Result = $stmt->fetch(PDO::FETCH_OBJ);   
            $news = $Result->news; 
            $myRefId = $Result->cuurentId; 
            $marchant = $Result->marchant; 
            
            $stmt=$conn->prepare("select cuurentId   from UI__Rgst where refId =:cuurentId ");   
            $stmt->bindValue(':cuurentId', $Result->cuurentId  , PDO::PARAM_INT);  
            $stmt->execute(); 
            
      
            $myTT = 0;
            if($stmt->rowCount()>0)
            { 
                $Result = $stmt->fetchAll(PDO::FETCH_OBJ);     
                foreach($Result as $dtm) 
                    $stepCt['step1']['id'][] = $dtm->cuurentId;
                    
                    
                $myTT +=count($stepCt['step1']['id']);       
                foreach($Result as $dtm) 
                    $stepCt['step2']['id'][] =  Refcall($dtm->cuurentId); 
                
            }
              
             
              
            for($i=0;$i<count($stepCt['step2']['id']);$i++)
            {
                 
                if(count($stepCt['step2']['id'][$i])>0)
                {
                       $myTT +=count($stepCt['step2']['id'][$i]);     
                       
                   foreach($stepCt['step2']['id'][$i] as $dtm)
                     $stepCt['step3']['id'][] =  Refcall($dtm->cuurentId);  
                }
                
            } 
             
             
            
            for($i=0;$i<count($stepCt['step3']['id']);$i++)
            {
                 
                if(count($stepCt['step3']['id'][$i])>0)
                {
                     $myTT +=count($stepCt['step3']['id'][$i]);     
                     
                   foreach($stepCt['step3']['id'][$i] as $dtm)
                     $stepCt['step4']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step4']['id']);$i++)
            {
                 
                if(count($stepCt['step4']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step4']['id'][$i]);   
                   
                   foreach($stepCt['step4']['id'][$i] as $dtm)
                     $stepCt['step5']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step5']['id']);$i++)
            {
                 
                if(count($stepCt['step5']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step5']['id'][$i]);   
                   
                   foreach($stepCt['step5']['id'][$i] as $dtm)
                     $stepCt['step6']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step6']['id']);$i++)
            {
                 
                if(count($stepCt['step6']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step6']['id'][$i]);   
                   
                   foreach($stepCt['step6']['id'][$i] as $dtm)
                     $stepCt['step7']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step7']['id']);$i++)
            {
                 
                if(count($stepCt['step7']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step7']['id'][$i]);   
                   
                   foreach($stepCt['step7']['id'][$i] as $dtm)
                     $stepCt['step8']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step8']['id']);$i++)
            {
                 
                if(count($stepCt['step8']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step8']['id'][$i]);   
                   
                   foreach($stepCt['step8']['id'][$i] as $dtm)
                     $stepCt['step9']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            for($i=0;$i<count($stepCt['step9']['id']);$i++)
            {
                 
                if(count($stepCt['step9']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step9']['id'][$i]);   
                   
                   foreach($stepCt['step9']['id'][$i] as $dtm)
                     $stepCt['step10']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            
            for($i=0;$i<count($stepCt['step10']['id']);$i++)
            {
                 
                if(count($stepCt['step10']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step10']['id'][$i]);   
                   
                   foreach($stepCt['step10']['id'][$i] as $dtm)
                     $stepCt['step11']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
			
			 for($i=0;$i<count($stepCt['step11']['id']);$i++)
            {
                 
                if(count($stepCt['step11']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step11']['id'][$i]);   
                   
                   foreach($stepCt['step11']['id'][$i] as $dtm)
                     $stepCt['step12']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step12']['id']);$i++)
            {
                 
                if(count($stepCt['step12']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step12']['id'][$i]);   
                   
                   foreach($stepCt['step12']['id'][$i] as $dtm)
                     $stepCt['step13']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step13']['id']);$i++)
            {
                 
                if(count($stepCt['step13']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step13']['id'][$i]);   
                   
                   foreach($stepCt['step13']['id'][$i] as $dtm)
                     $stepCt['step14']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step14']['id']);$i++)
            {
                 
                if(count($stepCt['step14']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step14']['id'][$i]);   
                   
                   foreach($stepCt['step14']['id'][$i] as $dtm)
                     $stepCt['step15']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
			
			
			
			 for($i=0;$i<count($stepCt['step15']['id']);$i++)
            {
                 
                if(count($stepCt['step15']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step15']['id'][$i]);   
                   
                   foreach($stepCt['step15']['id'][$i] as $dtm)
                     $stepCt['step16']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step16']['id']);$i++)
            {
                 
                if(count($stepCt['step16']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step16']['id'][$i]);   
                   
                   foreach($stepCt['step16']['id'][$i] as $dtm)
                     $stepCt['step17']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step17']['id']);$i++)
            {
                 
                if(count($stepCt['step17']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step17']['id'][$i]);   
                   
                   foreach($stepCt['step17']['id'][$i] as $dtm)
                     $stepCt['step18']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			 for($i=0;$i<count($stepCt['step18']['id']);$i++)
            {
                 
                if(count($stepCt['step18']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step18']['id'][$i]);   
                   
                   foreach($stepCt['step18']['id'][$i] as $dtm)
                     $stepCt['step19']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step19']['id']);$i++)
            {
                 
                if(count($stepCt['step19']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step19']['id'][$i]);   
                   
                   foreach($stepCt['step19']['id'][$i] as $dtm)
                     $stepCt['step20']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step20']['id']);$i++)
            {
                 
                if(count($stepCt['step20']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step20']['id'][$i]);   
                   
                   foreach($stepCt['step20']['id'][$i] as $dtm)
                     $stepCt['step21']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step21']['id']);$i++)
            {
                 
                if(count($stepCt['step21']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step21']['id'][$i]);   
                   
                   foreach($stepCt['step21']['id'][$i] as $dtm)
                     $stepCt['step22']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
			
			
			
            
             for($i=0;$i<count($stepCt['step22']['id']);$i++)
            {
                 
                if(count($stepCt['step22']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step22']['id'][$i]);   
                   
                   foreach($stepCt['step22']['id'][$i] as $dtm)
                     $stepCt['step23']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			
			 for($i=0;$i<count($stepCt['step23']['id']);$i++)
            {
                 
                if(count($stepCt['step23']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step23']['id'][$i]);   
                   
                   foreach($stepCt['step23']['id'][$i] as $dtm)
                     $stepCt['step24']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
			
			
			 for($i=0;$i<count($stepCt['step24']['id']);$i++)
            {
                 
                if(count($stepCt['step24']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step24']['id'][$i]);   
                   
                   foreach($stepCt['step24']['id'][$i] as $dtm)
                     $stepCt['step25']['id'][] =  Refcall($dtm->cuurentId);  
                }

            } 


			 for($i=0;$i<count($stepCt['step25']['id']);$i++)
            {
                 
                if(count($stepCt['step25']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step25']['id'][$i]);   
                   
                   foreach($stepCt['step25']['id'][$i] as $dtm)
                     $stepCt['step26']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step26']['id']);$i++)
            {
                 
                if(count($stepCt['step26']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step26']['id'][$i]);   
                   
                   foreach($stepCt['step26']['id'][$i] as $dtm)
                     $stepCt['step27']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
			
			
			 for($i=0;$i<count($stepCt['step28']['id']);$i++)
            {
                 
                if(count($stepCt['step28']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step28']['id'][$i]);   
                   
                   foreach($stepCt['step28']['id'][$i] as $dtm)
                     $stepCt['step29']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
			
			
			 for($i=0;$i<count($stepCt['step29']['id']);$i++)
            {
                 
                if(count($stepCt['step29']['id'][$i])>0)
                {
                    
                   $myTT +=count($stepCt['step29']['id'][$i]);   
                   
                   foreach($stepCt['step29']['id'][$i] as $dtm)
                     $stepCt['step30']['id'][] =  Refcall($dtm->cuurentId);  
                }
            } 
            
            
            		
            
            
            
            
            
            
            
            
            
            
            
            
             
                $ActTeam = 0;
                $NBusinessAmt = 0;      
                foreach($stepCt['step1']['id'] as $dtm) 
                {      
                    
                    $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                    $stmt->bindValue(':Rid', $dtm , PDO::PARAM_STR);  
                    $stmt->execute(); 
                    $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                    
                    foreach($Resultx  as $mmt)
                    {
    					$NBusinessAmt += $mmt->amt;
    					 $ActTeam++;
                    }
                }  
                
                 
                
                
                foreach($stepCt['step2']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
                
                foreach($stepCt['step3']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }  
                
                
                foreach($stepCt['step4']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                    }
                }
                 
                 
                foreach($stepCt['step5']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                       if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                } 
                 
                 
                foreach($stepCt['step6']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
                
                foreach($stepCt['step7']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                       if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
                
                foreach($stepCt['step8']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                       if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
                
                foreach($stepCt['step9']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
                
                foreach($stepCt['step10']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				 foreach($stepCt['step11']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step12']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step13']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step14']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
				
				foreach($stepCt['step15']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
                
				foreach($stepCt['step16']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step17']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step18']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step19']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step20']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step21']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step22']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step23']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step24']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step25']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step26']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				
				foreach($stepCt['step27']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step28']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step29']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
				foreach($stepCt['step30']['id'] as $dtm) 
                {    
                    foreach($dtm as $dtmx) 
                    {    
                        $stmt=$conn->prepare("select *  from UI__DChstr where Rid=:Rid and typ=1");   
                        $stmt->bindValue(':Rid', $dtmx->cuurentId , PDO::PARAM_STR);  
                        $stmt->execute(); 
                        if($stmt->rowCount()>0)
                        {
                            $Resultx = $stmt->fetchAll(PDO::FETCH_OBJ);   
                            foreach($Resultx as $MM)
                            {
                                $NBusinessAmt += $MM->amt; 
                                $ActTeam++;   
                            }
                        }
                        
                    }
                }
				
                $stmt=$conn->prepare("select *   from UI__Rgst where refId=:refId   ");   
                $stmt->bindValue(':refId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                $MyDteam = $stmt->rowCount();
                $Dbusiness = $stmt->fetchAll(PDO::FETCH_OBJ);  
                
                $directAmount = 0;
                foreach($Dbusiness as $dmm)
                {
                        $stmt=$conn->prepare("select amt  from UI__DChstr  where Rid=:cuurentId  and typ=1 ");   
                        $stmt->bindValue(':cuurentId',  $dmm->cuurentId , PDO::PARAM_INT);  
                        $stmt->execute();  
                        
                        $amt = 0;
                        if($stmt->rowCount()>0)
                        { 
                            $Result1 = $stmt->fetch(PDO::FETCH_OBJ); 
                            $directAmount += $Result1->amt;  
                        }      
                }
                
                
                
                   
                
             
                $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;          


                $UI__DirectCt = 0;
                
                
                $stmt=$conn->prepare("select *   from  UI__TopWithDrw where custId =:custId  and (type=1 || type=2) and status=0 order by id desc");   
                $stmt->bindValue(':custId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                if($stmt->rowCount() > 0)
                {
                        $Mdirectc = $stmt->fetch(PDO::FETCH_OBJ); 
                        if($Mdirectc->type==1) 
                        {
                            $stmt=$conn->prepare("update UI__TopWithDrw set status=1 where id=:id ");    
                            $stmt->bindValue(':id',  $Mdirectc->id, PDO::PARAM_INT);  
                            $stmt->execute(); 
                            $_SESSION['TpMsg']  = "Congratulation!! Your Account Has Been Top Up By Rs ".($Mdirectc->amt*2);
                        }
                }
                
                
                
                $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  Tamt from UI__Bns    where Rid =:sId  and Tdate=:Tdate  ");   
                $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_INT);  
                $stmt->execute(); 
                $UI__Bns = $stmt->fetchAll(PDO::FETCH_OBJ); 
                
                $LTBal = 0;
                foreach($UI__Bns as $dddm)
                    $LTBal +=$dddm->Tamt;
                    
                    
                $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId  and Tdate=:Tdate   ");   
                $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_INT);  
                $stmt->execute(); 
                $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                
                $TLt = 0;
                foreach($XUI__DailyROIGene as $xx)
                    $TLt +=$xx->amount;

                $TodaysBalance  = $LTBal + $TLt; 

        
               /* $stmt=$conn->prepare("select * from UI__DirectCt where Custid=:Custid ");   
                $stmt->bindValue(':Custid',  $_SESSION['userId'] , PDO::PARAM_STR);  
                $stmt->execute();  
                 
                
               
                if($stmt->rowCount()>=1)
                {
                    $MdirectBTc = $stmt->fetch(PDO::FETCH_OBJ);  
                    if($MdirectBTc->MyCt>=10)
                    $UI__DirectCt = 200;
                }
                
                    
                $stmt=$conn->prepare("select *  from UI__Mtransfer    where userid=:sId   ");   
                $stmt->bindValue(':sId',  $_SESSION['userId'] , PDO::PARAM_INT);  
                $stmt->execute(); 
                $UI__Mtransfer = $stmt->fetchAll(PDO::FETCH_OBJ); 
                
                  
                foreach($UI__Mtransfer as $tlx)
                {
                    $totalWithdrwaxx +=$tlx->amont;
                }   
            
                */
                
               
            $stmt=$conn->prepare("select * from  UI__News    ");   
            $stmt->execute();  
            $UI__News = $stmt->fetch(PDO::FETCH_OBJ);   
            $newCt =  $UI__News->is_active;
            
            
            $stmt=$conn->prepare("select * from  UI__News  where typ=1   ");   
            $stmt->execute();  
            $UI__NewsNext = $stmt->fetch(PDO::FETCH_OBJ);    
            $newsData = $UI__NewsNext->news; 
            
    
            $stmt=$conn->prepare("select * from UI__theamcolor ");       
            $stmt->execute();           
            $colorTyp1 = $stmt->fetch(PDO::FETCH_OBJ);    
          
        
            $Studentset = 0;
            $mystring = $_SESSION['userId'];
            $findme   = 'SD';
            $pos = strpos($mystring, $findme); 
            if ($pos === false) 
            {
             
            }else 
                $Studentset = 1;
    
    
            $stmt=$conn->prepare("select  Amt from   UI__Mtwi  where     custId=:custId and  status=1   ");   
            $stmt->bindValue(':custId',  $_SESSION['userId'] , PDO::PARAM_STR);  
            $stmt->execute();  
            $UI__NewsNext = $stmt->fetchAll(PDO::FETCH_OBJ);    
             
            $mtwi = 0;
            foreach($UI__NewsNext as $amt)
                $mtwi +=$amt->Amt;
                
            
     
            
                
include_once("../view/dashboard/sdt.php");
?>