-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewfund.php
123 lines (108 loc) · 2.33 KB
/
viewfund.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
<?php
session_start();
?>
<?php
include("header.php");
if(!isset($_SESSION[staff_id]))
{
echo "<script>window.location=index.php;</script>";
}
if(isset($_GET[delid]))
{
$sql = "DELETE FROM fund WHERE fund_id=$_GET[delid]";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert(fund record deleted successfully..);</script>";
echo "<script>window.location=viewfund.php;</script>";
}
else
{
echo mysqli_error($con);
}
}
?>
</header>
<div id="about" class="section">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="section-title">
<center><h2 class="title">View Fund</h2></center>
</div>
</div>
</div>
</div>
</div>
<div id="numbers" class="section">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="number">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Banner</th>
<th>Title</th>
<th style=text-align: right;>Fund Amount</th>
<th>Start Date</th>
<th>End Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM fund_raiser";
$qsql = mysqli_query($con,$sql);
while($rs = mysqli_fetch_array($qsql))
{
echo "<tr><td style=text-align: left;>";
if($rs[banner_img] == "")
{
echo "<img src=img/no-image-icon.png style=width: 100px;height: 100px; >";
}
else if(file_exists("imgfundraiser/".$rs[banner_img]))
{
echo "<img src=imgfundraiser/".$rs[banner_img]. " style=width: 100px;height: 100px; >";
}
else
{
echo "<img src=img/no-image-icon.png style=width: 100px;height: 100px; >";
}
echo "</td>
<td style=text-align: left; width: 250px;>$rs[title]</td>
<td style=text-align: right;>₹$rs[fund_amount]</td>
<td>" . date("d-M-Y",strtotime($rs[start_date])) . " </td>
<td>" . date("d-M-Y",strtotime($rs[end_date])) . " </td>
<td>$rs[status]</td>
<td>
<a href=fund.php?editid=$rs[0] class=btn btn-primary >Edit</a>
<a href=viewfund.php?delid=$rs[0] class=btn btn-danger onclick=return confirmdel() >Delete</a>
</td>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php
include("footer.php");
?>
<script>
function confirmdel()
{
if(confirm("Are you sure want to delete this record?") == true)
{
return true;
}
else
{
return false;
}
}
</script>