");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'
',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('
![]()
').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
--------------------------------------------------------------------------------
/assets/js/jquery.meanmenu.min.js:
--------------------------------------------------------------------------------
1 | !function($){"use strict";$.fn.meanmenu=function(e){var n={meanMenuTarget:jQuery(this),meanMenuContainer:"body",meanMenuClose:"X",meanMenuCloseSize:"18px",meanMenuOpen:"
",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"",meanScreenWidth:"480",meanNavPush:"",meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,meanDisplay:"block",removeElements:""};e=$.extend(n,e);var a=window.innerWidth||document.documentElement.clientWidth;return this.each(function(){var n=e.meanMenuTarget,t=e.meanMenuContainer,r=e.meanMenuClose,i=e.meanMenuCloseSize,s=e.meanMenuOpen,u=e.meanRevealPosition,m=e.meanRevealPositionDistance,l=e.meanRevealColour,o=e.meanScreenWidth,c=e.meanNavPush,v=".meanmenu-reveal",h=e.meanShowChildren,d=e.meanExpandableChildren,y=e.meanExpand,j=e.meanContract,Q=e.meanRemoveAttrs,f=e.onePage,g=e.meanDisplay,p=e.removeElements,C=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/Blackberry/i)||navigator.userAgent.match(/Windows Phone/i))&&(C=!0),(navigator.userAgent.match(/MSIE 8/i)||navigator.userAgent.match(/MSIE 7/i))&&jQuery("html").css("overflow-y","scroll");var w="",x=function(){if("center"===u){var e=window.innerWidth||document.documentElement.clientWidth,n=e/2-22+"px";w="left:"+n+";right:auto;",C?jQuery(".meanmenu-reveal").animate({left:n}):jQuery(".meanmenu-reveal").css("left",n)}},A=!1,E=!1;"right"===u&&(w="right:"+m+";left:auto;"),"left"===u&&(w="left:"+m+";right:auto;"),x();var M="",P=function(){M.html(jQuery(M).is(".meanmenu-reveal.meanclose")?r:s)},W=function(){jQuery(".mean-bar,.mean-push").remove(),jQuery(t).removeClass("mean-container"),jQuery(n).css("display",g),A=!1,E=!1,jQuery(p).removeClass("mean-remove")},b=function(){var e="background:"+l+";color:"+l+";"+w;if(o>=a){jQuery(p).addClass("mean-remove"),E=!0,jQuery(t).addClass("mean-container"),jQuery(".mean-container").prepend('
');var r=jQuery(n).html();jQuery(".mean-nav").html(r),Q&&jQuery("nav.mean-nav ul, nav.mean-nav ul *").each(function(){jQuery(this).is(".mean-remove")?jQuery(this).attr("class","mean-remove"):jQuery(this).removeAttr("class"),jQuery(this).removeAttr("id")}),jQuery(n).before('
'),jQuery(".mean-push").css("margin-top",c),jQuery(n).hide(),jQuery(".meanmenu-reveal").show(),jQuery(v).html(s),M=jQuery(v),jQuery(".mean-nav ul").hide(),h?d?(jQuery(".mean-nav ul ul").each(function(){jQuery(this).children().length&&jQuery(this,"li:first").parent().append('
'+y+"")}),jQuery(".mean-expand").on("click",function(e){e.preventDefault(),jQuery(this).hasClass("mean-clicked")?(jQuery(this).text(y),jQuery(this).prev("ul").slideUp(300,function(){})):(jQuery(this).text(j),jQuery(this).prev("ul").slideDown(300,function(){})),jQuery(this).toggleClass("mean-clicked")})):jQuery(".mean-nav ul ul").show():jQuery(".mean-nav ul ul").hide(),jQuery(".mean-nav ul li").last().addClass("mean-last"),M.removeClass("meanclose"),jQuery(M).click(function(e){e.preventDefault(),A===!1?(M.css("text-align","center"),M.css("text-indent","0"),M.css("font-size",i),jQuery(".mean-nav ul:first").slideDown(),A=!0):(jQuery(".mean-nav ul:first").slideUp(),A=!1),M.toggleClass("meanclose"),P(),jQuery(p).addClass("mean-remove")}),f&&jQuery(".mean-nav ul > li > a:first-child").on("click",function(){jQuery(".mean-nav ul:first").slideUp(),A=!1,jQuery(M).toggleClass("meanclose").html(s)})}else W()};C||jQuery(window).resize(function(){a=window.innerWidth||document.documentElement.clientWidth,a>o,W(),o>=a?(b(),x()):W()}),jQuery(window).resize(function(){a=window.innerWidth||document.documentElement.clientWidth,C?(x(),o>=a?E===!1&&b():W()):(W(),o>=a&&(b(),x()))}),b()})}}(jQuery);
--------------------------------------------------------------------------------
/assets/js/main.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | "use strict";
3 |
4 | $(document).ready(function($){
5 |
6 | // testimonial sliders
7 | $(".testimonial-sliders").owlCarousel({
8 | items: 1,
9 | loop: true,
10 | autoplay: true,
11 | responsive:{
12 | 0:{
13 | items:1,
14 | nav:false
15 | },
16 | 600:{
17 | items:1,
18 | nav:false
19 | },
20 | 1000:{
21 | items:1,
22 | nav:false,
23 | loop:true
24 | }
25 | }
26 | });
27 |
28 | // homepage slider
29 | $(".homepage-slider").owlCarousel({
30 | items: 1,
31 | loop: true,
32 | autoplay: true,
33 | nav: true,
34 | dots: false,
35 | navText: ['
', '
'],
36 | responsive:{
37 | 0:{
38 | items:1,
39 | nav:false,
40 | loop:true
41 | },
42 | 600:{
43 | items:1,
44 | nav:true,
45 | loop:true
46 | },
47 | 1000:{
48 | items:1,
49 | nav:true,
50 | loop:true
51 | }
52 | }
53 | });
54 |
55 | // logo carousel
56 | $(".logo-carousel-inner").owlCarousel({
57 | items: 4,
58 | loop: true,
59 | autoplay: true,
60 | margin: 30,
61 | responsive:{
62 | 0:{
63 | items:1,
64 | nav:false
65 | },
66 | 600:{
67 | items:3,
68 | nav:false
69 | },
70 | 1000:{
71 | items:4,
72 | nav:false,
73 | loop:true
74 | }
75 | }
76 | });
77 |
78 | // count down
79 | if($('.time-countdown').length){
80 | $('.time-countdown').each(function() {
81 | var $this = $(this), finalDate = $(this).data('countdown');
82 | $this.countdown(finalDate, function(event) {
83 | var $this = $(this).html(event.strftime('' + '
' + '
' + '
' + '
'));
84 | });
85 | });
86 | }
87 |
88 | // projects filters isotop
89 | $(".product-filters li").on('click', function () {
90 |
91 | $(".product-filters li").removeClass("active");
92 | $(this).addClass("active");
93 |
94 | var selector = $(this).attr('data-filter');
95 |
96 | $(".product-lists").isotope({
97 | filter: selector,
98 | });
99 |
100 | });
101 |
102 | // isotop inner
103 | $(".product-lists").isotope();
104 |
105 | // magnific popup
106 | $('.popup-youtube').magnificPopup({
107 | disableOn: 700,
108 | type: 'iframe',
109 | mainClass: 'mfp-fade',
110 | removalDelay: 160,
111 | preloader: false,
112 | fixedContentPos: false
113 | });
114 |
115 | // light box
116 | $('.image-popup-vertical-fit').magnificPopup({
117 | type: 'image',
118 | closeOnContentClick: true,
119 | mainClass: 'mfp-img-mobile',
120 | image: {
121 | verticalFit: true
122 | }
123 | });
124 |
125 | // homepage slides animations
126 | $(".homepage-slider").on("translate.owl.carousel", function(){
127 | $(".hero-text-tablecell .subtitle").removeClass("animated fadeInUp").css({'opacity': '0'});
128 | $(".hero-text-tablecell h1").removeClass("animated fadeInUp").css({'opacity': '0', 'animation-delay' : '0.3s'});
129 | $(".hero-btns").removeClass("animated fadeInUp").css({'opacity': '0', 'animation-delay' : '0.5s'});
130 | });
131 |
132 | $(".homepage-slider").on("translated.owl.carousel", function(){
133 | $(".hero-text-tablecell .subtitle").addClass("animated fadeInUp").css({'opacity': '0'});
134 | $(".hero-text-tablecell h1").addClass("animated fadeInUp").css({'opacity': '0', 'animation-delay' : '0.3s'});
135 | $(".hero-btns").addClass("animated fadeInUp").css({'opacity': '0', 'animation-delay' : '0.5s'});
136 | });
137 |
138 |
139 |
140 | // stikcy js
141 | $("#sticker").sticky({
142 | topSpacing: 0
143 | });
144 |
145 | //mean menu
146 | $('.main-menu').meanmenu({
147 | meanMenuContainer: '.mobile-menu',
148 | meanScreenWidth: "992"
149 | });
150 |
151 | // search form
152 | $(".search-bar-icon").on("click", function(){
153 | $(".search-area").addClass("search-active");
154 | });
155 |
156 | $(".close-btn").on("click", function() {
157 | $(".search-area").removeClass("search-active");
158 | });
159 |
160 | });
161 |
162 |
163 | jQuery(window).on("load",function(){
164 | jQuery(".loader").fadeOut(1000);
165 | });
166 |
167 |
168 | }(jQuery));
--------------------------------------------------------------------------------
/assets/js/sticker.js:
--------------------------------------------------------------------------------
1 | // Sticky Plugin v1.0.4 for jQuery
2 | // =============
3 | // Author: Anthony Garand
4 | // Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
5 | // Improvements by Leonardo C. Daronco (daronco)
6 | // Created: 02/14/2011
7 | // Date: 07/20/2015
8 | // Website: http://stickyjs.com/
9 | // Description: Makes an element on the page stick on the screen as you scroll
10 | // It will only set the 'top' and 'position' of your element, you
11 | // might need to adjust the width in some cases.
12 |
13 | (function (factory) {
14 | if (typeof define === 'function' && define.amd) {
15 | // AMD. Register as an anonymous module.
16 | define(['jquery'], factory);
17 | } else if (typeof module === 'object' && module.exports) {
18 | // Node/CommonJS
19 | module.exports = factory(require('jquery'));
20 | } else {
21 | // Browser globals
22 | factory(jQuery);
23 | }
24 | }(function ($) {
25 | var slice = Array.prototype.slice; // save ref to original slice()
26 | var splice = Array.prototype.splice; // save ref to original slice()
27 |
28 | var defaults = {
29 | topSpacing: 0,
30 | bottomSpacing: 0,
31 | className: 'is-sticky',
32 | wrapperClassName: 'sticky-wrapper',
33 | center: false,
34 | getWidthFrom: '',
35 | widthFromWrapper: true, // works only when .getWidthFrom is empty
36 | responsiveWidth: false,
37 | zIndex: 'inherit'
38 | },
39 | $window = $(window),
40 | $document = $(document),
41 | sticked = [],
42 | windowHeight = $window.height(),
43 | scroller = function() {
44 | var scrollTop = $window.scrollTop(),
45 | documentHeight = $document.height(),
46 | dwh = documentHeight - windowHeight,
47 | extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
48 |
49 | for (var i = 0, l = sticked.length; i < l; i++) {
50 | var s = sticked[i],
51 | elementTop = s.stickyWrapper.offset().top,
52 | etse = elementTop - s.topSpacing - extra;
53 |
54 | //update height in case of dynamic content
55 | s.stickyWrapper.css('height', s.stickyElement.outerHeight());
56 |
57 | if (scrollTop <= etse) {
58 | if (s.currentTop !== null) {
59 | s.stickyElement
60 | .css({
61 | 'width': '',
62 | 'position': '',
63 | 'top': '',
64 | 'z-index': ''
65 | });
66 | s.stickyElement.parent().removeClass(s.className);
67 | s.stickyElement.trigger('sticky-end', [s]);
68 | s.currentTop = null;
69 | }
70 | }
71 | else {
72 | var newTop = documentHeight - s.stickyElement.outerHeight()
73 | - s.topSpacing - s.bottomSpacing - scrollTop - extra;
74 | if (newTop < 0) {
75 | newTop = newTop + s.topSpacing;
76 | } else {
77 | newTop = s.topSpacing;
78 | }
79 | if (s.currentTop !== newTop) {
80 | var newWidth;
81 | if (s.getWidthFrom) {
82 | padding = s.stickyElement.innerWidth() - s.stickyElement.width();
83 | newWidth = $(s.getWidthFrom).width() - padding || null;
84 | } else if (s.widthFromWrapper) {
85 | newWidth = s.stickyWrapper.width();
86 | }
87 | if (newWidth == null) {
88 | newWidth = s.stickyElement.width();
89 | }
90 | s.stickyElement
91 | .css('width', newWidth)
92 | .css('position', 'fixed')
93 | .css('top', newTop)
94 | .css('z-index', s.zIndex);
95 |
96 | s.stickyElement.parent().addClass(s.className);
97 |
98 | if (s.currentTop === null) {
99 | s.stickyElement.trigger('sticky-start', [s]);
100 | } else {
101 | // sticky is started but it have to be repositioned
102 | s.stickyElement.trigger('sticky-update', [s]);
103 | }
104 |
105 | if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
106 | // just reached bottom || just started to stick but bottom is already reached
107 | s.stickyElement.trigger('sticky-bottom-reached', [s]);
108 | } else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
109 | // sticky is started && sticked at topSpacing && overflowing from top just finished
110 | s.stickyElement.trigger('sticky-bottom-unreached', [s]);
111 | }
112 |
113 | s.currentTop = newTop;
114 | }
115 |
116 | // Check if sticky has reached end of container and stop sticking
117 | var stickyWrapperContainer = s.stickyWrapper.parent();
118 | var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing);
119 |
120 | if( unstick ) {
121 | s.stickyElement
122 | .css('position', 'absolute')
123 | .css('top', '')
124 | .css('bottom', 0)
125 | .css('z-index', '');
126 | } else {
127 | s.stickyElement
128 | .css('position', 'fixed')
129 | .css('top', newTop)
130 | .css('bottom', '')
131 | .css('z-index', s.zIndex);
132 | }
133 | }
134 | }
135 | },
136 | resizer = function() {
137 | windowHeight = $window.height();
138 |
139 | for (var i = 0, l = sticked.length; i < l; i++) {
140 | var s = sticked[i];
141 | var newWidth = null;
142 | if (s.getWidthFrom) {
143 | if (s.responsiveWidth) {
144 | newWidth = $(s.getWidthFrom).width();
145 | }
146 | } else if(s.widthFromWrapper) {
147 | newWidth = s.stickyWrapper.width();
148 | }
149 | if (newWidth != null) {
150 | s.stickyElement.css('width', newWidth);
151 | }
152 | }
153 | },
154 | methods = {
155 | init: function(options) {
156 | return this.each(function() {
157 | var o = $.extend({}, defaults, options);
158 | var stickyElement = $(this);
159 |
160 | var stickyId = stickyElement.attr('id');
161 | var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
162 | var wrapper = $('
')
163 | .attr('id', wrapperId)
164 | .addClass(o.wrapperClassName);
165 |
166 | stickyElement.wrapAll(function() {
167 | if ($(this).parent("#" + wrapperId).length == 0) {
168 | return wrapper;
169 | }
170 | });
171 |
172 | var stickyWrapper = stickyElement.parent();
173 |
174 | if (o.center) {
175 | stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
176 | }
177 |
178 | if (stickyElement.css("float") === "right") {
179 | stickyElement.css({"float":"none"}).parent().css({"float":"right"});
180 | }
181 |
182 | o.stickyElement = stickyElement;
183 | o.stickyWrapper = stickyWrapper;
184 | o.currentTop = null;
185 |
186 | sticked.push(o);
187 |
188 | methods.setWrapperHeight(this);
189 | methods.setupChangeListeners(this);
190 | });
191 | },
192 |
193 | setWrapperHeight: function(stickyElement) {
194 | var element = $(stickyElement);
195 | var stickyWrapper = element.parent();
196 | if (stickyWrapper) {
197 | stickyWrapper.css('height', element.outerHeight());
198 | }
199 | },
200 |
201 | setupChangeListeners: function(stickyElement) {
202 | if (window.MutationObserver) {
203 | var mutationObserver = new window.MutationObserver(function(mutations) {
204 | if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) {
205 | methods.setWrapperHeight(stickyElement);
206 | }
207 | });
208 | mutationObserver.observe(stickyElement, {subtree: true, childList: true});
209 | } else {
210 | if (window.addEventListener) {
211 | stickyElement.addEventListener('DOMNodeInserted', function() {
212 | methods.setWrapperHeight(stickyElement);
213 | }, false);
214 | stickyElement.addEventListener('DOMNodeRemoved', function() {
215 | methods.setWrapperHeight(stickyElement);
216 | }, false);
217 | } else if (window.attachEvent) {
218 | stickyElement.attachEvent('onDOMNodeInserted', function() {
219 | methods.setWrapperHeight(stickyElement);
220 | });
221 | stickyElement.attachEvent('onDOMNodeRemoved', function() {
222 | methods.setWrapperHeight(stickyElement);
223 | });
224 | }
225 | }
226 | },
227 | update: scroller,
228 | unstick: function(options) {
229 | return this.each(function() {
230 | var that = this;
231 | var unstickyElement = $(that);
232 |
233 | var removeIdx = -1;
234 | var i = sticked.length;
235 | while (i-- > 0) {
236 | if (sticked[i].stickyElement.get(0) === that) {
237 | splice.call(sticked,i,1);
238 | removeIdx = i;
239 | }
240 | }
241 | if(removeIdx !== -1) {
242 | unstickyElement.unwrap();
243 | unstickyElement
244 | .css({
245 | 'width': '',
246 | 'position': '',
247 | 'top': '',
248 | 'float': '',
249 | 'z-index': ''
250 | })
251 | ;
252 | }
253 | });
254 | }
255 | };
256 |
257 | // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
258 | if (window.addEventListener) {
259 | window.addEventListener('scroll', scroller, false);
260 | window.addEventListener('resize', resizer, false);
261 | } else if (window.attachEvent) {
262 | window.attachEvent('onscroll', scroller);
263 | window.attachEvent('onresize', resizer);
264 | }
265 |
266 | $.fn.sticky = function(method) {
267 | if (methods[method]) {
268 | return methods[method].apply(this, slice.call(arguments, 1));
269 | } else if (typeof method === 'object' || !method ) {
270 | return methods.init.apply( this, arguments );
271 | } else {
272 | $.error('Method ' + method + ' does not exist on jQuery.sticky');
273 | }
274 | };
275 |
276 | $.fn.unstick = function(method) {
277 | if (methods[method]) {
278 | return methods[method].apply(this, slice.call(arguments, 1));
279 | } else if (typeof method === 'object' || !method ) {
280 | return methods.unstick.apply( this, arguments );
281 | } else {
282 | $.error('Method ' + method + ' does not exist on jQuery.sticky');
283 | }
284 | };
285 | $(function() {
286 | setTimeout(scroller, 0);
287 | });
288 | }));
289 |
--------------------------------------------------------------------------------
/assets/js/waypoints.js:
--------------------------------------------------------------------------------
1 | // Generated by CoffeeScript 1.6.2
2 | /*
3 | jQuery Waypoints - v2.0.3
4 | Copyright (c) 2011-2013 Caleb Troughton
5 | Dual licensed under the MIT license and GPL license.
6 | https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
7 | */
8 | (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e
=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
--------------------------------------------------------------------------------
/assets/webfonts/fa-brands-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-brands-400.eot
--------------------------------------------------------------------------------
/assets/webfonts/fa-brands-400.eot_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-brands-400.eot_
--------------------------------------------------------------------------------
/assets/webfonts/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-brands-400.ttf
--------------------------------------------------------------------------------
/assets/webfonts/fa-brands-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-brands-400.woff
--------------------------------------------------------------------------------
/assets/webfonts/fa-brands-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-brands-400.woff2
--------------------------------------------------------------------------------
/assets/webfonts/fa-regular-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-regular-400.eot
--------------------------------------------------------------------------------
/assets/webfonts/fa-regular-400.eot_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-regular-400.eot_
--------------------------------------------------------------------------------
/assets/webfonts/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-regular-400.ttf
--------------------------------------------------------------------------------
/assets/webfonts/fa-regular-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-regular-400.woff
--------------------------------------------------------------------------------
/assets/webfonts/fa-regular-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-regular-400.woff2
--------------------------------------------------------------------------------
/assets/webfonts/fa-solid-900.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-solid-900.eot
--------------------------------------------------------------------------------
/assets/webfonts/fa-solid-900.eot_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-solid-900.eot_
--------------------------------------------------------------------------------
/assets/webfonts/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-solid-900.ttf
--------------------------------------------------------------------------------
/assets/webfonts/fa-solid-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-solid-900.woff
--------------------------------------------------------------------------------
/assets/webfonts/fa-solid-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/assets/webfonts/fa-solid-900.woff2
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/composer.json
--------------------------------------------------------------------------------
/config/Database.php:
--------------------------------------------------------------------------------
1 | conn = null;
13 |
14 | try {
15 | $this->conn = new PDO('mysql:host=' . $this->host . ';dbname=' . $this->db_name, $this->username, $this->password);
16 | $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
17 | } catch(PDOException $e) {
18 | echo 'Connection Error: ' . $e->getMessage();
19 | }
20 |
21 | return $this->conn;
22 | }
23 | }
--------------------------------------------------------------------------------
/connect.php:
--------------------------------------------------------------------------------
1 | connect_error) {
10 | die("Connection failed: " . $conn->connect_error);
11 | }
12 | ?>
--------------------------------------------------------------------------------
/dish.php:
--------------------------------------------------------------------------------
1 | connect_error)
9 | {
10 | die("Connection failed: " . $conn->connect_error);
11 | }
12 | ?>
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | RwemaAPI-Resto
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 |
56 |
57 |
58 |
59 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
Search For:
110 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
supervision & rating
130 |
culinary health supervision and rating agency in Rwanda
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
The Dishes for this restaurant equals
147 |
148 | query($quer);
156 | $num = $result->num_rows;
157 | echo ''.$num.'';
158 | }
159 |
160 | ?>
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 | Restaurant_Id | Dish_Name | cooking_time | ingredients | dish_price | pic_one | pic_two | pic_three |
173 |
174 | query($query1);
182 |
183 |
184 | if ($result->num_rows > 0){
185 | while($row = $result->fetch_array()) {
186 |
187 | echo "".$row['restaurant_id']." | ";
188 | echo "".$row['dishname']." | ";
189 | echo "".$row['cooking_time']." | ";
190 | echo "".$row['ingredients']." | ";
191 | echo "".$row['dish_price']." | ";
192 | $pic_one ='
".$pic_one."";
194 | $pic_two='
".$pic_two."";
196 | $pic_three='
".$pic_three."";
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | }
207 |
208 | }
209 | else{
210 | echo "No dish found Fund for this restaurant";
211 | }
212 | }
213 |
214 | ?>
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
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 |
--------------------------------------------------------------------------------
/here.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwema3/api/13f0540d5c0f1b0c9c40fd7044423628fa9a2ac4/here.gif
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | connect_error)
10 | {
11 | die("Connection failed: " . $conn->connect_error);
12 | }
13 |
14 | if(isset($_POST['search'])){
15 | $searchq = $_POST['search'];
16 | $sql = "SELECT * FROM restaurants WHERE location LIKE '%$searchq%' OR rating like '%$searchq%' ";
17 |
18 | $count = $conn->query($sql);
19 |
20 | if ($count->num_rows > 0){
21 |
22 | while($row = $count->fetch_array()) {
23 |
24 | $restaurant_id = $row['restaurant_id'];
25 | $restaurant_name = $row['restaurant_name'];
26 | $owner = $row['owner'];
27 | $rating = $row['rating'];
28 | $location = $row['location'];
29 |
30 | $output .= ''.$restaurant_name.' '.$location.'
';
31 |
32 | }
33 |
34 |
35 |
36 | }
37 | }
38 | ?>
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
RwemaAPI-Resto
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 |
81 |
82 |
83 |
84 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
Search For:
135 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
supervision & rating
157 |
culinary health supervision and rating agency in Rwanda
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
The available Restaurants
175 | query($quer);
179 | $num = $result->num_rows;
180 | echo ''.$num.'';
181 | ?>
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 | Restaurant_Id | Restaurant_Name | owner | Rating | location | View Dishes Here |
190 |
191 |
192 | query($query1);
197 |
198 | if ($result->num_rows > 0){
199 | while($row = $result->fetch_assoc()) {
200 |
201 | echo "".$row['restaurant_id']." | ";
202 | echo "".$row['restaurant_name']." | ";
203 | echo "".$row['owner']." | ";
204 | echo "".$row['rating']." Stars | ";
205 | echo "".$row['location']." | ";
206 | echo " Here | ";
207 |
208 | }
209 |
210 | }
211 |
212 | ?>
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
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 |
--------------------------------------------------------------------------------
/models/Dish.php:
--------------------------------------------------------------------------------
1 | conn = $db;
22 | }
23 |
24 | // Get dishes
25 | public function read() {
26 | // Create query
27 | $query = 'SELECT r.restaurant_name as restaurant_name,
28 | d.id,
29 | d.restaurant_id,
30 | d.cooking_time,
31 | d.dishname,
32 | d.ingredients,
33 | d.dish_price,
34 | d.pic_one,
35 | d.pic_two,
36 | d.pic_three,
37 | d.created_at
38 | FROM ' . $this->table . ' d
39 | LEFT JOIN
40 | restaurants r ON d.restaurant_id = r.restaurant_id
41 | ORDER BY
42 | d.created_at DESC';
43 |
44 | // Prepare statement
45 | $stmt = $this->conn->prepare($query);
46 |
47 | // Execute query
48 | $stmt->execute();
49 | return $stmt;
50 | }
51 |
52 | // Get Single Dish
53 | public function read_single() {
54 | // Create query
55 | $query = 'SELECT r.restaurant_name as restaurant_name,
56 | d.id,
57 | d.restaurant_id,
58 | d.dishname,
59 | d.cooking_time,
60 | d.ingredients,
61 | d.dish_price,
62 | d.pic_one,
63 | d.pic_two,
64 | d.pic_three,
65 | d.created_at
66 |
67 | FROM ' . $this->table . ' d LEFT JOIN
68 | restaurants r ON d.restaurant_id = r.restaurant_id
69 | WHERE
70 | d.id = ?
71 | LIMIT 0,1';
72 |
73 | // Prepare statement
74 | $stmt = $this->conn->prepare($query);
75 |
76 | // Bind ID
77 | $stmt->bindParam(1, $this->id);
78 |
79 | // Execute query
80 | $stmt->execute();
81 |
82 | $row = $stmt->fetch(PDO::FETCH_ASSOC);
83 |
84 | // Set properties
85 |
86 | $this->id = $row['id'];
87 | $this->restaurant_id = $row['restaurant_id'];
88 | $this->dishname = $row['dishname'];
89 | $this->cooking_time = $row['cooking_time'];
90 | $this->ingredients = $row['ingredients'];
91 | $this->dish_price = $row['dish_price'];
92 | $this->pic_one = $row['pic_one'];
93 | $this->pic_two = $row['pic_two'];
94 | $this->pic_three = $row['pic_three'];
95 | $this->created_at = $row['created_at'];
96 |
97 | }
98 |
99 | // Create Dish
100 | public function create() {
101 | // Create query
102 | $query = 'INSERT INTO ' . $this->table . ' SET
103 | id = :id,
104 | restaurant_id = :restaurant_id,
105 | dishname = :dishname,
106 | cooking_time = :cooking_time,
107 | ingredients = :ingredients,
108 | dish_price = :dish_price
109 | '
110 | ;
111 |
112 | // Prepare statement
113 | $stmt = $this->conn->prepare($query);
114 |
115 | // Clean data
116 | $this->id = htmlspecialchars(strip_tags($this->id));
117 | $this->restaurant_id = htmlspecialchars(strip_tags($this->restaurant_id));
118 | $this->dishname = htmlspecialchars(strip_tags($this->dishname));
119 | $this->cooking_time = htmlspecialchars(strip_tags($this->cooking_time));
120 | $this->ingredients = htmlspecialchars(strip_tags($this->ingredients));
121 | $this->dish_price = htmlspecialchars(strip_tags($this->dish_price));
122 |
123 | // Bind data
124 | $stmt->bindParam(':id', $this->id);
125 | $stmt->bindParam(':restaurant_id', $this->restaurant_id);
126 | $stmt->bindParam(':dishname', $this->dishname);
127 | $stmt->bindParam(':cooking_time', $this->cooking_time);
128 | $stmt->bindParam(':ingredients', $this->ingredients);
129 | $stmt->bindParam(':dish_price', $this->dish_price);
130 |
131 | // Execute query
132 | if($stmt->execute()) {
133 | return true;
134 | }
135 |
136 | // Print error if something goes wrong
137 | printf("Error: %s.\n", $stmt->error);
138 |
139 | return false;
140 | }
141 |
142 |
143 | // UPDATE Dish
144 | public function update() {
145 | // Create query
146 | $query = 'UPDATE ' .
147 | $this->table . '
148 | SET
149 | restaurant_id = :restaurant_id,
150 | dishname = :dishname,
151 | cooking_time = :cooking_time,
152 | ingredients = :ingredients,
153 | dish_price = :dish_price
154 | WHERE id =:id' ;
155 |
156 | // Prepare statement
157 | $stmt = $this->conn->prepare($query);
158 |
159 | // Clean data
160 | $this->id = htmlspecialchars(strip_tags($this->id));
161 | $this->restaurant_id = htmlspecialchars(strip_tags($this->restaurant_id));
162 | $this->dishname = htmlspecialchars(strip_tags($this->dishname));
163 | $this->cooking_time = htmlspecialchars(strip_tags($this->cooking_time));
164 | $this->ingredients = htmlspecialchars(strip_tags($this->ingredients));
165 | $this->dish_price = htmlspecialchars(strip_tags($this->dish_price));
166 |
167 | // Bind data
168 | $stmt->bindParam(':id', $this->id);
169 | $stmt->bindParam(':restaurant_id', $this->restaurant_id);
170 | $stmt->bindParam(':dishname', $this->dishname);
171 | $stmt->bindParam(':cooking_time', $this->cooking_time);
172 | $stmt->bindParam(':ingredients', $this->ingredients);
173 | $stmt->bindParam(':dish_price', $this->dish_price);
174 |
175 | // Execute query
176 | if($stmt->execute()) {
177 | return true;
178 | }
179 |
180 | // Print error if something goes wrong
181 | printf("Error: %s.\n", $stmt->error);
182 |
183 | return false;
184 | }
185 |
186 | public function delete() {
187 | // Create query
188 | $query = 'DELETE FROM ' . $this->table . ' WHERE id = :id';
189 |
190 | // Prepare statement
191 | $stmt = $this->conn->prepare($query);
192 |
193 | // Clean data
194 | $this->id = htmlspecialchars(strip_tags($this->id));
195 |
196 | // Bind data
197 | $stmt->bindParam(':id', $this->id);
198 |
199 | // Execute query
200 | if($stmt->execute()) {
201 | return true;
202 | }
203 |
204 | // Print error if something goes wrong
205 | printf("Error: %s.\n", $stmt->error);
206 |
207 | return false;
208 | }
209 |
210 |
211 | }
212 |
--------------------------------------------------------------------------------
/models/Restaurants.php:
--------------------------------------------------------------------------------
1 | conn = $db;
18 | }
19 |
20 | // Get dishes
21 | public function allrestaurants() {
22 | // Create query
23 | $query = 'SELECT r.restaurant_name as restaurant_name,
24 |
25 | d.restaurant_id,
26 | d.restaurant_name,
27 | d.owner,
28 | d.rating,
29 | d.location,
30 | d.created_at
31 | FROM ' . $this->table . ' d
32 | LEFT JOIN
33 | restaurants r ON d.restaurant_id = r.restaurant_id
34 | ORDER BY
35 | d.created_at DESC';
36 |
37 | // Prepare statement
38 | $stmt = $this->conn->prepare($query);
39 |
40 | // Execute query
41 | $stmt->execute();
42 | return $stmt;
43 | }
44 |
45 | // Create Dish
46 | public function create() {
47 | // Create query
48 | $query = 'INSERT INTO ' . $this->table . ' SET
49 |
50 | restaurant_id = :restaurant_id,
51 | restaurant_name = :restaurant_name,
52 | owner = :owner,
53 | rating = :rating,
54 | location = :location
55 | '
56 | ;
57 |
58 | // Prepare statement
59 | $stmt = $this->conn->prepare($query);
60 |
61 | // Clean data
62 |
63 | $this->restaurant_id = htmlspecialchars(strip_tags($this->restaurant_id));
64 | $this->restaurant_name = htmlspecialchars(strip_tags($this->restaurant_name));
65 | $this->owner = htmlspecialchars(strip_tags($this->owner));
66 | $this->rating = htmlspecialchars(strip_tags($this->rating));
67 | $this->location = htmlspecialchars(strip_tags($this->location));
68 |
69 | // Bind data
70 | $stmt->bindParam(':restaurant_id', $this->restaurant_id);
71 | $stmt->bindParam(':restaurant_name', $this->restaurant_name);
72 | $stmt->bindParam(':owner', $this->owner);
73 | $stmt->bindParam(':rating', $this->rating);
74 | $stmt->bindParam(':location', $this->location);
75 |
76 | // Execute query
77 | if($stmt->execute()) {
78 | return true;
79 | }
80 |
81 | // Print error if something goes wrong
82 | printf("Error: %s.\n", $stmt->error);
83 |
84 | return false;
85 | }
86 |
87 |
88 | // UPDATE Dish
89 | public function update() {
90 |
91 | $query = 'UPDATE ' .
92 | $this->table . '
93 | SET
94 | restaurant_name = :restaurant_name,
95 | owner = :owner,
96 | rating = :rating,
97 | location = :location
98 |
99 | WHERE restaurant_id =:restaurant_id' ;
100 |
101 | // Prepare statement
102 | $stmt = $this->conn->prepare($query);
103 |
104 | // Clean data
105 |
106 | $this->restaurant_id = htmlspecialchars(strip_tags($this->restaurant_id));
107 | $this->restaurant_name = htmlspecialchars(strip_tags($this->restaurant_name));
108 | $this->owner = htmlspecialchars(strip_tags($this->owner));
109 | $this->rating = htmlspecialchars(strip_tags($this->rating));
110 | $this->location = htmlspecialchars(strip_tags($this->location));
111 |
112 | // Bind data
113 | $stmt->bindParam(':restaurant_id', $this->restaurant_id);
114 | $stmt->bindParam(':restaurant_name', $this->restaurant_name);
115 | $stmt->bindParam(':owner', $this->owner);
116 | $stmt->bindParam(':rating', $this->rating);
117 | $stmt->bindParam(':location', $this->location);
118 | // Execute query
119 | if($stmt->execute()) {
120 | return true;
121 | }
122 |
123 | // Print error if something goes wrong
124 | printf("Error: %s.\n", $stmt->error);
125 |
126 | return false;
127 | }
128 |
129 | public function delete() {
130 | // Create query
131 | $query = 'DELETE FROM ' . $this->table . ' WHERE restaurant_id = :restaurant_id';
132 |
133 | // Prepare statement
134 | $stmt = $this->conn->prepare($query);
135 |
136 | // Clean data
137 | $this->restaurant_id = htmlspecialchars(strip_tags($this->restaurant_id));
138 |
139 | // Bind data
140 | $stmt->bindParam(':restaurant_id', $this->restaurant_id);
141 |
142 | // Execute query
143 | if($stmt->execute()) {
144 | return true;
145 | }
146 |
147 | // Print error if something goes wrong
148 | printf("Error: %s.\n", $stmt->error);
149 |
150 | return false;
151 | }
152 |
153 |
154 | }
155 |
--------------------------------------------------------------------------------
/search.php:
--------------------------------------------------------------------------------
1 | connect_error)
10 | {
11 | die("Connection failed: " . $conn->connect_error);
12 | }
13 |
14 | ?>
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
RwemaAPI-Resto
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 |
57 |
58 |
59 |
60 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
Search For:
111 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
supervision & rating
133 |
culinary health supervision and rating agency in Rwanda
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
Those Restaurants are:
147 |
148 |
149 | Restaurant_Name | Rating | location |
150 |
151 |
152 | query($sql);
159 |
160 | if ($count->num_rows == 0){
161 |
162 | echo"No restaurant matches!!";
163 |
164 | }
165 | else{
166 | while($row = $count->fetch_array()) {
167 |
168 | echo "".$row['restaurant_name']." | ";
169 | echo "".$row['rating']." Stars | ";
170 | echo "".$row['location']." | ";
171 |
172 | }
173 | }
174 |
175 | }
176 |
177 | ?>
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
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 |
--------------------------------------------------------------------------------