-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinscreve.php
368 lines (290 loc) · 11.2 KB
/
inscreve.php
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<?php
include_once('db/conexao.php');
include_once ('classes/inscricao.php');
function getIp()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
date_default_timezone_set('America/Sao_Paulo');
//Sempre serão preenchidos
$tppessoa = $_POST['tppessoa'];
$nome = $_POST['nome'];
$email = $_POST['email'];
$ip = getIp(); //getenv("REMOTE_ADDR");
$data = date('Y-m-d H:i:s');
//Campos Opcionais
if(isset($_POST['empresa'])) {
$empresa = $_POST['empresa'];
} else {
$empresa = '';
}
if(isset($_POST['areatuacao'])) {
$segmento = $_POST['areatuacao'];
} else {
$segmento = '';
}
$iinscricao = new inscricao($nome, $email, $tppessoa, $empresa, $segmento, $ip, $data);
try{
$ins=$pdo->prepare("insert into inscritos(INS_NOME, INS_EMAIL, INS_IP, INS_DATA, INS_EMPRESA, INS_SEGMENTO, INS_TPPESSOA) values(:nome,:email,:ip,:data,:empresa,:segmento,:tppessoa)");
$ins->bindValue(':nome',$iinscricao->nome);
$ins->bindValue(':email',$iinscricao->email);
$ins->bindValue(':tppessoa',$iinscricao->tppessoa);
$ins->bindValue(':empresa',$iinscricao->empresa);
$ins->bindValue(':segmento',$iinscricao->segmento);
$ins->bindValue(':ip',$iinscricao->ip);
$ins->bindValue(':data',$iinscricao->data);
$ins->execute();
$mensagem = 'Olá '.$nome.','."\n"."\n";
$mensagem .= 'Obrigado por se cadastrar na Iglu Business!'."\n";
$mensagem .= 'Para você, que ainda não é um empresário ou que deseja se apronfundar nos primeiros passos no mundo da gestão, segue um livro referência no assunto:'."\n";
$mensagem .= 'https://www.iglubusiness.com/pdf/Business-Model-Generation.pdf'."\n";
$mensagem .= "\n".'Esta é uma mensagem automática, por favor não responda esse email.'."\n";
$mensagem .= 'Qualquer dúvida, por favor entrar em contato pelo email: contato@iglubusiness.com.'."\n"."\n";
$mensagem .= 'Atenciosamente,'."\n";
$mensagem .= 'Equipe Iglu Business'."\n";
// enviar o email
mail( $email, 'Iglu Business - Obrigado pelo Registro', $mensagem );
echo <<<HTML
<!doctype html>
<html lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>iGLU Business - Sucesso</title>
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="images/android-desktop.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#3372DF">
<link rel="shortcut icon" href="images/favicon.png">
<!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
<!--
<link rel="canonical" href="http://www.example.com/">
-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium& lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.grey-orange.min.css">
<link rel="stylesheet" href="css/styles_fail.css">
<style>
.botao{
float:right
}
#logar{
width: 100%;
}
.texto{
width: 100%;
}
#show-dialog{
color: #696969;
}
.mdl-dialog {
border: none;
box-shadow: 0 9px 46px 8px rgba(0,0,0,.14), 0 11px 15px -7px rgba(0,0,0,.12), 0 24px 38px 3px rgba(0,0,0,.2);
width: 480px;
}
a {
color: #696969;
font-weight: 500;
text-decoration:none;
}
.grey {
color: #696969;
font-weight: 300;
text-decoration:none;
}
.demo-blog .demo-blog__posts {
max-width: 750px !important;
}
.logo-linkedin{
height: 100px;
width: 100px;
}
.logo-fluig{
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<div class="demo-blog mdl-layout mdl-js-layout has-drawer is-upgraded">
<main class="mdl-layout__content">
<div class="demo-blog__posts mdl-grid">
<div class="mdl-card on-the-road-again mdl-cell mdl-cell--12-col mdl-shadow--2dp">
<!-- <div id="p2" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div> -->
<div class="mdl-card__media mdl-color-text--grey-50">
<h3><a href="entry.html">Obrigado!</a></h3>
</div>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--12-col">
<span class="grey">Sua inscrição foi realizada com <strong>sucesso!</strong></span>
</div>
</div>
<hr>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--9-col">
<br>
<span class="grey">Aproveite e siga a página da <strong>TOTVS no Linkedin</strong>. Basta clicar em cima do icone ao lado:</span> <br>
</div>
<div class="mdl-cell mdl-cell--3-col">
<a href="https://pt.linkedin.com/company/totvs" target="_blank"> <img class="logo-linkedin" src="images/linkedin.svg" alt="Logo do Linkedin" /> </a>
</div>
</div>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--9-col">
<br>
<span class="grey">Conheça mais sobre o <strong>Fluig</strong>, o principal produto da TOTVS. Clique em cima do icone ao lado:</span> <br>
</div>
<div class="mdl-cell mdl-cell--3-col">
<a href="https://pt.linkedin.com/company/totvs" target="_blank"> <img class="logo-fluig" src="images/fluig.svg" alt="Logo do Linkedin" /> </a>
</div>
</div>
<hr>
<div class="mdl-card__supporting-text meta mdl-color-text--grey-600">
<i class="material-icons">info_outline</i>
<nav class="demo-nav mdl-cell mdl-cell--12-col">
<a href="index.html" type="button" class="demo-nav__button" style="text-align: justify;">
<b>Clique aqui</b> para voltar ao site.
</a>
</nav>
</div>
</div>
</div>
</main>
<div class="mdl-layout__obfuscator"></div>
</div>
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
</body>
</html>
HTML;
} catch(PDOException $e) {
echo <<<HTML
<!doctype html>
<html lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>iGLU Business - Falha</title>
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="images/android-desktop.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#3372DF">
<link rel="shortcut icon" href="images/favicon.png">
<!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
<!--
<link rel="canonical" href="http://www.example.com/">
-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium& lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.grey-orange.min.css">
<link rel="stylesheet" href="css/styles_fail.css">
<style>
.botao{
float:right
}
#logar{
width: 100%;
}
.texto{
width: 100%;
}
#show-dialog{
color: #696969;
}
.mdl-dialog {
border: none;
box-shadow: 0 9px 46px 8px rgba(0,0,0,.14), 0 11px 15px -7px rgba(0,0,0,.12), 0 24px 38px 3px rgba(0,0,0,.2);
width: 480px;
}
a {
color: #696969;
font-weight: 500;
text-decoration:none;
}
.grey {
color: #696969;
font-weight: 300;
text-decoration:none;
}
.demo-blog .demo-blog__posts {
max-width: 750px !important;
}
.logo-linkedin{
height: 100px;
width: 100px;
}
.logo-fluig{
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<div class="demo-blog mdl-layout mdl-js-layout has-drawer is-upgraded">
<main class="mdl-layout__content">
<div class="demo-blog__posts mdl-grid">
<div class="mdl-card on-the-road-again mdl-cell mdl-cell--12-col mdl-shadow--2dp">
<!-- <div id="p2" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div> -->
<div class="mdl-card__media mdl-color-text--grey-50">
<h3><a href="entry.html">Ops, algo deu errado!</a></h3>
</div>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--12-col" style="text-align: center;">
<span class="grey"><strong>Desculpe</strong>, infelizmente houve um problema durante a inscrição.</span>
<br>
<span class="grey"><strong>Erro: </strong>
HTML;
$e->getMessage();
echo <<<HTML
</span>
<i class="material-icons" style="font-size: 150px; color: #247dca;">sentiment_very_dissatisfied</i>
</div>
</div>
<hr>
<div class="mdl-card__supporting-text meta mdl-color-text--grey-600">
<i class="material-icons">info_outline</i>
<nav class="demo-nav mdl-cell mdl-cell--12-col">
<a href="index.html" type="button" class="demo-nav__button" style="text-align: justify;">
<b>Clique aqui</b> para tentar novamente.
</a>
</nav>
</div>
</div>
</div>
</main>
<div class="mdl-layout__obfuscator"></div>
</div>
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
</body>
</html>
HTML;
}
?>