(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 .
Author: OpenEyes (info@openeyes.org.uk)
Inheritance: extends BaseActiveRecordVersioned
 public function actionEditOphInfo()
 {
     $cvi_status = PatientOphInfoCviStatus::model()->findByPk(@$_POST['PatientOphInfo']['cvi_status_id']);
     if (!$cvi_status) {
         throw new Exception('invalid cvi status selection:' . @$_POST['PatientOphInfo']['cvi_status_id']);
     }
     if (!($patient = Patient::model()->findByPk(@$_POST['patient_id']))) {
         throw new Exception('Unable to find patient: ' . @$_POST['patient_id']);
     }
     $cvi_status_date = $this->processFuzzyDate();
     $result = $patient->editOphInfo($cvi_status, $cvi_status_date);
     echo json_encode($result);
 }
示例#2
0
    $form = $this->beginWidget('FormLayout', array('id' => 'edit-oph_info', 'htmlOptions' => array('class' => 'form add-data'), 'layoutColumns' => array('label' => 3, 'field' => 9)));
    ?>

					<div class="field-row row">
						<div class="<?php 
    echo $form->columns('label');
    ?>
">
							<label for="PatientOphInfo_cvi_status_id">Status:</label>
						</div>
						<div class="<?php 
    echo $form->columns('field');
    ?>
">
							<?php 
    echo CHtml::activeDropDownList($info, 'cvi_status_id', CHtml::listData(PatientOphInfoCviStatus::model()->active()->findAll(array('order' => 'display_order')), 'id', 'name'));
    ?>
							<?php 
    echo $form->error($info, 'cvi_status_date');
    ?>
						</div>
					</div>

					<?php 
    $this->renderPartial('_fuzzy_date', array('form' => $form, 'date' => $info->cvi_status_date));
    ?>

					<input type="hidden" name="patient_id" value="<?php 
    echo $this->patient->id;
    ?>
" />