Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- success : function(response){
- var json = $.parseJSON(response);
- var html = '';
- html += '<table class="table table-bordered table-striped">\n';
- html += '<tr>\n';
- html += '<th class="text-center">Atleta 1</th>\n';
- html += '<th class="text-center">Atleta 2</th>\n';
- html += '<th class="text-center">Data e Hora</th>\n';
- html += '<th class="text-center">Pts. Atl. 1</th>\n';
- html += '<th class="text-center">Pts. Atl. 2</th>\n';
- html += '<th class="text-center">Parciais</th>\n';
- html += '<th class="text-center">Confirmado</th>\n';
- html += '</tr>\n';
- if(json.length > 0){
- var total = Math.ceil(json.length);
- for(var i = 0; i < total; i++)
- {
- html += '<tr>\n';
- html += '<td class="text-center">\n';
- html += '<select name="jogo_esq" class="form-control jogo-esq">\n';
- for(var a = 0; a < json.length; a++)
- {
- if(json[a].atl_ID_1 == json[i].atl_ID_1){
- html += '<option value="' + json[a].atl_ID_1 + '" selected="selected">' + json[a].atl_nome_1 + '</option>'
- } else {
- html += '<option value="' + json[a].atl_ID_1 + '">' + json[a].atl_nome_1 + '</option>';
- }
- }
- html += '</select>';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<select name="jogo_dir" class="form-control jogo-dir">\n';
- for(var b = 0; b < json.length; b++)
- {
- if(json[b].atl_ID_2 == json[i].atl_ID_2){
- html += '<option value="' + json[b].atl_ID_2 + '" selected="selected">' + json[b].atl_nome_2 + '</option>';
- } else {
- html += '<option value="' + json[b].atl_ID_2 + '">' + json[b].atl_nome_2 + '</option>';
- }
- }
- html += '</select>';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<input name="jogo_data[]" type="text" class="text-center jogo-data form-control" placeholder="DD/MM/YYYY HH:MM"/>\n';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<input name="jogo_pts_esq[]" type="text" class="text-center jogo-pts-esq form-control" />\n';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<input name="jogo_pts_dir[]" type="text" class="text-center jogo-pts-dir form-control" />\n';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<input name="jogo_parciais[]" type="text" class="text-center jogo-parciais form-control" placeholder="1 X 2 | 2 X 1 | 4 X 2" />\n';
- html += '</td>\n';
- html += '<td class="text-center">\n';
- html += '<select name="jogo_confirma" class="form-control">\n';
- html += '<option value="Não">Não</option>\n';
- html += '<option value="Sim">Sim</option>\n';
- html += '</select>\n';
- html += '</td>\n';
- html += '</tr>\n';
- }
- } else {
- html += '<tr>\n';
- html += '<td class="text-center" colspan="8">Esta categoria não possui nenhum atleta até o momento.</td>\n';
- html += '</tr>\n';
- }
- html += '</table>';
- html += '<input type="hidden" name="jogo_rodada" value="' + Categoria + '" />';
- $('.loading-data').fadeOut('fast', function(){
- $('#form-salvar-jogos').fadeIn('fast', function(){
- $('#ajx-games').append(html);
- console.log(response);
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement