diff --git a/authenticate.php b/authenticate.php new file mode 100644 index 0000000..b53456b --- /dev/null +++ b/authenticate.php @@ -0,0 +1,17 @@ +query("select * from User where username='$username' and passwd='$pass'"); + $count = $res->num_rows; + if($count == 1){ + session_start(); + $row = $res->fetch_assoc(); + $_SESSION['id'] = $row['id']; + $_SESSION['name'] = $row['Name']; + } + + header("Location:./"); +?> diff --git a/connection.php b/connection.php new file mode 100644 index 0000000..ac8a74c --- /dev/null +++ b/connection.php @@ -0,0 +1,12 @@ + diff --git a/css/bootstrap-modal-bs3patch.css b/css/bootstrap-modal-bs3patch.css new file mode 100755 index 0000000..e4139ed --- /dev/null +++ b/css/bootstrap-modal-bs3patch.css @@ -0,0 +1,35 @@ +/*! + * Bootstrap Modal + * + * Copyright Jordan Schroter + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Boostrap 3 patch for for bootstrap-modal. Include BEFORE bootstrap-modal.css! + */ + +body.modal-open, +.modal-open .navbar-fixed-top, +.modal-open .navbar-fixed-bottom { + margin-right: 0; +} + +.modal { + left: 50%; + bottom: auto; + right: auto; + padding: 0; + width: 500px; + margin-left: -250px; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; +} + +.modal.container { + max-width: none; +} \ No newline at end of file diff --git a/css/bootstrap-modal.css b/css/bootstrap-modal.css new file mode 100755 index 0000000..a59f1fe --- /dev/null +++ b/css/bootstrap-modal.css @@ -0,0 +1,262 @@ +/*! + * Bootstrap Modal + * + * Copyright Jordan Schroter + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +.modal-open { + overflow: hidden; +} + + +/* add a scroll bar to stop page from jerking around */ +.modal-open.page-overflow .page-container, +.modal-open.page-overflow .page-container .navbar-fixed-top, +.modal-open.page-overflow .page-container .navbar-fixed-bottom, +.modal-open.page-overflow .modal-scrollable { + overflow-y: scroll; +} + +@media (max-width: 979px) { + .modal-open.page-overflow .page-container .navbar-fixed-top, + .modal-open.page-overflow .page-container .navbar-fixed-bottom { + overflow-y: visible; + } +} + + +.modal-scrollable { + position: fixed; + top: 0; + bottom: 0; + left: 70px; + right: 0; + overflow: auto; +} + +.modal { + outline: none; + position: absolute; + margin-top: 0; + top: 50%; + overflow: visible; /* allow content to popup out (i.e tooltips) */ +} + +.modal.fade { + top: -100%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out, bottom 0.3s ease-out, margin-top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out, bottom 0.3s ease-out, margin-top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out, bottom 0.3s ease-out, margin-top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out, bottom 0.3s ease-out, margin-top 0.3s ease-out; +} + +.modal.fade.in { + top: 50%; + margin:inherit; +} + +.modal-body { + max-height: none; + overflow: visible; +} + +.modal.modal-absolute { + position: absolute; + z-index: 950; +} + +.modal .loading-mask { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: #fff; + border-radius: 6px; +} + +.modal-backdrop.modal-absolute{ + position: absolute; + z-index: 940; +} + +.modal-backdrop, +.modal-backdrop.fade.in{ + opacity: 0.7; + filter: alpha(opacity=70); + background: #fff; +} + +.modal.container { + width: 940px; + margin-left: -470px; +} + +/* Modal Overflow */ + +.modal-overflow.modal { + top: 1%; +} + +.modal-overflow.modal.fade { + top: -100%; +} + +.modal-overflow.modal.fade.in { + top: 1%; + margin-left:70px!important; + width:280px; + height:450px; + } + +.modal-overflow .modal-body { + overflow: auto; + -webkit-overflow-scrolling: touch; +} + +/* Responsive */ + +@media (min-width: 1200px) { + .modal.container { + width: 1170px; + margin-left: -585px; + } +} + +@media (max-width: 979px) { + .modal, + .modal.container, + .modal.modal-overflow { + top: 1%; + right: 1%; + left: 1%; + bottom: auto; + width: auto !important; + height: auto !important; + margin: 0 !important; + padding: 0 !important; + } + + .modal.fade.in, + .modal.container.fade.in, + .modal.modal-overflow.fade.in { + top: 1%; + bottom: auto; + margin-left:70px; + } + + .modal-body, + .modal-overflow .modal-body { + position: static; + margin: 0; + height: auto !important; + max-height: none !important; + overflow: visible !important; + } + + .modal-footer, + .modal-overflow .modal-footer { + position: static; + } +} + +.loading-spinner { + position: absolute; + top: 50%; + left: 50%; + margin: -12px 0 0 -12px; +} + +/* +Animate.css - http://daneden.me/animate +Licensed under the ☺ license (http://licence.visualidiot.com/) + +Copyright (c) 2012 Dan Eden*/ + +.animated { + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -o-animation-duration: 1s; + animation-duration: 1s; + -webkit-animation-fill-mode: both; + -moz-animation-fill-mode: both; + -o-animation-fill-mode: both; + animation-fill-mode: both; +} + +@-webkit-keyframes shake { + 0%, 100% {-webkit-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-webkit-transform: translateX(10px);} +} + +@-moz-keyframes shake { + 0%, 100% {-moz-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-moz-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-moz-transform: translateX(10px);} +} + +@-o-keyframes shake { + 0%, 100% {-o-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-o-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-o-transform: translateX(10px);} +} + +@keyframes shake { + 0%, 100% {transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {transform: translateX(-10px);} + 20%, 40%, 60%, 80% {transform: translateX(10px);} +} + +.shake { + -webkit-animation-name: shake; + -moz-animation-name: shake; + -o-animation-name: shake; + animation-name: shake; +} + + +.buttonModal { +display: block; +width: 125px; +height: 25px; +background: #DBD0DB; +padding: 10px; +text-align: center; +border-radius: 5px; +color: rgb(147,45,151); +font-size:medium; +padding-bottom:30px; +} + +.buttonImageModal { +display: block; +height: 25px; +background: #DBD0DB; +padding: 10px; +text-align: center; +border-radius: 5px; +color: rgb(147,45,151); +font-size:medium; +padding-bottom:30px; +} + +.buttonColorModal { +display: inline; +width: 115px; +height: 25px; +background: #DBD0DB; +padding: 5px; +text-align: center; +border-radius: 10px; +color: rgb(147,45,151); +font-size:larger; +padding-bottom:12px; +} + +.modalImageSlider{ +width:800px; +} diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..3bc9455 --- /dev/null +++ b/css/index.css @@ -0,0 +1,39 @@ +#top-bar{ + background-color:black; + color:white; +} + +#myModal{ + left:20%; + top:34%; +} + +#joinModal{ + left:20%; + top:34%; +} +#reportModal{ + left:20%; + top:34%; +} +@media (max-width: 979px){ + #myModal{ + top:10%; + left:0%; + } + #joinModal{ + top:10%; + left:0%; + } + #reportModal{ + top:10%; + left:0%; + } + .modal-scrollable{ + left:0px; + } + .modal { + + } +} + diff --git a/event.php b/event.php new file mode 100644 index 0000000..3409c52 --- /dev/null +++ b/event.php @@ -0,0 +1,43 @@ +query("select * from spotfixevents where id = " . $eventid); +$count = $res->num_rows; +if($count == 1){ + $row = $res->fetch_assoc(); + echo "
"; + echo "
"; + echo "
". $row['description']."
"; + echo "
"; + echo "
Latitude : ". $row['latitude'] . ", Longitude : ". $row['longitude'] . "
"; + echo "
Address : " . $row['address'] . "
"; + $res1 = $con->query("select * from spotfixattendees where eventid=" . $eventid); + $attendCount = $res1->num_rows; + echo "
Number of attendees : $attendCount
"; + if($row['isreported'] == 1){ + echo "
Status : Reported
"; + $res_for_report = $con->query("select * from spotfixreports where eventid=".$eventid); + $row = $res_for_report->fetch_assoc(); + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
Before Pic
After Pic
"; + echo "
Description of the fix : " . $row['Description'] . "
"; + } else { + $res1 = $con->query("select * from spotfixattendees where userid = " . $userid . " and eventid=" . $eventid); + $count1 = $res1->num_rows; + if($count1 == 1){ + echo "
Status : Joined
"; + } else { + echo "
Status : Available TO Join
"; + } + } + + echo "
"; + +} +?> diff --git a/flow.pdf b/flow.pdf new file mode 100644 index 0000000..e83ac82 Binary files /dev/null and b/flow.pdf differ diff --git a/images/bg.jpg b/images/bg.jpg new file mode 100644 index 0000000..564ad48 Binary files /dev/null and b/images/bg.jpg differ diff --git a/images/home.png b/images/home.png new file mode 100644 index 0000000..1ecf4ba Binary files /dev/null and b/images/home.png differ diff --git a/img/ajax-loader.gif b/img/ajax-loader.gif new file mode 100755 index 0000000..4e651ed Binary files /dev/null and b/img/ajax-loader.gif differ diff --git a/img/available.png b/img/available.png new file mode 100644 index 0000000..f28ef78 Binary files /dev/null and b/img/available.png differ diff --git a/img/facebook-icon.png b/img/facebook-icon.png new file mode 100644 index 0000000..6a21d93 Binary files /dev/null and b/img/facebook-icon.png differ diff --git a/img/x-mark-13.png b/img/x-mark-13.png new file mode 100644 index 0000000..d951fbe Binary files /dev/null and b/img/x-mark-13.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..9a1888a --- /dev/null +++ b/index.php @@ -0,0 +1,228 @@ + + + + + + + + SpotFix + + + + + + + + + + + + + + + +
+
Welcome !!!
+
+ + + + + +
+
+
+ + + + + + + + + + + +
+
+ + + + +
Username :
Password :
+
+
+ + + + + diff --git a/join.php b/join.php new file mode 100644 index 0000000..0dbcfb0 --- /dev/null +++ b/join.php @@ -0,0 +1,56 @@ +query("select * from spotfixevents where id NOT IN(select eventid from spotfixattendees where userid=" . $userid . ")"); + while($row = $res->fetch_assoc()){ + $distArray[] = distance($homelat, $homelon, $row['latitude'], $row['longitude'], $row); + } + usort($distArray, "comp"); + $outputArray = array(); + $i = 0; + foreach($distArray as $val){ + if($i < 5){ + $outputArray[] = $val; + } + $i++; + } + echo json_encode($outputArray); +} +if(isset($_GET['join'])) { + session_start(); + $eventid = $_GET['id']; + $userid = $_SESSION['id']; + include("./connection.php"); + $con = connection :: getConnection(); + $stmt = $con->prepare("insert into spotfixattendees values(NULL,?,?)"); + $stmt->bind_param("ii", $eventid, $userid); + $stmt->execute(); + $lastid = $con->insert_id; + if($lastid > 0){ + echo 1; + } else { + echo 0; + } + +} + +?> diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js new file mode 100755 index 0000000..97c684e --- /dev/null +++ b/js/bootstrap-modal.js @@ -0,0 +1,379 @@ +/* =========================================================== + * bootstrap-modal.js v2.2.3 + * =========================================================== + * Copyright 2012 Jordan Schroter + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + /* MODAL CLASS DEFINITION + * ====================== */ + + var Modal = function (element, options) { + this.init(element, options); + }; + + Modal.prototype = { + + constructor: Modal, + + init: function (element, options) { + var that = this; + + this.options = options; + + this.$element = $(element) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)); + + this.options.remote && this.$element.find('.modal-body').load(this.options.remote, function () { + var e = $.Event('loaded'); + that.$element.trigger(e); + }); + + var manager = typeof this.options.manager === 'function' ? + this.options.manager.call(this) : this.options.manager; + + manager = manager.appendModal ? + manager : $(manager).modalmanager().data('modalmanager'); + + manager.appendModal(this); + }, + + toggle: function () { + return this[!this.isShown ? 'show' : 'hide'](); + }, + + show: function () { + var e = $.Event('show'); + + if (this.isShown) return; + + this.$element.trigger(e); + + if (e.isDefaultPrevented()) return; + + this.escape(); + + this.tab(); + + this.options.loading && this.loading(); + }, + + hide: function (e) { + e && e.preventDefault(); + + e = $.Event('hide'); + + this.$element.trigger(e); + + if (!this.isShown || e.isDefaultPrevented()) return (this.isShown = false); + + this.isShown = false; + + this.escape(); + + this.tab(); + + this.isLoading && this.loading(); + + $(document).off('focusin.modal'); + + this.$element + .removeClass('in') + .removeClass('animated') + .removeClass(this.options.attentionAnimation) + .removeClass('modal-overflow') + .attr('aria-hidden', true); + + $.support.transition && this.$element.hasClass('fade') ? + this.hideWithTransition() : + this.hideModal(); + }, + + layout: function () { + var prop = this.options.height ? 'height' : 'max-height', + value = this.options.height || this.options.maxHeight; + + if (this.options.width){ + this.$element.css('width', this.options.width); + + var that = this; + this.$element.css('margin-left', function () { + if (/%/ig.test(that.options.width)){ + return -(parseInt(that.options.width) / 2) + '%'; + } else { + return -($(this).width() / 2) + 'px'; + } + }); + } else { + this.$element.css('width', ''); + this.$element.css('margin-left', ''); + } + + this.$element.find('.modal-body') + .css('overflow', '') + .css(prop, ''); + + if (value){ + this.$element.find('.modal-body') + .css('overflow', 'auto') + .css(prop, value); + } + + var modalOverflow = $(window).height() - 10 < this.$element.height(); + + if (modalOverflow || this.options.modalOverflow) { + this.$element + .css('margin-top', 0) + .addClass('modal-overflow'); + } else { + this.$element + .css('margin-top', 0 - this.$element.height() / 2) + .removeClass('modal-overflow'); + } + }, + + tab: function () { + var that = this; + + if (this.isShown && this.options.consumeTab) { + this.$element.on('keydown.tabindex.modal', '[data-tabindex]', function (e) { + if (e.keyCode && e.keyCode == 9){ + var $next = $(this), + $rollover = $(this); + + that.$element.find('[data-tabindex]:enabled:not([readonly])').each(function (e) { + if (!e.shiftKey){ + $next = $next.data('tabindex') < $(this).data('tabindex') ? + $next = $(this) : + $rollover = $(this); + } else { + $next = $next.data('tabindex') > $(this).data('tabindex') ? + $next = $(this) : + $rollover = $(this); + } + }); + + $next[0] !== $(this)[0] ? + $next.focus() : $rollover.focus(); + + e.preventDefault(); + } + }); + } else if (!this.isShown) { + this.$element.off('keydown.tabindex.modal'); + } + }, + + escape: function () { + var that = this; + if (this.isShown && this.options.keyboard) { + if (!this.$element.attr('tabindex')) this.$element.attr('tabindex', -1); + + this.$element.on('keyup.dismiss.modal', function (e) { + e.which == 27 && that.hide(); + }); + } else if (!this.isShown) { + this.$element.off('keyup.dismiss.modal') + } + }, + + hideWithTransition: function () { + var that = this + , timeout = setTimeout(function () { + that.$element.off($.support.transition.end); + that.hideModal(); + }, 500); + + this.$element.one($.support.transition.end, function () { + clearTimeout(timeout); + that.hideModal(); + }); + }, + + hideModal: function () { + var prop = this.options.height ? 'height' : 'max-height'; + var value = this.options.height || this.options.maxHeight; + + if (value){ + this.$element.find('.modal-body') + .css('overflow', '') + .css(prop, ''); + } + + this.$element + .hide() + .trigger('hidden'); + }, + + removeLoading: function () { + this.$loading.remove(); + this.$loading = null; + this.isLoading = false; + }, + + loading: function (callback) { + callback = callback || function () {}; + + var animate = this.$element.hasClass('fade') ? 'fade' : ''; + + if (!this.isLoading) { + var doAnimate = $.support.transition && animate; + + this.$loading = $('
') + .append(this.options.spinner) + .appendTo(this.$element); + + if (doAnimate) this.$loading[0].offsetWidth; // force reflow + + this.$loading.addClass('in'); + + this.isLoading = true; + + doAnimate ? + this.$loading.one($.support.transition.end, callback) : + callback(); + + } else if (this.isLoading && this.$loading) { + this.$loading.removeClass('in'); + + var that = this; + $.support.transition && this.$element.hasClass('fade')? + this.$loading.one($.support.transition.end, function () { that.removeLoading() }) : + that.removeLoading(); + + } else if (callback) { + callback(this.isLoading); + } + }, + + focus: function () { + var $focusElem = this.$element.find(this.options.focusOn); + + $focusElem = $focusElem.length ? $focusElem : this.$element; + + $focusElem.focus(); + }, + + attention: function (){ + // NOTE: transitionEnd with keyframes causes odd behaviour + + if (this.options.attentionAnimation){ + this.$element + .removeClass('animated') + .removeClass(this.options.attentionAnimation); + + var that = this; + + setTimeout(function () { + that.$element + .addClass('animated') + .addClass(that.options.attentionAnimation); + }, 0); + } + + + this.focus(); + }, + + + destroy: function () { + var e = $.Event('destroy'); + this.$element.trigger(e); + if (e.isDefaultPrevented()) return; + + this.teardown(); + }, + + teardown: function () { + if (!this.$parent.length){ + this.$element.remove(); + this.$element = null; + return; + } + + if (this.$parent !== this.$element.parent()){ + this.$element.appendTo(this.$parent); + } + + this.$element.off('.modal'); + this.$element.removeData('modal'); + this.$element + .removeClass('in') + .attr('aria-hidden', true); + } + }; + + + /* MODAL PLUGIN DEFINITION + * ======================= */ + + $.fn.modal = function (option, args) { + return this.each(function () { + var $this = $(this), + data = $this.data('modal'), + options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option); + + if (!data) $this.data('modal', (data = new Modal(this, options))); + if (typeof option == 'string') data[option].apply(data, [].concat(args)); + else if (options.show) data.show() + }) + }; + + $.fn.modal.defaults = { + keyboard: true, + backdrop: true, + loading: false, + show: true, + width: null, + height: null, + maxHeight: null, + modalOverflow: false, + consumeTab: true, + focusOn: null, + replace: false, + resize: false, + attentionAnimation: 'shake', + manager: 'body', + spinner: '
', + backdropTemplate: '