Example #1
0
        }
    }
} else {
    $jq2footer .= '$("#modal-title").empty();
				$("#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);
Example #2
0
		';
    }
    BSformomod("admin_gare.php?torneo=" . $_GET[torneo]);
    if ($_GET[open] > 0 && $_GET[gid] > 0) {
        hidden("regris");
        hidden($_GET[gid], "gara");
        $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");