-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrowdfunding.php
103 lines (93 loc) · 4.27 KB
/
crowdfunding.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
<!doctype html5>
<html lang="it">
<head>
<?php
require("navbarhead.php");
?>
<link href="css/carousel.css" rel="stylesheet">
<link href="css/crowdfunding.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php
session_start();
if(empty($_SESSION['id'])){
require_once('navbar.html');
}
elseif($_SESSION['role'] == 'master'){
require_once('master_navbar.html');
}
else{
require_once('logged_navbar.html');
}
require("php/connection.php");
if(!($stmt_select = mysqli_prepare($connection, "SELECT importo FROM Crowdfunding"))){
die("<div class = 'error'>statement select non riuscita</div>");
}
if(!mysqli_stmt_execute($stmt_select)){
die("<div class = 'error'>esecuzione select fallita</div>");
}
if(!($result=mysqli_stmt_get_result($stmt_select))){
die("<div class = 'error'>query non riuscita select<br> <a href=home_page.php>torna alla home_page</a></div>");
}
$i=0;
foreach($result as $e){
$i=$i+$e['importo'];
}
?>
<div class="container">
<section class="section-iniz">
<p>Sostieni Magic Fairy. Grazie al tuo aiuto potremo incominciare a svilluppare il gioco online.</p>
<button id="btnmodale" class="btn">Versa un contributo</button> <!--modal-btn java-->
</section>
<section class="section-progress">
<div class="progress-item">
<div class="digit">€<span id="donato"><?php echo $i;?></span></div><!--total-amount total-target java-->
<div class="digit-text" id="totale-donazioni">di € 100,000 totali</div>
</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</section>
</div>
<!-- Selection Modal Start -->
<section id="modal">
<div class="modal-header">
<h2>Aiuta Magic Fairy </h2>
<p>Rendiamo Magic Fairy un gioco sempre più coinvolgente grazie al tuo aiuto</p>
<button id="close-modal">×</button>
</div>
<div class="finestra-modale">
<form action="php/salva_crowdfunding.php" method="POST" id="form1" nome="invio">
<input id="email" name="email" type="email" class="input" value='<?php if(@$_SESSION['email']){echo (@$_SESSION['email']);}else echo "";?>' onfocusout="validaMail(this.id);"/>
<label id="err_email" class="err_label"></label>
<input type="number" name="importo" id="importo" class="input-bid" id="any-pledge" min="1" placeholder="0" required />
<input type = "text" maxlength="16" minlength="15" id = "cardNumber" name = "cardNumber" class="carta" placeholder="Numero di carta di credito" onfocusout="validaCarta(this.id);"/>
<label id="err_cardNumber" class="err_label"></label>
<br>Scadenza
<input type="date" name ="scad"class="scad" id="scad" onfocusout="valida(this.id);"/>
<input type="text" name ="cvv" maxlength="4" minlength="3" placeholder="CVV" class="cvv" id ="cvv" onfocusout="validaCvv(this.id);"/>
<label id="err_cvv" class="err_label"></label>
Lascia un commento<textarea placeholder="Messaggio..." rows="3" name="msg"></textarea>
<button type="submit" class="continue pay button" id="any-continue" value="invia" onsubmit="validaCrowd()">invia</button>
</form>
</div>
<!-- Success modal start CELLE finestra modale che ringrazia-->
<div id="success-container">
<div id="success-modal">
<img src="img/logod.jpg" id="success-icon">
<h3>Grazie per il supporto</h3>
<button id="final-success">Continua</button>
</div>
</div>
</section>
<!-- Success modal end -->
<!-- Notification modal start -->
<div id="notification-container">
<div id="notification-modal"></div>
</div>
<!-- Notification modal end -->
<script src="js/crowdfunding.js"></script>
<script src="js/checkform.js"></script>
</body>
</html>