<?php

namespace App\Controllers;

require_once BASE_PATH . '/app/helpers/permissions.php';

use App\Core\Controller;
use App\Core\Database;

class AuthorDashboardController extends Controller
{
    private function requireLogin(): void
    {
        if (session_status() !== PHP_SESSION_ACTIVE) {
            session_start();
        }

        if (empty($_SESSION['user_id'])) {
            header("Location: /easychair/login");
            exit;
        }
    }

    private function db()
    {
        return Database::getInstance();
    }

    private function tableColumns(string $table): array
    {
        static $cache = [];

        if (isset($cache[$table])) {
            return $cache[$table];
        }

        try {
            $stmt = $this->db()->query("DESCRIBE `$table`");
            $cols = $stmt->fetchAll(\PDO::FETCH_COLUMN);
            $cache[$table] = array_map('strtolower', $cols ?: []);
        } catch (\Throwable $e) {
            $cache[$table] = [];
        }

        return $cache[$table];
    }

    private function hasColumn(string $table, string $column): bool
    {
        return in_array(strtolower($column), $this->tableColumns($table), true);
    }

private function authorDashboardMetrics(
array $submissions
): array
{
    $x=[

        'pending_revision'=>0,

        'reviewed'=>0,

        'camera_ready'=>0,

        'accepted_ratio'=>0

    ];

    $accepted=0;

    foreach(
        $submissions
        as $s
    ){

        $status=
        strtolower(
            $s['status']
            ?? ''
        );

        if(
            $status
            ===
            'revision_required'
        ){
            $x[
                'pending_revision'
            ]++;
        }

        if(
            (
                $s[
                    'reviews_count'
                ]
                ??
                0
            )>0
        ){
            $x[
                'reviewed'
            ]++;
        }

        if(
            !empty(
                $s[
                    'decision'
                ]
            )
            &&
            strtolower(
                $s[
                    'decision'
                ]
            )
            ===
            'accept'
        ){
            $accepted++;
        }

        if(
            !empty(
                $s[
                    'doi'
                ]
            )
            ||
            !empty(
                $s[
                    'published_at'
                ]
            )
        ){
            $x[
                'camera_ready'
            ]++;
        }

    }

    if(
        count(
            $submissions
        )
    ){

        $x[
            'accepted_ratio'
        ]
        =
        round(

            (
                $accepted
                /
                count(
                    $submissions
                )
            )

            *100,

            1
        );

    }

    return $x;
}

private function workflowSummary(
array $submissions
): array
{
return [

'revision_queue'=>

count(
array_filter(

$submissions,

fn($x)=>

in_array(

strtolower(
$x[
'status'
]
??
''
),

[
'revision_required',
'revised'
]

)

)

),

'decision_pending'=>

count(
array_filter(

$submissions,

fn($x)=>

empty(
$x[
'decision'
]
)
&&
(
$x[
'reviews_count'
]
??
0
)>0

)

),

'unread_reviews'=>

array_sum(

array_map(

fn($x)=>

(int)(
$x[
'reviews_count'
]
??
0
),

$submissions

)

),

'camera_ready'=>

count(
array_filter(

$submissions,

fn($x)=>

!empty(
$x[
'published_at'
]
)

)

)

];

}

private function submissionWorkspace(
array $submissions
): array
{
$out=[

'reupload'=>[],

'response'=>[],

'camera'=>[],

'active'=>[]

];

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s['status']
??
''
)
);

if(
in_array(

$status,

[
'revision_required',
'revised'
],

true
)
){
$out[
'reupload'
][]
=
$s;
}

if(

(
(int)(
$s[
'reviews_count'
]
??
0
)
)>0

){
$out[
'response'
][]
=
$s;
}

if(

!empty(
$s[
'published_at'
]
)

||
!empty(
$s[
'doi'
]
)

){
$out[
'camera'
][]
=
$s;
}

if(
!in_array(

$status,

[
'rejected',
'withdrawn'
]

)
){

$out[
'active'
][]
=
$s;

}

}

return $out;
}

private function reviewExplorer(
array $submissions
): array
{
$out=[

'decision_ready'=>[],

'version_ready'=>[],

'needs_response'=>[],

'accepted'=>[]

];

foreach(
$submissions
as $s
){

$reviews=
(int)(
$s[
'reviews_count'
]
??
0
);

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
)
);

