Esempio n. 1
0
 function generate_user_table($user_inv)
 {
     $users = $user_inv->get_users();
     $table_string = '';
     $table_string .= "<table>\n" . "  <tr>\n" . "    <td>" . "First name" . "</td>\n" . "    <td>" . "Last name" . "</td>\n" . "    <td>" . "Email address" . "</td>\n" . "    <td>" . "PIN" . "</td>\n" . "    <td>" . "Uploaded paper" . "</td>\n" . "    <td>" . "Number of submitted reviews" . "</td>\n" . "  </tr>\n";
     foreach ($users as $u) {
         if ($u->get_uploaded_paper()) {
             $has_uploaded = generate_paper_download_link($u);
         } else {
             $has_uploaded = '(none)';
         }
         $table_string .= "  <tr>\n" . "    <td>" . $u->get_first_name() . "</td>\n" . "    <td>" . $u->get_last_name() . "</td>\n" . "    <td>" . $u->get_email_address() . "</td>\n" . "    <td>" . $u->get_pin() . "</td>\n" . "    <td>" . $has_uploaded . "</td>\n" . "    <td>" . count($u->get_submitted_reviews()) . "</td>\n" . "  </tr>\n";
     }
     $table_string .= "</table>\n";
     return $table_string;
 }
Esempio n. 2
0
function generate_review_upload_table($author_emails, $user_inv, $this_reviewer)
{
    $table_string = "<table>\n";
    $list_num = 1;
    foreach ($author_emails as $a) {
        // if the user has already submitted a review for this author, disable submission of another
        $review_upload_disabled_string = '';
        if (isset($this_reviewer->get_submitted_reviews()[$a])) {
            $review_upload_disabled_string = ' disabled';
        }
        $the_author = $user_inv->get_user_by_email_address($a);
        $table_string .= "  <tr>\n" . "    <td>" . $list_num . "." . "</td>\n" . "    <td>\"" . generate_paper_download_link($the_author) . "\"</td>\n" . "    <td>\n" . '      <form action="submitreview.php" method="post" enctype="multipart/form-data">' . "\n" . '        <input type="hidden" name="MAX_FILE_SIZE" value=5000000>' . "\n" . '        <input type="hidden" name="email_address" value="' . $this_reviewer->get_email_address() . '">' . "\n" . '        <input type="hidden" name="paper_id" value="' . $the_author->get_uploaded_paper()['id'] . '">' . "\n" . "        Review file:\n" . '        <input name="uploaded_file" type="file"' . $review_upload_disabled_string . ">\n" . '        <input type="submit" value="Upload Review"' . $review_upload_disabled_string . ">\n" . "      </form>\n" . "    </td>\n" . "  </tr>\n";
        $list_num++;
    }
    $table_string .= "<table>\n";
    return $table_string;
}