-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectForm.php
More file actions
389 lines (341 loc) · 12.5 KB
/
projectForm.php
File metadata and controls
389 lines (341 loc) · 12.5 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
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<?php
session_start ();
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Home</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<!-- Jquery core CSS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="ckeditor/ckeditor.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.form.min.js"></script>
<!-- datepicker -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.min.js"></script>
<!-- projectForm -->
<script src="js/projectForm_functions.js"></script>
<script>
$(document).ready(function() {
var projectId = <?php echo $_POST["projectId"]; ?>;
fillFormData(projectId);
addReward("","","1");
});
</script>
<style type="text/css">
#eventForm .form-control-feedback {
top: 0;
right: -15px;
}
</style>
<!-- Navbar -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="js/navbar.js"></script>
<script src="js/modal.js"></script>
<link href="css/navbar.css" rel="stylesheet">
<script>
var userName;
var user_id;
var userType;
var app = angular.module('myApp', []);
app.controller('searchCtrl', function($scope, $http) {
$http.get("php/getProjects.php").success(function(response) {
$scope.names = response;
$scope.getURL = function(id) {
return "project.php?id=" + id;
}
});
});
$(document).ready(function() {
userType = <?php echo isset($_SESSION['is_auth']) ? $_SESSION['is_auth'] : -1; ?>;
userName = <?php echo isset($_SESSION['name']) ? "'".$_SESSION['name']."'" : "''" ?>;
user_id= <?php echo isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0; ?>;
var link = "index.php";
if( userType == 2 || userType == 3 )
onLogIn(userName, link);
else {
$('#body').html("");
alert("You are not autohirze");
window.location.assign(link);
}
});
</script>
<style>
body {
position: relative;
}
ul.nav-pills {
top: 20%;
position: fixed;
}
div.col-sm-9 div {
height: 250px;
font-size: 28px;
}
</style>
<!-- Custom styles for this template
<link href="jumbotron.css" rel="stylesheet">-->
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>-->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="body" data-spy="scroll" data-target="#myScrollspy" data-offset="20">
<!-- Navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<!-- Navbar Header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Kickstarter Project</a>
</div>
<!-- Navbar Search Area -->
<div class="nav navbar-nav navbar-form">
<div ng-app="myApp" ng-controller="searchCtrl">
<div class="form-group col-md-12">
<div class="searchBoxDropdown input-group col-md-12" style="padding-left: 20px; padding-right: 20px; width:150%;">
<input type="text" ng-model="test" placeholder="Find what interests you most..." id="searchbox" class="form-control dropdown-toggle" data-toggle="dropdown" />
<span class="input-group-btn">
<button class="btn btn-info searchBT" style="border-radius: 4px; margin-left: 0px; cursor: default;">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
<ul class="dropdown-menu col-md-9" style="padding: 2px; margin-left: 20px;">
<li ng-repeat="x in names | filter:test" style="padding-bottom: 2px;">
<a class="well searchDiv" href={{getURL(x.id)}} style="padding: 5px; margin: 0px;">
<img width="50px" src={{x.picture}} /> {{x.name}}
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Navbar Right -->
<div id="navbar" class="navbar-collapse collapse" >
<form class="navbar-form navbar-right"></form>
</div>
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div id="title" class="jumbotron">
<div class="container">
<!-- Page Title -->
<div class="col-md-12 text-center" style="margin-top: 20px;">
<h1 id="FormTitle">Project Creator</h1>
<p>(-: Lets get your project going :-)</p>
<p> ~ Give us the details we need ~ </p>
</div>
<!-- Main Container -->
<div class="col-md-12" style="margin-top: 30px;">
<!-- Left Navigator -->
<nav class="col-sm-3" id="myScrollspy">
<ul class="nav nav-pills nav-stacked"
style="font-size: 19px; left: 6%;">
<li class="active"><a href="#title">Project Name</a></li>
<li><a href="#ShortBlurb">Summary</a></li>
<li><a href="#image">Project Poster</a></li>
<li><a href="#video">Project Video</a></li>
<li><a href="#date">Raise Period</a></li>
<li><a href="#targetPrice">Raise Goal</a></li>
<li><a href="#Rewards">Rewards</a></li>
<li><a href="#description">Project Description</a></li>
<li><a href="#SubmitFinal">Finish</a></li>
</ul>
</nav>
<!-- Form Container -->
<div class="col-md-10" style="float: none; margin: -35px auto;">
<div class="panel panel-default" style="margin: 50px;">
<div class="panel-body">
<form id="productForm" action="php/insertProduct.php" method="post" enctype="multipart/form-data">
<!--Project id -->
<input type="hidden" name="projectId" value="<?php echo $_POST["projectId"]; ?>"/>
<!--Project Name -->
<div id="ShortBlurb" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Project Name</b>
</h5>
</div>
<div class="col-md-9">
<input id="title_input" name="title" type="text" class="form-control"> <br>
</div>
</div>
</div>
</div>
<!--Summary -->
<div id="image" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Summary</b>
</h5>
</div>
<div class="col-md-9">
<textarea id="shortBlurb_input" class="form-control" name="shortBlurb" rows="5" maxlength="135" style="width: 100%;"></textarea>
<br>
</div>
</div>
</div>
</div>
<!--Project Poster -->
<div id="video" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Project Poster </b>
</h5>
</div>
<div class="col-md-9">
<img id="displayImg" class="img-thumbnail" alt="image" width="100%" src="img/no_image.png">
<input id="file_image" class="form-control" type="file" accept="image/*" name="image" />
</div>
</div>
</div>
</div>
<!--Project video -->
<div id="date" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Project video</b>
</h5>
</div>
<div class="col-md-9">
<div class="radio">
<label><input id="URLVideoRB" type="radio" name="videoRB" value="YouTubeVideoRB" checked>URL from YouTube</label>
<input id="URL_Video" class="form-control" name="YouTubeVideo" type="text">
</div>
<div class="radio">
<label><input id="uploudVideoRB" type="radio" name="videoRB" value="FileVideoRB">Upload Video</label>
<input id="file_Video" class="form-control" type="file" accept="video/*" name="FileVideo" />
</div>
</div>
</div>
</div>
</div>
<!--Raise Period -->
<div id="targetPrice" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Raise Period</b>
</h5>
</div>
<div class="col-md-9">
<div class="form-group">
<div class="date">
<div class="input-group input-append date" id="datePicker">
<input id="date_input" type="text" class="form-control" name="date" />
<span class="input-group-addon add-on">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Raise Goal -->
<div id="Rewards" class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Raise Goal</b>
</h5>
</div>
<div class="col-md-9">
<input id="target_input" class="form-control" type="number" name="targetPrice">
</div>
</div>
</div>
</div>
<!--Rewards -->
<div id="description" class="jumbotron">
<div class="container">
<div id="rewardContainer"></div>
<!-- add button -->
<div id="SubmitFinal" class="col-md-12">
<div class="col-md-4"></div>
<input class="col-md-4 btn btn-primary btn-xs"
value="Add Reward" onclick="addReward('','','1')" type="button"
style="height: 25px;" />
<div class="col-md-4"></div>
</div>
</div>
</div>
<!--Project Description -->
<div class="jumbotron">
<div class="container">
<div class="col-md-12">
<div class="col-md-3">
<h5>
<b>Project Description</b>
</h5>
</div>
<div class="col-md-9">
<textarea id="description_input" class="check form-control" name="projectDesc" rows="10" cols="80"></textarea>
</div>
</div>
</div>
</div>
<center>
<input class="btn btn-success" type="submit" value="Finish">
</center>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'description_input', {language: 'en'} );
</script>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog"></div>
<div class="container">
<footer>
<p>© Yakir Giladi & Nir Ostrovski</p>
</footer>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script> -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
-->
</body>
</html>