if(
$reviews>=2
){
$out[
'decision_ready'
][]
=
$s;
}

if(
$reviews>0
&&
in_array(

$status,

[
'revision_required',
'revised'
],

true
)
){
$out[
'version_ready'
][]
=
$s;
}

if(
$reviews>0
&&
empty(
$s[
'author_response_at'
]
)
){
$out[
'needs_response'
][]
=
$s;
}

if(
strtolower(
(string)(
$s[
'decision'
]
??
''
)
)
===
'accept'
){
$out[
'accepted'
][]
=
$s;
}

}

return $out;
}

private function publicationReadiness(
array $submissions
): array
{
$out=[

'camera_ready'=>[],

'accepted'=>[],

'ready_score'=>0,

'blockers'=>[]

];

$total=
count(
$submissions
);

$ready=0;

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s['status']
??
''
));

$decision=
strtolower(
(string)(
$s['decision']
??
''
));

$isAccepted=
(
$decision==='accept'
||
$status==='accepted'
);

if(
$isAccepted
){

$out[
'accepted'
][]
=
$s;

if(
!empty(
$s[
'final_file'
]
)
||
!empty(
$s[
'camera_ready_file'
]
)
){

$out[
'camera_ready'
][]
=
$s;

$ready++;

}else{

$out[
'blockers'
][]
=
[
'id'=>$s['id'],

'title'=>$s['display_title']
??
'',

'reason'=>'camera_ready_missing'

];

}

}

}

$out[
'ready_score'
]
=
$total
?
round(
(
$ready
/
$total
)
*
100
)
:
0;

return $out;
}

private function collaborationWorkspace(
array $submissions
): array
{
$out=[

'needs_coordination'=>[],

'multi_author'=>[],

'governance_alert'=>[],

'ready_to_submit'=>[]

];

foreach(
$submissions
as $s
){

$authors=
(int)(
$s[
'authors_count'
]
??
1
);

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

if(
$authors>1
){
$out[
'multi_author'
][]
=
$s;
}

if(
$authors>2
&&
$status!=='published'
){
$out[
'needs_coordination'
][]
=
$s;
}

if(
empty(
$s[
'track_id'
])
||
empty(
$s[
'title'
])
){
$out[
'governance_alert'
][]
=
$s;
}

if(
in_array(

$status,

[
'draft',
'revised'
],

true
)
){
$out[
'ready_to_submit'
][]
=
$s;
}

}

return $out;
}


private function communicationHub(
array $submissions
): array
{
$out=[

'notifications'=>0,

'reviewer_ready'=>[],

'waiting_author'=>[],

'conversation'=>[]

];

foreach(
$submissions
as $s
){

$reviews=
(int)(
$s[
'reviews_count'
]
??
0
);

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

if(
$reviews>0
){

$out[
'notifications'
]
+=
$reviews;

$out[
'reviewer_ready'
][]
=
$s;

}

if(
$reviews>0
&&
empty(
$s[
'author_response_at'
]
)
){

$out[
'waiting_author'
][]
=
$s;

}

if(
in_array(

$status,

[
'revision_required',
'revised',
'under_review'
],

true
)
){

$out[
'conversation'
][]
=
$s;

}

}

return $out;
}

private function researchPortfolio(
array $submissions
): array
{
$out=[

'total'=>0,

'accepted'=>0,

'published'=>0,

'under_review'=>0,

'acceptance_rate'=>0,

'impact_score'=>0,

'portfolio'=>[]

];

foreach(
$submissions
as $s
){

$out[
'total'
]++;

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

$decision=
strtolower(
(string)(
$s[
'decision'
]
??
''
));

if(
$decision==='accept'
||
$status==='accepted'
){

$out[
'accepted'
]++;

}

if(
!empty(
$s[
'published_at'
]
)
){

$out[
'published'
]++;

}

if(
in_array(

$status,

[
'under_review',
'reviewing'
],

true
)
){

$out[
'under_review'
]++;

}

$out[
'portfolio'
][]
=
$s;

}

$out[
'acceptance_rate'
]
=
$out[
'total'
]

?

round(

(
$out[
'accepted'
]
/
$out[
'total'
]
)

*100

)

:

0;

$out[
'impact_score'
]
=

round(

(
$out[
'published'
]
*40

)

+

(
$out[
'accepted'
]
*10

)

+

(
$out[
'under_review'
]
*5

)

);

return $out;
}

