You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.9 KiB
68 lines
1.9 KiB
<?php
|
|
|
|
use App\Enumerators\SessionElement;
|
|
use App\Wrappers\DatabaseInteractions;
|
|
use App\Wrappers\SessionWrapper;
|
|
use App\Wrappers\TwigWrapper;
|
|
|
|
require_once __DIR__ . "/../vendor/autoload.php";
|
|
|
|
|
|
$db = new DatabaseInteractions();
|
|
|
|
$yourTunes = $db->RunSelect(
|
|
queryBuilder: \App\Wrappers\SQLQueryBuilderWrapper::SELECT(
|
|
table: 'Tunes'
|
|
)
|
|
->where(cond: 'T.CreatedBy LIKE :__user_id__')
|
|
->bindValue(name: '__user_id__', value: SessionWrapper::Get(target: SessionElement::USER_ID))
|
|
);
|
|
|
|
$yourLikedTunes = $db->RunSelect(
|
|
queryBuilder: \App\Wrappers\SQLQueryBuilderWrapper::SELECT(
|
|
table: 'TuneRatings'
|
|
)
|
|
->cols(cols: [
|
|
'T_T.Title',
|
|
'T_T.CreatedAt',
|
|
'T_T.Copyright',
|
|
])
|
|
->join(
|
|
join: 'INNER',
|
|
spec: 'Tunes AS T_T',
|
|
cond: 'T.TuneID=T_T.ID',
|
|
)
|
|
->where(cond: 'T.CreatedBy LIKE :__user_id__')
|
|
->where(cond: 'Rating = 1')
|
|
->bindValue(name: '__user_id__', value: SessionWrapper::Get(target: SessionElement::USER_ID))
|
|
);
|
|
|
|
$yourDislikedTunes = $db->RunSelect(
|
|
queryBuilder: \App\Wrappers\SQLQueryBuilderWrapper::SELECT(
|
|
table: 'TuneRatings'
|
|
)
|
|
->cols(cols: [
|
|
'T_T.Title',
|
|
'T_T.CreatedAt',
|
|
'T_T.Copyright',
|
|
])
|
|
->join(
|
|
join: 'INNER',
|
|
spec: 'Tunes AS T_T',
|
|
cond: 'T.TuneID=T_T.ID',
|
|
)
|
|
->where(cond: 'T.CreatedBy LIKE :__user_id__')
|
|
->where(cond: 'Rating = 0')
|
|
->bindValue(name: '__user_id__', value: SessionWrapper::Get(target: SessionElement::USER_ID))
|
|
);
|
|
|
|
TwigWrapper::RenderTwig(
|
|
target: "Pages/profile.html.twig",
|
|
arguments: [
|
|
"YourTunes" => $yourTunes,
|
|
"YourDances" => [],
|
|
"YourLikedTunes"=> $yourLikedTunes,
|
|
"YourDislikedTunes"=> $yourDislikedTunes,
|
|
"YourBookmarkedTunes"=> [],
|
|
],
|
|
);
|
|
|