Server IP : 149.202.105.228 / Your IP : 216.73.216.18 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/atfycaf/www/admin/js/jsF/ |
Upload File : |
$(document).ready(function() { $("#tournType").selectmenu({ change: function() { var thisVal = $(this).val(); $.ajax({ type:"POST", url: "knockoutData.php", data: "tT=" + thisVal, cache: false, success: function(getRules) { $("#additonalRules").html(getRules); } }); } }); $("#customRules").selectmenu({ change: function() { var thisVal = $(this).val(); if (thisVal == "1") { $("#addRules").slideDown("slow"); $(".tox-tinymce").css("display", "flex"); } else { $("#addRules").slideUp("slow"); $(".tox-tinymce").css("display", "none"); } } }); $(document).on("change", "#noCompetitors", function() { var thisVal = parseInt($(this).val()); var thisMin = parseInt($(this).attr("min")); var thisInc = parseInt($(this).attr("step")); if (thisVal < thisMin) { $(this).val(thisMin); } getRounds(); $("#createTourney").prop("disabled", false); }); $(document).on("click", "#roundSelect a", function() { var thisID = $(this).attr("id"); $("#roundSelect a").removeClass("selectedRound"); $("#" + thisID).addClass("selectedRound"); $("#roundDisplay .roundDisplay").removeClass("selectedRoundDisplay"); $("#" + thisID + "Display").addClass("selectedRoundDisplay"); }); $(document).on("click", "#hasPreliminary", function() { var numRounds = $("#noCompetitors").val(); if (numRounds == "") { } else { getRounds(); } }); var dateFormat = "dd/mm/yy", from = $( "#tournStartDate" ).datepicker({ defaultDate: "+1w", changeMonth: true, changeYear: true, firstDay: 1, dateFormat: dateFormat }).on( "change", function() { to.datepicker( "option", "minDate", getDate( this ) ); }), to = $( "#tournEndDate" ).datepicker({ defaultDate: "+1w", changeMonth: true, changeYear: true, firstDay: 1, dateFormat: dateFormat }).on( "change", function() { from.datepicker( "option", "maxDate", getDate( this ) ); }); /* $(document).on("focusout", ".scoreInput", function() { var thisScoreInp = $(this); var scoreName = thisScoreInp.attr("name"); var oppInp = $("[name='" + scoreName + "']").not(thisScoreInp); var thisMatch = thisScoreInp.data("m"); var thisRound = thisScoreInp.data("r"); var nextRound = parseInt(thisRound) + 1; var thisScoreD = thisScoreInp.val(); var oppScoreD = oppInp.val(); var thisScore = parseInt(thisScoreD); var oppScore = parseInt(oppScoreD); var advPlayer; var thisScoreUC = thisScoreD.toUpperCase(); var oppScoreUC = oppScoreD.toUpperCase(); if (thisScoreUC == "B") { advPlayer = thisScoreInp.siblings(".playerName").val(); } else if (oppScoreUC == "B") { advPlayer = oppInp.siblings(".playerName").val(); } else if (thisScoreUC == "WD") { advPlayer = oppInp.siblings(".playerName").val(); } else if (oppScoreUC == "WD") { advPlayer = thisScoreInp.siblings(".playerName").val(); } else { if (thisScore !== thisScore) { if (oppInp.siblings(".playerName").length) { var oppName = oppInp.siblings(".playerName").val(); if (oppName == "") { thisScore = 1; } else { thisScore = 0; } } else { thisScore = 1; } } if (oppInp.length) { if (oppScore !== oppScore) { if (thisScoreInp.siblings(".playerName").length) { var oppName = thisScoreInp.siblings(".playerName").val(); if (oppName == "") { oppScore = 1; } else { oppScore = 0; } } else { oppScore = 1; } } } else { oppScore = 0; } if (thisScore > oppScore) { advPlayer = thisScoreInp.siblings(".playerName").val(); } else { advPlayer = oppInp.siblings(".playerName").val(); } } if ($("#players" + nextRound).length) { var nextRoundList = $("#players" + nextRound); if ($("#players" + nextRound + " .mw" + thisMatch).length) { $("#players" + nextRound + " .mw" + thisMatch).remove(); } nextRoundList.append('<li class="mw' + thisMatch + ' ui-sortable-handle" data-m="" data-r="' + nextRound + '"><i class="fas fa-grip-horizontal"></i><input type="text" class="playerName" name="playerNames[' + nextRound + '][9999][]" size="50" placeholder="Player Name" value="' + advPlayer + '" readonly /> <input type="text" class="scoreInput" name="playerScore[' + nextRound + '][9999][]" size="50" placeholder="Score" data-m="" data-r="' + nextRound + '" /><span class="fixtureDateTime"><label>Date:</label><input type="datetime-local" class="roundDateInput" name="roundDate[' + nextRound + '][9999][]"></span></li>'); } }); $(document).on("focusout", ".scoreInputPre", function() { var thisScoreInp = $(this); var scoreName = thisScoreInp.attr("name"); var oppInp = $("[name='" + scoreName + "']").not(thisScoreInp); var thisMatch = thisScoreInp.data("m"); var thisRound = thisScoreInp.data("r"); var nextRound = parseInt(thisRound) + 1; var thisScoreD = thisScoreInp.val(); var oppScoreD = oppInp.val(); var thisScore = parseInt(thisScoreD); var oppScore = parseInt(oppScoreD); var advPlayer; var thisScoreUC = thisScoreD.toUpperCase(); var oppScoreUC = oppScoreD.toUpperCase(); if (thisScoreUC == "B") { advPlayer = thisScoreInp.siblings(".playerName").val(); } else if (oppScoreUC == "B") { advPlayer = oppInp.siblings(".playerName").val(); } else if (thisScoreUC == "WD") { advPlayer = oppInp.siblings(".playerName").val(); } else if (oppScoreUC == "WD") { advPlayer = thisScoreInp.siblings(".playerName").val(); } else { if (thisScore !== thisScore) { if (oppInp.siblings(".playerName").length) { var oppName = oppInp.siblings(".playerName").val(); if (oppName == "") { thisScore = 1; } else { thisScore = 0; } } else { thisScore = 1; } } if (oppInp.length) { if (oppScore !== oppScore) { if (thisScoreInp.siblings(".playerName").length) { var oppName = thisScoreInp.siblings(".playerName").val(); if (oppName == "") { oppScore = 1; } else { oppScore = 0; } } else { oppScore = 1; } } } else { oppScore = 0; } if (thisScore > oppScore) { advPlayer = thisScoreInp.siblings(".playerName").val(); } else { advPlayer = oppInp.siblings(".playerName").val(); } } var thisID = "pm" + thisMatch; if ($("#" + thisID).length) { $("#" + thisID).val(advPlayer); } else { $("#fixtures" + nextRound + " .playerName").each(function(index, element) { var thisVal = $(this).val(); if ($.trim(thisVal) == "") { $(this).attr("id", thisID); $(this).val(advPlayer); return false; } }); } }); $(document).on("click", "#shufflePlayers", function() { shufflePlayers(); }); */ function getDate( element ) { var date; try { date = $.datepicker.parseDate( dateFormat, element.value ); } catch( error ) { date = null; } return date; } function getRounds() { var noComps = $("#noCompetitors").val(); var isChecked = $("#hasPreliminary").prop("checked"); var dataURL = ""; if (isChecked == true) { var hasPrelim = "1"; } else { var hasPrelim = "0"; } ///// CHECK TO SEE IF THERE IS INPUTTED DATA - DON'T WANT TO LOSE IT AND HAVE TO START AGAIN \\\\\ dataURL = dataURL + "&" + $("#competitorDisplay .playerName").serialize(); dataURL = dataURL + "&" + $("#competitorDisplay .scoreInput").serialize(); dataURL = dataURL + "&" + $("#competitorDisplay .roundDate").serialize(); $.ajax({ type:"POST", url: "knockoutData.php", data: "nC=" + noComps + "&hP=" + hasPrelim + decodeURI(dataURL), cache: false, success: function(addRounds) { $("#competitorDisplay").html(addRounds); /* $( ".playersSet, .fixtureSet" ).sortable({ connectWith: ".ui-sortable", placeholder: "ui-state-highlight", stop: updateDeleteList }).disableSelection(); $( ".roundDate" ).datepicker({ changeMonth: true, changeYear: true, firstDay: 1, dateFormat: dateFormat }); */ } }); } function shufflePlayers() { var noComps = $("#noCompetitors").val(); var isChecked = $("#hasPreliminary").prop("checked"); var dataURL = ""; if (isChecked == true) { var hasPrelim = "1"; } else { var hasPrelim = "0"; } ///// CHECK TO SEE IF THERE IS INPUTTED DATA - DON'T WANT TO LOSE IT AND HAVE TO START AGAIN \\\\\ dataURL = dataURL + "&" + $("#competitorDisplay .playerName").serialize(); $.ajax({ type:"POST", url: "knockoutData.php", data: "sP=true&nC=" + noComps + "&hP=" + hasPrelim + decodeURI(dataURL), cache: false, success: function(shufflePlayers) { $("#competitorDisplay").html(shufflePlayers); /* $( ".playersSet, .fixtureSet" ).sortable({ connectWith: ".ui-sortable", placeholder: "ui-state-highlight", stop: updateDeleteList }).disableSelection(); $( ".roundDate" ).datepicker({ changeMonth: true, changeYear: true, firstDay: 1, dateFormat: dateFormat }); */ } }); } function updateDeleteList() { var theParent = $("#roundDisplay").children(".selectedRoundDisplay").children(".fixturesListC").children(".fixtureSet").attr("id"); var noMatches = $("#" + theParent).data("fc"); var theChildren = $("#" + theParent).children(); var theTChildren = $("#" + theParent).children(".ui-sortable-placeholder"); var noChildren = theChildren.length; if (noChildren > noMatches) { $("#" + theParent).children(".ui-sortable-placeholder").last().remove(); } else if (noChildren < noMatches) { $("#" + theParent).append('<li class="ui-sortable-placeholder ui-sortable-handle"></li>'); } var theseChildren = $("#roundDisplay").children(".selectedRoundDisplay").children(".fixturesListC").children(".fixtureSet").children("li"); var matchNo = 0; var rowCount = 1; theseChildren.each(function() { matchNo = matchNo + 1; var thisRow = $(this); var thisRound = thisRow.data("r"); thisRow.data("m", rowCount); var thisName = thisRow.children(".playerName"); if (thisRow.children(".scoreInput").length) { var thisScore = thisRow.children(".scoreInput"); } else { var thisScore = thisRow.children(".scoreInputPre"); } var thisDate = thisRow.children(".fixtureDateTime").children(".roundDateInput"); thisName.attr("name", "playerNames[" + thisRound + "][" + rowCount + "][]"); thisScore.attr("name", "playerScore[" + thisRound + "][" + rowCount + "][]"); thisDate.attr("name", "roundDate[" + thisRound + "][" + rowCount + "][]"); thisScore.data("m", rowCount); if (matchNo % 2 == 0) { rowCount = rowCount + 1; } }); } tinymce.init({ selector: '.tinyTxtEditor', inline: true, menubar: false, plugins: ['advlist autolink lists link image charmap print preview anchor','searchreplace visualblocks responsivefilemanager code fullscreen','insertdatetime media table contextmenu paste'], toolbar1: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link', image_advtab: true , relative_urls : false, remove_script_host : true, document_base_url : thisURL, contextmenu: "link image media", external_filemanager_path:"/admin/filemanager/", filemanager_title:"Responsive Filemanager" , external_plugins: { "filemanager" : "/admin/filemanager/plugin.min.js"} }); });