<commit_before><?php
require_once("utilities.php");
$username = param('username');
$password = <PASSWORD>(param('password'));
$projectId = param('id');

$stmt = prepare("SELECT user_id FROM users WHERE user_username=? AND user_password=?");
$stmt->bind_param('ss', $username, $password);
$result = execute($stmt);
if ($row = $result->fetch_assoc()) {
    $stmt = prepare("SELECT project_id, project_funded, project_budget, picture_filename FROM projects JOIN project_updates ON project_id=? AND pu_project_id=project_id JOIN pictures ON pu_image_id=picture_id LIMIT 1");
    $stmt->bind_param("i", $projectId);
    $result = execute($stmt);
    if ($row = $result->fetch_assoc()) {
        $projectId = $row['project_id'];
        $funded = $row['project_funded'];
        $budget = $row['project_budget'];
        $pictureFilename = $row['picture_filename'];
        
        if ($funded < $budget - 1) {
            print "This project is not fully funded.  Please insure that it is funded before attempting to mark it completed.";
            die();
        }
        
        $result = doUnprotectedQuery("SELECT pe_id FROM project_events WHERE pe_project_id=$projectId AND pe_type=4");
        if ($row = $result->fetch_assoc()) {
            print "This project has already been marked as complete.  No further action is possible.";
            die();<commit_msg>Replacing project update picture with raw update picture<commit_after><?php
require_once("utilities.php");
$username = param('username');
$password = <PASSWORD>(param('password'));
$projectId = param('id');

$stmt = prepare("SELECT user_id FROM users WHERE user_username=? AND user_password=?");
$stmt->bind_param('ss', $username, $password);
$result = execute($stmt);
if ($row = $result->fetch_assoc()) {
    $stmt = prepare("SELECT project_id, project_funded, project_budget, picture_filename FROM projects JOIN raw_updates ON project_id=? AND project_id=ru_project_id JOIN pictures ON ru_picture_ids LIKE CONCAT('%,', picture_id, ',%') LIMIT 1");
    $stmt->bind_param("i", $projectId);
    $result = execute($stmt);
    if ($row = $result->fetch_assoc()) {
        $projectId = $row['project_id'];
        $funded = $row['project_funded'];
        $budget = $row['project_budget'];
        $pictureFilename = $row['picture_filename'];
        
        if ($funded < $budget - 1) {
            print "This project is not fully funded.  Please insure that it is funded before attempting to mark it completed.";
            die();
        }
        
        $result = doUnprotectedQuery("SELECT pe_id FROM project_events WHERE pe_project_id=$projectId AND pe_type=4");
        if ($row = $result->fetch_assoc()) {
            print "This project has already been marked as complete.  No further action is possible.";
            die();
{'fraction_non_alphanumeric': 0.14010695187165775, 'fraction_numerical': 0.0021390374331550803, 'mean_word_length': 3.708053691275168, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '5184074', 'n_tokens_mistral': 813, 'n_tokens_neox': 795, 'n_words': 231}