<?php
 $janveh='';
 $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='January'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='January' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $janveh=$row['sum(cost)'];
    }
    }else
    {
    $janveh='0';
    }
    
    //February
    $febveh='';
    
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='February'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='February' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $febveh=$row['sum(cost)'];
    }
    }else
    {
    $febveh='0';
    }
    
    //March
    $marveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='March'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='March' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $marveh=$row['sum(cost)'];
    }
    }else
    {
    $marveh='0';
    }
    
     //April
    $aprveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='April'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='April' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $aprveh=$row['sum(cost)'];
    }
    }else
    {
    $aprveh='0';
    }
    
    
     //May
    $mayveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='May'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='May' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $mayveh=$row['sum(cost)'];
    }
    }else
    {
    $mayveh='0';
    }
    
    
     //June
    $junveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='June'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='June' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $junveh=$row['sum(cost)'];
    }
    }else
    {
    $junveh='0';
    }
    
    //July
     $julyveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='July'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='July' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $julyveh=$row['sum(cost)'];
    }
    }else
    {
    $julyveh='0';
    }
    
    
    //August
    $augveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='August'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='August' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $augveh=$row['sum(cost)'];
    }
    }else
    {
    $augveh='0';
    }
    
    
    //September
    $sepveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='September'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='September' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $sepveh=$row['sum(cost)'];
    }
    }else
    {
    $sepveh='0';
    }
    
    
    //October
    $octveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='October'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='October' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $octveh=$row['sum(cost)'];
    }
    }else
    {
    $octveh='0';
    }
    
    //November
    $novveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='November'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='November' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $novveh=$row['sum(cost)'];
    }
    }else
    {
    $novveh='0';
    }
    
    
    //December
    $decveh='';
    $sql = mysqli_query($con,"SELECT * FROM busincome where Year='$yr' AND Month='December'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(cost) FROM busincome where Month ='December' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $decveh=$row['sum(cost)'];
    }
    }else
    {
    $decveh='0';
    }
 
    ?>