<?php

namespace App\Terms;

class RelatorioProcedimentoValor
{

    public function getRelatorioProcedimentoValor($dados)
    {
        $html = '';
        $html .= '<html>';
        $html .= '<head>';
        $html .= '	<title></title>';
        $html .= '	<style>
	                    h3 {
	                        margin: 40px 0px;
	                    }
	                    .info{
	                        margin: 40px 0px;
	                    }
	                    .rodape{
	                        margin-top: 350px;
	                        text-align: center;
	                    }
	
	
                    </style>';
        $html .= '</head>';
        $html .= '<body>';
        $html .= '<h3>';
        $html .= " <div style='text-align: center;'>";
        $html .= " RELATÓRIO DE PROCEDIMENTO VALOR <br/>";
        $html .= " </h3>";
        $html .= "";

        $html .= '<table style="font-size: 13px" border="0" width="100%">
                 <tr>
                    <td style="text-align: center"><strong> Procedimento</strong></td>
                    <td style="text-align: center"><strong> Tipo Procedimento</strong></td>
                    <td style="text-align: center"><strong>Convenio</strong></td>
                    <td style="text-align: center"><strong>Unidade</strong></td>
                    <td style="text-align: center"><strong>Status</strong></td>
                    <td style="text-align: center"><strong>Data de inicio</strong></td>
                    <td style="text-align: center"><strong>Valor Cliente</strong></td>
                    <td style="text-align: center"><strong>Valor Interno</strong></td>
                    <td style="text-align: center"><strong>Valor de Repasse Médico</strong></td>
                </tr>';

        $html .= '
            <tr>
                <td colspan="12"><hr></td>
            </tr>
        ';

        // FOREACH PETS
        foreach ( $dados as $key => $value ) {
            $html .= '
                <tr>
                    <td style="text-align: center;">' . $value["descricao_procedimento"] . ' </td>
                    <td style="text-align: center;">' . $value["descricao_tipo_procedimento"] . ' </td>
                    <td style="text-align: center;">' . $value["descricao_convenio"] . ' </td>
                    <td style="text-align: center;">' . $value["descricao_unidade"] . ' </td>
                    <td style="text-align: center;">' . ($value["status"] ? 'ATIVO' : 'INATIVO'  ) . ' </td>
                    <td style="text-align: center;">' . date( "d/m/Y", strtotime( $value["data_inicio"] ) ) . '</td>
                    <td style="text-align: center;">' . $value["valor"] . ' </td>
                    <td style="text-align: center;">' . $value["valor_interno"] . ' </td>
                    <td style="text-align: center;">' . $value["valor_repasse_medico"] . ' </td>
                </tr>
            ';
        }
        $html .= '</table>';


        $html .= "</body>";
        $html .= "</html>";

        return $html;
    }
}