Пример #1
0
 public function insertUser($player)
 {
     $vector = array($player->getCodigo(), $player->getNombre());
     $con = new BDDConexion();
     $con->executeQuery($this->INSERT_USER, $vector);
     return $con->getLastIdTable("jugadores");
 }
Пример #2
0
 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;
 }