-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.php
298 lines (258 loc) · 7.44 KB
/
project.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?php
include("config.php");
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["logged"]) || $_SESSION["logged"] !== true)
{
header("location: signin.php");
exit;
}
$id = $_SESSION["username"];
if(isset($_POST['submit'])) {
$pname = $_POST['pname'];
$type = $_POST['type'];
$lang = $_POST['lang'];
$m1 = $_POST['m1'];
$m2 = $_POST['m2'];
$m3 = $_POST['m3'];
$res=mysqli_query($mysqli, "INSERT INTO projects(pname,lang,type) VALUES('$pname','$lang','$type' )")
or die("Could not execute the res query.");
$p=mysqli_query($mysqli, "SELECT pid FROM projects WHERE pname='$pname' ")
or die("Could not execute the pid query.");
$row = mysqli_fetch_row($p);
$pid = $row[0];
$add=mysqli_query($mysqli, "INSERT INTO workson(proj,member) VALUES('$pid','$id')")or die("Could not execute the add query.");
if(mysqli_num_rows(mysqli_query($mysqli, "SELECT uname FROM users WHERE uname='$m1' "))==1) {
$res1=mysqli_query($mysqli, "INSERT INTO workson(proj,member) VALUES('$pid','$m1')")
or alert("Could not execute the res1 query.");
}
if(mysqli_num_rows(mysqli_query($mysqli, "SELECT uname FROM users WHERE uname='$m2' "))==1){
$res2=mysqli_query($mysqli, "INSERT INTO workson(proj,member) VALUES('$pid','$m2')")
or alert("Could not execute the res2 query.");
}
if(mysqli_num_rows(mysqli_query($mysqli, "SELECT uname FROM users WHERE uname='$m3' "))==1){
$res3=mysqli_query($mysqli, "INSERT INTO workson(proj,member) VALUES('$pid','$m3')")
or alert("Could not execute the res3 query.");
}
echo "Registration successfully";
header("Location: editor.php?pid=$pid");
}
else {
echo "Something Went Wrong.";
}
?>
<!DOCTYPE html>
<html>
<!------Head----------->
<head>
<title>Codether</title>
<link href="icon2.png" rel="icon">
<link href="css/style.css" rel="stylesheet" type="text/css">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<!------Style----------->
<style>
form{
margin-top: 3.125em;
border-radius: 1em;
background-color: rgb(0, 0, 0,0.5);
width: 50%;
margin-bottom: 2em;
}
input[type=text], input[type=password], input[type=date] {
width: 100%;
padding: 0.9375em;
margin: 0.3125em 0 1.375em 0;
display: inline-block;
border: none;
background: #f1f1f1;
font-family: Exo;
}
input[type=text]:focus, input[type=password]:focus {
background-color: #ddd;
outline: none;
}
select{
width: 100%;
padding: 0.9375em;
margin: 0.3125em 0 1.375em 0;
display: inline-block;
border: none;
color: #343635;
font-family: Exo;
background: #f1f1f1;
}
hr {
border: 0.0625em solid #f1f1f1;
margin-bottom: 1.5625em;
}
input[type=submit] {
background-color: orange;
color: white;
padding: 0.875em 1.25em;
margin: 0.5em 0;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
font-family: exo;
}
input[type=submit]:hover {
opacity:1;
}
.container {
padding: 1em;
text-align: left;
}
}
</style>
<!------Style----------->
</head>
<!------Body----------->
<body>
<div class="bg"></div>
<div class="bg bg2"></div>
<div class="bg bg3"></div>
<!------Header----------->
<header>
<div class="row">
<!------NavBar----------->
<div class="navbar col-12">
<div class="webname col-m-12 col-8">
<h1>Codether</h1>
</div>
<ul class=" col-m-12 col-4">
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="index.php#aboutsect">About</a>
</li>
<li>
<a href="register.php">Register</a>
</li>
<li>
<a href="signout.php">Log Out</a>
</li>
<li>
<a href="index.php#contactsect">Contact</a>
</li>
</ul>
</div>
</div>
</header>
<!------Div for Align----------->
<div class="col-3"></div>
<!------Form----------->
<form method="post" action="" class="col-m-12 col-6" style="border:0.0625em solid #ccc">
<div class="container">
<h1 style="text-align: center;">Project</h1>
<hr>
<label for="pname"><b>Project Name</b></label> <input name="pname" placeholder="Enter Project Name" required="" type="text">
<!------DropDown----------->
<label for="type"><b>Project Type</b></label> <select name="type" >
<option value=" Mobile Application">
Mobile Application
</option>
<option value="Web Application">
Web Application
</option>
<option value=" Desktop Application">
Desktop Application
</option>
<option value="Database">
Database
</option>
<option value=" Game">
Game
</option>
</select>
<!------DropDown----------->
<label for="lang"><b>Language</b></label> <select name="lang">
<option selected id="js" value="JavaScript">
JavaScript
</option>
<option id="php" value="PHP">
PHP
</option>
<option id="c" value="C">
C
</option>
<option id="cpp" value="C++">
C++
</option>
<option id="html" value="HTML">
Html
</option>
<option id="mysql" value="MySQL">
MySQL
</option>
<option id="css" value="CSS">
CSS
</option>
<option id="ruby" value="Ruby">
Ruby
</option>
<option id="xml" value="XML">
XML
</option>
<option id="python3" value="Python3">
Python3
</option>
<option id="java" value="Java">
Java
</option>
</select>
<label for="team"><b>Team Members</b></label> <input name="m1" placeholder="Add Username of Member 1" type="text">
<input name="m2" placeholder="Add Username of Member 2" type="text">
<input name="m3" placeholder="Add Username of Member 3" type="text">
<div>
<!------Button----------->
<input type="submit" name="submit" id="submit"
value="Create Project">
</div>
</div>
</form>
<!------Footer----------->
<footer class="col-12 col-m-12" id="contactsect">
<div class="row">
<h1>Contact Us</h1>
<!------Table1----------->
<div class=" col-8 tab1">
<table>
<tr>
<td><img src="img/add.png"></td>
<td>Silicon Valley<br>
California, USA</td>
</tr>
<tr>
<td><img src="img/cont.png"></td>
<td>408-920-5006</td>
</tr>
<tr>
<td><img src="img/email.png"></td>
<td>fzulfiqar@codether.co.uk</td>
</tr>
</table>
</div>
<!------Table2----------->
<div class=" col-4 tab2">
<table>
<tr>
<td><img src="img/fb.png"></td>
<td>codether@facebook</td>
</tr>
<tr>
<td><img src="img/twi.png"></td>
<td>codether@twitter</td>
</tr>
<tr>
<td><img src="img/link.png"></td>
<td>codether@linkedin</td>
</tr>
</table>
</div>
</div>
</footer>
</body>
</html>