Initial commit

This commit is contained in:
BB 2023-10-03 07:57:37 +02:00
commit 80aae025a2
64 changed files with 32770 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# npm
node_modules
package-lock.json

4171
adatbazis.sql Normal file

File diff suppressed because it is too large Load Diff

50
app.js Normal file
View File

@ -0,0 +1,50 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var router = require('./routes/api');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'web')));
// enable CORS
app.use(function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
next()
})
app.use('/api', router);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;

31
assets/sqlTasks.js Normal file
View File

@ -0,0 +1,31 @@
const fs = require('fs')
const path = require('path')
let sqlTasks = require('./sqlTasks.json')
const os = require('os');
const getSqlTasks = () => {
return new Promise((resolve, reject) => {
fs.readFile(path.join(__dirname, "../lekerdezesek/lekerdezesek.sql"), 'utf8', (err, data) => {
if (err) {
reject(err)
} else {
let sqlQueriesFromFile = data.split("***").splice(1)
sqlQueriesFromFile.forEach(sqlQuery => {
let lines = sqlQuery.split(os.EOL)
const id = lines[1].split(".")[0]
lines = lines.splice(2)
if (lines.length > 0) {
const sqlQueryText = lines.reduce((sql, line) => sql + " " + line).trim()
let sqlTask = sqlTasks.filter(task => task.id == id)[0]
sqlTask.sql = sqlQueryText
}
})
resolve(sqlTasks)
}
})
})
}
module.exports = getSqlTasks

37
assets/sqlTasks.json Normal file
View File

@ -0,0 +1,37 @@
[{
"id": 14,
"description": "Adatbázis létrehozása",
"adminPage": false
},
{
"id": 16,
"description": "Ételek száma az étlapon",
"adminPage": true
},
{
"id": 17,
"description": "Desszertek",
"adminPage": true
},
{
"id": 18,
"description": "Új desszert",
"adminPage": false
},
{
"id": 19,
"description": "A három legnépszerűbb étel februárban",
"adminPage": true
},
{
"id": 20,
"description": "Bruttó árbevétel és befizetendő ÁFA",
"adminPage": true
},
{
"id": 99,
"description": "Vendégkönyv bejegyzések",
"adminPage": true,
"sql": "SELECT bejegyzes, createdAt AS datum FROM vendegkonyv;"
}
]

91
bin/www Normal file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('csudijo-server:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '8000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port)
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
//console.log('Listening on ' + bind);
console.log('A szerver az alábbi címen érhető el: http://localhost:' + addr.port)
}

BIN
csudijo.pdf Normal file

Binary file not shown.

19
kartya.txt Normal file
View File

@ -0,0 +1,19 @@
1.
Kép: kepek/etlap1.jpg
Cím:
Szöveg:
2.
Kép: kepek/etlap2.jpg
Cím:
Szöveg:
3.
Kép: kepek/etlap3.jpg
Cím:
Szöveg:
4.
Kép: kepek/etlap4.jpg
Cím:
Szöveg:

View File

@ -0,0 +1,21 @@
CREATE TABLE kategoriak (
id INT PRIMARY KEY,
nev INT
);
CREATE TABLE rendelesek (
id INT PRIMARY KEY,
mennyiseg DECIMAL,
afakulcs DECIMAL,
datum DATE
);
CREATE TABLE termekek (
id INT PRIMARY KEY,
nev VARCHAR(255),
egysegar INT,
etel INT,
kategoriaId INT,
rendelesek INT,
FOREIGN KEY(kategoriaId) REFERENCES katerologiak(id)
);

View File

@ -0,0 +1,43 @@
A feladatok megoldására elkészített SQL parancsokat illessze be a feladat sorszáma után!
***
14. feladat
***
16. feladat
SELECT count(etel) AS `etelek-szama`
FROM termekek
WHERE termekek.etel = 1;
***
17. feladat
SELECT termekek.nev AS "nev", termekek.ar AS "egysegar"
FROM termekek, kategoriak
WHERE kategoriak.nev = "Desszertek"
ORDER BY termekek.nev DESC;
***
18. feladat
INSERT INTO termekek
(nev, ar, etel, kategoriaId)
VALUES
('Málnahabos pohárkrém', 1090, 1, 6);
***
19. feladat
SELECT sum(rendelesek.mennyiseg) AS `mennyiseg` FROM rendelesek
WHERE MONTH(rendelesek.datum) = 2
GROUP BY rendelesek.termekId
ORDER BY `mennyiseg` DESC
LIMIT 3;
***
20. feladat
SELECT
round(sum(rendelesek.termekAr)) AS `brutto`,
round(sum(rendelesek.termekAr * (1 - (1 / (1 / rendelesek.afakulcs))))) AS `afa`
FROM rendelesek;

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "csudijo-server",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "nodemon ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"morgan": "~1.9.0",
"mysql": "^2.16.0",
"nodemon": "^1.18.11",
"pug": "2.0.0-beta11"
}
}

