<td> <input type="text" size="80" name="phone" id="phone" /> </td> </tr> <?php if (fAuthorization::checkAuthLevel('super')) { ?> <tr class="regionRow"> <td><label>Región</label></td> <td> <select class="state" name="state"> <option value="0">Estado</option> <?php $r = Region::findAll(1); foreach ($r as $item) { ?> <option value="<?php echo $item->prepareIdRegion(); ?> "><?php echo $item->prepareName(); ?> </option> <?php } ?> </select> <select class="region" name="region"> <option value="0">Municipio</option>
<?php $r = new Region(); $tmp = $r->findAll(fRequest::encode('region')); $regions = array(); if (!empty($tmp)) { foreach ($tmp as $item) { $regions[] = array('id_region' => $item->prepareIdRegion(), 'name' => $item->prepareName()); } } die(json_encode($regions));