<?php
 $janpro='';
 $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='January'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='January' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $janpro=$row['sum(Amount)'];
    }
    }else
    {
    $janpro='0';
    }
    
    //February
    $febpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='February'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='February' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $febpro=$row['sum(Amount)'];
    }
    }else
    {
    $febpro='0';
    }
    
    //March
    $marpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='March'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='March' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $marpro=$row['sum(Amount)'];
    }
    }else
    {
    $marpro='0';
    }
    
     //April
    $aprpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='April'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT SUM(Amount) as Amountapril FROM prodata where Month ='April' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $aprpro=$row['Amountapril'];
    }
    }else
    {
    $aprpro='0';
    }
    
     //May
    $maypro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='May'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='May' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $maypro=$row['sum(Amount)'];
    }
    }else
    {
    $maypro='0';
    }
 
       //June
    $junpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='June'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='June' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $junpro=$row['sum(Amount)'];
    }
    }else
    {
    $junpro='0';
    }
    
     //July
    $julypro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='July'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='July' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $julypro=$row['sum(Amount)'];
    }
    }else
    {
    $julypro='0';
    }
    
    
     //August
    $augpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='August'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='August' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $augpro=$row['sum(Amount)'];
    }
    }else
    {
    $augpro='0';
    }
    
    
    //September
    $seppro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='September'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='September' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $seppro=$row['sum(Amount)'];
    }
    }else
    {
    $seppro='0';
    }
    
    
    //October
    $octpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='October'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='October' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $octpro=$row['sum(Amount)'];
    }
    }else
    {
    $octpro='0';
    }
    
    
    //November
    $novpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='November'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='November' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $novpro=$row['sum(Amount)'];
    }
    }else
    {
    $novpro='0';
    }
    
    
    
    //December
    $decpro='';
    
    $sql = mysqli_query($con,"SELECT * FROM prodata where Year='$yr' AND Month='December'");
    $num=mysqli_fetch_array($sql);
    if($num>0)
    {
    $result = mysqli_query($con,"SELECT sum(Amount) FROM prodata where Month ='December' AND Year='$yr'");
    while($row = $result->fetch_assoc()) 
    {
    $decpro=$row['sum(Amount)'];
    }
    }else
    {
    $decpro='0';
    }
    
    ?>