<tr>


   <td>
                    <button type="button" class="btn btn-outline-warning" data-bs-toggle="modal" data-bs-target="#modal_<?php echo $vendas2[0]; ?>">
                        <?php echo $vendas2[0] ?>
                    </button>
                </td>

                <!-- Adicione as outras colunas da tabela aqui -->

                <!-- 

                  ARQUIVO QUE EXPLICA O FUNCIONAMENTO NA PASTA ARQUIVOS 

                 -->

                <div class="modal fade" id="modal_<?php echo $vendas2[0]; ?>" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="modalLabel_<?php echo $vendas2[0]; ?>" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="modalLabel_<?php echo $vendas2[0]; ?>">Dados do produto</h5>
                                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                            </div>
                            <div class="modal-body">

                            <?php                                
                                echo "COD = " . $vendas2[0]. "<br>";
                                echo "MERCADORIA = " .  $vendas2['Nome_Mercadoria'] . "<br>";
                                echo "DIAS COBERTURA = " . $coberturadias . "<br>";
                                echo "ESTOQUE = " . $vendas2['ESTOQUE'] . "<br>";
                                echo "<hr>";
                                echo "ESTOQUE EM TODAS AS LOJAS <br>";
 
                                $estoqueLoja = $dados->EstoquePorLoja($vendas2[0]);
                                foreach ($estoqueLoja as $estoqueLoja2) {
                                    echo $estoqueLoja2[0];
                                    echo " [ ";
                                    echo ROUND($estoqueLoja2[1]);
                                    echo " ] <br>";
                                }
                            ?>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
                            </div>
                        </div>
                    </div>
                </div>


    <td class="largura"><?php echo $vendas2['Nome_Mercadoria']?></td>
        <td><?php echo ROUND($vendas2['Janeiro'])?></td>
        <td><?php echo ROUND($vendas2['Fevereiro'])?></td>
        <td><?php echo ROUND($vendas2['Marco'])?></td>
        <td><?php echo ROUND($vendas2['Abril'])?></td>
        <td><?php echo ROUND($vendas2['Maio'])?></td>
        <td><?php echo ROUND($vendas2['Junho'])?></td>
        <td><?php echo ROUND($vendas2['Julho'])?></td>
        <td><?php echo ROUND($vendas2['Agosto'])?></td>
        <td><?php echo ROUND($vendas2['Setembro'])?></td>
        <td><?php echo ROUND($vendas2['Outubro'])?></td>
        <td><?php echo ROUND($vendas2['Novembro'])?></td>
        <td><?php echo ROUND($vendas2['Dezembro'])?></td>
        <td><?php echo  ROUND($vendas2['Soma_Meses']); ?></td>

        <?php if($vendasmes > 0){ ?>

        <td><?php echo  ROUND($vendas2['Soma_Meses'] / $meses)?></td>
		
        <?php }else{ ?>
		
		<td> 0 </td>
		
		<?php } ?>

        <td><?php echo  ROUND($vendas2['ESTOQUE']); ?></td>

        <?php if($cobertura > 0){ ?>
        
		<td><?php echo $cobertura; ?></td>
        
		<?php }else{ ?>
        
		<td>0</td>
		
	        
		<?php } ?>

        <td><?php echo $coberturadias; ?></td>
        
        <!-- quantidade nescessasria para terminar o mes -->
		<td> <?php echo ROUND((($vendas2['Soma_Meses'] / $meses) / 30 ) * $diasRestantes , 2) ; ?> </td>

        <?php
        //SO VAI FAZER SUGESTAO SE NAO TIVER ESTOQUE PARA PELO MENOS 30 DIAS E SE HOUVE VENDAS
        if($coberturadias < 29.9999 && $vendasmes > 0) {

        //MIN(PRODUTO.[Preço C]) AS PRECO_COMPRA_SEM_IMPOSTOS
 
        $sugerido = ROUND(($vendas2['Soma_Meses'] / $meses) - $vendas2['ESTOQUE']);

        //$sugeridoTotal = $vendas2['PRECO_COMPRA_SEM_IMPOSTOS'];
        //$sugeridoTotal = $sugeridoTotal + $sugeridoTotal1;
        $sugeridoTotal1 = $sugerido * $vendas2['PRECO_COMPRA_SEM_IMPOSTOS'];
        $sugeridoTotal += $sugeridoTotal1;
        //$sugeridoTotal = $sugeridoTotal + $sugeridoTotal1;
		
        ?>
		
				
        <td> <?php echo $sugerido;?> </td>
		
	   <?php }else{?>
		
		<td> 0 </td>
		
		
		<?php } ?>

 <?php if ($coberturadias > 29.99999){?>
<td> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-smile-fill sucesso" viewBox="0 0 16 16">
  <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zM4.285 9.567a.5.5 0 0 1 .683.183A3.498 3.498 0 0 0 8 11.5a3.498 3.498 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.498 4.498 0 0 1 8 12.5a4.498 4.498 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683zM10 8c-.552 0-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5S10.552 8 10 8z"/>
</svg></td>
<?php }elseif( $coberturadias > 14.9999  && $coberturadias < 29.9999){ ?>
<td>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-astonished-fill medio" viewBox="0 0 16 16">
  <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-4.884-3.978a2.092 2.092 0 0 1 .53.332.5.5 0 0 0 .708-.708h-.001v-.001a1.885 1.885 0 0 0-.237-.197 3.087 3.087 0 0 0-.606-.345 2.996 2.996 0 0 0-2.168-.077.5.5 0 1 0 .316.948 1.997 1.997 0 0 1 1.458.048Zm-4.774-.048a.5.5 0 0 0 .316-.948 2.996 2.996 0 0 0-2.167.077 3.091 3.091 0 0 0-.773.478c-.024.02-.047.042-.07.064l-.002.001a.5.5 0 1 0 .728.689 2.09 2.09 0 0 1 .51-.313 2 2 0 0 1 1.458-.048ZM7 6.5C7 5.672 6.552 5 6 5s-1 .672-1 1.5S5.448 8 6 8s1-.672 1-1.5Zm4 0c0-.828-.448-1.5-1-1.5s-1 .672-1 1.5S9.448 8 10 8s1-.672 1-1.5Zm-5.247 4.746c-.383.478.08 1.06.687.98 1.04-.135 2.08-.135 3.12 0 .606.08 1.07-.502.687-.98C9.747 10.623 8.998 10 8 10c-.998 0-1.747.623-2.247 1.246Z"/>
</svg>

</td>
<?php }elseif($coberturadias < 14.9999 && $vendasmes > 0){ ?>

<td>

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-frown-fill baixo" viewBox="0 0 16 16">
  <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm-2.715 5.933a.5.5 0 0 1-.183-.683A4.498 4.498 0 0 1 8 9.5a4.5 4.5 0 0 1 3.898 2.25.5.5 0 0 1-.866.5A3.498 3.498 0 0 0 8 10.5a3.498 3.498 0 0 0-3.032 1.75.5.5 0 0 1-.683.183zM10 8c-.552 0-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5S10.552 8 10 8z"/>
</svg>

</td>

<?php }else{ ?>
<td>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-neutral-fill desconhecido" viewBox="0 0 16 16">
  <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm-3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zM10 8c-.552 0-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5S10.552 8 10 8z"/>
</svg>
</td>
</tr>

<?php } ?>