95
routes/api.js Normal file
View File

@ -0,0 +1,95 @@
var express = require('express')
var router = express.Router()
var mysql = require('mysql')
var sqlTasks = require('../assets/sqlTasks.json')
var db = {
host: 'localhost',
user: 'root',
password: '',
database: 'csudijo'
}
const getSqlTasks = require('../assets/sqlTasks')
const databaseQuery = sqlQuery => {
return new Promise((resolve, reject) => {
const connection = mysql.createConnection(db)
connection.connect()
console.log('sqlQuery', sqlQuery)
connection.query(sqlQuery, (error, lines, fields) => {
if (error) reject(error)
resolve(lines)
})
})
}
/* fech data from database */
router.get('/lekerdezes/:id', function(req, res, next) {
getSqlTasks().then(result => {
const sqlTasks = result
console.log('sqlTasks', sqlTasks)
const sqlTaskById = sqlTasks.filter(task => task.id == req.params.id)
if (sqlTaskById) {
const sqlTask = sqlTaskById[0]
if (sqlTask.sql) {
databaseQuery(sqlTask.sql)
.then(result => {
res.send(JSON.stringify(result))
})
.catch(error => {
res.status(error.status || 500)
if (error.sqlMessage) {
console.log(error.sqlMessage)
res.send(JSON.stringify({ error: error.sqlMessage }))
} else {
console.log(JSON.stringify(error))
res.send(JSON.stringify({ error: 'Ismeretlen eredetű error' }))
}
})
}
}
})
})
/* GET legnepszerubb. */
router.get('/legnepszerubb', function(req, res, next) {
res.send(JSON.stringify({ etelNev: 'LECSÓ KOLBÁSZCSIPSSZEL' }))
})
/* GET sqlTasks */
router.get('/sqltasks', function(req, res, next) {
res.send(JSON.stringify(sqlTasks))
})
/* POST vendegkonyv */
router.post('/vendegkonyv', function(req, res, next) {
console.log(req.body)
if (req.body.bejegyzes) {
let sql = ''
sql += 'CREATE TABLE IF NOT EXISTS vendegkonyv '
sql += '(bejegyzes longtext COLLATE utf8_hungarian_ci NOT NULL, '
sql += 'createdAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP) '
sql += 'ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;'
databaseQuery(sql)
.then(result => {
console.log('result', result)
sql = `INSERT INTO vendegkonyv (bejegyzes) VALUES ("${req.body.bejegyzes}");`
databaseQuery(sql)
.then(result => {
console.log('result2', result)
res.send(JSON.stringify(req.body))
})
.catch(error => {
console.log('result2', error)
res.send(JSON.stringify(error))
})
})
.catch(error => {
console.log('result', error)
res.send(JSON.stringify(error))
})
}
})
module.exports = router

6
views/error.pug Normal file
View File

@ -0,0 +1,6 @@
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}

5
views/index.pug Normal file
View File

@ -0,0 +1,5 @@
extends layout
block content
h1= title
p Welcome to #{title}

7
views/layout.pug Normal file
View File

@ -0,0 +1,7 @@
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content

View File

@ -0,0 +1,15 @@
{
"main.css": "/admin/static/css/main.ef36aea8.chunk.css",
"main.js": "/admin/static/js/main.8eee9a34.chunk.js",
"main.js.map": "/admin/static/js/main.8eee9a34.chunk.js.map",
"runtime~main.js": "/admin/static/js/runtime~main.b3695f6e.js",
"runtime~main.js.map": "/admin/static/js/runtime~main.b3695f6e.js.map",
"static/css/2.7375eb1f.chunk.css": "/admin/static/css/2.7375eb1f.chunk.css",
"static/js/2.d842664d.chunk.js": "/admin/static/js/2.d842664d.chunk.js",
"static/js/2.d842664d.chunk.js.map": "/admin/static/js/2.d842664d.chunk.js.map",
"index.html": "/admin/index.html",
"precache-manifest.6a45463c9c570d423462519d92f856a9.js": "/admin/precache-manifest.6a45463c9c570d423462519d92f856a9.js",
"service-worker.js": "/admin/service-worker.js",
"static/css/2.7375eb1f.chunk.css.map": "/admin/static/css/2.7375eb1f.chunk.css.map",
"static/css/main.ef36aea8.chunk.css.map": "/admin/static/css/main.ef36aea8.chunk.css.map"
}

