<div class="modal-header partition-blue"> <button type="button" class="close" data-dismiss="modal">×</button> <h3 class="no-margin"><i class="fa fa-list-alt"></i> Listado de Tipos de Accion</h3> </div> <div class="modal-body padding-20 " style="overflow-x: hidden; overflow-y: auto"> <form > <table id="tablaDetallesTipoAccion" class="table table-bordered table-striped" style="width:100%;" > <thead class="text-center"> <tr> <th>Tipo de Acción</th> </tr> </thead> <tbody class="text-center"> <?php $tipoAccion = new TipoAccion(); $tiposAccion = $tipoAccion->findAll(); foreach ($tiposAccion as $value) { ?> <tr> <td> <?php echo $value->nombre; ?> </td> </tr> <?php } ?>
} function DameTuSumaEstocastica($id) { $cantidad = 0; $criteria = new CDbCriteria(); $riesgoss = Riesgo::model()->findAllByAttributes(array('estado' => 1)); for ($index = 0; $index < count($riesgoss); $index++) { if ($riesgoss[$index]->id_grupo_riesgo == $id) { $cantidad = $cantidad + (int) $riesgoss[$index]->riesgo_estocastico; } } return $cantidad; } //LLENAR FILTRO TIPO DE ACCION $arregloTipoAccion = []; $arrayTA = TipoAccion::model()->findAll(); for ($index3 = 0; $index3 < count($arrayTA); $index3++) { $arregloTipoAccion[$index3] = $arrayTA[$index3]->nombre; } $arregloTipoAccionDeterministico = []; for ($index2 = 0; $index2 < count($arrayTA); $index2++) { $aux = DameTuSumaDeterministicaTA($arrayTA[$index2]->id_tipo_accion); $arregloTipoAccionDeterministico[$index2] = $aux; } function DameTuSumaDeterministicaTA($id) { $cantidad = 0; $riesgoss = Riesgo::model()->findAllByAttributes(array('estado' => 1)); for ($index = 0; $index < count($riesgoss); $index++) { if ($riesgoss[$index]->id_tipo_accion == $id) { $cantidad = $cantidad + (int) $riesgoss[$index]->riesgo_deterministico;
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return TipoAccion the loaded model * @throws CHttpException */ public function loadModel($id) { $model = TipoAccion::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<div class="row"> <div class="col-md-3"> <div id="" class="form-group"> <label class="control-label"> Tipo de Acción <span class="symbol required"></span> </label> <div class="input-group"> <span class="input-group-addon"> <input id="idTipoAccionCheckReplicar" type="checkbox"> </span> <select id="idTipoAccionReplicar" name="idTipoAccionReplicar" class="js-example-basic-single" tabindex="-1" aria-hidden="true" style="width:100%; height: 35px;"> <option value="">Seleccione</option> <?php $tipoAccionReplicar = new TipoAccion(); $tiposAccionReplicar = $tipoAccionReplicar->findAll(); foreach ($tiposAccionReplicar as $value) { ?> <option value="<?php echo $value->id_tipo_accion; ?> " title="<?php echo $value->nombre; ?> "> <?php echo $value->nombre; }