<?php
/*session_start();*/

$tanggal1 = new DateTime('2019-01-11');
$tanggal2 = new DateTime('2019-12-31');
$interval = $tanggal1->diff($tanggal2);
echo $interval->format('%a');


                  /*echo $_SESSION['kode'];
                  "";*/
                 
                  /*echo $_SESSION['warkatp']['kode']['sql'];*/
                  
                
                  /*echo session_id();*/
                 /* session_id(YOUR_SESSION_ID);*/

                 $timeStart2 = strtotime("2023-01-01");
                $timeEnd2 = strtotime("2023-05-03");
                // Menambah bulan ini + semua bulan pada tahun sebelumnya
               /* $jmlBulan1 = 1 + (date("Y",$timeEnd2)-date("Y",$timeStart2))*12;
                // menghitung selisih bulan
                $jmlBulan3 = (date("m",$timeEnd2)-date("m",$timeStart2));
                $jmlBulan2 = (date("d",$timeEnd2)-date("d",$timeStart2))*$jmlBulan1*$jmlBulan3;
                @$bulan2=0;*/


                 function kol($jmlBulan2){
                    if($jmlBulan2<=15){
                     return 0;
                    }elseif($jmlBulan2<=30){
                    return 1;
                    }elseif($jmlBulan2<=45){
                        return 2;
                    }else{return 3;
                    } 
                    }
              echo kol($jmlBulan2).
              '</br>';
              echo $jmlBulan2;

    
        
        /*$tot_tunggakan=0;
        $jmlBulan2=3;

                function kol($tunggakan,$Bulan2){
                    if($tunggakan<=0)
                    { echo "0";
                    }else{
                    if($Bulan2<=1){ echo "0";
                    }elseif($Bulan2<=2){
                    echo "1";
                    }else{echo "2";
                    } 
                    }
                    }  

     echo kol ($tot_tunggakan,$jmlBulan2);*/

      /*function kol($tunggakan,$Bulan2){
                    if($tunggakan<=0)
                    { return "0";
                    }else{
                    if($Bulan2<=1){ return "0";
                    }elseif($Bulan2<=2){
                    return "1";
                    }else{return "2";
                    } 
                    }
                    }  */