function get($Code) { $parametros = array(); $parametros['Code'] = $Code; $this->bd->select($this->tabla, '*', "Code=:Code", $parametros); $fila = $this->bd->getRow(); $country = new Country(); $country->set($fila); return $country; }
function getList() { $this->bd->select($this->tabla, "*", "1=1", array(), "Name, Continent, Code"); $r = array(); while ($fila = $this->bd->getRow()) { $country = new Country(); $country->set($fila); $r[] = $country; } return $r; }
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; }
</div> <div class="row"> <div class="box col-md-12"> <div class="box-inner"> <div class="box-header well" data-original-title=""> <h2><i class="glyphicon glyphicon-edit"></i>Add/Edit Country</h2> </div> <div class="box-content"> <?php $id = Request::get("id"); if (is_numeric($id) && $id > 0) { $countryObj = new Country(); $countryObj->set("country_id", $id); $result = $countryObj->getName(); if (count($result)) { $row = $result[0]; $country_id = $row['id']; $country_name = $row['name']; $country_status = $row['active']; } } ?> <form action="" method="POST" name="country_frm" id="country_frm"> <table class="table table-striped table-bordered bootstrap-datatable datatable responsive"> <tr> <td><label class="control-label" for="selectError">Country</label></td> <td><div class="input-group" > <span class="input-group-addon"></span>