private function academicIdentity(
array $submissions
): array
{
$out=[

'conferences'=>[],

'tracks'=>[],

'published'=>0,

'accepted'=>0,

'identity_score'=>0,

'timeline'=>[]

];

foreach(
$submissions
as $s
){

if(
!empty(
$s[
'conference_name'
]
)
){
$out[
'conferences'
][]
=
$s[
'conference_name'
];
}

if(
!empty(
$s[
'track_name'
]
)
){
$out[
'tracks'
][]
=
$s[
'track_name'
];
}

if(
!empty(
$s[
'published_at'
]
)
){
$out[
'published'
]++;
}

if(
strtolower(
(string)(
$s[
'decision'
]
??
''
)
)
==='accept'
){
$out[
'accepted'
]++;
}

$out[
'timeline'
][]
=
[
'title'
=>
$s[
'display_title'
]
??
'',

'date'
=>
$s[
'updated_at'
]
??
$s[
'submitted_at'
]
??
'',

'status'
=>
$s[
'status'
]
??
''
];

}

$out[
'conferences'
]
=
array_unique(
$out[
'conferences'
]
);

$out[
'tracks'
]
=
array_unique(
$out[
'tracks'
]
);

$out[
'identity_score'
]
=

(
count(
$out[
'conferences'
]
)
*
20

)

+

(
$out[
'published'
]
*
30

)

+

(
$out[
'accepted'
]
*
10

);

return $out;
}

private function careerAnalytics(
array $submissions
): array
{
$out=[

'network_score'=>0,

'growth_score'=>0,

'institutions'=>[],

'collaborators'=>[],

'active_years'=>[],

'portfolio'=>[]

];

foreach(
$submissions
as $s
){

if(
!empty(
$s[
'organization_name'
]
)
){

$out[
'institutions'
][]
=
$s[
'organization_name'
];

}

if(
!empty(
$s[
'authors_count'
]
)
){

$out[
'collaborators'
][]
=
(int)
$s[
'authors_count'
];

}

$date=
$s[
'updated_at'
]
??
$s[
'submitted_at'
]
??
null;

if(
$date
){

$out[
'active_years'
][]
=
substr(
$date,
0,
4
);

}

$out[
'portfolio'
][]
=
$s;

}

$out[
'institutions'
]
=
array_unique(
$out[
'institutions'
]
);

$out[
'active_years'
]
=
array_unique(
$out[
'active_years'
]
);

$out[
'network_score'
]
=

(
count(
$out[
'institutions'
]
)
*
15

)

+

(
array_sum(
$out[
'collaborators'
]
)
*
2

);

$out[
'growth_score'
]
=

(
count(
$out[
'active_years'
]
)
*
20

)

+

(
count(
$out[
'portfolio'
]
)
*
5

);

return $out;
}

private function strategicPlanning(
array $submissions
): array
{
$out=[

'pipeline'=>[],

'action_required'=>[],

'future_ready'=>[],

'stalled'=>[],

'roadmap_score'=>0

];

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

$updated=
strtotime(
$s[
'updated_at'
]
??
$s[
'submitted_at'
]
??
'now'
);

$days=
floor(
(
time()
-
$updated
)
/
86400
);

if(
in_array(

$status,

[
'draft',
'revised',
'revision_required'
],

true
)
){

$out[
'pipeline'
][]
=
$s;

}

if(
in_array(

$status,

[
'revision_required',
'decision',
'accepted'
],

true
)
){

$out[
'action_required'
][]
=
$s;

}

if(
$status==='published'
){

$out[
'future_ready'
][]
=
$s;

}

if(
$days>30
&&
!in_array(

$status,

[
'published',
'rejected'
]

)
){

$out[
'stalled'
][]
=
$s;

}

}

$out[
'roadmap_score'
]
=

(
count(
$out[
'pipeline'
]
)
*
10

)

+

(
count(
$out[
'future_ready'
]
)
*
20

);

return $out;
}

