-
Notifications
You must be signed in to change notification settings - Fork 0
/
peopledependent.php
206 lines (183 loc) · 5.77 KB
/
peopledependent.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
session_start();
include("groupFunction.php");
include("main_ics_processer.php");
include("databaseconnection.php");
if(!isset($_SESSION['username'])){header('Location: index.php');}
$username=$_SESSION['username'];
$_SESSION['fullName']=gettingNameFromUsername($_SESSION['username']);
$groupID=$_SESSION['groupID'];
?>
<!DOCTYPE html>
<html>
<head>
<!--<title>People Dependent Function</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<title>Cleeque | People Dependent Slots</title>
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<meta name="theme-color" content="#ffffff">
<link type="text/css" rel="stylesheet" href="style.css"></link>
<!---Fonts-->
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
<script>
$(function(){
$('#check').button();
$('input').buttonset();
});
</script>
<style>
input {margin-top: 2em;}
button {background: 'blue';
color: 'navy';}
</style>
</head>
<body>
<div class="modal">
<div class="modal-content">
<div class="modalHeader">
<span class="close"> X </span>
<p id="modalCleeque">CLEEQUE</p>
</div>
<div class="modalBody">
<form method="post">
<input type="text" id="username" placeholder="Username"><br><br>
<input type="password" id="password" placeholder="Password"><br>
<p id="errorMessage" style="color:red"></p>
<input type="submit" name="submit" value="Sign In" id="loginButton">
</form>
<br id="account"> Don't have an account? <a href="signup.php" id="modalSignup">Sign up!</a>
</div>
</div>
</div>
<div class="navbar">
<img id="logo" src="http://i.imgur.com/NXXGa4e.png" height="35" width="35" style="float: left; margin-top: 6.4px;"><p id= "cleeque" style="margin-top:0px;" > CLEEQUE</p>
<div class="menu" style="float:right;">
<div class="mainMenu">
<p><a href="index.php">Home</a></p>
<p><a href="about.php">About</a></p>
</div>
<a id="usernameNav" style="text-decoration:none;" href="logout.php">Log Out</a>
<p id="responsiveNavButton"> ☰ Menu</p>
</div>
</div>
<style>
input.submit[type=submit] {
width: 10%;
background-color: #3498db;
color: white;
padding: 6px 10px;
margin: 8px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-family: "Roboto";
font-size: 15px;
}
input.submit[type=submit]:hover {
background-color: #2b3856;
transition: 0.2s;
color: white;
}
input.member[type=checkbox] select{
font-family: "Roboto";
}
input.return[type=submit] {
width: 10%;
background-color: white;
color: red;
padding: 6px 10px;
border: 1px solid red;
margin: 8px 20px;
border-radius: 4px;
cursor: pointer;
font-family: "Roboto";
font-size: 15px;
}
input.return[type=submit]:hover {
background-color: red;
transition: 0.2s;
color: white;
margin-left: 20px;
}
.groupPeopleDep{
font-size: 20px;
margin: 0px;
margin-bottom: 10px;
background-color: white;
padding: 5px;
color: #3498db;
display: inline-block;
width: 31%;
max-width: 250px;
text-align: center;
border-radius: 7px;
border: 1px solid;
cursor: pointer;
transition: 0.2s;
overflow: hidden;
font-family: "Montserrat";
}
.groupPeopleDep:hover{
background-color: #8ac3f1;
}
.selected{
background-color: #2b3856;
color: white;
}
.selectedForName{
color: #3498db ;
}
</style>
<br><br><p id="selectmember">Select the members:
<form action="<?php echo $_SERVER['PHP_SELF'] ;?>" method="post" name="userChosen">
<?php
$groupMember=gettingGroupMember($_SESSION['groupID']);
foreach($groupMember as $key=>$value){
foreach ($value as $subkey => $userID) {
$name= gettingUsernameFromID($userID);
$fullname = gettingNameFromUsername($name);
echo "<input type='checkbox' class='member' name='userChosen[$name]' value='$userID' id='$name' style='display:none'></input>";
echo "<label for='$name' class='groupPeopleDep'><p style='margin:0;'>$name</p><p class='nameDescription' style='color:#999999'>$fullname</p></label>";
}
}
//echo "<br><br><input type='submit' value='Submit'>";
echo "<br><br><input class='submit' type='submit'>";
echo "</form>";
$_SESSION['groupID']=$groupID;
?>
<form action="addmember.php" method="Get">
<input type="hidden" name="groupNameSelected" value="<?php echo $groupID; ?>">
<input type="hidden" name="submit" value='Go'>
<input class= "return" type="submit" value="Cancel">
</form>
<?php
if(isset($_POST['userChosen'])){
//$freeTimeArray=array();
initialiseWeekArray($freeTimeArray);
foreach($_POST['userChosen'] as $key=>$userID){
initialiseWeekArray($userTimeslotArray);
$filename=gettingFilename($userID);
//echo "Filename for $subvalue is $filename<br>";
$userTimeslotArray=unserialize($filename);
comparison($userTimeslotArray, $freeTimeArray);
}
} else {
echo "<p id='selectmember'>Please choose some users!</p>";
exit();
}
echo "<p id='selectmember'> Common Free Time For Selected Users</p>";
echo '<div class="showTableDiv" style="overflow-x: scroll;">';
$numberOfPeopleSubmitted = count($_POST['userChosen']);
printTableArray($freeTimeArray, $numberOfPeopleSubmitted);
echo '</div>';
?>
</body>
</html>