2021-03-14 17:31:55 -04:00
|
|
|
<?php
|
2021-03-19 16:06:32 -04:00
|
|
|
|
|
|
|
use Mangadex\Model\MdexAtHomeClient;
|
|
|
|
|
2021-03-14 17:31:55 -04:00
|
|
|
$section = $_GET['section'] ?? 'info';
|
|
|
|
|
|
|
|
$approvaltime = $user->get_client_approval_time();
|
|
|
|
|
|
|
|
switch ($section) {
|
|
|
|
case 'options':
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
];
|
|
|
|
|
|
|
|
$tab_html = parse_template('md_at_home/partials/options', $templateVars);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'stats':
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
];
|
|
|
|
|
|
|
|
$tab_html = parse_template('md_at_home/partials/stats', $templateVars);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'request':
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
];
|
|
|
|
|
|
|
|
$tab_html = parse_template('md_at_home/partials/request', $templateVars);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'clients':
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
'user_clients' => $user->get_clients(),
|
2021-03-19 16:06:32 -04:00
|
|
|
'approvaltime' => $approvaltime,
|
|
|
|
'ip' => _IP,
|
|
|
|
'backend' => new MdexAtHomeClient(),
|
2021-03-14 17:31:55 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
if (validate_level($user, 'member')) {
|
|
|
|
$tab_html = parse_template('md_at_home/partials/clients', $templateVars);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'admin':
|
|
|
|
$clients = new Clients();
|
|
|
|
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
2021-03-19 16:06:32 -04:00
|
|
|
'clients' => $clients,
|
|
|
|
'ip' => _IP,
|
|
|
|
'backend' => new MdexAtHomeClient(),
|
|
|
|
];
|
2021-03-14 17:31:55 -04:00
|
|
|
|
|
|
|
if (validate_level($user, 'admin')) {
|
|
|
|
$tab_html = parse_template('md_at_home/partials/admin', $templateVars);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'info':
|
|
|
|
default:
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
];
|
|
|
|
|
|
|
|
$tab_html = parse_template('md_at_home/partials/info', $templateVars);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$templateVars = [
|
|
|
|
'user' => $user,
|
|
|
|
'section' => $section,
|
|
|
|
'approvaltime' => $approvaltime,
|
|
|
|
'tab_html' => $tab_html,
|
|
|
|
];
|
|
|
|
|
|
|
|
$page_html = parse_template('md_at_home/md_at_home', $templateVars);
|