-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroups.php
131 lines (113 loc) · 3.76 KB
/
groups.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
<?php require_once("config/connect.php"); adminPage(); ?>
<!DOCTYPE html>
<html>
<head>
<?php
$sql = "SELECT * FROM groups";//get ALL groups
$data = mysql_query($sql);
?>
<title>Group Management</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="config/infoBox.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var aboutUs = new infoBox("aboutus", "http://www.wegnerdesign.com", [ "fRight" ]);
$(".menuClose").mouseenter(function() {
$(this).css('background-color', '#112233');
});
$(".menuClose").mouseleave(function() {
$(this).css('background-color', '#172E45');
});
$(".menuClose").click(function() {
$("#menu").slideUp(300);
});
});
function register() {
var group_name = $("#group_name").val();//Group Vars
var open_register = $("#open_register").attr('checked') ? 1 : 0;
var user = $("#user").val();//User Vars
var pass = $("#password").val();
var pass2 = $("#password2").val();
var name = $("#name").val();
var email = $("#email").val();
var phone= $("#phone").val();
//Validation here//
//End Validation//
$.ajax({
type: "POST",
url: "ajaxGroup.php",
data: {"g_name": group_name, "open_register": open_register, "user": user, "pass": pass,
"a_name": name, "email": email, "phone": phone },
success: function(msg) {
$("#menu").slideUp(500);
},
error: function(err, err2, err3) {
alert(err3);
}
});
}
function startCreate() {
$("#menuGroup").children("input").val("");
$("#menuContact").children("input").val("");
$("#menuGroup").css('margin-left', '0px');
$("#menu").slideDown(300);
}
</script>
</head>
<body>
<?php include "header.php"; ?>
<div id="wrapper">
<div id="menu">
<div id="menuContents">
<div class="menuItem" id="menuGroup">
<span class="menuHeader">Group Details</span>
<span class="menuClose">X</span><br>
Group Name:
<input type="text" id="group_name" style="margin-top: 100px; margin-bottom: 30px;" /><br>
Open Registration:
<input type="checkbox" id="open_register"><br>
<span id="current">1/2</span><br>
<span onclick="$('#menuGroup').animate({'margin-left': '-500px'}, 500);" id="menuNext">Next -></span><br>
</div>
<div class="menuItem" id="menuContact">
<span class="menuHeader">Admin Info</span>
<span class="menuClose">X</span><br>
<div style="width: 80%; margin-top: 80px;" class="alignRight">
Username: <input type="text" id="user" name="user" /><br>
Password: <input type="password" id="password" name="password" /><br>
Verify Password: <input type="password" id="password2" name="password2" /><br>
Name: <input type="text" id="name" name="name" /><br>
Email Address: <input type="text" id="email" name="email" /><br>
Phone Number: <input type="text" id="phone" name="phone" /><br>
<span id="current">2/2</span><br>
</div>
<span onClick="register();" id="menuNext">Create Group -></span><br>
</div>
</div>
</div>
<div id="header2">Groups</div>
<button style="margin-top: 10px; margin-bottom: 5px;" onClick="startCreate();">New</button>
<div class="clearboth"></div>
<div id="log2">
<?php if(mysql_num_rows($data) < 1) { ?>
No groups have been created.
<?php } else {
while($row = mysql_fetch_array($data)) {
extract($row, EXTR_PREFIX_ALL, "r");//break into vars
$open = ($r_open_register) ? "Yes" : "No";
?>
<div class="logItem">
<div class="groupDetail">Name: <?php echo $r_name;?></div>
<div class="groupDetail">Code: <?php echo $r_code;?></div>
<div class="groupDetail">Open Registration: <?php echo $open;?></div>
</div>
<?php
}
}
?>
</div>
</div>
<?php include "footer.php"; ?>
</body>
</html>