BIN
web/admin/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

1
web/admin/index.html Normal file
View File

@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/admin/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/admin/manifest.json"/><title>Csudijó Étterem - Adminisztrációs honlap</title><link href="/admin/static/css/2.7375eb1f.chunk.css" rel="stylesheet"><link href="/admin/static/css/main.ef36aea8.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,n,t=e[0],o=e[1],u=e[2],i=0,f=[];i<t.length;i++)n=t[i],p[n]&&f.push(p[n][0]),p[n]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);f.length;)f.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var n=c[r],t=!0,o=1;o<n.length;o++){var u=n[o];0!==p[u]&&(t=!1)}t&&(c.splice(r--,1),e=i(i.s=n[0]))}return e}var n={},p={1:0},c=[];function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=l,i.c=n,i.d=function(e,r,n){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(r,e){if(1&e&&(r=i(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)i.d(n,t,function(e){return r[e]}.bind(null,t));return n},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/admin/";var r=window.webpackJsonp=window.webpackJsonp||[],t=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=t;a()}([])</script><script src="/admin/static/js/2.d842664d.chunk.js"></script><script src="/admin/static/js/main.8eee9a34.chunk.js"></script></body></html>

15
web/admin/manifest.json Normal file
View File

@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -0,0 +1,26 @@
self.__precacheManifest = [
{
"revision": "7c4f45329e47798217a3",
"url": "/admin/static/js/runtime~main.b3695f6e.js"
},
{
"revision": "ac4a1cd31a9eb5dea556",
"url": "/admin/static/js/main.8eee9a34.chunk.js"
},
{
"revision": "e2ec3d9ce8995dcc73e5",
"url": "/admin/static/js/2.d842664d.chunk.js"
},
{
"revision": "ac4a1cd31a9eb5dea556",
"url": "/admin/static/css/main.ef36aea8.chunk.css"
},
{
"revision": "e2ec3d9ce8995dcc73e5",
"url": "/admin/static/css/2.7375eb1f.chunk.css"
},
{
"revision": "1fed318b7c4f7ab7e6a85c693885d68d",
"url": "/admin/index.html"
}
];

View File

@ -0,0 +1,34 @@
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/admin/precache-manifest.6a45463c9c570d423462519d92f856a9.js"
);
workbox.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute("/admin/index.html", {
blacklist: [/^\/_/,/\/[^\/]+\.[^\/]+$/],
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}
/*# sourceMappingURL=main.ef36aea8.chunk.css.map */

View File

@ -0,0 +1 @@
{"version":3,"sources":["d:/Doc/HTTP-Alapítvány/Futó projektek/Érettségi/2019/2020_minta/emelt/web-adatbázis/csudijo-admin/src/d:/Doc/HTTP-Alapítvány/Futó projektek/Érettségi/2019/2020_minta/emelt/web-adatbázis/csudijo-admin/src/index.css","main.ef36aea8.chunk.css"],"names":[],"mappings":"AAAA,KACE,QAAA,CACA,SAAA,CACA,mICEY,CDCZ,kCAAA,CACA,iCCCF,CDEA,KACE,uECEF","file":"main.ef36aea8.chunk.css","sourcesContent":["body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n","body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{26:function(e,t,a){e.exports=a(56)},31:function(e,t,a){},56:function(e,t,a){"use strict";a.r(t);var n=a(1),r=a.n(n),c=a(17),s=a.n(c),o=(a(31),a(32),a(7)),i=a(18),l=a(19),d=a(23),u=a(20),m=a(24),f=a(59),h=a(57),p=a(58),k=a(9),v=a.n(k),b=(a(52),function(e){var t=e.data,a=Object.keys(t[0]);return r.a.createElement("table",{className:"table table-striped"},r.a.createElement("thead",null,r.a.createElement("tr",null,a.map(function(e,t){return r.a.createElement("th",{key:t},e)}))),r.a.createElement("tbody",null,t.map(function(e,n){return r.a.createElement("tr",{key:n},a.map(function(e,a){return r.a.createElement("td",{key:a},t[n][e])}))})))}),E=function(e){return r.a.createElement(h.a,{className:"m-1"},r.a.createElement(p.a,{xs:"12",className:"text-white bg-secondary p-2"},e.title),r.a.createElement(p.a,{xs:"12",className:"bg-light p-2"},r.a.createElement(b,{field:e.field,value:e.value,data:e.data})))},y=function(e){function t(){var e,a;Object(i.a)(this,t);for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return(a=Object(d.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(r)))).state={lekerdezes:[],forgalom:"",etelNev:"",stat:[],sqlTasks:[],errors:[]},a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"componentDidMount",value:function(){var e=this;v.a.get("http://localhost:8000/api/sqltasks").then(function(t){var a=t.data;e.setState({sqlTasks:a},function(){e.fetchStat()})}).catch(function(t){var a=[].concat(Object(o.a)(e.state.errors),[{description:"Hiba: a lek\xe9rdez\xe9sek defin\xedci\xf3j\xe1t nem siker\xfclt lek\xe9rni a szerverr\u0151l!"}]);e.setState({errors:a}),console.error(e.state.errors)})}},{key:"fetchStat",value:function(){var e=this;this.state.sqlTasks.forEach(function(t){t.adminPage&&v.a.get("http://localhost:8000/api/lekerdezes/"+t.id).then(function(a){console.log(t.id);var n=[].concat(Object(o.a)(e.state.stat),[{id:t.id,description:t.description,data:a.data}]);e.setState({stat:n.sort(function(e,t){return e.id-t.id})},function(){return console.log(JSON.stringify(e.state.stat))})}).catch(function(a){var n=[].concat(Object(o.a)(e.state.stat),[{id:t.id,description:t.description,data:[{error:"Hiba: A lek\xe9rdez\xe9s nem hajthat\xf3 v\xe9gre!"}]}]);e.setState({stat:n})})})}},{key:"render",value:function(){return r.a.createElement("div",{className:"App"},r.a.createElement(f.a,{className:"mt-5"},r.a.createElement(h.a,null,r.a.createElement(p.a,null,r.a.createElement("h1",{className:"text-center"},"Csudij\xf3 \xc9tterem - Adminisztr\xe1ci\xf3s oldal"))),this.state.stat.map(function(e,t){return r.a.createElement(E,{title:e.id+". "+e.description,field:Object.keys(e.data[0])[0],value:e.data[0][Object.keys(e.data[0])[0]],data:e.data,key:t})})))}}]),t}(n.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));s.a.render(r.a.createElement(y,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})}},[[26,1,2]]]);
//# sourceMappingURL=main.8eee9a34.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
!function(e){function r(r){for(var t,i,f=r[0],l=r[1],a=r[2],c=0,s=[];c<f.length;c++)i=f[c],o[i]&&s.push(o[i][0]),o[i]=0;for(t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),n()}function n(){for(var e,r=0;r<u.length;r++){for(var n=u[r],t=!0,f=1;f<n.length;f++){var l=n[f];0!==o[l]&&(t=!1)}t&&(u.splice(r--,1),e=i(i.s=n[0]))}return e}var t={},o={1:0},u=[];function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,r,n){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)i.d(n,t,function(r){return e[r]}.bind(null,t));return n},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/admin/";var f=window.webpackJsonp=window.webpackJsonp||[],l=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=l;n()}([]);
//# sourceMappingURL=runtime~main.b3695f6e.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,331 @@
/*!
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
outline: 0;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: 0.5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
select {
word-wrap: normal;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

File diff suppressed because one or more lines are too long

10038
web/assets/bootstrap/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4435
web/assets/bootstrap/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
web/assets/jquery/jquery-3.3.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
web/assets/popper/popper.min.js vendored Normal file

File diff suppressed because one or more lines are too long

63
web/csudijo.css Normal file
View File

@ -0,0 +1,63 @@
body {
line-height: 1.8;
}
nav {
font-weight: 500;
}
#fejlec {
height: 100vh;
min-height: 500px;
background-image: url('kepek/etterem.jpg');
background-repeat: no-repeat;
background-size: cover;
color: #fff;
}
h1 {
font-size: 6em;
font-weight: 300;
}
h2 {
padding-top: 10px;
font-weight: 300
}
section {
padding: 15px 15px 15px 15px;
margin-bottom: 15px;
}
a:link,
a:visited {
color: rgb(236, 236, 236);
;
}
a:hover,
a:active {
color: white;
text-decoration: none;
}
.card {
height: 100% !important;
}
.szurke-hatter {
background-color: rgb(236, 236, 236);
}
.motto {
font-size: 3em;
}
#rolunk > img {
max-width: 100%;
}
p {
font-weight: 300;
}

51
web/csudijo.js Normal file
View File

@ -0,0 +1,51 @@
function GetLegnepszerubb() {
const def = 'LECSÓ KOLBÁSZCSIPSSZEL'
fetch('/api/legnepszerubb', { method: 'GET' })
.then(res => {
res.json()
.then(json => {
document.getElementById('legnepszerubb').innerText = json.etelNev ?? def
})
.catch(error => {
document.getElementById('legnepszerubb').innerText = json.etelNev ?? def
console.error(error)
})
})
.catch(error => {
document.getElementById('legnepszerubb').innerText = json.etelNev ?? def
console.error(error)
})
}
function PostVendegkonyv() {
const bejegyzes = document.getElementById('bejegyzes').value
const body = {
bejegyzes: bejegyzes,
}
console.log(body)
fetch('/api/vendegkonyv', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(body),
})
.then(res => {
console.log(res)
res.json()
.then(json => {
const resBejegyzes = json.bejegyzes
console.log(resBejegyzes)
})
.catch(error => {
console.error(error)
})
})
.catch(error => {
console.error(error)
})
}
GetLegnepszerubb()

BIN
web/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

186
web/index.html Normal file
View File

@ -0,0 +1,186 @@
<!doctype html>
<html lang="hu">
<head>
<!-- Szükséges meta elemek -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="csudijo.css">
<title>Csudijó Étterem</title>
</head>
<body>
<!-- Navigáció -->
<nav class="navbar navbar-expand-lg navbar-light bg-light shadow fixed-top">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#rolunk">Rólunk</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#etlap">Étlap</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#legnepszerubb">Legnépszerűbb</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#vendegkonyv">Vendégkönyv</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#kapcsolat">Kapcsolat</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Fejléc -->
<header id="fejlec">
<div class="container-fluid h-100">
<div class="row h-100 align-items-center">
<div class="col-12 text-center">
<h1>Csudijó Étterem</h1>
<div class="motto">
Ahol az ízek életre kelnek
</div>
</div>
</div>
</div>
</header>
<div class="container">
<!-- Rólunk -->
<section id="rolunk">
<h2>Rólunk</h2>
<p>
A Csudijó Étterem, Magyarország egyik legszebb vidékén, a festői Pitypangtövis hegy lábánál csörgedező Csicseri patak partján található. A fáradt utazó nálunk megtalálhatja mindazt, amire vágyik: kiváló ételeink Mindróf Benedek mesterszakácsunk kifinomult
ízvilágát dicsérik, a desszerteket a környék méltán világhíres Mézmanna cukrászata szállítja számunkra, a helyben készült pitypangtövisi kézműves sörök telt aromája pedig rabul ejti kostolójukat. Ha nem csak egy mennyei ebédre látogat meg
minket, hanem szívesen időzne még a környék mesebéli tájain, akkor panziónkban minden igényt kielégítő otthonos apartmanjaink várják a családokat, párokat vagy épp a magányos vándort. Térjen be hozzánk, hogy vendéglátásunkkal Önnek is
Csudijó napot varázsolhassunk!
</p>
<img src="kepek/csicseri.jpg" alt="Csicseri patak" title="Csicseri patak">
</section>
<!-- Étlap -->
<section id="etlap" class="szurke-hatter">
<h2>Ízelítő étlapunkról</h2>
<!-- Étel kártyák -->
<div class="row">
<div class="card col-12 col-md-6">
<img class=".card-img-top" src="kepek/etlap1.jpg">
<div class="card-body">
<h4 class="card-title">
TEJSZÍNES-MUSTÁROS CSIRKE ALMÁVAL
</h4>
<p class="card-text">
A csirkét vajon megpirítjuk, sóval és borssal ízesítjük. Hozzáadjuk
a megtisztított hagymát, a feldarabolt zellert, és néhány percig együtt pirítjuk,
majd felöntjük a borral és az alaplével. A kimagozott, gerezdekre vágott almákat megpirítjuk.
Tejszínes kukoricalisztet, mustárt és a tárkonyt keverve a pecsenyeléhez mártást készítünk.
A hús-, a zöldség- és az alma darabokat beleforgatjuk a mártásba, majd forrón, friss kenyérrel kínáljuk.
</p>
</div>
</div>
<div class="card col-12 col-md-6">
<img class=".card-img-top" src="kepek/etlap2.jpg">
<div class="card-body">
<h4 class="card-title">
LECSÓ KOLBÁSZCSIPSSZEL
</h4>
<p class="card-text">
A hajszálvékonyra szeletelt kolbászt forró serpenyőben ropogósra sütjük. Kolbászzsíron megfonnyasztjuk
az apróra vágott vöröshagymát, majd megszórjuk és elkeverjük a pirospaprikával. Feldarabolt paprikát és
paradicsomot adunk hozzá. Megsózzuk, megborsozzuk ízlés szerint. A frissen elkészült lecsót a ropogós
kolbászcsipsszel megszórva tálaljuk, friss kenyeret és főtt rizst kínálunk mellé.
</p>
</div>
</div>
<div class="card col-12 col-md-6">
<img class=".card-img-top" src="kepek/etlap3.jpg">
<div class="card-body">
<h4 class="card-title">
BÖGRÉBEN SÜLT PARADICSOMOS TÉSZTA
</h4>
<p class="card-text">
A tésztát kifőzzük, leszűrjük, és olívaolajjal összekeverjük. Egy bögrébep izzaszószt kanalazunk,
megszórjuk felkockázott mozzarellával, felaprított bazsalikommal, majd ismét paradicsomszószt és mozzarellát teszünk rá.
A kifőtt tésztával körberakjuk az edényünket, meglocsoljuk paradicsomszósszal, majd sütőbe rakjuk. A kisült a tésztát tányérra
borítjuk és forrón tálaljuk.
</p>
</div>
</div>
<div class="card col-12 col-md-6">
<img class=".card-img-top" src="kepek/etlap4.jpg">
<div class="card-body">
<h4 class="card-title">
TORTELLINIS PARADICSOMLEVES
</h4>
<p class="card-text">
Lábasban olívaolajon megfonnyasztjuk a kétféle felpirított hagymát, és babérleveleket adunk hozzá.
A hagymás keverékbe forgatjuk a darabolt paradicsomot, lecsipkedett bazsalikom leveleket adunk hozzá, sózzuk, borsozzuk.
A levest joghurttal dúsítjuk és tortellinivel gazdagítjuk. Melegen, egy kevés aprított bazsalikommal és leforgácsolt parmezánnal megszórva tálaljuk.
</p>
</div>
</div>
</div>
</section>
<!-- Legnépszerűbb -->
<section class="legnepszerubb">
<h2>Legnépszerűbb étel az étlapunkról az elmúlt évben</h2>
<p id="legnepszerubb">
</p>
</section>
<!-- Vendégkönyv -->
<section id="vendegkonyv" class="szurke-hatter">
<h2>Vendégkönyv</h2>
<p>Ossza meg másokkal, hogy mi tetszett nálunk, és mondja el nekünk, hogy mivel tehetnénk még kellemesebbé itt létét legközelebb!</p>
<form>
<div class="form-group">
<label for="bejegyzes">Bejegyzés:</label>
<textarea class="form-control" id="bejegyzes" rows="10"></textarea>
</div>
<button type="button" class="btn btn-secondary" onclick="PostVendegkonyv()">Bejegyzés elküldése</button>
</form>
</section>
</div>
<!-- Kapcsolat -->
<footer id="kapcsolat" class="py-4 bg-dark text-white-50">
<div class="text-center">
<small>
Csudijó Étterem <br />
9999 Karakumszörcsög <br />
Macskakapocs utca 29. <br />
Telefon: +36 55 555-5555 <br />
Email: <a href="mailto:kapcsolat@csudijo-etterem.hu">kapcsolat@csudijo-etterem.hu</a>
</small>
</div>
</footer>
<!-- Opcionális JavaScript -->
<!-- jQuery először, utána a Popper.js, végül Bootstrap JS -->
<script src="assets/jquery/jquery-3.3.1.min.js"></script>
<script src="assets/popper/popper.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="csudijo.js"></script>
</body>
</html>

BIN
web/kepek/csicseri.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

BIN
web/kepek/etlap1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

BIN
web/kepek/etlap2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
web/kepek/etlap3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

BIN
web/kepek/etlap4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

BIN
web/kepek/etterem.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

2173
yarn.lock Normal file

File diff suppressed because it is too large Load Diff