* @author OpenEyes <*****@*****.**> * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust * @copyright Copyright (c) 2011-2012, OpenEyes Foundation * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ $statuses = \OEModule\OphCiExamination\models\OphCiExamination_Management_Status::model()->activeOrPk(array($element->left_laser_status_id, $element->right_laser_status_id))->findAll(); $status_options = array('empty' => '- Please select -', 'options' => array()); foreach ($statuses as $opt) { $status_options['options'][(string) $opt->id] = array('data-deferred' => $opt->deferred, 'data-book' => $opt->book, 'data-event' => $opt->event); } $deferrals = \OEModule\OphCiExamination\models\OphCiExamination_Management_DeferralReason::model()->activeOrPk(array($element->left_laser_deferralreason_id, $element->right_laser_deferralreason_id))->findAll(); $deferral_options = array('empty' => '- Please select -', 'options' => array()); foreach ($deferrals as $opt) { $deferral_options['options'][(string) $opt->id] = array('data-other' => $opt->other); } $lasertypes = \OEModule\OphCiExamination\models\OphCiExamination_LaserManagement_LaserType::model()->activeOrPk(array($element->right_lasertype_id, $element->left_lasertype_id))->findAll(); $lasertype_options = array(); foreach ($lasertypes as $lt) { $lasertype_options[(string) $lt->id] = array('data-other' => $lt->other); } ?> <div class="element-eyes sub-element-fields jsTreatmentFields" id="div_<?php echo CHtml::modelName($element); ?> _treatment_fields"> <?php echo $form->hiddenInput($element, 'eye_id', false, array('class' => 'sideField')); ?> <div class="element-eye right-eye column left side<?php if (!$element->hasRight()) {
echo $element->getAttributeLabel($side . '_lasertype_id'); ?> : </label> </div> <div class="large-6 column end"> <?php echo CHtml::activeDropDownList($element, $side . '_lasertype_id', CHtml::listData($lasertypes, 'id', 'name'), array('options' => $lasertype_options, 'empty' => '- Please select -')); ?> </div> </div> <?php $show_other = false; if (@$_POST[$model_name]) { if ($lasertype = \OEModule\OphCiExamination\models\OphCiExamination_LaserManagement_LaserType::model()->findByPk((int) @$_POST[$model_name][$side . '_lasertype_id'])) { $show_other = $lasertype->other; } } else { if ($lasertype = $element->{$side . '_lasertype'}) { $show_other = $lasertype->other; } } ?> <div class="row field-row lasertype_other<?php if (!$show_other) { echo " hidden"; } ?> ">