<commit_before><?php 

include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );

mustHaveAnyOfTheseRoles( Array( 'USER' ) );

echo userHTML( );


echo '<div class="info">';
$scheduledAWS = scheduledAWSInFuture( $_SESSION['user'] );
$tempScheduleAWS = temporaryAwsSchedule( $_SESSION[ 'user' ] );
if( $scheduledAWS )
{
    echo alertUser( "
        <strong>&#x2620 Your AWS has been scheduled on " . 
        humanReadableDate( $scheduledAWS[ 'date' ] ) . '</strong>'
    );
}
else if( $tempScheduleAWS )
{
    echo "<strong>This is a test message. This is NOT an official date, yet!</strong>";
    echo printInfo( "&#x2620 Your AWS is most likely to be on " . 
        humanReadableDate( $tempScheduleAWS[ 'date' ] ) );

    echo printWarning( "This date is likely to change if any other speakers
        request to change their AWS or new speakers are added." 
    );
}
else
{
    echo printInfo( "You don't have any AWS scheduled in next 12 months" );
}
echo '</div>';

echo printInfo( 'Please fill-in details of your upcoming  AWS below.
     We will use this to generate the notification email
     and document. You can change it as many times as you like 
     <small> (Note: We will not store the old version).</small>
    ' );

if( $scheduledAWS )
{
    $id = $scheduledAWS[ 'id' ];
    echo "<form method=\"post\" action=\"user_aws_update_upcoming_aws.php\">";
    echo arrayToVerticalTableHTML( $scheduledAWS, 'aws', NULL
        , Array( 'speaker', 'id' ));
    echo "<button class=\"submit\" name=\"response\" value=\"update\">Update</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
}


echo "<h3>Update pending requests</h3>";

$awsRequests = getAwsRequestsByUser( $_SESSION['user'] );
foreach( $awsRequests as $awsr )
{
    $id = $awsr['id'];
    echo "<form method=\"post\" action=\"user_aws_request.php\">";
    echo arrayToVerticalTableHTML( $awsr, 'aws' );
    echo "<button name=\"response\" value=\"edit\">Edit</button>";
    echo "<button name=\"response\" value=\"cancel\">Cancel</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
}


echo "<h3>Create a request</h3>";
echo "<table class=\"show_user\">";
echo '<tr><td>
    You can add a missing AWS here for review.
    </td><td> <a href="user_aws_request.php">Add previous 
    AWS</a>';
echo "</td></tr>";
echo '<tr>
    <td>Edit previous AWS. Something is wrong in my previous AWS entries.</td>
    <td>Just scroll down to the list of previous AWSes and press Edit button.</td>
    
</tr>';
echo "</table>";


echo goBackToPageLink( "user.php", "Go back" );
echo "<br />";

echo "<h3>Past Annual Work Seminar</h3>";

$awses = getMyAws( $_SESSION['user'] );

foreach( $awses as $aws )
{
    $id = $aws['id'];
    echo "<div>";
    // One can submit an edit request to AWS.
    echo "<form method=\"post\" action=\"user_aws_edit_request.php\">";
    echo arrayToVerticalTableHTML( $aws, 'aws', NULL
    , Array( 'speaker', 'id' ));
    echo "<button class=\"submit\" name=\"response\" value=\"edit\">Edit</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
    echo "<br /><br />";
    echo "</div>";<commit_msg>Cleanup user interface a little.<commit_after><?php 

include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );

mustHaveAnyOfTheseRoles( Array( 'USER' ) );

echo userHTML( );


echo '<div class="info">';
$scheduledAWS = scheduledAWSInFuture( $_SESSION['user'] );
$tempScheduleAWS = temporaryAwsSchedule( $_SESSION[ 'user' ] );
if( $scheduledAWS )
{
    echo alertUser( "
        <strong>&#x2620 Your AWS has been scheduled on " . 
        humanReadableDate( $scheduledAWS[ 'date' ] ) . '</strong>'
    );
}
else if( $tempScheduleAWS )
{
    echo "<strong>This is a test message. This is NOT an official date, yet!</strong>";
    echo printInfo( "&#x2620 Your AWS is most likely to be on " . 
        humanReadableDate( $tempScheduleAWS[ 'date' ] ) );

    echo printWarning( "This date is likely to change if any other speakers
        request to change their AWS or new speakers are added." 
    );
}
else
{
    echo printInfo( "You don't have any AWS scheduled in next 12 months" );
}
echo '</div>';

if( $scheduledAWS )
{

    echo printInfo( 'Please fill-in details of your upcoming  AWS below.
         We will use this to generate the notification email
         and document. You can change it as many times as you like 
         <small> (Note: We will not store the old version).</small>
        ' );
    $id = $scheduledAWS[ 'id' ];
    echo "<form method=\"post\" action=\"user_aws_update_upcoming_aws.php\">";
    echo arrayToVerticalTableHTML( $scheduledAWS, 'aws', NULL
        , Array( 'speaker', 'id' ));
    echo "<button class=\"submit\" name=\"response\" value=\"update\">Update</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
}

$awsRequests = getAwsRequestsByUser( $_SESSION['user'] );
if( count( $awsRequests ) > 0 )
    echo "<h3>Update pending requests</h3>";

foreach( $awsRequests as $awsr )
{
    $id = $awsr['id'];
    echo "<form method=\"post\" action=\"user_aws_request.php\">";
    echo arrayToVerticalTableHTML( $awsr, 'aws' );
    echo "<button name=\"response\" value=\"edit\">Edit</button>";
    echo "<button name=\"response\" value=\"cancel\">Cancel</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
}




echo goBackToPageLink( "user.php", "Go back" );
echo "<br />";

echo "<h3>Past Annual Work Seminar</h3>";

echo "<table>";
echo '<tr><td>
    You can add a missing AWS for review.
    </td><td> <a href="user_aws_request.php">Add previous 
    AWS</a>';
echo "</td></tr>";
echo "</table>";
echo "<br/>";

$awses = getMyAws( $_SESSION['user'] );

foreach( $awses as $aws )
{
    $id = $aws['id'];
    echo "<div>";
    // One can submit an edit request to AWS.
    echo "<form method=\"post\" action=\"user_aws_edit_request.php\">";
    echo arrayToVerticalTableHTML( $aws, 'aws', NULL
    , Array( 'speaker', 'id' ));
    echo "<button class=\"submit\" name=\"response\" value=\"edit\">Edit</button>";
    echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
    echo "</form>";
    echo "<br /><br />";
    echo "</div>";
{'fraction_non_alphanumeric': 0.1847657461991933, 'fraction_numerical': 0.004809183990071362, 'mean_word_length': 3.480194579569145, 'pattern_counts': {'":': 0, '<': 102, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '598024', 'n_tokens_mistral': 2082, 'n_tokens_neox': 2067, 'n_words': 626}