Пример #1
0
function dataEntered($district, $machine)
{
    //TODO check if all fields entered not just one
    global $variables;
    $table = $variables['resultsTableName'];
    $votes = $variables['votes_results'];
    $d = $variables['district_results'];
    $m = $variables['machine_results'];
    $query = "Select {$votes} from {$table} where {$d} = {$district} and {$m} = {$machine}";
    $result = mysql_query($query) or die("dataEntered failed" . mysql_error());
    $rows = mysql_num_rows($result);
    $categoryCount = getTotalCandidateCount();
    //echo "Rows = $rows and count = $categoryCount";
    if ($rows >= $categoryCount) {
        return true;
    } else {
        return false;
    }
}
Пример #2
0
function dataEntered($district, $machine)
{
    $query = "SELECT tally FROM results WHERE election_district_id = {$district} AND machine_number = {$machine}";
    $result = runQuery($query);
    $rows = $result->num_rows;
    //mysql_num_rows($result);
    //echo $query;
    $categoryCount = getTotalCandidateCount();
    //echo "Rows = $rows and count = $categoryCount";
    if ($rows >= $categoryCount) {
        return true;
    } else {
        //echo "false";
        return false;
    }
}