<?php
	include_once('config.php');    
	 
	              
	             
	                  
	                  
	                    die;
                        $stmt=$conn->prepare("select  custId   from UI__DailyROIGeneClone   group by custId  ");   
                        $stmt->execute();  
                        $UI__DailyROIGeneClone = $stmt->fetchAll(PDO::FETCH_OBJ); 
                         

                        foreach($UI__DailyROIGeneClone as $ky=>$ampp)
                        {
                            
                             
                        if( ($ky>=300) && ($ky<499)   ) 
                        {    
                                 echo "<h2 style='text-align:center'>ID: $ampp->custId </h2> ";
                         
                          $date = "'%01-Jan-2025%'";  
                        $stmt=$conn->prepare("select  type,availableBal,addDel,byw,Intype,Tdate  from  UI__DebitCredit  where custId =:userid and  Tdate like $date  order by id desc   ");   
                        $stmt->bindValue(':userid', $ampp->custId , PDO::PARAM_INT);  
                        $stmt->execute(); 
                        
                    	if($stmt->rowCount()>0) {   
                        $Result = $stmt->fetchAll(PDO::FETCH_OBJ);  
                        
                         
                        
                        
                        
?>
           
             <table style="width:100%;" border="1">
                
                <tr>
                          <th>S No.</th> 
                                        <th>Amount</th> 
                                        <th>Date</th> 
                                        <th>Type</th> 
                                        <th>Flow</th> 
                                        <th>Balance</th> 
                                        <th>By</th> 
                                        <th>Receipt</th> 
                                        <th>Status</th> 
                </tr>  
                
                      <?php 
                                $sr = 1;
                                foreach($Result as $dmm) 
                                {        
                                ?>
                    <tr>
                         
                                        <td><?php echo $sr++;?></td>
                                        <td <?php if($dmm->type==1) {?> style="color:green;" <?php } else {?> style="color:red;"<?php }?> >&#8377;<?php echo $dmm->addDel;?> </td>
                                        <td><?php echo $dmm->Tdate;?> </td>
                                        <td <?php if($dmm->type==1) {?> style="color:green;" <?php } else {?> style="color:red;"<?php }?> ><?php if($dmm->type==1) echo "Credit"; else echo "Debit";?></td> 
                                        <td><?php echo $dmm->Intype ?></td>
                                        <td> <?php echo  number_format((float)($dmm->availableBal), 2, '.', ''); ?></td>
                                        <td><?php echo $dmm->byw; ?></td> 
                                        <td> 
                                        
                                        
                                        </td> 
                                        <td  style="color:green;"> <?php if($dmm->type==2)   echo "Success";?></td> 
                                       
                    </tr>
                    <?php                
                                
                    		}     
                	?>    
              </table>
    <?php 
                	}
                    $date = "'%31-Dec-2024%'";  
                    $stmt=$conn->prepare("select  type,availableBal,addDel,byw,Intype,Tdate  from  UI__DebitCredit  where custId =:userid and  Tdate like $date  order by id desc   ");   
                    $stmt->bindValue(':userid', $ampp->custId , PDO::PARAM_INT);  
                    $stmt->execute(); 
                	if($stmt->rowCount()>0) {
                    $Result = $stmt->fetchAll(PDO::FETCH_OBJ);  
                    
        ?>
                 
                    <table style="width:100%;" border="1">
                
                <tr>
                          <th>S No.</th> 
                                        <th>Amount</th> 
                                        <th>Date</th> 
                                        <th>Type</th> 
                                        <th>Flow</th> 
                                        <th>Balance</th> 
                                        <th>By</th> 
                                        <th>Receipt</th> 
                                        <th>Status</th> 
                </tr>  
                
                      <?php 
                                $sr = 1;
                                foreach($Result as $dmm) 
                                {        
                                ?>
                    <tr>
                         
                                        <td><?php echo $sr++;?></td>
                                        <td <?php if($dmm->type==1) {?> style="color:green;" <?php } else {?> style="color:red;"<?php }?> >&#8377;<?php echo $dmm->addDel;?> </td>
                                        <td><?php echo $dmm->Tdate;?> </td>
                                        <td <?php if($dmm->type==1) {?> style="color:green;" <?php } else {?> style="color:red;"<?php }?> ><?php if($dmm->type==1) echo "Credit"; else echo "Debit";?></td> 
                                        <td><?php echo $dmm->Intype ?></td>
                                        <td> <?php echo  number_format((float)($dmm->availableBal), 2, '.', ''); ?></td>
                                        <td><?php echo $dmm->byw; ?></td> 
                                        <td> 
                                        
                                         
                                        </td> 
                                        <td  style="color:green;"> <?php if($dmm->type==2)   echo "Success";?></td> 
                                       
                    </tr>
                    <?php                
                                
                    		}     
                	?>    
              </table>
              
        <?php
                 }
              }
            }
    ?>          