The followings are the available columns in table:
Inheritance: extends SplitEventTypeElement
 /**
  * @param $attribute
  * @param $params
  */
 public function checkSelectedLensFormula($attribute, $params)
 {
     if (count(OphInBiometry_Imported_Events::model()->findAllByAttributes(array('event_id' => $this->event_id))) > 0) {
         $lensCount = count(Element_OphInBiometry_IolRefValues::model()->findAll(array('select' => 'lens_id', 'condition' => 'event_id=' . $this->event_id, 'distinct' => 'true')));
         $formulaCount = count(Element_OphInBiometry_IolRefValues::model()->findAll(array('select' => 'formula_id', 'condition' => 'event_id=' . $this->event_id, 'distinct' => 'true')));
         if ($params['selectData'] == 'left_lens' && $formulaCount > 1 && $lensCount > 1) {
             if (empty($this->formula_id_left) && !empty($this->lens_id_left) || !empty($this->formula_id_left) && empty($this->lens_id_left)) {
                 if (empty($this->lens_id_left)) {
                     $this->addError('lens_id_left', 'Lens and Formula must be selected or left blank (Left side).');
                 }
             }
         } elseif ($params['selectData'] == 'left_formula' && $lensCount > 1 && $formulaCount > 1) {
             if (empty($this->formula_id_left) && !empty($this->lens_id_left) || !empty($this->formula_id_left) && empty($this->lens_id_left)) {
                 if (empty($this->formula_id_left)) {
                     $this->addError('formula_id_left', 'Lens and Formula must be selected or left blank (Left side).');
                 }
             }
         } elseif ($params['selectData'] == 'right_lens' && $formulaCount > 1 && $lensCount > 1) {
             if (empty($this->formula_id_right) && !empty($this->lens_id_right) || !empty($this->formula_id_right) && empty($this->lens_id_right)) {
                 if (empty($this->lens_id_right)) {
                     $this->addError('lens_id_right', 'Lens and Formula must be selected or left blank (Right side).');
                 }
             }
         } elseif ($params['selectData'] == 'right_formula' && $lensCount > 1 && $formulaCount > 1) {
             if (empty($this->formula_id_right) && !empty($this->lens_id_right) || !empty($this->formula_id_right) && empty($this->lens_id_right)) {
                 if (empty($this->lens_id_right)) {
                     $this->addError('formula_id_right', 'Lens and Formula must be selected or left blank (Right side).');
                 }
             }
         }
     }
 }
 * (C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011
 * (C) OpenEyes Foundation, 2011-2013
 * This file is part of OpenEyes.
 * OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
 *
 * @link http://www.openeyes.org.uk
 *
 * @author OpenEyes <*****@*****.**>
 * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust
 * @copyright Copyright (c) 2011-2013, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
if ($element->event->id > 0) {
    $iolRefValues = Element_OphInBiometry_IolRefValues::Model()->findAllByAttributes(array('event_id' => $element->event->id));
}
?>

<section class="element">
	<div class="element-data element-eyes row">
		<div class="element-eye right-eye column">
			<div class="element-header right-side">
				<h4><b>RIGHT</b></h4>
			</div>
			<?php 
if ($element->hasRight()) {
    $this->renderPartial('view_Element_OphInBiometry_Measurement_fields', array('side' => 'right', 'element' => $element, 'measurementInput' => $iolRefValues));
} else {
    ?>
				<div class="data-value">Not recorded</div>
                $emmetropiadata['right'][$measurementData->{'lens_id'}][$measurementData->{'formula_id'}] = $measurementData->{'emmetropia_right'};
                $acon['right'][$measurementData->{'lens_id'}][$measurementData->{'formula_id'}] = $measurementData->{'constant'};
            }
        }
    }
    ?>
        <div class="row">
            <div class="large-12 column">
                <div class="row field-row">
                    <div class="large-4 column">
                        <span class="field-info">Surgeon:</span>
                    </div>
                    <div class="large-8 column">
                        <b><?php 
    if (isset(Element_OphInBiometry_IolRefValues::model()->findByAttributes(array('event_id' => $this->event->id))->surgeon_id)) {
        echo OphInBiometry_Surgeon::model()->findByAttributes(array('id' => Element_OphInBiometry_IolRefValues::model()->findByAttributes(array('event_id' => $this->event->id))->surgeon_id))->name;
    }
    ?>
</b>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="large-12 column">
                <?php 
    $criteria = new CDbCriteria();
    if (!empty(${'lens_' . $side})) {
        $numberOfLens = count(OphInBiometry_LensType_Lens::model()->findAll($criteria->condition = ' id in (' . implode(',', array_unique(${'lens_' . $side})) . ')'));
        if ($numberOfLens == 1) {
Example #4
0
 /**
  * @param $id
  */
 public function actionView($id)
 {
     if ($this->event != null && $this->event->id > 0) {
         $this->iolRefValues = Element_OphInBiometry_IolRefValues::Model()->findAllByAttributes(array('event_id' => $this->event->id));
         $this->selectionValues = Element_OphInBiometry_Selection::Model()->findAllByAttributes(array('event_id' => $this->event->id));
     }
     $this->setFlashMessage($id);
     parent::actionView($id);
 }