Exemple #1
0
                    <div class="admin-seed-area admin-view-seed-<?php 
        echo $project['project_id'];
        ?>
">
                            <?php 
        echo '' . ($ix + 1) . '.' . substr($project['project_title'], 0, 30);
        ?>
 <span class="seed-value"> <?php 
        echo $seed;
        ?>
                    </span></br>
                            <div class="divline"></div>
                        <div class="seeding-block">
                            <?php 
        $score = getScroreForProject($project['project_id']);
        if (!$score) {
            $feasibility = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $uniqueness = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $growth_quality = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $startup_easeness = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $process_clarity = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $risk_factor = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $time_consumption = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $redundancy_featured = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $impact = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
            $profile = array('N/A', 'N/A', 'N/A', 'N/A', 'N/A');
        } else {
            $feasibility = explode(',', $score['feasibility']);
            $uniqueness = explode(',', $score['uniqueness']);
            $growth_quality = explode(',', $score['growth_quality']);
function calculate_mr($project_id)
{
    $score = getScroreForProject($project_id);
    if (!$score) {
        return 'N/A';
    }
    //if (in_array(''))
    $feasibility = explode(',', $score['feasibility']);
    $uniqueness = explode(',', $score['uniqueness']);
    $growth_quality = explode(',', $score['growth_quality']);
    $startup_easeness = explode(',', $score['startup_easeness']);
    $process_clarity = explode(',', $score['process_clarity']);
    $risk_factor = explode(',', $score['risk_factor']);
    $time_consumption = explode(',', $score['time_consumption']);
    $redundancy_featured = explode(',', $score['redundancy_featured']);
    $impact = explode(',', $score['impact']);
    $profile = explode(',', $score['profile']);
    $means = array();
    for ($i = 0; $i < 5; $i++) {
        $means[] = ($feasibility[$i] + $uniqueness[$i] + $growth_quality[$i] + $startup_easeness[$i] + $process_clarity[$i] + $risk_factor[$i] + $time_consumption[$i] + $redundancy_featured[$i] + $impact[$i] + $profile[$i]) / 10;
    }
    if ($means[0] < 0 || $means[1] < 0 || $means[2] < 0 || $means[3] < 0 || $means[4] < 0) {
        return 'N/A';
    }
    return round(array_sum($means) / 5, 2);
}