private function executionCenter(
array $submissions
): array
{
$out=[

'urgent'=>[],

'active'=>[],

'overdue'=>[],

'ready'=>[],

'execution_score'=>0

];

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

$deadline=
$s[
'deadline'
]
??
$s[
'revision_deadline'
]
??
null;

$isOverdue=
false;

if(
$deadline
){

$isOverdue=
strtotime(
$deadline
)
<
time();

}

if(
$isOverdue
){

$out[
'overdue'
][]
=
$s;

}

if(
in_array(

$status,

[
'revision_required',
'revised',
'accepted'
],

true
)
){

$out[
'urgent'
][]
=
$s;

}

if(
!in_array(

$status,

[
'published',
'rejected',
'withdrawn'
]

)

){

$out[
'active'
][]
=
$s;

}

if(
$status
===
'submitted'
){

$out[
'ready'
][]
=
$s;

}

}

$out[
'execution_score'
]
=

(
count(
$out[
'ready'
]
)
*
20

)

+

(
count(
$out[
'active'
]
)
*
5

)

-

(
count(
$out[
'overdue'
]
)
*
10

);

return $out;
}

private function submissionOS(
array $submissions
): array
{
$out=[

'next_action'=>[],

'decision_queue'=>[],

'publication_path'=>[],

'risk'=>0

];

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s['status']
??
''
));

if(
$status
==='revision_required'
){
$out[
'next_action'
][]
=
$s;
}

if(
(
(int)(
$s[
'reviews_count'
]
??
0
)
)>=2
){
$out[
'decision_queue'
][]
=
$s;
}

if(
in_array(

$status,

[
'accepted',
'published'
],

true
)
){
$out[
'publication_path'
][]
=
$s;
}

if(
in_array(

$status,

[
'draft',
'revision_required'
],

true
)
){
$out[
'risk'
]++;
}

}

return $out;
}

private function decisionCockpit(array $submissions): array
{
    $out = [
        'accepted_waiting_final' => [],
        'needs_author_response' => [],
        'ready_for_publication' => [],
        'decision_score' => 0
    ];

    foreach ($submissions as $s) {
        $status = strtolower((string)($s['status'] ?? ''));
        $decision = strtolower((string)($s['decision'] ?? ''));

        $accepted = ($status === 'accepted' || $decision === 'accept');

        if ($accepted && empty($s['camera_ready_file']) && empty($s['final_file'])) {
            $out['accepted_waiting_final'][] = $s;
        }

        if ((int)($s['reviews_count'] ?? 0) > 0 && empty($s['response_letter_path'])) {
            $out['needs_author_response'][] = $s;
        }

        if ($accepted && (!empty($s['camera_ready_file']) || !empty($s['final_file']) || !empty($s['published_at']))) {
            $out['ready_for_publication'][] = $s;
        }
    }

    $out['decision_score'] =
        count($out['ready_for_publication']) * 30
        + count($out['accepted_waiting_final']) * 10
        - count($out['needs_author_response']) * 5;

    return $out;
}

private function operatingSystem(
array $submissions
): array
{
$out=[

'publish_ready'=>0,

'decision_ready'=>0,

'lifecycle'=>[],

'next_action'=>[]

];

foreach(
$submissions
as $s
){

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

if(
in_array(

$status,

[
'accepted',
'published'
],

true
)
){
$out[
'publish_ready'
]++;
}

if(
(
(int)(
$s[
'reviews_count'
]
??
0
)
)>=2
){
$out[
'decision_ready'
]++;
}

$out[
'lifecycle'
][]
=
[
'title'
=>
$s[
'display_title'
]
??
(
$s[
'title'
]
??
''
),

'status'
=>
$status,

'date'
=>
(
$s[
'updated_at'
]
??
$s[
'submitted_at'
]
??
''
)

];

if(
in_array(

$status,

[
'revision_required',
'accepted'
],

true
)
){
$out[
'next_action'
][]
=
$s;
}

}

return $out;
}

