-
Notifications
You must be signed in to change notification settings - Fork 1
/
group.php
184 lines (132 loc) · 4.18 KB
/
group.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
<?php
ob_start();
session_start();
//error_reporting( E_ALL & ~E_DEPRECATED & ~E_NOTICE );
require_once 'connect.php';
// if session is not set this will redirect to login page
if( !isset($_SESSION['userName']) ) {
header("Location: login.php");
exit;
}else $userName = $_SESSION['userName'];
$id = $_GET['id'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Group</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="assets/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
.btn-floating-container {
right: 80px;
bottom: 80px;
position: fixed;
z-index: 99;
}
.btn-floating {
width: 50px;
height: 50px;
border-radius: 50%;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.2);
border: 1px solid rgba(245, 245, 245, 0.075);
text-align: center;
padding: 0px;
font-size: 24px;
background-color: green;
}
@media (max-width: 768px) {
.btn-floating-container {
right: 40px;
bottom: 40px;
}
}
</style>
</head>
<body>
<a href="logout.php?logout">Sign Out</a></li>
<div id="wrapper">
<div class="container">
<div class="btn-floating-container">
<button class="btn-floating btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm"><i class="fa fa-plus " aria-hidden="true"></i></button>
</div>
<div id="amt"></div>
<div style="width: 40%" >
<table class="table table-condensed table-bordered table-hover table-striped">
<thead>
<tr>
<th>#id</th>
<th>name</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT "
. " users.id, users.name"
. " FROM "
. " users";
//echo($sql);
$result = mysqli_query($link, $sql);
$num_rows = mysqli_num_rows($result);
if($result)if ($result->num_rows ) {
while($row = $result->fetch_array()) {
echo "<tr>";
echo "<td>" . $row["id"] . "</td>";
echo "<td>" . $row["name"] . "</td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<form class="form-horizontal" action="group-ins.php" method="POST">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel2">Add Memner</h4>
</div>
<div class="modal-body">
<div class="form-group">
<input class="form-control" type="text" name="mem">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".cbx").click(function(){
var usr_id = $(this).attr('usrid');
var top_id = $(this).attr('topid');
$.post("process.php",{
usrid: usr_id,
topid: top_id,
cstat: cbstat
},
function(data) {
//alert(data);
//$('#form')[0].reset(); //To reset form fields after submission
$('#alert').fadeTo(2000,500).slideUp(500,function(){ //fade out
$('#alert').addClass('hiden'); //adds a class .hidden
});
});
});
});
</script>
</body>
</html>