-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactnameparttable.php
122 lines (117 loc) · 2.65 KB
/
actnameparttable.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
<?php
session_start();
include_once 'dbconnect.php';
if(!isset($_SESSION['user']))
{
header("Location: index.php");
}
$tabname=$_GET['aptb'];
$actfee=$_GET['apfee'];
$actn=$_GET['apnm'];
if((isset($_POST['bapaid'])))
{
$id=$_POST['bapaid'];
$result=mysqli_query($bd,"UPDATE $tabname SET paid='yes' WHERE id='$id'");
if(!$result)
{
?>
<script>alert('Could not update!');</script>
<?php
}
}
if((isset($_POST['barem'])))
{
$sql_query=mysqli_query($bd,"DELETE FROM $tabname WHERE act_name='$actn' AND paid='no'");
if($sql_query)
{
?>
<script>alert('Removed Successfully!');</script>
<?php
}
else
{
?>
<script>alert('Could not remove!');</script>
<?php
}
}
include 'header.php';
include 'validation.php';
include 'teachersidenavbar.php'; ?>
<div class="col-sm-9">
<div class="main" id="myprofile">
<center>
<h1>Students Participating In <?php echo $actn; ?></h1>
<br /><br />
<?php
if($actfee>0)
{?>
<form method="post">
<button type="submit" class="btn btn-warning" name="barem">Remove All Unpaid Participants</button>
</form>
<br /><br />
<?php
}?>
<div class="table-responsive">
<table class="headtable">
<tr>
<th>Sr No</th>
<th>Participant</th>
<th>Branch</th>
<th>Year</th>
<?php
if($actfee!=0)
{?>
<th>Paid</th>
<?php
}?>
</tr>
<?php
include_once 'dbconnect.php';
$sql_query=mysqli_query($bd,"SELECT * FROM $tabname WHERE act_name='$actn' ORDER BY paid");
$i=1;
if(mysqli_num_rows($sql_query)>0)
{
while($row=mysqli_fetch_row($sql_query))
{?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row[3]; ?></td>
<td><?php echo $row[4]; ?></td>
<td><?php echo $row[5]; ?></td>
<?php
if($actfee>0)
{?>
<td>
<?php
if($row[7]=="no")
{?>
<form method="post">
<button type="submit" name="bapaid" class="btn btn-warning" value="<?php echo $row[0];?>">Paid</button>
</form>
<?php
}
else
{
echo $row[7];
}?>
</td>
<?php
}?>
</tr>
<?php
$i++;
}
}
else
{?>
<tr><td colspan="5">There are no participants!</td></tr>
<?php
}?>
</table>
</div>
</center>
</div>
</div>
</div>
<?php include 'footer.php'; ?>