Exemplo n.º 1
0
				<input type="text" name="ape" id='ape' class='validate' required>
				<label for='ape'>Apellidos:</label>
			</div>
			<div class="input-field col s6" >
				<input type="text" name="dir" id='dir' class='validate'  required>
				<label for='dir'>Dirección:</label>
			</div>
			<div class="input-field col s6">
				<input type="text" name="tel" id='tel' class='validate'  required>
				<label for='tel'>Teléfono:</label>
			</div>
			<div class="input-field col s6" >
				<select class='tableInput' name='id_ciu' id='id_ciu' required>
					<option value='0' disabled selected>Ciudad</option>
					<?php 
foreach ($ciudad->findAll() as $c) {
    ?>
						<option value='<? echo $c['id']; ?>' <? if($c['id']==$_SESSION['id_ciu']) echo "selected"; ?>><? echo $c['nom']; ?></option>
					<?php 
}
?>
					</select>
				<label for='id_ciu'>Ciudad:</label>
			</div>
			<div class="input-field col s6" >
				<select class='tableInput' name='id_dep' id='id_dep' required>
					<option value='0' disabled selected>Departamento</option>
					<?php 
foreach ($departamento->findAll() as $d) {
    ?>
						<option value='<? echo $d['id']; ?>' <? if($d['id']==$_SESSION['id_dep']) echo "selected"; ?>><? echo $d['nom']; ?></option>
Exemplo n.º 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Ciudad('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Ciudad'])) {
         $model->attributes = $_GET['Ciudad'];
     }
     if (count($model->findAll()) > 0) {
         $this->render('admin', array('model' => $model));
     } else {
         $this->render('empty', array('model' => $model));
     }
 }