First prototypes
This commit is contained in:
parent
58b5ddb660
commit
639383b008
|
|
@ -7,7 +7,7 @@ Application.use(
|
|||
express.static(
|
||||
resolve("./public"),{
|
||||
etag: true,
|
||||
lastModified: false
|
||||
lastModified: true
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
@ -4,6 +4,7 @@ const {ConnectSessionKnexStore} = require('connect-session-knex');
|
|||
const {Application} = require("../core/server");
|
||||
|
||||
Application.set('trust proxy', 1);
|
||||
Application.enable('trust proxy');
|
||||
|
||||
const store = new ConnectSessionKnexStore({
|
||||
knex: DB,
|
||||
|
|
|
|||
|
|
@ -127,9 +127,33 @@ async function createEvent(owner_id, studentid, catalogid)
|
|||
});
|
||||
}
|
||||
|
||||
async function countEvents()
|
||||
async function countEvents(owner_id, searchTerm)
|
||||
{
|
||||
return 0
|
||||
return (
|
||||
await DB
|
||||
.select([
|
||||
"student_events.id as id",
|
||||
"students.name as studentname",
|
||||
"students.surname as studentsurname",
|
||||
"student_events.score",
|
||||
"events.name as catalog",
|
||||
"student_events.created_at",
|
||||
])
|
||||
.table("student_events")
|
||||
.innerJoin("students","students.id","=","student_id")
|
||||
.innerJoin("events","events.id","=","event_id")
|
||||
.where("student_events.owner_id",owner_id)
|
||||
.where(function(q){
|
||||
q.where("students.name","like",`%${searchTerm ?? ""}%`)
|
||||
q.orWhere("events.name","like",`%${searchTerm ?? ""}%`)
|
||||
})
|
||||
.orderBy("student_events.created_at","desc")
|
||||
.whereNull("student_events.deleted_at")
|
||||
.whereNull("students.deleted_at")
|
||||
.whereNull("events.deleted_at")
|
||||
.count("student_events.id as total")
|
||||
.first()
|
||||
).total;
|
||||
}
|
||||
|
||||
async function getEvents(owner_id,start,length,searchTerm)
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
dataTable = $("#eventslist").DataTable({
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: false,
|
||||
responsive: true,
|
||||
ajax: {
|
||||
url: "/events/list",
|
||||
method:"post"
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<ul class="main-nav p-0 mt-2">
|
||||
<li class="menu-title no-sub">
|
||||
<a href="/">
|
||||
Anasayfa
|
||||
Öğrenci Skor Tablosu
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-title">
|
||||
|
|
@ -66,13 +66,13 @@
|
|||
</a>
|
||||
</li>
|
||||
<li class="menu-title"><span>Hesap</span></li>
|
||||
<li class="no-sub">
|
||||
<!--li class="no-sub">
|
||||
<a href="/profile">
|
||||
<svg stroke="currentColor" stroke-width="1.5">
|
||||
</svg>
|
||||
Hesap Ayarları
|
||||
</a>
|
||||
</li>
|
||||
</li-->
|
||||
<li class="no-sub text-danger">
|
||||
<a href="/logout" class=" text-danger">
|
||||
<svg stroke="currentColor" stroke-width="1.5">
|
||||
|
|
|
|||
Loading…
Reference in New Issue