Ejemplo n.º 1
0
 function getList($pagina = 1, $orden = "", $nrpp = Constant::NRPP, $condicion = "1=1", $parametros = array())
 {
     $ordenPredeterminado = "{$orden}, Name, CountryCode, ID";
     if ($orden === "" || $orden === null) {
         $ordenPredeterminado = "Name, CountryCode, ID";
     }
     $registroInicial = ($pagina - 1) * $nrpp;
     $this->bd->select($this->tabla, "*", $condicion, $parametros, $ordenPredeterminado, "{$registroInicial}, {$nrpp}");
     $r = array();
     while ($fila = $this->bd->getRow()) {
         $city = new City();
         $city->set($fila);
         $r[] = $city;
     }
     return $r;
 }
Ejemplo n.º 2
0
 function getList($pagina = 1, $orden = "", $nrpp = Configuracion::NRPP, $condicion = "1=1", $parametros = array())
 {
     $ordenPredeterminado = "{$orden}, Name, CountryCode, ID";
     if (trim($orden) === "" || trim($orden) === NULL) {
         $ordenPredeterminado = "Name, CountryCode, ID";
     }
     $registroInicial = ($pagina - 1) * $nrpp;
     $this->bd->select($this->tabla, "*", $condicion, $parametros, $ordenPredeterminado, "{$registroInicial}, {$nrpp}");
     $r = array();
     while ($fila = $this->bd->getRow()) {
         $city = new City();
         $city->set($fila);
         $r[] = $city;
     }
     return $r;
     //Devuelve un array de ciudades;
 }
Ejemplo n.º 3
0
 </option>
                                                        <?php 
}
?>
                                                    </select>


                                                </div>

                                            </td>
                                        </tr>
                                        <?php 
$id = Request::get("id");
if (is_numeric($id) && $id > 0) {
    $cityObj = new City();
    $cityObj->set("city_id", $id);
    $result = $cityObj->getName();
    if (count($result)) {
        $row = $result[0];
        $city_id = $row['id'];
        $state_id = $row['state_id'];
        $city_name = $row['name'];
        $city_status = $row['active'];
    }
}
?>
                                        <tr>
                                            <td><label class="control-label" for="selectError">City</label></td>
                                            <td><div class="input-group" style="width: 50%">
                                                    <span class="input-group-addon"></span>
                                                    <input type="text" name="city_name" value="<?php 
Ejemplo n.º 4
0
 function getListCountryCityCountryLanguage($condicion = null, $parametros = array())
 {
     if ($condicion === null) {
         $condicion = "";
     } else {
         $condicion = "where {$condicion}";
     }
     $sql = "select co.*, ci.*, cl.* \r\n                from country co \r\n                left join city ci\r\n                on co.Code = ci.CountryCode \r\n                left join countrylanguage cl \r\n                on co.Code = cl.CountryCode where {$condicion}";
     $this->bd->send($sql, $parametros);
     $r = array();
     //$contador = 0;
     while ($fila = $this->bd->getRow()) {
         $country = new Country();
         $country->set($fila);
         $city = new City();
         $city->set($fila, 15);
         $countrylanguage = new Countrylanguage();
         $countrylanguage->set($fila, 20);
         //            $r[$contador]["country"] = $country;
         //            $r[$contador]["city"] = $city;
         //            $r[$contador]["countrylanguage"] = $countrylanguage;
         //            $contador++;
         $r[] = new CountryCityCountryLanguage($country, $city, $countrylanguage);
     }
     return $r;
 }