} $n = ssql("select get_nomet(" . $_GET[torneo] . ")"); $e = ssql("select get_edizione(" . $_GET[torneo] . ")"); $appendthat = str_replace("\n", "", $start . $rows . $end); $jq2footer .= '$("#modal-title").empty(); $("#formomod").empty(); $("#edithere").modal("show"); $("#modal-title").append("Classifica del torneo ' . $n . ' ed.' . $e . '"); '; if ($position > 1) { $jq2footer .= '$("#formomod").append("' . $appendthat . '");'; } else { $jq2footer .= '$("#formomod").append("Classifica non ancora definita.");'; } } BSformcmod("passati.php"); $corpoPagina = ob_get_contents(); ob_end_clean(); $jq2footer .= ' $("#garet > tbody tr").each(function() { var players = $(this).find(".players").html(); console.log(players); if(players.indexOf("Direttamente") >= 0){ var data = $(this).find(".data"); data.empty(); var res = $(this).find(".res"); res.empty(); var points = $(this).find(".points"); points.empty(); points.append("+3"); var mod = $(this).find(".mod");
$("#modal-title").append("Nuovo torneo"); //$("#n_gironi").prop("disabled", true);'; hidden("new"); BScheck("ried", "Riedizione", 0); BSdropdown("rieddi", "Riedizione di", "select nome,id from torneo " . $where1 . " \n\t\t\t\t\t\t\t\t\t\t\t\twhere ed<=all(select ed from torneo t1 where t1.nome=nome)", "id", "nome", ""); BSinput("nome", "Nome", ""); BSnum("ed", "Edizione", "1"); BSdropdown("tipo", "Tipo", "select id,nome from tipo_torneo", "id", "nome", "1"); BSnum("n_gironi", "Numero Gironi", 0); BSdate("chiusura_iscr", "Chiusura Iscrizioni", date("Y-m-d")); BSdate("data_inizio", "Data Inizio", date("Y-m-d", time() + 86400)); BSnum("partecipanti", "Max Partecipanti", "2"); BSinput("quota", "Quota", "1"); BSbutton("Inserisci"); } BSformcmod("admin_tornei.php"); $jq2footer .= ' // se torneo misto allora posso scegliere num gironi if($("#tipo").val()!=2) $("#n_gironi").prop("disabled", true); else $("#n_gironi").prop("disabled", false); $("#tipo").change(function() { if($(this).val()!=2) $("#n_gironi").prop("disabled", true); else $("#n_gironi").prop("disabled", false); }); // se checkato riedizione disabilita tutto // eccetto le date e la quota
} $n = ssql("select get_nomet(" . $_GET[torneo] . ")"); $e = ssql("select get_edizione(" . $_GET[torneo] . ")"); $appendthat = str_replace("\n", "", $start . $rows . $end); $jq2footer .= '$("#modal-title").empty(); $("#formomod").empty(); $("#edithere").modal("show"); $("#modal-title").append("Classifica del torneo ' . $n . ' ed.' . $e . '"); '; if ($position > 1) { $jq2footer .= '$("#formomod").append("' . $appendthat . '");'; } else { $jq2footer .= '$("#formomod").append("Classifica non ancora definita.");'; } } BSformcmod("index.php"); $jq2footer .= ' $("#title > u").empty(); $("#title > u").append("Tornei in corso"); $("#garet > tbody tr").each(function() { var players = $(this).find(".players").html(); console.log(players); if(players.indexOf("Direttamente") >= 0){ var data = $(this).find(".data"); data.empty(); var res = $(this).find(".res"); res.empty(); var points = $(this).find(".points"); points.empty(); points.append("+3");
} $n = ssql("select get_nomet(" . $_GET[torneo] . ")"); $e = ssql("select get_edizione(" . $_GET[torneo] . ")"); $appendthat = str_replace("\n", "", $start . $rows . $end); $jq2footer .= '$("#modal-title").empty(); $("#formo").empty(); $("#edithere").modal("show"); $("#modal-title").append("Classifica del torneo ' . $n . ' ed.' . $e . '"); '; if ($position > 1) { $jq2footer .= '$("#formomod").append("' . $appendthat . '");'; } else { $jq2footer .= '$("#formomod").append("Classifica non ancora definita.");'; } } BSformcmod(); $ADDcss = '<link rel="stylesheet" href="./deps/bower_components/bootstrap-calendar/css/calendar.min.css">'; $ADDjs = '<script type="text/javascript" src="./deps/bower_components/underscore/underscore-min.js"></script> <script type="text/javascript" src="./deps/bower_components/bootstrap-calendar/js/calendar.min.js"></script> <script type="text/javascript" src="./deps/bower_components/bootstrap-calendar/js/language/it-IT.js"></script>'; $jq2footer .= "\n//var food = " . $food . ";\nvar calendar = \$('#calendar').calendar(\n\t{\n\t\ttmpl_path: '/deps/bower_components/bootstrap-calendar/tmpls/',\n\t\tevents_source: " . $food . ",\n\t\tlanguage: 'it-IT',\n\t\tweekbox: 'false',\n\t\tonAfterViewLoad: function(view) {\n\t\t\t\$('#cal_title').text(this.getTitle());\n\t\t\t\$('.btn-group button').removeClass('active');\n\t\t\t\$('button[data-calendar-view=\"' + view + '\"]').addClass('active');\n\t\t},\n\t\tclasses: {\n\t\t\tmonths: {\n\t\t\t\tgeneral: 'label'\n\t\t\t}\n\t\t}\n\t});\n\n\$('.btn-group button[data-calendar-nav]').each(function() {\n\tvar \$this = \$(this);\n\t\$this.click(function() {\n\t\tcalendar.navigate(\$this.data('calendar-nav'));\n\t});\n});\n\n\$('.btn-group button[data-calendar-view]').each(function() {\n\tvar \$this = \$(this);\n\t\$this.click(function() {\n\t\tcalendar.view(\$this.data('calendar-view'));\n\t});\n});"; $corpoPagina = ob_get_contents(); ob_end_clean(); $jq2footer .= ' $("#garet > tbody tr").each(function() { var players = $(this).find(".players").html(); console.log(players); if(players.indexOf("Direttamente") >= 0){ var data = $(this).find(".data"); data.empty(); var res = $(this).find(".res");
$gara = multisqlarr("select * from gara where id='" . $_GET[gid] . "'"); $tipo = ssql("select get_tipo(" . $_GET[torneo] . ")"); hidden($tipo, "tipo"); $jq2footer = '$("#modal-title").empty(); $("#modal-title").append("Risultati della gara del ' . $gara[data] . '"); $("#edithere").modal("show");'; $res = sql("select nome,\n\t\t\t\t\t\t\tcognome,\n\t\t\t\t\t\t\trisultato,\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\tfrom utenti \n\t\t\t\t\t\t\tleft join partecipa_a on IDutente=id\n\t\t\t\t\t\twhere IDgara='" . $gara[id] . "'"); $c = 1; while ($g = pg_fetch_array($res)) { BSnum("gioc{$c}", $g[nome] . " " . $g[cognome], $g[risultato]); hidden($g[id], "g{$c}"); $c++; } BSbutton("Inserisci"); } BSformcmod("admin_gare.php?torneo=" . $_GET[torneo]); } else { echo "Per poter gestire le gare e i gironi dei tuoi tornei devi selezionare il torneo da <a href='admin_tornei.php'>qui</a>."; } $jq2footer .= ' $("#garet > tbody tr").each(function() { var players = $(this).find(".players").html(); console.log(players); if(players.indexOf("Direttamente") >= 0){ var data = $(this).find(".data"); data.empty(); var res = $(this).find(".res"); res.empty(); var points = $(this).find(".points"); points.empty(); points.append("+3");
mod.empty(); } });'; } elseif ($_GET[clas] > 0) { $start = "\n\t<table class='table table-striped table-bordered table-hover ui-datatable'>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Posizione</th>\n\t\t\t<th>Giocatore</th>\n\t\t\t<th>Punteggio</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t"; $end = "\n\t</tbody>\n\t</table>\n\t"; $rows = ""; $res = sql("select concat(u.nome,' ',u.cognome) as giocatore, \n\t\t\t\t\tsum(pa.punteggio),\n\t\t\t\t\tcase when sum(pa.punteggio) is null then 0\n\t\t\t\t\t\telse sum(pa.punteggio)\n\t\t\t\t\tend as punti\n\t\t\t\tfrom utenti u\n\t\t\t\t\tleft join partecipa_a pa on pa.IDutente=u.id\n\t\t\t\t\tleft join gara g on g.id=pa.IDgara\n\t\t\t\twhere g.IDtorneo='" . $_GET[torneo] . "'\n\t\t\t\t\tand u.id>2\n\t\t\t\tgroup by pa.IDutente, u.nome, u.cognome\n\t\t\t\torder by punti desc"); $position = 1; while ($r = pg_fetch_array($res)) { $rows .= "\n\t\t<tr>\n\t\t\t<td>" . $position . "</td>\n\t\t\t<td>" . $r[giocatore] . "</td>\n\t\t\t<td>" . $r[punti] . "</td>\n\t\t</tr>\n\t\t"; $position++; } $n = ssql("select get_nomet(" . $_GET[torneo] . ")"); $e = ssql("select get_edizione(" . $_GET[torneo] . ")"); $appendthat = str_replace("\n", "", $start . $rows . $end); $jq2footer .= '$("#modal-title").empty(); $("#formomod").empty(); $("#edithere").modal("show"); $("#modal-title").append("Classifica del torneo ' . $n . ' ed.' . $e . '"); '; if ($position > 1) { $jq2footer .= '$("#formomod").append("' . $appendthat . '");'; } else { $jq2footer .= '$("#formomod").append("Classifica non ancora definita.");'; } } BSformcmod("myhof.php"); $corpoPagina = ob_get_contents(); ob_end_clean(); include "inc/template_all.php";