-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroups.php
More file actions
86 lines (63 loc) · 2.31 KB
/
groups.php
File metadata and controls
86 lines (63 loc) · 2.31 KB
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
<?php
include("includes/header.php");
if(isset($_POST['post'])){
$imageName = $_FILES['fileToUpload']['name'];
//Get the temp file path
$tmpFilePath = $_FILES['fileToUpload']['tmp_name'];
//Make sure we have a file path
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "assets/images/group_cover/" . $_FILES['fileToUpload']['name'];
//Upload the file into the temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
}
$post = new Groups($con, $userLoggedIn);
$post->create_group($userLoggedIn, $newFilePath);
//Handle other code here
}
}
?>
<div class="container">
<div class="user_details column" style="height: 400px; overflow: auto;">
<div class="trends">
<button type="button" class="btn btn-primary" onclick="show();">Create New Group</button>
<div id="groups_form" style="display: none;">
<form action="groups.php" method="POST" enctype="multipart/form-data">
<input type="text" name="groupname" class="form-control" placeholder="Enter Group Name">
<textarea class="form-control" name="groupdes">Add Description</textarea>
<select class="form-control" id="group_type" name="group_type">
<option class="form-control" >Select..</option>
<option value="private">Private</option>
<option value="public">Public</option>
</select>
<div class="image-upload">
<label for="fileToUpload">
<img src="assets/images/backgrounds/plus_sign.png" style="height: 8vh;margin-left: 40px;margin-bottom: 11px;"><br>
<p style="margin-left: 8px;color: turquoise;position:inherit;">Add cover photo</p>
<input type="file" name="fileToUpload" id="fileToUpload" value="post" style="display:block;">
</label>
<br>
<input type="submit" name="post" value="Save">
</div>
</form>
</div>
<br>
<div>Available Groups
<?php
$posts = new Groups($con, $userLoggedIn);
$posts->new_group();
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function show() {
var x = document.getElementById("groups_form");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>