-
Notifications
You must be signed in to change notification settings - Fork 1
/
fundraiser.php
101 lines (79 loc) · 2.26 KB
/
fundraiser.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
<?php
session_start();
include("header.php");
?>
</header>
<div id="cta" class="section">
<div class="section-bg" style="background-image: url(img/charity/downloadfile.jpg);" data-stellar-background-ratio="0.5"></div>
<div class="container">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="cta-content text-center">
<h1>FUND RAISER</h1>
</div>
</div>
</div>
</div>
</div>
<div id="causes" class="section">
<div class="container">
<div class="row">
<?php
$sql = "SELECT * FROM fund_raiser where status=Active";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
$perc=0;
$sqlfund_collection = "SELECT SUM(paid_amt) FROM fund_collection where fund_raiser_id=$rs[0] AND status=Active";
$qsqlfund_collection = mysqli_query($con,$sqlfund_collection);
$rsfund_collection = mysqli_fetch_array($qsqlfund_collection);
$perc = ($rsfund_collection[0] * 100 / $rs[fund_amount])
?>
<div class="col-md-4">
<div class="causes">
<div class="causes-img">
<a href="funraiserdetailed.php?fund_raiser_id=<?php echo $rs[0]; ?>">
<?php
if($rs[banner_img] == "")
{
echo "<img src=img/no-image-icon.png style=height: 300px;>";
}
else if(file_exists("imgfundraiser/".$rs[banner_img]))
{
echo "<img src=imgfundraiser/".$rs[banner_img]. " style=height: 300px;>";
}
else
{
echo "<img src=img/no-image-icon.png style=height: 300px; >";
}
?>
</a>
</div>
<div class="causes-progress">
<div class="causes-progress-bar">
<div style="width: <?php echo $perc; ?>%;">
<span><?php echo $perc ?>%</span>
</div>
</div>
<div>
<span class="causes-raised">Raised: <strong>₹<?php echo $rsfund_collection[0]; ?></strong></span>
<span class="causes-goal">Goal: <strong>₹<?php echo $rs[fund_amount]; ?></strong></span>
</div>
</div>
<div class="causes-content">
<h3><a href="funraiserdetailed.php?fund_raiser_id=<?php echo $rs[0]; ?>"><?php echo $rs[title]; ?></a></h3>
<p><?php echo $string = substr($rs[fund_raiser_description],0,100)....; ?></p>
<a href="funraiserdetailed.php?fund_raiser_id=<?php echo $rs[0]; ?>" class="primary-button causes-donate">Donate Now</a>
</div>
</div>
</div>
<?php
}
?>
<div class="clearfix visible-md visible-lg"></div>
</div>
</div>
</div>
<?php
include("footer.php");
?>