public function getListado($pagina) { $sql = "select c.id_cliente,c.numero_cliente,c.razon_social,c.telefono,c.contacto,d.calle,d.puerta,d.piso,d.localidad,d.provincia,\n\tid_visita_venta,id_dia_entrega,id_dia_cobranza from clientes c inner join direccion d on c.id_direccion = d.id_direccion"; $sp = $this->db->PrepareSP($sql); $rs = $this->db->Execute($sp); $clientes = array(); while (!$rs->EOF) { $tr = $rs->GetRowAssoc(false); $cliente = new Cliente(); $cliente->id_cliente = $tr['id_cliente']; $cliente->numeroCliente = $tr['numero_cliente']; $cliente->razon_social = $tr['razon_social']; $cliente->telefono = $tr['telefono']; $cliente->contacto = $tr['contacto']; $cliente->calle = $tr['calle']; $cliente->puerta = $tr['puerta']; $cliente->piso = $tr['piso']; $cliente->localidad = $tr['localidad']; $cliente->provincia = $tr['provincia']; $cliente->idVisitaVenta = $tr['id_visita_venta']; $cliente->idDiaEntrega = $tr['id_dia_entrega']; $cliente->idDiaCobranza = $tr['id_dia_cobranza']; $cliente->visitaVenta = DaysOfWeek::getDayById($tr['id_visita_venta']); $cliente->diaCobranza = DaysOfWeek::getDayById($tr['id_dia_cobranza']); $cliente->diaEntrega = DaysOfWeek::getDayById($tr['id_dia_entrega']); $clientes[] = $cliente; $rs->MoveNext(); } $rs->Close(); return $clientes; }
$p = new Page(); $p->HTML('<b>It works!</b>'); $p->Render(); abstract class DaysOfWeek extends Enum { const Sunday = 0; const Monday = 1; const Tuesday = 2; const Wednesday = 3; const Thursday = 4; const Friday = 5; const Saturday = 6; } DaysOfWeek::isValidName('Humpday'); // false DaysOfWeek::isValidName('Monday'); // true DaysOfWeek::isValidName('monday'); // true DaysOfWeek::isValidName('monday', $strict = true); // false DaysOfWeek::isValidName(0); // false DaysOfWeek::isValidValue(0); // true DaysOfWeek::isValidValue(5); // true DaysOfWeek::isValidValue(7); // false DaysOfWeek::isValidValue('Friday'); // false