public function getEstadisticasPorTipoPartido($tipoPartido) { $estadisticasJugadores = array(); $vector = array(); $con = new BDDConexion(); $tmpSql = $this->GET_STATS_BY_TYPE_MATH; if ($tipoPartido > 0 && $tipoPartido < 5) { $tmpSql = $tmpSql . $this->GET_STATS_BY_TYPE_MATH_WHERE_CONDITION; array_push($vector, $tipoPartido); } $tmpSql = $tmpSql . $this->GET_STATS_BY_TYPE_MATH_GROUPBY_CONDITION; $resultado = $con->launchQuery($tmpSql, $vector); if ($resultado != null) { $estadisticasJugador = null; foreach ($resultado as $row) { $estadisticasJugador = new ControlEstadisticasJugador(); $estadisticasJugador->idJugador = $row['id_jugador']; $estadisticasJugador->totalPartidos = $row['total_partidos']; $estadisticasJugador->totalVictorias = $row['total_victorias']; $estadisticasJugador->totalMvps = $row['total_mvps']; $estadisticasJugador->totalPuntaje = $row['total_puntaje']; $estadisticasJugador->mediaPuntaje = $row['media_puntaje']; $estadisticasJugador->totalGoles = $row['total_goles']; $estadisticasJugador->mediaGoles = $row['media_goles']; $estadisticasJugador->totalAsistencias = $row['total_asistencias']; $estadisticasJugador->mediaAsistencias = $row['media_asistencias']; $estadisticasJugador->totalSalvadas = $row['total_salvadas']; $estadisticasJugador->mediaSalvadas = $row['media_salvadas']; $estadisticasJugador->totalTiros = $row['total_tiros']; $estadisticasJugador->mediaTiros = $row['media_tiros']; array_push($estadisticasJugadores, $estadisticasJugador); } } return $estadisticasJugadores; }
public function searchUser($userName) { $user = new Jugador(); $vector = array($userName); $con = new BDDConexion(); $resultado = $con->launchQuery($this->SELET_USER, $vector); if ($resultado != null) { foreach ($resultado as $row) { $user->setId($row['id']); $user->setCodigo($row['codigo']); $user->setNombre($row['nombre']); $user->setContra($row['contra']); } } return $user; }