File size: 3,823 Bytes
94e6b77
8ed8c51
94e6b77
5521d2e
aefe514
5521d2e
 
 
aefe514
 
5521d2e
aefe514
5521d2e
aefe514
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5521d2e
 
aefe514
 
 
 
 
5521d2e
 
aefe514
 
 
 
5521d2e
0147f30
 
aefe514
5521d2e
0147f30
aefe514
 
 
 
 
 
 
 
 
5521d2e
aefe514
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5521d2e
 
 
aefe514
 
 
5521d2e
aefe514
5521d2e
 
aefe514
 
 
 
 
 
 
 
 
 
 
 
 
 
5521d2e
aefe514
94e6b77
 
0147f30
62e8649
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="pt-BR">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Simulador de Investimentos</title>
  <style>
    body {
      font-family: 'Segoe UI', sans-serif;
      background-color: #f4f8fb;
      margin: 40px;
      color: #333;
    }

    h1 {
      color: #007cf0;
      text-align: center;
      margin-bottom: 30px;
    }

    form {
      background-color: #fff;
      padding: 25px;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
      max-width: 700px;
      margin: 0 auto 40px auto;
    }

    label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
      margin-top: 15px;
    }

    input[type="number"] {
      width: 100%;
      padding: 10px;
      font-size: 1em;
      border: 1px solid #ccc;
      border-radius: 4px;
    }

    button {
      margin-top: 25px;
      padding: 12px 20px;
      font-size: 1em;
      background-color: #007cf0;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    button:hover {
      background-color: #005ec2;
    }

    .center {
      text-align: center;
    }

    .resultado {
      background-color: #fff;
      padding: 25px;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
      margin-bottom: 40px;
    }

    img {
      max-width: 100%;
      height: auto;
      margin: 30px 0;
    }

    .botao-pdf {
      background-color: #28a745;
      margin-top: 20px;
    }

    .botao-pdf:hover {
      background-color: #1f8d3a;
    }
  </style>
</head>
<body>

  <h1>Simulador de Investimentos</h1>

  <form method="POST">
    <label>Capital Inicial (R$):</label>
    <input type="number" name="capital" step="0.01" required value="{{ capital or '' }}">

    <label>Retorno Mensal do Studio (%):</label>
    <input type="number" name="studio_ret" step="0.01" required value="{{ studio_ret or '' }}">

    <label>Valorização Anual do Imóvel (%):</label>
    <input type="number" name="valorizacao" step="0.01" required value="{{ valorizacao or '' }}">

    <label>Lucro Anual da Franquia (R$):</label>
    <input type="number" name="franquia_ret" step="0.01" required value="{{ franquia_ret or '' }}">

    <label>Retorno Anual em Ações (%):</label>
    <input type="number" name="acoes_ret" step="0.01" required value="{{ acoes_ret or '' }}">

    <label>Retorno Anual Renda Fixa (%):</label>
    <input type="number" name="renda_fixa" step="0.01" required value="{{ renda_fixa or '' }}">

    <label>Inflação Anual Esperada (%):</label>
    <input type="number" name="inflacao" step="0.01" required value="{{ inflacao or '' }}">

    <div class="center">
      <button type="submit">Simular</button>
    </div>
  </form>

  {% if grafico %}
  <div class="resultado">
    <h2 class="center">Gráfico de Simulação</h2>
    <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de Investimentos">

    <h2 class="center">Resultados</h2>
    {{ tabela|safe }}

    <form method="POST" action="/download_pdf">
      <!-- Campos ocultos para reenviar dados ao gerar PDF -->
      <input type="hidden" name="capital" value="{{ capital }}">
      <input type="hidden" name="studio_ret" value="{{ studio_ret }}">
      <input type="hidden" name="valorizacao" value="{{ valorizacao }}">
      <input type="hidden" name="franquia_ret" value="{{ franquia_ret }}">
      <input type="hidden" name="acoes_ret" value="{{ acoes_ret }}">
      <input type="hidden" name="renda_fixa" value="{{ renda_fixa }}">
      <input type="hidden" name="inflacao" value="{{ inflacao }}">
      <div class="center">
        <button class="botao-pdf" type="submit">Baixar Relatório em PDF</button>
      </div>
    </form>
  </div>
  {% endif %}

</body>
</html>