/** * Show the form for editing the specified hotel. * * @param int $id * @return Response */ public function edit($id) { $hotel = Hotel::with('caracteristicas')->find($id); $paises = Pais::lists("name", "id"); $caracteristicas = Caracteristica::where('publicado', '=', 1)->get(); return View::make('admin.hotel.edit', compact('hotel', 'paises', 'caracteristicas')); }
function consultarCaracteristicas($idProducto) { $mdb2 = conectar(); $caracteristicas = new Caracteristica($mdb2['dsn']); $caracteristicas->setSelect("nombre"); $caracteristicas->addSelect("descripcion"); $caracteristicas->setWhere("idProducto = {$idProducto}"); $cantidadCaracteristicas = $caracteristicas->getCount(); $caracteristicas = $caracteristicas->getAll(); return array("cantidad" => $cantidadCaracteristicas, "caracteristicas" => $caracteristicas); }
echo $form->labelEx($model, 'descripcion_pregunta'); ?> <?php echo $form->textField($model, 'descripcion_pregunta', array('size' => 60, 'maxlength' => 600)); ?> <?php echo $form->error($model, 'descripcion_pregunta'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'id_caracteristica'); ?> <?php echo $form->dropDownList($model, 'id_caracteristica', CHtml::listData(Caracteristica::model()->findAll(), 'id_caracteristica', 'nombre_caracteristica'), array('multiple' => true)); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'id_aspecto'); ?> <?php echo $form->dropDownList($model, 'id_aspecto', CHtml::listData(Aspecto::model()->findAll(), 'id_aspecto', 'nombre_aspecto')); ?> </div> <div class="row">
public function actionMostrar() { $resultado = $_GET['id_matriz']; $matriz = Matriz::model()->findByPk($resultado); $niveles = Nivel::model()->findAll(); $aspecto = Aspecto::model()->findAllByAttributes(array('id_matriz' => $matriz->id_matriz)); if (count($aspecto) != 0) { $count = count($niveles); $div = '<br /><br /><center>' . $matriz->nombre_matriz . '</center><br />'; $div .= '<table class="normal" style="padding-left:40px"><tr> <th>Aspectos</th>'; foreach ($niveles as $data) { $div .= '<th>' . $data->nombre_nivel . '</th>'; } $div .= '</tr>'; foreach ($aspecto as $data2) { $div .= '<tr><td>' . $data2->nombre_aspecto . '</td>'; $caracteristica = Caracteristica::model()->findAllByAttributes(array('id_aspecto' => $data2->id_aspecto)); foreach ($caracteristica as $data3) { $div .= '<td><a href="#" title="' . $data3->definicion_caracteristica . '">' . $data3->nombre_caracteristica . '</a></td>'; } $div .= '</tr>'; } $div .= '</table>'; } else { $div = '<br /><br /><center><p><b>**Matriz sin aspectos**</b></p></center>'; } $return['message'] = $div; echo json_encode($return); }
/** * 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 Caracteristica the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Caracteristica::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Show the form for editing the specified apt. * * @param int $id * @return Response */ public function edit($id) { $apartamento = Apartamento::with('caracteristicas')->find($id); $paises = Pais::lists("name", "id"); $caracteristicas = Caracteristica::where('publicado', '=', 1)->get(); return View::make('admin.apartamento.edit', compact('apartamento', 'paises', 'caracteristicas')); }