/** * busca un usuario en la base de datos y lo devuelve si este existe * sino existe devolvera null */ public function autenticar($user, $pass) { $SQLCommand = "SELECT \n idusuario, cuenta, password \n FROM usuario \n WHERE cuenta = '{$user}' AND password = '******'\n LIMIT 1"; $recordset = parent::query($SQLCommand); $usuario = $recordset->fetchObject(); return $usuario; }
public function listAll($Filter = "") { if ($Filter != "") { $Filter = " WHERE " . $Filtro; } $recordset = parent::queryArray("SELECT * FROM paquete {$Filter}"); return $recordset; }
public function CrearCombo2Valores($entidad, $secondVal, $displayValue, $selectedId, $Filtro = "") { if ($Filtro != "") { $Filtro = " WHERE " . $Filtro; } $keyValue = 'id' . $entidad; $result = "<select name='combo{$entidad}' id='combo{$entidad}' onchange='javascript:void(comboDependiente{$entidad}());'>"; if ($selectedId == 0) { $result .= "<option value='0' selected></option>"; } $recordset = parent::query("Select * from {$entidad} {$Filtro}"); while ($records = parent::handle($recordset)) { $value = $records->{$displayValue}; $key = $records->{$keyValue}; $key2 = $records->{$secondVal}; if ($key == $selectedId) { $result .= "<option value='{$key}#{$key2}' selected>{$value}</option>"; } else { $result .= "<option value='{$key}#{$key2}'>{$value}</option>"; } } $result .= '</select>'; return $result; }
public function listPagosDelMes($iniDate, $finDate) { $SQLCommand = "\n SELECT \n o.idpago, o.idpersona, o.idpaquete, o.fecha, o.monto,\n e.nombre, e.apaterno, e.amaterno, e.fechainscripcion, e.montoinscripcion\n FROM pago\to\n INNER JOIN persona e ON (o.idpersona = e.idpersona)\n WHERE o.fecha >= '{$iniDate}'\n AND o.fecha <= '{$finDate}'\n ORDER BY o.fecha DESC"; $recordset = parent::queryArray($SQLCommand); return $recordset; }
public function listInscritosEnMes($iniDate, $finDate) { $SQLCommand = "\n SELECT\n idpersona, nombre, apaterno, amaterno, direccion, telefono, email, contacto, \n contactotelefono, fecharegistro, fechainscripcion, montoinscripcion, \n inscrito, activo\n FROM persona\n WHERE fechainscripcion >= '{$iniDate}'\n AND fechainscripcion <= '{$finDate}'\n ORDER BY fechainscripcion DESC"; $recordset = parent::queryArray($SQLCommand); return $recordset; }