private function opportunityRadar(
array $submissions
): array
{

$out=[

'active'=>0,

'accepted'=>0,

'timeline'=>[],

'forecast'=>0

];

foreach(
$submissions
as
$s
){

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

if(
!in_array(

$status,

[
'rejected',
'withdrawn',
'published'
]

)
){

$out[
'active'
]++;

}

if(
$status==='accepted'
){

$out[
'accepted'
]++;

}

$out[
'timeline'
][]
=
[

'title'
=>
$s[
'display_title'
]
??
(
$s[
'title'
]
??
''
),

'date'
=>
$s[
'updated_at'
]
??
(
$s[
'submitted_at'
]
??
''
),

'status'
=>
$status

];

}

$out[
'forecast'
]
=
(
$out[
'active'
]
*
5
)
+
(
$out[
'accepted'
]
*
20
);

return $out;

}

private function researchCommandCenter(
array $submissions
): array
{

$out=[

'heatmap'=>[],

'pipeline'=>[],

'completed'=>0,

'score'=>0

];

foreach(
$submissions
as
$s
){

$status=
strtolower(
(string)(
$s[
'status'
]
??
''
));

$out[
'heatmap'
][]
=
[
'title'
=>
(
$s[
'display_title'
]
??
(
$s[
'title'
]
??
''
)
),

'value'
=>
match(
$status
){

'draft'
=>20,

'submitted'
=>35,

'under_review'
=>60,

'revision_required'
=>75,

'accepted'
=>90,

'published'
=>100,

default
=>10

}

];

if(
in_array(

$status,

[
'accepted',
'published'
],

true
)
){

$out[
'completed'
]++;

}

if(
!in_array(

$status,

[
'rejected',
'withdrawn'
]

)
){

$out[
'pipeline'
][]
=
$s;

}

}

$out[
'score'
]
=

(
count(
$out[
'pipeline'
]
)
*
10
)
+
(
$out[
'completed'
]
*
20
);

return $out;

}



    public function index()
    {
        $this->requireLogin();

        $db = $this->db();

        $userId = (int)$_SESSION['user_id'];
       // $conferenceId = (int)($_SESSION['conference_id'] ?? 0);

/*
Use submission context first
*/

$conferenceId =
    (int)(
        $_SESSION['submit_conference_id']
        ?? $_SESSION['conference_id']
        ?? 0
    );

/*
Persist session
*/

if ($conferenceId) {

    $_SESSION['conference_id'] =
        $conferenceId;

}

error_log(
    "AUTHOR DASHBOARD DEBUG: user="
    . $userId
    . " conf="
    . $conferenceId
);

        $select = [
            "s.*",
          //"COALESCE(s.title, s.title_en, s.title_ar, CONCAT('Submission #', s.id)) AS display_title",
          "COALESCE(NULLIF(s.title, ''), s.title_en, s.title_ar,CONCAT('Submission #', s.id)) As display_title",

            "COUNT(DISTINCT ra.id) AS assignments_count",
            "COUNT(DISTINCT rv.id) AS reviews_count",
            "ROUND(AVG(COALESCE(rv.overall_score, rv.score)), 2) AS reviews_avg_score"
        ];

        $sql = "
            SELECT " . implode(",\n", $select) . "
            FROM submissions s
            LEFT JOIN review_assignments ra
                ON ra.submission_id = s.id
            LEFT JOIN reviews rv
                ON rv.submission_id = s.id
            WHERE s.author_id = ?
  AND (
        ? = 0
        OR s.conference_id = ?
        OR s.conference_id IS NULL
      )
            GROUP BY s.id
            ORDER BY s.id DESC
        ";

        $stmt = $db->prepare($sql);

        $stmt->execute([
            $userId,
            $conferenceId,
            $conferenceId
        ]);

        $submissions = $stmt->fetchAll(\PDO::FETCH_ASSOC);

error_log(
    "AUTHOR DASHBOARD RESULTS: "
    . count($submissions)
);

        $stats = [
            'total' => 0,
            'draft' => 0,
            'submitted' => 0,
            'screening' => 0,
            'under_review' => 0,
            'revision_required' => 0,
            'accepted' => 0,
            'rejected' => 0,
            'published' => 0,
        ];

        $workflow = [
            'submission' => false,
            'screening' => false,
            'review' => false,
            'revision' => false,
            'decision' => false,
            'production' => false,
            'published' => false
        ];

        foreach ($submissions as $s) {
            $stats['total']++;

            $status = strtolower((string)($s['status'] ?? ''));

            if (isset($stats[$status])) {
                $stats[$status]++;
            }

            if (in_array($status, ['submitted', 'screening'], true)) {
                $stats['submitted']++;
            }

            $stage = strtolower((string)($s['stage'] ?? ''));

            if (isset($workflow[$stage])) {
                $workflow[$stage] = true;
            }

            if ($status === 'under_review') {
                $workflow['review'] = true;
            }

            if ($status === 'revision_required') {
                $workflow['revision'] = true;
            }

            if (in_array($status, ['accepted', 'rejected'], true)) {
                $workflow['decision'] = true;
            }

            if ($status === 'published') {
                $workflow['published'] = true;
            }
        }

        $success = $_SESSION['success'] ?? null;
        $error = $_SESSION['error'] ?? null;

        unset($_SESSION['success'], $_SESSION['error']);

$dashboardMetrics =
$this->authorDashboardMetrics(
    $submissions
);

$workflowSummary =
$this
->workflowSummary(
$submissions
);

$submissionWorkspace
=
$this
->submissionWorkspace(
$submissions
);

$reviewExplorer
=
$this
->reviewExplorer(
$submissions
);

$publicationReadiness
=
$this
->publicationReadiness(
$submissions
);

$collaborationWorkspace
=
$this
->collaborationWorkspace(
$submissions
);

$communicationHub
=
$this
->communicationHub(
$submissions
);
$researchPortfolio
=
$this
->researchPortfolio(
$submissions
);

$academicIdentity
=
$this
->academicIdentity(
$submissions
);

$careerAnalytics
=
$this
->careerAnalytics(
$submissions
);

$strategicPlanning
=
$this
->strategicPlanning(
$submissions
);

$executionCenter
=
$this
->executionCenter(
$submissions
);

$submissionOS
=
$this
->submissionOS(
$submissions
);

$decisionCockpit
=
$this
->decisionCockpit(
$submissions
);

$operatingSystem
=
$this
->operatingSystem(
$submissions
);

$opportunityRadar
=
$this
->opportunityRadar(
$submissions
);

$researchCommandCenter
=
$this
->researchCommandCenter(
$submissions
);






        $conference = null;

        if ($conferenceId > 0) {
            try {
                $stmt = $db->prepare("
                    SELECT *
                    FROM conferences
                    WHERE id = ?
                    LIMIT 1
                ");

                $stmt->execute([$conferenceId]);
                $conference = $stmt->fetch(\PDO::FETCH_ASSOC);
            } catch (\Throwable $e) {
                $conference = null;
            }
        }

        ob_start();

        //require BASE_PATH . '/app/views/author/dashboard.php';




if(
!isset(
$researchNetwork
)
){

$researchNetwork=[

'coauthors'=>0,

'multi'=>0,

'score'=>0,

'network'=>[]

];

}

if(
!isset(
$submissionStrategy
)
){

$submissionStrategy=[

'probability'=>0,

'deadline'=>0,

'priority'=>[],

'ready'=>0,

'score'=>0

];

}

extract([

'researchNetwork'=>$researchNetwork,

'submissionStrategy'=>$submissionStrategy,


'dashboardMetrics'
=>
$dashboardMetrics,

'workflowSummary'
=>
$workflowSummary,

'submissionWorkspace'
=>
$submissionWorkspace,

'reviewExplorer'
=>
$reviewExplorer,

'publicationReadiness'
=>
$publicationReadiness,

'collaborationWorkspace'
=>
$collaborationWorkspace,

'communicationHub'
=>
$communicationHub,

'researchPortfolio'
=>
$researchPortfolio,

'academicIdentity'
=>
$academicIdentity,

'careerAnalytics'
=>
$careerAnalytics,

'strategicPlanning'
=>
$strategicPlanning,

'executionCenter'
=>
$executionCenter,

'submissionOS'
=>
$submissionOS, 

'decisionCockpit'
=>
$decisionCockpit,

'operatingSystem'
=>
$operatingSystem,

'opportunityRadar'
=>
$opportunityRadar,

'researchCommandCenter'
=>
$researchCommandCenter]);


require
BASE_PATH
.
'/app/views/author/dashboard.php';

        $content = ob_get_clean();

        require BASE_PATH . '/app/views/layouts/author_layout.php';
    }
}
