<?php   
	include_once("../view/header-footer/header.php");  
?>  
   
   
    
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#accordion" ).accordion();
  } );
  </script>
   <!-- Features -->
   <div class="innerDeader">
      <div class="container">
        <a href="javascript:void(0);" id="go-back" class="goBack PaySound">
           <img src="<?php echo ROOTPATH;?>/images/Arrow 1.svg" alt="back">
       </a>  
       <h4>CREDIT & DEBIT REPORT</h4>  
     </div>    
   </div>    
<div class="innerBody">  
<div> 
    
        <?php 
                $xpl = explode("-",$_REQUEST['dt']);
                $year = date($xpl[1]);
                $month = date($xpl[0]);
                $monthNum  = $xpl[0];
                $dateObj   = DateTime::createFromFormat('!m', $monthNum);
                $monthName = $dateObj->format('F'); // March
        ?>
     <a  style="color:white;" href="DebitCreditReport.php?dt=<?php echo $_REQUEST['dt'];?>"> 
        <h3 style="width:100%;background:#8c8b8b;border-radius:2px;padding:2px;font-size:16px;text-align:center;font-weight:bold;color:#fff">
                <?php  
                    $days = cal_days_in_month(CAL_GREGORIAN, $month, $year); 
                    echo $monthName." ".$xpl[1].", 1 to ".$days; 
                ?> 
        </h3> 
    </a> 
        
    <?php   
    $sr=1;
    foreach($list as $key=>$Date)
    { 
        $newDate = date("Y-m-d", strtotime($Date));  
        
        $TheD = date("D", strtotime($Date)); 
        
        if(($TheD=="Sun") || ($TheD=="Sat"))
            $color = "#fc0307";
        else
            $color = "#fff";
            
        if($newDate <= date("Y-m-d")) 
        {
 ?>
        <?php 
            if($sr%2==0) 
            {
        ?>
        
        <a  style="color:white;" href="DebitCreditReport.php?dt=<?php echo $Date;?>"> 
        <h3 style="width:100%;background:#8c8b8b;border-radius:2px;padding:2px;font-size:16px;text-align:center;font-weight:bold;color:<?php echo $color; ?>">
                <?php echo $Date;?> 
        </h3> 
        </a> 
        <?php }else { ?>  
        
        <a  style="color:white;" href="DebitCreditReport.php?dt=<?php echo $Date;?>"> 
        <h3 style="width:100%;background:#a3a3a3;border-radius:2px;padding:2px;font-size:16px;text-align:center;font-weight:bold;color:<?php echo $color; ?>">
                <?php echo $Date;?> 
        
        </h3>
        </a>
        
        <?php } ?>
     
 <?php  
        $sr++;} 
    }
  ?>       
</div>     
   </div> 
</div>
 
<?php 
  include_once("../view/header-footer/footer.php");  
    unset($_SESSION['TpMsg']);