Ejemplo n.º 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));
 }
Ejemplo n.º 2
0
	</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($){