예제 #1
0
            As such, these options are available but are intended to be used sparingly and with definitive proof. We encourage users
            to contest and propose more specific options whenever they end up being used. Our current plan is to err on the side of caution and prefer to not contestable options, we'd rather not jump the gun and add negative marks hastily when they're not deserved.</p>
        <p>Justifications for options will be provided when available, and can be read by hovering the mouse over the option on a game's page.</p>
        <table border="1">
            <tr>
                <th>Category</th>
                <th>Option</th>
                <th>Sub-option</th>
                <th>Score</th>
                <th>Comments</th>
            </tr>


            <?php 
$categories = CategoryQuery::create()->orderBySequence()->find();
$options = CategoryOptionQuery::create()->orderBySequence()->find();
?>
            <tr>
                <th>
                    <?php 
foreach ($categories as $category) {
    ?>
                    <?php 
    echo $category->getTitle();
    ?>
                    <?php 
    foreach ($options as $option) {
        ?>
                    <?php 
        $sub_option_count = 0;
        ?>
예제 #2
0
         $value->setRatingHeader($header);
         $value->setCategoryOption($option);
         $value->setOriginalValue($option->getValue());
         if ($selected == "adns") {
             $value->setDoNotScore(true);
         }
         if (array_key_exists('comment_' . $option->getId(), $_POST)) {
             $value->setComments($_POST['comment_' . $option->getId()]);
         } else {
             $value->setComments("");
         }
         $value->save($con);
         if (array_key_exists('sub_option_' . $option->getId(), $_POST)) {
             $sub_value = new RatingValue();
             $sub_value->setRatingHeader($header);
             $sub_option = CategoryOptionQuery::create()->filterById($_POST['sub_option_' . $option->getId()])->findOne($con);
             if ($sub_option == null) {
                 throw new Exception("Sub option ID not found: " . $_POST['sub_option_' . $option->getId()]);
             }
             $sub_value->setCategoryOption($sub_option);
             $sub_value->setOriginalValue($sub_option->getValue());
             $sub_value->save($con);
             $score += $sub_option->getValue();
         }
         if (!$value->getDoNotScore()) {
             $score += $option->getValue();
         }
     }
 }
 $header->setUpdated(new DateTime());
 $header->setScore($score);