initial commit

This commit is contained in:
greggy
2025-10-06 23:10:59 +02:00
commit ad46abd2ba
62 changed files with 4332 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
/vendor/
/node_modules/
/.claude/
/.idea/
composer.lock
package-lock.json
.env
test_db.php

1
assets/css/app.css Normal file

File diff suppressed because one or more lines are too long

7
assets/css/bootstrap.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
body{background-color:#fff}#auth{height:100vh;overflow-x:hidden}#auth #auth-right{height:100%;background:url(../../images/bg/4853433.jpg),linear-gradient(90deg,#2d499d,#3f5491)}#auth #auth-left{padding:5rem 8rem}#auth #auth-left .auth-title{font-size:4rem;margin-bottom:1rem}#auth #auth-left .auth-subtitle{font-size:1.7rem;line-height:2.5rem;color:#a8aebb}#auth #auth-left .auth-logo{margin-bottom:7rem}#auth #auth-left .auth-logo img{height:2rem}@media screen and (max-width:767px){#auth #auth-left{padding:5rem}}

View File

@@ -0,0 +1 @@
.chat-application .chat-app{height:calc(100vh - 9rem);border:1px solid #dfe3e7;border-radius:5px}.chat-app .chat-app-right{padding-left:0}.chat-app .chat-app-header .person-name{font-size:1.2rem}.chat-app .chat-app-body .left{border-right:1px solid #e9ecef}.chat-app .chat-app-body ul{padding-left:0;overflow-y:auto}.chat-app .chat-app-body .the-contact{list-style:none;padding:1.5rem 2rem;background-color:#fff;border-bottom:1px solid #e9ecef;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:0;position:relative}.chat-app .chat-app-body .the-contact.active{background-color:#435ebe}.chat-app .chat-app-body .the-contact.active .message-excerpt,.chat-app .chat-app-body .the-contact.active .person-name{color:#fff}.chat-app .chat-app-body .the-contact .notification-count{position:absolute;right:1rem;top:50%;transform:translateY(-50%)}.chat-app .chat-app-body .the-contact:hover{cursor:pointer}.chat-app .chat-app-body .the-contact:not(.active):hover{background-color:#e9ecef;transition:all .1s}.chat-app .chat-app-body .the-contact .verified-badge{width:1.4em;height:1.4em;padding:0}.chat-app .chat-app-body .the-contact .person-name{font-size:1.1rem;margin-bottom:0;font-weight:700;color:#495057;display:flex;align-items:center}.chat-app .chat-app-body .the-contact .message-excerpt{font-size:1rem;color:#6c757d;margin-bottom:0}.chat-app .chat-app-footer{position:relative;height:100%}.chat-app .chat-app-footer .input-message-wrapper{position:absolute;bottom:0;padding:1rem;background-color:#fff;width:100%;right:0}.chat-app .messages{display:flex;width:100%;flex-direction:column}.chat-app .messages .message{background-color:#dee2e6;border-bottom-right-radius:1rem;border-top-right-radius:1rem;border-bottom-left-radius:1rem;padding:.8rem;margin:1rem;float:left;max-width:600px}.chat-app .messages .message.message-right{float:right;background-color:#697ecb;color:#fff;border-top-left-radius:1rem;border-top-right-radius:0}@media screen and (max-width:1200px){.chat-app .chat-app-left{right:100%}.chat-app .chat-app-right{position:absolute;top:0;left:0;right:0;bottom:0;padding-left:15px!important}.chat-app .chat-app-right .chat-app-header>div{padding:0 2rem}}

View File

@@ -0,0 +1,18 @@
.glyphs.character-mapping{margin:0;padding:0;border:none;}
.glyphs.character-mapping li{margin:0;display:inline-block;width:90px;border-radius:4px;}
.glyphs.character-mapping .icon{margin:10px 0 10px 15px;padding:15px;position:relative;width:55px;height:55px;color:#398FF7 !important;overflow:hidden;-webkit-border-radius:3px;border-radius:3px;font-size:32px;}
.glyphs.character-mapping .icon svg{fill:#398FF7}
.glyphs.character-mapping li:hover .icon{color:#fff !important;}
.glyphs.character-mapping li:hover .icon svg{fill:#fff}
.glyphs.character-mapping li:hover input{opacity:100;}
.glyphs.character-mapping li:hover{background:#374347;}
.glyphs.character-mapping input{opacity:0;background:#398FF7;color:#fff;margin:0;padding:10px 0;line-height:12px;font-size:12px;display:block;width:100%;border:none;text-align:center;outline:none;border-bottom-right-radius:3px;border-bottom-left-radius:3px;font-family:'Montserrat','Helvetica','Arial',sans-serif;font-weight:400;}
.glyphs.character-mapping input:focus{border:none;}
.glyphs.character-mapping input:hover{border:none;}
.glyphs.css-mapping{margin:0 0 60px 0;padding:30px 0 20px 30px;color:rgba(0,0,0,0.5);border:none;-webkit-border-radius:3px;border-radius:3px;}
.glyphs.css-mapping li{margin:0 30px 20px 0;padding:0;display:inline-block;overflow:hidden}
.glyphs.css-mapping .icon{margin:0;margin-right:10px;padding:13px;height:50px;width:50px;color:#398FF7 !important;overflow:hidden;float:left;font-size:24px}
.glyphs.css-mapping input{background:none;color:#398FF7;margin:0;margin-top:5px;padding:8px;line-height:14px;font-size:14px;font-family:'Montserrat','Helvetica','Arial',sans-serif;font-weight:700;display:block;width:120px;height:40px;border:none;-webkit-border-radius:5px;border-radius:5px;outline:none;float:right;}
.glyphs.css-mapping input:focus{border:none;}
.glyphs.css-mapping input:hover{}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
#error{height:100vh;background-color:#ebf3ff;padding-top:5rem}#error .img-error{width:100%}#error .error-title{font-size:4rem;margin-top:3rem}

View File

@@ -0,0 +1 @@
.chat{border-radius:5px}.chat.chat-left .chat-message{background:#5a8dee!important;float:left!important;color:#fff}.chat .chat-message{text-align:left!important;float:right!important;margin:.2rem 0 1.8rem .2rem!important;color:#525361;background-color:#fafbfb!important;box-shadow:0 2px 6px 0 rgba(0,0,0,.3)!important;padding:.75rem 1rem!important;position:relative!important;max-width:calc(100% - 5rem)!important;clear:both!important;word-break:break-word!important;border-radius:.267rem!important}

View File

@@ -0,0 +1 @@
.widget-todo-list-wrapper{padding:0;margin:0}.widget-todo-list-wrapper .widget-todo-item{padding:.8rem 2rem .8rem .8rem;list-style:none}.widget-todo-list-wrapper .widget-todo-item:hover{background-color:#f8f9fa}.widget-todo-list-wrapper .widget-todo-item .checkbox{margin-left:1rem}.widget-todo-list-wrapper .widget-todo-item i,.widget-todo-list-wrapper .widget-todo-item svg{font-size:12px;cursor:move;height:1rem}

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
assets/images/faces/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
assets/images/faces/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 KiB

BIN
assets/images/faces/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
assets/images/faces/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 KiB

BIN
assets/images/faces/5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
assets/images/faces/6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
assets/images/faces/7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
assets/images/faces/8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
assets/images/logo/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
assets/images/samples/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
assets/images/samples/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/images/samples/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/images/samples/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

7
assets/js/bootstrap.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
assets/js/bootstrap.min.js vendored Normal file

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,38 @@
window.raterJs({
element: document.querySelector("#basic"),
starSize: 32,
rateCallback:function rateCallback(rating, done) {
this.setRating(rating);
done();
}
});
window.raterJs({
element:document.querySelector("#step"),
rateCallback:function rateCallback(rating, done) {
this.setRating(rating);
done();
},
starSize:32,
step:0.5
})
window.raterJs({
element:document.querySelector("#unli1"),
rateCallback:function rateCallback(rating, done) {
this.setRating(rating);
done();
},
starSize:32,
max:10,
step:0.5
})
window.raterJs({
element:document.querySelector("#unli2"),
rateCallback:function rateCallback(rating, done) {
this.setRating(rating);
done();
},
starSize:32,
max:16,
step:0.5
})

View File

@@ -0,0 +1,154 @@
document.getElementById('basic').addEventListener('click', (e) => {
Swal.fire('Any fool can use a computer')
})
document.getElementById('footer').addEventListener('click', (e) => {
Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Something went wrong!',
footer: '<a href>Why do I have this issue?</a>'
})
})
document.getElementById('title').addEventListener('click', (e) => {
Swal.fire(
'The Internet?',
'That thing is still around?',
'question'
)
})
document.getElementById('success').addEventListener('click', (e) => {
Swal.fire({
icon: "success",
title: "Success"
})
})
document.getElementById('error').addEventListener('click', (e) => {
Swal.fire({
icon: "error",
title: "Error"
})
})
document.getElementById('warning').addEventListener('click', (e) => {
Swal.fire({
icon: "warning",
title: "Warning"
})
})
document.getElementById('info').addEventListener('click', (e) => {
Swal.fire({
icon: "info",
title: "Info"
})
})
document.getElementById('question').addEventListener('click', (e) => {
Swal.fire({
icon: "question",
title: "Question"
})
})
document.getElementById('text').addEventListener('click', (e) => {
Swal.fire({
title: 'Enter your IP address',
input: 'text',
inputLabel: 'Your IP address',
showCancelButton: true,
})
})
document.getElementById('email').addEventListener('click', async (e) => {
const { value: email } = await Swal.fire({
title: 'Input email address',
input: 'email',
inputLabel: 'Your email address',
inputPlaceholder: 'Enter your email address'
})
if (email) {
Swal.fire(`Entered email: ${email}`)
}
})
document.getElementById('url').addEventListener('click', async (e) => {
const { value: url } = await Swal.fire({
input: 'url',
inputLabel: 'URL address',
inputPlaceholder: 'Enter the URL'
})
if (url) {
Swal.fire(`Entered URL: ${url}`)
}
})
document.getElementById('password').addEventListener('click', async (e) => {
const { value: password } = await Swal.fire({
title: 'Enter your password',
input: 'password',
inputLabel: 'Password',
inputPlaceholder: 'Enter your password',
inputAttributes: {
maxlength: 10,
autocapitalize: 'off',
autocorrect: 'off'
}
})
if (password) {
Swal.fire(`Entered password: ${password}`)
}
})
document.getElementById('textarea').addEventListener('click', async (e) => {
const { value: text } = await Swal.fire({
input: 'textarea',
inputLabel: 'Message',
inputPlaceholder: 'Type your message here...',
inputAttributes: {
'aria-label': 'Type your message here'
},
showCancelButton: true
})
if (text) {
Swal.fire(text)
}
})
document.getElementById('select').addEventListener('click', async (e) => {
const { value: fruit } = await Swal.fire({
title: 'Select field validation',
input: 'select',
inputOptions: {
'Fruits': {
apples: 'Apples',
bananas: 'Bananas',
grapes: 'Grapes',
oranges: 'Oranges'
},
'Vegetables': {
potato: 'Potato',
broccoli: 'Broccoli',
carrot: 'Carrot'
},
'icecream': 'Ice cream'
},
inputPlaceholder: 'Select a fruit',
showCancelButton: true,
inputValidator: (value) => {
return new Promise((resolve) => {
if (value === 'oranges') {
resolve()
} else {
resolve('You need to select oranges :)')
}
})
}
})
if (fruit) {
Swal.fire(`You selected: ${fruit}`)
}
})

View File

@@ -0,0 +1,81 @@
document.getElementById('basic').addEventListener('click', () => {
Toastify({
text: "This is a toast",
duration: 3000
}).showToast();
})
document.getElementById('background').addEventListener('click', () => {
Toastify({
text: "This is a toast",
duration: 3000,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
})
document.getElementById('close').addEventListener('click', () => {
Toastify({
text: "Click close button",
duration: 3000,
close:true,
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('top-left').addEventListener('click', () => {
Toastify({
text: "This is toast in top left",
duration: 3000,
close:true,
gravity:"top",
position: "left",
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('top-center').addEventListener('click', () => {
Toastify({
text: "This is toast in top center",
duration: 3000,
close:true,
gravity:"top",
position: "center",
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('top-right').addEventListener('click', () => {
Toastify({
text: "This is toast in top right",
duration: 3000,
close:true,
gravity:"top",
position: "right",
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('bottom-right').addEventListener('click', () => {
Toastify({
text: "This is toast in bottom right",
duration: 3000,
close:true,
gravity:"bottom",
position: "right",
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('bottom-center').addEventListener('click', () => {
Toastify({
text: "This is toast in bottom center",
duration: 3000,
close:true,
gravity:"bottom",
position: "center",
backgroundColor: "#4fbe87",
}).showToast();
})
document.getElementById('bottom-left').addEventListener('click', () => {
Toastify({
text: "This is toast in bottom left",
duration: 3000,
close:true,
gravity:"bottom",
position: "left",
backgroundColor: "#4fbe87",
}).showToast();
})

51
assets/js/main.js Normal file
View File

@@ -0,0 +1,51 @@
function slideToggle(t,e,o){0===t.clientHeight?j(t,e,o,!0):j(t,e,o)}function slideUp(t,e,o){j(t,e,o)}function slideDown(t,e,o){j(t,e,o,!0)}function j(t,e,o,i){void 0===e&&(e=400),void 0===i&&(i=!1),t.style.overflow="hidden",i&&(t.style.display="block");var p,l=window.getComputedStyle(t),n=parseFloat(l.getPropertyValue("height")),a=parseFloat(l.getPropertyValue("padding-top")),s=parseFloat(l.getPropertyValue("padding-bottom")),r=parseFloat(l.getPropertyValue("margin-top")),d=parseFloat(l.getPropertyValue("margin-bottom")),g=n/e,y=a/e,m=s/e,u=r/e,h=d/e;window.requestAnimationFrame(function l(x){void 0===p&&(p=x);var f=x-p;i?(t.style.height=g*f+"px",t.style.paddingTop=y*f+"px",t.style.paddingBottom=m*f+"px",t.style.marginTop=u*f+"px",t.style.marginBottom=h*f+"px"):(t.style.height=n-g*f+"px",t.style.paddingTop=a-y*f+"px",t.style.paddingBottom=s-m*f+"px",t.style.marginTop=r-u*f+"px",t.style.marginBottom=d-h*f+"px"),f>=e?(t.style.height="",t.style.paddingTop="",t.style.paddingBottom="",t.style.marginTop="",t.style.marginBottom="",t.style.overflow="",i||(t.style.display="none"),"function"==typeof o&&o()):window.requestAnimationFrame(l)})}
let sidebarItems = document.querySelectorAll('.sidebar-item.has-sub');
for(var i = 0; i < sidebarItems.length; i++) {
let sidebarItem = sidebarItems[i];
sidebarItems[i].querySelector('.sidebar-link').addEventListener('click', function(e) {
e.preventDefault();
let submenu = sidebarItem.querySelector('.submenu');
if( submenu.classList.contains('active') ) submenu.style.display = "block"
if( submenu.style.display == "none" ) submenu.classList.add('active')
else submenu.classList.remove('active')
slideToggle(submenu, 300)
})
}
window.addEventListener('DOMContentLoaded', (event) => {
var w = window.innerWidth;
if(w < 1200) {
document.getElementById('sidebar').classList.remove('active');
}
});
window.addEventListener('resize', (event) => {
var w = window.innerWidth;
if(w < 1200) {
document.getElementById('sidebar').classList.remove('active');
}else{
document.getElementById('sidebar').classList.add('active');
}
});
document.querySelector('.burger-btn').addEventListener('click', () => {
document.getElementById('sidebar').classList.toggle('active');
})
document.querySelector('.sidebar-hide').addEventListener('click', () => {
document.getElementById('sidebar').classList.toggle('active');
})
// Perfect Scrollbar Init
if(typeof PerfectScrollbar == 'function') {
const container = document.querySelector(".sidebar-wrapper");
const ps = new PerfectScrollbar(container, {
wheelPropagation: false
});
}
// Scroll into active sidebar
document.querySelector('.sidebar-item.active').scrollIntoView(false)

View File

@@ -0,0 +1,116 @@
var optionsProfileVisit = {
annotations: {
position: 'back'
},
dataLabels: {
enabled:false
},
chart: {
type: 'bar',
height: 300
},
fill: {
opacity:1
},
plotOptions: {
},
series: [{
name: 'sales',
data: [9,20,30,20,10,20,30,20,10,20,30,20]
}],
colors: '#435ebe',
xaxis: {
categories: ["Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug","Sep","Oct","Nov","Dec"],
},
}
let optionsVisitorsProfile = {
series: [70, 30],
labels: ['Male', 'Female'],
colors: ['#435ebe','#55c6e8'],
chart: {
type: 'donut',
width: '100%',
height:'350px'
},
legend: {
position: 'bottom'
},
plotOptions: {
pie: {
donut: {
size: '30%'
}
}
}
}
var optionsEurope = {
series: [{
name: 'series1',
data: [310, 800, 600, 430, 540, 340, 605, 805,430, 540, 340, 605]
}],
chart: {
height: 80,
type: 'area',
toolbar: {
show:false,
},
},
colors: ['#5350e9'],
stroke: {
width: 2,
},
grid: {
show:false,
},
dataLabels: {
enabled: false
},
xaxis: {
type: 'datetime',
categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z", "2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z", "2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z","2018-09-19T07:30:00.000Z","2018-09-19T08:30:00.000Z","2018-09-19T09:30:00.000Z","2018-09-19T10:30:00.000Z","2018-09-19T11:30:00.000Z"],
axisBorder: {
show:false
},
axisTicks: {
show:false
},
labels: {
show:false,
}
},
show:false,
yaxis: {
labels: {
show:false,
},
},
tooltip: {
x: {
format: 'dd/MM/yy HH:mm'
},
},
};
let optionsAmerica = {
...optionsEurope,
colors: ['#008b75'],
}
let optionsIndonesia = {
...optionsEurope,
colors: ['#dc3545'],
}
var chartProfileVisit = new ApexCharts(document.querySelector("#chart-profile-visit"), optionsProfileVisit);
var chartVisitorsProfile = new ApexCharts(document.getElementById('chart-visitors-profile'), optionsVisitorsProfile)
var chartEurope = new ApexCharts(document.querySelector("#chart-europe"), optionsEurope);
var chartAmerica = new ApexCharts(document.querySelector("#chart-america"), optionsAmerica);
var chartIndonesia = new ApexCharts(document.querySelector("#chart-indonesia"), optionsIndonesia);
chartIndonesia.render();
chartAmerica.render();
chartEurope.render();
chartProfileVisit.render();
chartVisitorsProfile.render()

View File

@@ -0,0 +1,32 @@
var snow = new Quill('#snow', {
theme: 'snow'
});
var bubble = new Quill('#bubble', {
theme: 'bubble'
});
new Quill("#full", {
bounds: "#full-container .editor",
modules: {
toolbar: [
[{ font: [] }, { size: [] }],
["bold", "italic", "underline", "strike"],
[
{ color: [] },
{ background: [] }
],
[
{ script: "super" },
{ script: "sub" }
],
[
{ list: "ordered" },
{ list: "bullet" },
{ indent: "-1" },
{ indent: "+1" }
],
["direction", { align: [] }],
["link", "image", "video"],
["clean"]]
},
theme: "snow"
})

View File

@@ -0,0 +1,519 @@
var lineOptions = {
chart: {
type: "line",
},
series: [
{
name: "sales",
data: [30, 40, 35, 50, 49, 60, 70, 91, 125],
},
],
xaxis: {
categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999],
},
};
var candleOptions = {
series: [
{
name: "candle",
data: [
{
x: new Date(1538778600000),
y: [6629.81, 6650.5, 6623.04, 6633.33],
},
{
x: new Date(1538780400000),
y: [6632.01, 6643.59, 6620, 6630.11],
},
{
x: new Date(1538782200000),
y: [6630.71, 6648.95, 6623.34, 6635.65],
},
{
x: new Date(1538784000000),
y: [6635.65, 6651, 6629.67, 6638.24],
},
{
x: new Date(1538785800000),
y: [6638.24, 6640, 6620, 6624.47],
},
{
x: new Date(1538787600000),
y: [6624.53, 6636.03, 6621.68, 6624.31],
},
{
x: new Date(1538789400000),
y: [6624.61, 6632.2, 6617, 6626.02],
},
{
x: new Date(1538791200000),
y: [6627, 6627.62, 6584.22, 6603.02],
},
{
x: new Date(1538793000000),
y: [6605, 6608.03, 6598.95, 6604.01],
},
{
x: new Date(1538794800000),
y: [6604.5, 6614.4, 6602.26, 6608.02],
},
{
x: new Date(1538796600000),
y: [6608.02, 6610.68, 6601.99, 6608.91],
},
{
x: new Date(1538798400000),
y: [6608.91, 6618.99, 6608.01, 6612],
},
{
x: new Date(1538800200000),
y: [6612, 6615.13, 6605.09, 6612],
},
{
x: new Date(1538802000000),
y: [6612, 6624.12, 6608.43, 6622.95],
},
{
x: new Date(1538803800000),
y: [6623.91, 6623.91, 6615, 6615.67],
},
{
x: new Date(1538805600000),
y: [6618.69, 6618.74, 6610, 6610.4],
},
{
x: new Date(1538807400000),
y: [6611, 6622.78, 6610.4, 6614.9],
},
{
x: new Date(1538809200000),
y: [6614.9, 6626.2, 6613.33, 6623.45],
},
{
x: new Date(1538811000000),
y: [6623.48, 6627, 6618.38, 6620.35],
},
{
x: new Date(1538812800000),
y: [6619.43, 6620.35, 6610.05, 6615.53],
},
{
x: new Date(1538814600000),
y: [6615.53, 6617.93, 6610, 6615.19],
},
{
x: new Date(1538816400000),
y: [6615.19, 6621.6, 6608.2, 6620],
},
{
x: new Date(1538818200000),
y: [6619.54, 6625.17, 6614.15, 6620],
},
{
x: new Date(1538820000000),
y: [6620.33, 6634.15, 6617.24, 6624.61],
},
{
x: new Date(1538821800000),
y: [6625.95, 6626, 6611.66, 6617.58],
},
{
x: new Date(1538823600000),
y: [6619, 6625.97, 6595.27, 6598.86],
},
{
x: new Date(1538825400000),
y: [6598.86, 6598.88, 6570, 6587.16],
},
{
x: new Date(1538827200000),
y: [6588.86, 6600, 6580, 6593.4],
},
{
x: new Date(1538829000000),
y: [6593.99, 6598.89, 6585, 6587.81],
},
{
x: new Date(1538830800000),
y: [6587.81, 6592.73, 6567.14, 6578],
},
{
x: new Date(1538832600000),
y: [6578.35, 6581.72, 6567.39, 6579],
},
{
x: new Date(1538834400000),
y: [6579.38, 6580.92, 6566.77, 6575.96],
},
{
x: new Date(1538836200000),
y: [6575.96, 6589, 6571.77, 6588.92],
},
{
x: new Date(1538838000000),
y: [6588.92, 6594, 6577.55, 6589.22],
},
{
x: new Date(1538839800000),
y: [6589.3, 6598.89, 6589.1, 6596.08],
},
{
x: new Date(1538841600000),
y: [6597.5, 6600, 6588.39, 6596.25],
},
{
x: new Date(1538843400000),
y: [6598.03, 6600, 6588.73, 6595.97],
},
{
x: new Date(1538845200000),
y: [6595.97, 6602.01, 6588.17, 6602],
},
{
x: new Date(1538847000000),
y: [6602, 6607, 6596.51, 6599.95],
},
{
x: new Date(1538848800000),
y: [6600.63, 6601.21, 6590.39, 6591.02],
},
{
x: new Date(1538850600000),
y: [6591.02, 6603.08, 6591, 6591],
},
{
x: new Date(1538852400000),
y: [6591, 6601.32, 6585, 6592],
},
{
x: new Date(1538854200000),
y: [6593.13, 6596.01, 6590, 6593.34],
},
{
x: new Date(1538856000000),
y: [6593.34, 6604.76, 6582.63, 6593.86],
},
{
x: new Date(1538857800000),
y: [6593.86, 6604.28, 6586.57, 6600.01],
},
{
x: new Date(1538859600000),
y: [6601.81, 6603.21, 6592.78, 6596.25],
},
{
x: new Date(1538861400000),
y: [6596.25, 6604.2, 6590, 6602.99],
},
{
x: new Date(1538863200000),
y: [6602.99, 6606, 6584.99, 6587.81],
},
{
x: new Date(1538865000000),
y: [6587.81, 6595, 6583.27, 6591.96],
},
{
x: new Date(1538866800000),
y: [6591.97, 6596.07, 6585, 6588.39],
},
{
x: new Date(1538868600000),
y: [6587.6, 6598.21, 6587.6, 6594.27],
},
{
x: new Date(1538870400000),
y: [6596.44, 6601, 6590, 6596.55],
},
{
x: new Date(1538872200000),
y: [6598.91, 6605, 6596.61, 6600.02],
},
{
x: new Date(1538874000000),
y: [6600.55, 6605, 6589.14, 6593.01],
},
{
x: new Date(1538875800000),
y: [6593.15, 6605, 6592, 6603.06],
},
{
x: new Date(1538877600000),
y: [6603.07, 6604.5, 6599.09, 6603.89],
},
{
x: new Date(1538879400000),
y: [6604.44, 6604.44, 6600, 6603.5],
},
{
x: new Date(1538881200000),
y: [6603.5, 6603.99, 6597.5, 6603.86],
},
{
x: new Date(1538883000000),
y: [6603.85, 6605, 6600, 6604.07],
},
{
x: new Date(1538884800000),
y: [6604.98, 6606, 6604.07, 6606],
},
],
},
],
chart: {
height: 350,
type: "candlestick",
},
title: {
text: "CandleStick Chart - Category X-axis",
align: "left",
},
annotations: {
xaxis: [
{
x: "Oct 06 14:00",
borderColor: "#00E396",
label: {
borderColor: "#00E396",
style: {
fontSize: "12px",
color: "#fff",
background: "#00E396",
},
orientation: "horizontal",
offsetY: 7,
text: "Annotation Test",
},
},
],
},
tooltip: {
enabled: true,
},
xaxis: {
type: "category",
labels: {
formatter: function(val) {
return dayjs(val).format("MMM DD HH:mm");
},
},
},
yaxis: {
tooltip: {
enabled: true,
},
},
};
var barOptions = {
series: [
{
name: "Net Profit",
data: [44, 55, 57, 56, 61, 58, 63, 60, 66],
},
{
name: "Revenue",
data: [76, 85, 101, 98, 87, 105, 91, 114, 94],
},
{
name: "Free Cash Flow",
data: [35, 41, 36, 26, 45, 48, 52, 53, 41],
},
],
chart: {
type: "bar",
height: 350,
},
plotOptions: {
bar: {
horizontal: false,
columnWidth: "55%",
endingShape: "rounded",
},
},
dataLabels: {
enabled: false,
},
stroke: {
show: true,
width: 2,
colors: ["transparent"],
},
xaxis: {
categories: ["Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"],
},
yaxis: {
title: {
text: "$ (thousands)",
},
},
fill: {
opacity: 1,
},
tooltip: {
y: {
formatter: function(val) {
return "$ " + val + " thousands";
},
},
},
};
var radialGradientOptions = {
series: [75],
chart: {
height: 350,
type: "radialBar",
toolbar: {
show: true,
},
},
plotOptions: {
radialBar: {
startAngle: -135,
endAngle: 225,
hollow: {
margin: 0,
size: "70%",
background: "#fff",
image: undefined,
imageOffsetX: 0,
imageOffsetY: 0,
position: "front",
dropShadow: {
enabled: true,
top: 3,
left: 0,
blur: 4,
opacity: 0.24,
},
},
track: {
background: "#fff",
strokeWidth: "67%",
margin: 0, // margin is in pixels
dropShadow: {
enabled: true,
top: -3,
left: 0,
blur: 4,
opacity: 0.35,
},
},
dataLabels: {
show: true,
name: {
offsetY: -10,
show: true,
color: "#888",
fontSize: "17px",
},
value: {
formatter: function(val) {
return parseInt(val);
},
color: "#111",
fontSize: "36px",
show: true,
},
},
},
},
fill: {
type: "gradient",
gradient: {
shade: "dark",
type: "horizontal",
shadeIntensity: 0.5,
gradientToColors: ["#ABE5A1"],
inverseColors: true,
opacityFrom: 1,
opacityTo: 1,
stops: [0, 100],
},
},
stroke: {
lineCap: "round",
},
labels: ["Percent"],
};
var areaOptions = {
series: [
{
name: "series1",
data: [31, 40, 28, 51, 42, 109, 100],
},
{
name: "series2",
data: [11, 32, 45, 32, 34, 52, 41],
},
],
chart: {
height: 350,
type: "area",
},
dataLabels: {
enabled: false,
},
stroke: {
curve: "smooth",
},
xaxis: {
type: "datetime",
categories: [
"2018-09-19T00:00:00.000Z",
"2018-09-19T01:30:00.000Z",
"2018-09-19T02:30:00.000Z",
"2018-09-19T03:30:00.000Z",
"2018-09-19T04:30:00.000Z",
"2018-09-19T05:30:00.000Z",
"2018-09-19T06:30:00.000Z",
],
},
tooltip: {
x: {
format: "dd/MM/yy HH:mm",
},
},
};
var radialBarOptions = {
series: [44, 55, 67, 83],
chart: {
height: 350,
type: "radialBar",
},
plotOptions: {
radialBar: {
dataLabels: {
name: {
fontSize: "22px",
},
value: {
fontSize: "16px",
},
total: {
show: true,
label: "Total",
formatter: function(w) {
// By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
return 249;
},
},
},
},
},
labels: ["Apples", "Oranges", "Bananas", "Berries"],
};
var bar = new ApexCharts(document.querySelector("#bar"), barOptions);
var line = new ApexCharts(document.querySelector("#line"), lineOptions);
var candle = new ApexCharts(document.querySelector("#candle"), candleOptions);
var radialGradient = new ApexCharts(document.querySelector("#radialGradient"), radialGradientOptions);
var area = new ApexCharts(document.querySelector("#area"), areaOptions);
area.render();
radialGradient.render();
candle.render();
bar.render();
line.render();

View File

@@ -0,0 +1,427 @@
var chartColors = {
red: 'rgb(255, 99, 132)',
orange: 'rgb(255, 159, 64)',
yellow: 'rgb(255, 205, 86)',
green: 'rgb(75, 192, 192)',
info: '#41B1F9',
blue: '#3245D1',
purple: 'rgb(153, 102, 255)',
grey: '#EBEFF6'
};
var config1 = {
type: "line",
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "Balance",
backgroundColor: "#fff",
borderColor: "#fff",
data: [20, 40, 20, 70, 10, 50, 20],
fill: false,
pointBorderWidth: 100,
pointBorderColor: "transparent",
pointRadius: 3,
pointBackgroundColor: "transparent",
pointHoverBackgroundColor: "rgba(63,82,227,1)",
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
layout: {
padding: {
left: -10,
top: 10,
},
},
legend: {
display: false,
},
title: {
display: false,
},
tooltips: {
mode: "index",
intersect: false,
},
hover: {
mode: "nearest",
intersect: true,
},
scales: {
xAxes: [
{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
},
},
],
yAxes: [
{
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
display: false,
},
},
],
},
},
};
var config2 = {
type: "line",
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "Revenue",
backgroundColor: "#fff",
borderColor: "#fff",
data: [20, 800, 300, 400, 10, 50, 20],
fill: false,
pointBorderWidth: 100,
pointBorderColor: "transparent",
pointRadius: 3,
pointBackgroundColor: "transparent",
pointHoverBackgroundColor: "rgba(63,82,227,1)",
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
layout: {
padding: {
left: -10,
top: 10,
},
},
legend: {
display: false,
},
title: {
display: false,
},
tooltips: {
mode: "index",
intersect: false,
},
hover: {
mode: "nearest",
intersect: true,
},
scales: {
xAxes: [
{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
},
},
],
yAxes: [
{
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
display: false,
},
},
],
},
},
};
var config3 = {
type: "line",
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "Orders",
backgroundColor: "#fff",
borderColor: "#fff",
data: [20, 40, 20, 200, 10, 540, 723],
fill: false,
pointBorderWidth: 100,
pointBorderColor: "transparent",
pointRadius: 3,
pointBackgroundColor: "transparent",
pointHoverBackgroundColor: "rgba(63,82,227,1)",
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
layout: {
padding: {
left: -10,
top: 10,
},
},
legend: {
display: false,
},
title: {
display: false,
text: "Chart.js Line Chart",
},
tooltips: {
mode: "index",
intersect: false,
},
hover: {
mode: "nearest",
intersect: true,
},
scales: {
xAxes: [
{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
},
},
],
yAxes: [
{
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
display: false,
},
},
],
},
},
};
var config4 = {
type: "line",
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
backgroundColor: "#fff",
borderColor: "#fff",
data: [20, 40, 20, 70, 10, 5, 23],
fill: false,
pointBorderWidth: 100,
pointBorderColor: "transparent",
pointRadius: 3,
pointBackgroundColor: "transparent",
pointHoverBackgroundColor: "rgba(63,82,227,1)",
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
layout: {
padding: {
left: -10,
top: 10,
},
},
legend: {
display: false,
},
title: {
display: false,
text: "Chart.js Line Chart",
},
tooltips: {
mode: "index",
intersect: false,
},
hover: {
mode: "nearest",
intersect: true,
},
scales: {
xAxes: [
{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
},
},
],
yAxes: [
{
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
display: false,
},
},
],
},
},
};
var ctxBar = document.getElementById("bar").getContext("2d");
var myBar = new Chart(ctxBar, {
type: 'bar',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
datasets: [{
label: 'Students',
backgroundColor: [chartColors.grey, chartColors.grey, chartColors.grey, chartColors.grey, chartColors.info, chartColors.blue, chartColors.grey],
data: [
5,
10,
30,
40,
35,
55,
15,
]
}]
},
options: {
responsive: true,
barRoundness: 1,
title: {
display: true,
text: "Students in 2020"
},
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
suggestedMax: 40 + 20,
padding: 10,
},
gridLines: {
drawBorder: false,
}
}],
xAxes: [{
gridLines: {
display: false,
drawBorder: false
}
}]
}
}
});
var line = document.getElementById("line").getContext("2d");
var gradient = line.createLinearGradient(0, 0, 0, 400);
gradient.addColorStop(0, 'rgba(50, 69, 209,1)');
gradient.addColorStop(1, 'rgba(265, 177, 249,0)');
var gradient2 = line.createLinearGradient(0, 0, 0, 400);
gradient2.addColorStop(0, 'rgba(255, 91, 92,1)');
gradient2.addColorStop(1, 'rgba(265, 177, 249,0)');
var myline = new Chart(line, {
type: 'line',
data: {
labels: ['16-07-2018', '17-07-2018', '18-07-2018', '19-07-2018', '20-07-2018', '21-07-2018', '22-07-2018', '23-07-2018', '24-07-2018', '25-07-2018'],
datasets: [{
label: 'Balance',
data: [50, 25, 61, 50, 72, 52, 60, 41, 30, 45],
backgroundColor: "rgba(50, 69, 209,.6)",
borderWidth: 3,
borderColor: 'rgba(63,82,227,1)',
pointBorderWidth: 0,
pointBorderColor: 'transparent',
pointRadius: 3,
pointBackgroundColor: 'transparent',
pointHoverBackgroundColor: 'rgba(63,82,227,1)',
}, {
label: 'Balance',
data: [20, 35, 45, 75, 37, 86, 45, 65, 25, 53],
backgroundColor: "rgba(253, 183, 90,.6)",
borderWidth: 3,
borderColor: 'rgba(253, 183, 90,.6)',
pointBorderWidth: 0,
pointBorderColor: 'transparent',
pointRadius: 3,
pointBackgroundColor: 'transparent',
pointHoverBackgroundColor: 'rgba(63,82,227,1)',
}]
},
options: {
responsive: true,
layout: {
padding: {
top: 10,
},
},
tooltips: {
intersect: false,
titleFontFamily: 'Helvetica',
titleMarginBottom: 10,
xPadding: 10,
yPadding: 10,
cornerRadius: 3,
},
legend: {
display: true,
},
scales: {
yAxes: [
{
gridLines: {
display: true,
drawBorder: true,
},
ticks: {
display: true,
},
},
],
xAxes: [
{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
},
},
],
},
}
});
// let ctx1 = document.getElementById("canvas1").getContext("2d");
// let ctx2 = document.getElementById("canvas2").getContext("2d");
// let ctx3 = document.getElementById("canvas3").getContext("2d");
// let ctx4 = document.getElementById("canvas4").getContext("2d");
// var lineChart1 = new Chart(ctx1, config1);
// var lineChart2 = new Chart(ctx2, config2);
// var lineChart3 = new Chart(ctx3, config3);
// var lineChart4 = new Chart(ctx4, config4);

0
assets/js/vendors.js Normal file
View File

11
bootstrap.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
// bootstrap.php - Haupt-Bootstrap-Datei für Doctrine
use Doctrine\ORM\EntityManager;
// EntityManager laden
$entityManager = require_once __DIR__ . '/doctrine-config.php';
// Nun kann $entityManager in anderen Dateien verwendet werden:
// require_once 'bootstrap.php';
// $repository = $entityManager->getRepository(Entity\YourEntity::class);

11
cli-config.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
// cli-config.php - Konfiguration für Doctrine CLI Tools
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;
$entityManager = require __DIR__ . '/doctrine-config.php';
return ConsoleRunner::createApplication(
new SingleManagerProvider($entityManager)
);

13
composer.json Normal file
View File

@@ -0,0 +1,13 @@
{
"require": {
"doctrine/orm": "^3.5",
"doctrine/dbal": "^4.3",
"symfony/cache": "^7.3"
},
"autoload": {
"psr-4": {
"Entity\\": "src/Entity/",
"Repository\\": "src/Repository/"
}
}
}

5
config.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
$databaseHost = 'localhost';
$databaseUser = 'root';
$databasePassword = '';
$databaseDatabase = 'paid4click';

31
doctrine-config.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
// doctrine-config.php
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\ORMSetup;
require_once "vendor/autoload.php";
require_once "config.php";
// Pfad zu den Entity-Klassen
$paths = [__DIR__ . "/src/Entity"];
$isDevMode = true;
// Doctrine ORM Konfiguration
$config = ORMSetup::createAttributeMetadataConfiguration($paths, $isDevMode);
// Datenbankverbindungs-Parameter aus config.php
$connectionParams = [
'driver' => 'pdo_mysql',
'host' => $databaseHost,
'user' => $databaseUser,
'password' => $databasePassword,
'dbname' => $databaseDatabase,
'charset' => 'utf8mb4',
];
$connection = DriverManager::getConnection($connectionParams, $config);
$entityManager = new EntityManager($connection, $config);
return $entityManager;

View File

@@ -0,0 +1,179 @@
<?php
// example-repository-usage.php - Beispiele für die Verwendung des UserRepository
require_once 'bootstrap.php';
use Entity\User;
use Repository\UserRepository;
/** @var UserRepository $userRepo */
$userRepo = $entityManager->getRepository(User::class);
// Beispiel 1: Neuen User erstellen und speichern
function createUser($userRepo, $username, $email, $password)
{
$user = new User();
$user->setUsername($username);
$user->setEmail($email);
$user->setPassword(password_hash($password, PASSWORD_DEFAULT));
$userRepo->save($user);
echo "User erstellt mit ID: " . $user->getId() . "\n";
return $user;
}
// Beispiel 2: User nach ID finden
function getUserById($userRepo, $id)
{
$user = $userRepo->findById($id);
if ($user) {
echo "User gefunden: " . $user->getUsername() . "\n";
} else {
echo "User nicht gefunden\n";
}
return $user;
}
// Beispiel 3: User nach Username finden
function getUserByUsername($userRepo, $username)
{
$user = $userRepo->findByUsername($username);
if ($user) {
echo "User gefunden: " . $user->getEmail() . "\n";
} else {
echo "User nicht gefunden\n";
}
return $user;
}
// Beispiel 4: User nach Email finden
function getUserByEmail($userRepo, $email)
{
$user = $userRepo->findByEmail($email);
if ($user) {
echo "User gefunden: " . $user->getUsername() . "\n";
} else {
echo "User nicht gefunden\n";
}
return $user;
}
// Beispiel 5: Alle User abrufen
function getAllUsers($userRepo)
{
$users = $userRepo->findAllUsers();
echo "Anzahl User: " . count($users) . "\n";
foreach ($users as $user) {
echo "- " . $user->getUsername() . " (" . $user->getEmail() . ")\n";
}
return $users;
}
// Beispiel 6: Prüfen ob Username existiert
function checkUsernameExists($userRepo, $username)
{
$exists = $userRepo->usernameExists($username);
echo "Username '$username' existiert: " . ($exists ? 'Ja' : 'Nein') . "\n";
return $exists;
}
// Beispiel 7: Prüfen ob Email existiert
function checkEmailExists($userRepo, $email)
{
$exists = $userRepo->emailExists($email);
echo "Email '$email' existiert: " . ($exists ? 'Ja' : 'Nein') . "\n";
return $exists;
}
// Beispiel 8: User suchen (LIKE)
function searchUsers($userRepo, $search)
{
$users = $userRepo->searchByUsername($search);
echo "Gefundene User für '$search': " . count($users) . "\n";
foreach ($users as $user) {
echo "- " . $user->getUsername() . "\n";
}
return $users;
}
// Beispiel 9: User zählen
function countAllUsers($userRepo)
{
$count = $userRepo->countUsers();
echo "Gesamtanzahl User: $count\n";
return $count;
}
// Beispiel 10: User nach Erstellungsdatum finden
function getRecentUsers($userRepo, $daysAgo = 7)
{
$date = new DateTime();
$date->modify("-$daysAgo days");
$users = $userRepo->findByCreatedAfter($date);
echo "User erstellt in den letzten $daysAgo Tagen: " . count($users) . "\n";
foreach ($users as $user) {
echo "- " . $user->getUsername() . " (" . $user->getCreatedAt()->format('Y-m-d H:i:s') . ")\n";
}
return $users;
}
// Beispiel 11: User aktualisieren
function updateUser($userRepo, $id, $newEmail)
{
$user = $userRepo->findById($id);
if ($user) {
$user->setEmail($newEmail);
$userRepo->save($user);
echo "User aktualisiert\n";
} else {
echo "User nicht gefunden\n";
}
}
// Beispiel 12: User löschen
function deleteUser($userRepo, $id)
{
$user = $userRepo->findById($id);
if ($user) {
$userRepo->delete($user);
echo "User gelöscht\n";
} else {
echo "User nicht gefunden\n";
}
}
// Verwendungsbeispiele (auskommentiert):
// createUser($userRepo, 'john_doe', 'john@example.com', 'secret123');
// getUserById($userRepo, 1);
// getUserByUsername($userRepo, 'john_doe');
// getUserByEmail($userRepo, 'john@example.com');
// getAllUsers($userRepo);
// checkUsernameExists($userRepo, 'john_doe');
// checkEmailExists($userRepo, 'john@example.com');
// searchUsers($userRepo, 'john');
// countAllUsers($userRepo);
// getRecentUsers($userRepo, 7);
// updateUser($userRepo, 1, 'newemail@example.com');
// deleteUser($userRepo, 1);

100
example-usage.php Normal file
View File

@@ -0,0 +1,100 @@
<?php
// example-usage.php - Beispiel zur Verwendung von Doctrine
require_once 'bootstrap.php';
use Entity\User;
// Beispiel 1: Neuen User erstellen
function createUser($entityManager, $username, $email, $password)
{
$user = new User();
$user->setUsername($username);
$user->setEmail($email);
$user->setPassword(password_hash($password, PASSWORD_DEFAULT));
$entityManager->persist($user);
$entityManager->flush();
echo "User created with ID: " . $user->getId() . "\n";
return $user;
}
// Beispiel 2: User suchen
function findUserById($entityManager, $id)
{
$user = $entityManager->find(User::class, $id);
if ($user) {
echo "Found user: " . $user->getUsername() . " (" . $user->getEmail() . ")\n";
} else {
echo "User not found\n";
}
return $user;
}
// Beispiel 3: Alle User abrufen
function getAllUsers($entityManager)
{
$userRepository = $entityManager->getRepository(User::class);
$users = $userRepository->findAll();
echo "Found " . count($users) . " users:\n";
foreach ($users as $user) {
echo "- " . $user->getUsername() . " (" . $user->getEmail() . ")\n";
}
return $users;
}
// Beispiel 4: User nach Email suchen
function findUserByEmail($entityManager, $email)
{
$userRepository = $entityManager->getRepository(User::class);
$user = $userRepository->findOneBy(['email' => $email]);
if ($user) {
echo "Found user by email: " . $user->getUsername() . "\n";
} else {
echo "No user found with email: $email\n";
}
return $user;
}
// Beispiel 5: User aktualisieren
function updateUser($entityManager, $id, $newEmail)
{
$user = $entityManager->find(User::class, $id);
if ($user) {
$user->setEmail($newEmail);
$entityManager->flush();
echo "User updated\n";
} else {
echo "User not found\n";
}
}
// Beispiel 6: User löschen
function deleteUser($entityManager, $id)
{
$user = $entityManager->find(User::class, $id);
if ($user) {
$entityManager->remove($user);
$entityManager->flush();
echo "User deleted\n";
} else {
echo "User not found\n";
}
}
// Verwendungsbeispiel (auskommentiert):
// createUser($entityManager, 'johndoe', 'john@example.com', 'secret123');
// findUserById($entityManager, 1);
// getAllUsers($entityManager);
// findUserByEmail($entityManager, 'john@example.com');
// updateUser($entityManager, 1, 'newemail@example.com');
// deleteUser($entityManager, 1);

1916
index.php Normal file

File diff suppressed because it is too large Load Diff

56
package.json Normal file
View File

@@ -0,0 +1,56 @@
{
"name": "mazer",
"version": "1.0.0",
"description": "Mazer",
"main": "index.js",
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js --progress --watch ",
"hot": "node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"author": "zuramai",
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.6.0",
"apexcharts": "^3.23.1",
"bootstrap-icons": "^1.11.3",
"chart.js": "^2.9.3",
"choices.js": "^9.0.1",
"ckeditor4": "^4.22.1",
"cross-env": "^7.0.3",
"dayjs": "^1.8.29",
"dragula": "^3.7.2",
"dripicons": "^2.0.0",
"feather-icons": "^4.28.0",
"iconly": "^1.0.1",
"jquery": "^3.7.1",
"laravel-mix": "^6.0.10",
"nunjucks": "^3.2.1",
"perfect-scrollbar": "^1.5.0",
"popper.js": "^1.16.1",
"quill": "^1.3.7",
"rater-js": "^1.0.1",
"simple-datatables": "^2.1.13",
"summernote": "^0.8.20",
"sweetalert2": "^10.13.0",
"tinymce": "^6.8.3",
"toastify-js": "^1.8.0",
"toastr": "^2.1.4",
"webpack": "^5.15.0"
},
"devDependencies": {
"bootstrap": "^5.0.0-beta1",
"browser-sync": "^2.26.13",
"browser-sync-webpack-plugin": "2.2.2",
"laravel-mix-nunjucks": "^0.3.0",
"laravel-mix-purgecss": "^5.0.0",
"postcss": "^8.2.4",
"resolve-url-loader": "^3.1.0",
"sass": "^1.26.11",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
}
}

30
seed-werbenetzwerk.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
// seed-werbenetzwerk.php - Default-Daten für Werbenetzwerk einfügen
require_once 'doctrine-config.php';
use Entity\Werbenetzwerk;
try {
// Prüfen ob bereits Daten vorhanden sind
$existingData = $entityManager->getRepository(Werbenetzwerk::class)->findAll();
if (count($existingData) > 0) {
echo "Werbenetzwerk-Daten sind bereits vorhanden. Überspringe Seed.\n";
exit(0);
}
// Default-Daten einfügen
$werbenetzwerk = new Werbenetzwerk();
$werbenetzwerk->setWerbenetzwerk('ADC');
$werbenetzwerk->setName('AdCity.eu');
$werbenetzwerk->setUmrechnungskurs(0.0000000022);
$werbenetzwerk->setEigenanteilProzent(25);
$entityManager->persist($werbenetzwerk);
$entityManager->flush();
echo "Default-Werbenetzwerk 'ADC' wurde erfolgreich eingefügt.\n";
} catch (\Exception $e) {
echo "Fehler beim Einfügen der Daten: " . $e->getMessage() . "\n";
}

207
src/Entity/Kampagne.php Normal file
View File

@@ -0,0 +1,207 @@
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'kampagnen')]
#[ORM\HasLifecycleCallbacks]
class Kampagne
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'boolean')]
private bool $is_fb = false;
#[ORM\Column(type: 'boolean')]
private bool $is_tr = false;
#[ORM\Column(type: 'boolean')]
private bool $is_mail = false;
#[ORM\Column(type: 'string', length: 255)]
private string $dest_url;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $mailtext = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $img = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $linktext = null;
#[ORM\Column(type: 'smallint')]
private int $ma = 0;
#[ORM\Column(type: 'smallint')]
private int $reload = 0;
#[ORM\ManyToOne(targetEntity: Werbenetzwerk::class)]
#[ORM\JoinColumn(name: 'werbenetzwerk_id', referencedColumnName: 'werbenetzwerk', nullable: true)]
private ?Werbenetzwerk $werbenetzwerk = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)]
private ?User $user = null;
#[ORM\Column(type: 'datetime')]
private \DateTimeInterface $dateCreated;
#[ORM\Column(type: 'datetime')]
private \DateTimeInterface $dateModified;
#[ORM\PrePersist]
public function setDateCreatedValue(): void
{
$this->dateCreated = new \DateTime();
$this->dateModified = new \DateTime();
}
#[ORM\PreUpdate]
public function setDateModifiedValue(): void
{
$this->dateModified = new \DateTime();
}
// Getters and Setters
public function getId(): ?int
{
return $this->id;
}
public function getIsFb(): bool
{
return $this->is_fb;
}
public function setIsFb(bool $is_fb): self
{
$this->is_fb = $is_fb;
return $this;
}
public function getIsTr(): bool
{
return $this->is_tr;
}
public function setIsTr(bool $is_tr): self
{
$this->is_tr = $is_tr;
return $this;
}
public function getIsMail(): bool
{
return $this->is_mail;
}
public function setIsMail(bool $is_mail): self
{
$this->is_mail = $is_mail;
return $this;
}
public function getDestUrl(): string
{
return $this->dest_url;
}
public function setDestUrl(string $dest_url): self
{
$this->dest_url = $dest_url;
return $this;
}
public function getMailtext(): ?string
{
return $this->mailtext;
}
public function setMailtext(?string $mailtext): self
{
$this->mailtext = $mailtext;
return $this;
}
public function getImg(): ?string
{
return $this->img;
}
public function setImg(?string $img): self
{
$this->img = $img;
return $this;
}
public function getLinktext(): ?string
{
return $this->linktext;
}
public function setLinktext(?string $linktext): self
{
$this->linktext = $linktext;
return $this;
}
public function getMa(): int
{
return $this->ma;
}
public function setMa(int $ma): self
{
$this->ma = $ma;
return $this;
}
public function getReload(): int
{
return $this->reload;
}
public function setReload(int $reload): self
{
$this->reload = $reload;
return $this;
}
public function getDateCreated(): \DateTimeInterface
{
return $this->dateCreated;
}
public function getDateModified(): \DateTimeInterface
{
return $this->dateModified;
}
public function getWerbenetzwerk(): ?Werbenetzwerk
{
return $this->werbenetzwerk;
}
public function setWerbenetzwerk(?Werbenetzwerk $werbenetzwerk): self
{
$this->werbenetzwerk = $werbenetzwerk;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}

82
src/Entity/User.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: 'Repository\UserRepository')]
#[ORM\Table(name: 'users')]
class User
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\Column(type: 'string', length: 100)]
private string $username;
#[ORM\Column(type: 'string', length: 255)]
private string $email;
#[ORM\Column(type: 'string', length: 255)]
private string $password;
#[ORM\Column(type: 'datetime')]
private \DateTime $createdAt;
public function __construct()
{
$this->createdAt = new \DateTime();
}
// Getter und Setter
public function getId(): int
{
return $this->id;
}
public function getUsername(): string
{
return $this->username;
}
public function setUsername(string $username): self
{
$this->username = $username;
return $this;
}
public function getEmail(): string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}

View File

@@ -0,0 +1,84 @@
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'werbenetzwerk')]
#[ORM\HasLifecycleCallbacks]
class Werbenetzwerk
{
#[ORM\Id]
#[ORM\Column(type: 'string', length: 5)]
private string $werbenetzwerk;
#[ORM\Column(type: 'text')]
private string $name;
#[ORM\Column(type: 'float')]
private float $umrechnungskurs;
#[ORM\Column(type: 'smallint', options: ['unsigned' => true])]
private int $eigenanteil_prozent;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $date_updated = null;
#[ORM\PrePersist]
#[ORM\PreUpdate]
public function setDateUpdatedValue(): void
{
$this->date_updated = new \DateTime();
}
// Getters and Setters
public function getWerbenetzwerk(): string
{
return $this->werbenetzwerk;
}
public function setWerbenetzwerk(string $werbenetzwerk): self
{
$this->werbenetzwerk = $werbenetzwerk;
return $this;
}
public function getName(): string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getUmrechnungskurs(): float
{
return $this->umrechnungskurs;
}
public function setUmrechnungskurs(float $umrechnungskurs): self
{
$this->umrechnungskurs = $umrechnungskurs;
return $this;
}
public function getEigenanteilProzent(): int
{
return $this->eigenanteil_prozent;
}
public function setEigenanteilProzent(int $eigenanteil_prozent): self
{
$this->eigenanteil_prozent = $eigenanteil_prozent;
return $this;
}
public function getDateUpdated(): ?\DateTimeInterface
{
return $this->date_updated;
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace Repository;
use Doctrine\ORM\EntityRepository;
use Entity\User;
class UserRepository extends EntityRepository
{
/**
* Findet einen User anhand der ID
*/
public function findById(int $id): ?User
{
return $this->find($id);
}
/**
* Findet einen User anhand des Usernames
*/
public function findByUsername(string $username): ?User
{
return $this->findOneBy(['username' => $username]);
}
/**
* Findet einen User anhand der Email
*/
public function findByEmail(string $email): ?User
{
return $this->findOneBy(['email' => $email]);
}
/**
* Findet alle User
*/
public function findAllUsers(): array
{
return $this->findAll();
}
/**
* Prüft, ob ein Username bereits existiert
*/
public function usernameExists(string $username): bool
{
return $this->findByUsername($username) !== null;
}
/**
* Prüft, ob eine Email bereits existiert
*/
public function emailExists(string $email): bool
{
return $this->findByEmail($email) !== null;
}
/**
* Findet User, die nach einem bestimmten Datum erstellt wurden
*/
public function findByCreatedAfter(\DateTime $date): array
{
return $this->createQueryBuilder('u')
->where('u.createdAt > :date')
->setParameter('date', $date)
->orderBy('u.createdAt', 'DESC')
->getQuery()
->getResult();
}
/**
* Sucht User nach Username (mit LIKE)
*/
public function searchByUsername(string $search): array
{
return $this->createQueryBuilder('u')
->where('u.username LIKE :search')
->setParameter('search', '%' . $search . '%')
->orderBy('u.username', 'ASC')
->getQuery()
->getResult();
}
/**
* Zählt alle User
*/
public function countUsers(): int
{
return $this->createQueryBuilder('u')
->select('COUNT(u.id)')
->getQuery()
->getSingleScalarResult();
}
/**
* Speichert einen User
*/
public function save(User $user): void
{
$this->getEntityManager()->persist($user);
$this->getEntityManager()->flush();
}
/**
* Löscht einen User
*/
public function delete(User $user): void
{
$this->getEntityManager()->remove($user);
$this->getEntityManager()->flush();
}
}

22
update-schema.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
// update-schema.php - Datenbank-Schema aktualisieren
require_once 'doctrine-config.php';
use Doctrine\ORM\Tools\SchemaTool;
$classes = [
$entityManager->getClassMetadata('Entity\User'),
$entityManager->getClassMetadata('Entity\Kampagne'),
$entityManager->getClassMetadata('Entity\Werbenetzwerk'),
];
$schemaTool = new SchemaTool($entityManager);
try {
// Schema updaten
$schemaTool->updateSchema($classes);
echo "Database schema updated successfully!\n";
} catch (\Exception $e) {
echo "Error updating schema: " . $e->getMessage() . "\n";
}