예제 #1
0
 public function actionEdit($id)
 {
     $algorithm = Algorithms::model()->findByPk($id);
     if (isset($_REQUEST['Algorithms'])) {
         $algorithm->steps = $_REQUEST['Algorithms']['steps'];
         $algorithm->title = $_REQUEST['Algorithms']['title'];
         if (isset($_REQUEST['Algorithms']['Tracks'])) {
             $algorithm->setRelationRecords("Tracks", $_REQUEST['Algorithms']['Tracks']);
         }
         $algorithm->description = $_REQUEST['Algorithms']['description'];
         if ($algorithm->save()) {
             Yii::app()->notify->add("Обновлено", "success");
         }
     }
     $this->render('edit', array("algorithm" => $algorithm));
 }
예제 #2
0
파일: track.php 프로젝트: Kapodastr/grow
	</div>   <!-- /.col-md-8 -->



</div> <!-- /.row -->
 
	<br>Презентации <br>

	<?php 
echo $form->dropDownList($track, 'Docs', CHtml::listData(Docs::model()->findAll(), 'id', 'title'), array("multiple" => true));
?>
	
	<br>Алгоритмы<br>

	<?php 
echo $form->dropDownList($track, 'Algorithms', CHtml::listData(Algorithms::model()->findAll(), 'id', 'title'), array("multiple" => true));
?>
	

	<br><br>
	<button type="submit" class="btn btn-success btn-lg">Сохранить</button>

<?php 
$this->endWidget();
?>

<hr>

<script>
	
jQuery(document).ready(function($){