<?php

require_once STORYBOARD_CORE_URI . 'storyboard_db_api.php';
require_once STORYBOARD_CORE_URI . 'storyboard_print_api.php';
$storyboard_print_api = new storyboard_print_api();
$status_cols = plugin_config_get('status_cols');
$storyboard_print_api->print_page_head(plugin_lang_get('menu_title'));
echo '<table class="story_baord">';
print_thead($status_cols);
print_tbody($status_cols);
echo '</table>';
html_page_bottom1();
/**
 * Print table head
 * @param $status_cols
 */
function print_thead($status_cols)
{
    echo '<thead>';
    echo '<tr>';
    echo '<th></th>';
    foreach ($status_cols as $status_col) {
        echo '<th bgcolor="' . get_status_color($status_col, null, null) . '" class="center">';
        $assocArray = MantisEnum::getAssocArrayIndexedByValues(lang_get('status_enum_string'));
        echo $assocArray[$status_col];
        echo '</th>';
    }
    echo '</tr>';
    echo '</thead>';
}
/**
   <script type="text/javascript" src="plugins/UserProjectView/javascript/table.js"></script>
   <link rel="stylesheet" href="plugins/UserProjectView/files/UserProjectView.css"/>
<?php 
if (!$print) {
    html_page_top2();
    # print whiteboard menu bar
    userprojectapi::htmlPluginTriggerWhiteboardMenu();
}
echo '<div id="manage-user-div" class="form-container">' . PHP_EOL;
if (userprojectapi::is_mantis_rel()) {
    echo '<table class="width100" cellspacing="1">' . PHP_EOL;
} else {
    echo '<table>' . PHP_EOL;
}
print_thead();
print_tbody($data_rows);
echo '</table>' . PHP_EOL;
echo '</div>' . PHP_EOL;
if (!$print) {
    html_page_bottom1();
}
/** ********************* table head area *************************************************************************** */
/**
 * Print the head of the plugin table
 */
function print_thead()
{
    $dynamic_colspan = userprojectapi::get_stat_count() + userprojectapi::get_project_hierarchy_spec_colspan(6, true);
    echo '<thead>' . PHP_EOL;
    print_main_table_head_row($dynamic_colspan);
    echo '<tr>' . PHP_EOL;
auth_reauthenticate();
html_page_top1(plugin_lang_get('menu_title'));
?>
   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
   <script type="text/javascript" src="plugins/UserProjectView/javascript/table.js"></script>
   <link rel="stylesheet" href="plugins/UserProjectView/files/UserProjectView.css"/>
<?php 
html_page_top2();
# print whiteboard menu bar
userprojectapi::htmlPluginTriggerWhiteboardMenu();
echo '<div align="center">';
echo '<hr size="1" width="50%"/>';
echo plugin_lang_get('remove_quest') . '<br/><br/>';
echo '<table class="width50" cellspacing="1">';
print_thead();
print_tbody();
echo '</table>';
html_page_bottom();
function print_thead()
{
    echo '<thead>';
    echo '<tr>';
    echo '<th width="20px"></th>';
    echo '<th class="headrow" style="text-align: left" colspan="2">' . plugin_lang_get('thead_username') . '</th>';
    echo '<th class="headrow" style="text-align: left">' . plugin_lang_get('thead_realname') . '</th>';
    echo '</tr>';
    echo '<tr>';
    echo '<th></th>';
    echo '<th class="headrow" style="text-align: left" colspan="3">' . plugin_lang_get('config_layer_one_name_two') . '</th>';
    echo '</tr>';
    echo '</thead>';