Создание веб-приложения, сочетающего в себе проектирование и создание баз данных, работу со сторонними форматами данных, программирование в NET и веб-разработку, страница 78

                                search += "players.position = '" + position.Split(',')[i] + "' ";

                            else search += " OR players.position = '" + position.Split(',')[i] + "' ";

                        }

                        search += ")";

                    }

                    else search = "";

                }

                sql = "select players.id as r,players.name as player, teams.name as team, players.position as pos,sum(" + table_players_stats + ".gp) as gp,sum(" + table_players_stats + ".g) as g,sum(" + table_players_stats + ".a) as a,sum(" + table_players_stats + ".p) as p,sum(" + table_players_stats + ".pl_mn) as plmn,sum(" + table_players_stats + ".pim) as pim,round(sum(" + table_players_stats + ".pim)/sum(" + table_players_stats + ".gp),1) as pim_g,sum(" + table_players_stats + ".g_fs) as gfs,sum(" + table_players_stats + ".g_pp) as gpp,sum(" + table_players_stats + ".g_sh) as gsh,sum(" + table_players_stats + ".g_ot) as got,sum(" + table_players_stats + ".g_w) as gw,sum(" + table_players_stats + ".so) as so,sum(" + table_players_stats + ".g_so) as gso,round(sum(" + table_players_stats + ".g_so)/sum(" + table_players_stats + ".so)*100,1) as sop,sum(" + table_players_stats + ".g_wso) as sow,sum(" + table_players_stats + ".sh) as s,round(sum(" + table_players_stats + ".g)/sum(" + table_players_stats + ".sh)*100,1) as sper,sum(" + table_players_stats + ".fo) as fo,round(sum(" + table_players_stats + ".fo_w)/sum(" + table_players_stats + ".fo)*100,1) as fo,round(sum(" + table_players_stats + ".toi),1) as toi,round(sum(" + table_players_stats + ".toi)/sum(" + table_players_stats + ".gp),1) as toig,round(sum(" + table_players_stats + ".sft)/sum(" + table_players_stats + ".gp),1) as sft from  " + table_players_stats + " inner join teams on teams.id = " + table_players_stats + ".team " + team_filter + " inner join players on players.id = " + table_players_stats + ".player " + search + " group by " + table_players_stats + ".player order by p DESC";

                dt.Clear();

                da = new MySqlDataAdapter(sql, conn);

                da.Fill(dt);

                report.DataSource = dt;

                report.DataBind();

                if (!player_filter.Equals(""))

                {

                    for (int i = 0; i < report.Rows.Count; i++)

                    {

                        if (report.Rows[i].Cells[1].Text.Equals(player)) num = (i + 1);

                    }

                    sql = "select players.id as r,players.name as player, teams.name as team, players.position as pos,sum(" + table_players_stats + ".gp) as gp,sum(" + table_players_stats + ".g) as g,sum(" + table_players_stats + ".a) as a,sum(" + table_players_stats + ".p) as p,sum(" + table_players_stats + ".pl_mn) as plmn,sum(" + table_players_stats + ".pim) as pim,round(sum(" + table_players_stats + ".pim)/sum(" + table_players_stats + ".gp),1) as pim_g,sum(" + table_players_stats + ".g_fs) as gfs,sum(" + table_players_stats + ".g_pp) as gpp,sum(" + table_players_stats + ".g_sh) as gsh,sum(" + table_players_stats + ".g_ot) as got,sum(" + table_players_stats + ".g_w) as gw,sum(" + table_players_stats + ".so) as so,sum(" + table_players_stats + ".g_so) as gso,round(sum(" + table_players_stats + ".g_so)/sum(" + table_players_stats + ".so)*100,1) as sop,sum(" + table_players_stats + ".g_wso) as sow,sum(" + table_players_stats + ".sh) as s,round(sum(" + table_players_stats + ".g)/sum(" + table_players_stats + ".sh)*100,1) as sper,sum(" + table_players_stats + ".fo) as fo,round(sum(" + table_players_stats + ".fo_w)/sum(" + table_players_stats + ".fo)*100,1) as fo,round(sum(" + table_players_stats + ".toi),1) as toi,round(sum(" + table_players_stats + ".toi)/sum(" + table_players_stats + ".gp),1) as toig,round(sum(" + table_players_stats + ".sft)/sum(" + table_players_stats + ".gp),1) as sft from  " + table_players_stats + " inner join teams on teams.id = " + table_players_stats + ".team " + team_filter + " inner join players on players.id = " + table_players_stats + ".player " + player_filter + " " + search + " group by " + table_players_stats + ".player order by p DESC";