Inheritance: extends BaseActiveRecordVersioned
 style="display: none;"<?php 
}
?>
>
	<div class="row field-row">
		<div class="large-3 column">
			<label>
				<?php 
echo $element->getAttributeLabel('injection_deferralreason_id');
?>
:
			</label>
		</div>
		<div class="large-4 column ">
			<?php 
$options = \OEModule\OphCiExamination\models\OphCiExamination_Management_DeferralReason::model()->activeOrPk($element->injection_deferralreason_id)->findAll();
$html_options = array('empty' => '- Please select -', 'options' => array());
foreach ($options as $opt) {
    $html_options['options'][(string) $opt->id] = array('data-other' => $opt->other);
}
echo CHtml::activeDropDownList($element, 'injection_deferralreason_id', CHtml::listData($options, 'id', 'name'), $html_options);
?>
		</div>
	</div>
</div>

<div class="sub-element-fields" id="div_<?php 
echo CHtml::modelName($element);
?>
_injection_deferralreason_other"<?php 
if (!($element->injection_deferralreason && $element->injection_deferralreason->other)) {
 * 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-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 
// Work out what to show in the form
$show_deferral = false;
$show_deferral_other = false;
$show_treatment = false;
$show_booking_hint = false;
$show_event_hint = false;
$status = null;
$deferralreason = null;
if (@$_POST[$model_name]) {
    $status = \OEModule\OphCiExamination\models\OphCiExamination_Management_Status::model()->findByPk(@$_POST[$model_name][$side . '_laser_status_id']);
    if ($deferral_id = @$_POST[$model_name][$side . '_laser_deferralreason_id']) {
        $deferralreason = \OEModule\OphCiExamination\models\OphCiExamination_Management_DeferralReason::model()->findByPk($deferral_id);
    }
} else {
    $status = $element->{$side . '_laser_status'};
    $deferralreason = $element->{$side . '_laser_deferralreason'};
}
if ($status) {
    if ($status->deferred) {
        $show_deferral = true;
    } elseif ($status->book) {
        $show_treatment = true;
        $show_booking_hint = true;
    } elseif ($status->event) {
        $show_treatment = true;
        $show_event_hint = true;
    }