1// let dataProfile = null; 2// let dataActuaciones = null; 3// let dataAprontes = null; 4// let dataPedigree = null; 5// let dataRetirosFS = null; 6// let dataContratiempos = null; 7// let dataCampanaCompleta = null; 8// let dataHuinchadas = null; 9 10function setDataProfile(response) { 11 dataProfile = response; 12} 13 14function setDataPedigree(response) { 15 dataPedigree = response; 16 if (dataPedigree && dataProfile) { 17 renderProfile(); 18 renderPedigree(); 19 } 20} 21 22function setDataRetirosPFS(response) { 23 dataRetirosFS = response; 24 renderRetiros(); 25} 26 27function setDataActuaciones(response) { 28 dataActuaciones = response; 29 renderActuaciones(); 30} 31 32function setDataAprontes(response) { 33 dataAprontes = response; 34 renderAprontes(); 35} 36 37function setDataHuinchadas(response) { 38 dataHuinchadas = response; 39 renderHuinchadas(); 40} 41 42function setDataContratiempos(response) { 43 dataContratiempos = response; 44 renderContratiempos(); 45} 46 47function setDataCampanaCompleta(response) { 48 dataCampanaCompleta = response; 49 renderCampanaCompleta(); 50} 51 52function mainRenderProfile() { 53 renderProfile(dataProfile); 54 renderActuaciones(dataProfile); 55 renderCampanaCompleta(dataProfile); 56 renderPedigree(dataProfile); 57 renderRetiros(dataProfile); 58 renderContratiempos(dataProfile); 59 renderAprontes(dataProfile); 60 renderHuinchadas(dataProfile); 61 $('#spinner-campanas').hide(); 62} 63 64function getUrlNextRace(fecha, numero) { 65 return get_home_url_carreras + '/programa-y-resultados/?fecha=' + moment(fecha).format('YYYY-MM-DD') + '&carrera=' + numero; 66} 67 68function renderProfile() { 69 let perfil = dataProfile; 70 let pedigree = dataPedigree; 71 let invert = perfil.carreras.reverse(); 72 let sexo = resolveNull(perfil.sexo, '-'); 73 let color = resolveNull(perfil.color, '-'); 74 let fecha_nacimiento = resolveNull(perfil.fecha_nacimiento, '-'); 75 let fatalizacion = resolveNull(perfil.fecha_muerte, ''); 76 let codigo = resolveNull(perfil.codigo, ''); 77 let proxima_carrera = resolveNull(invert[0], ''); 78 let url_next_race; 79 var fecha; 80 if (perfil.carreras[0]) { 81 if (proxima_carrera.numero_carrera) { 82 let html = ''; 83 perfil.carreras.forEach(function (item) { 84 if (item.inscripciones[0].mandil) { 85 html += '<li><a href="' + getUrlNextRace(item.fecha, item.numero_carrera) + '">' + moment(item.fecha).format('DD-MM-YYYY') + ' - Carrera Nº' + item.numero_carrera + '</a></li>' 86 } 87 }); 88 if (html) { 89 if (perfil.carreras.length > 1) { 90 $('#next_race').html('<span class="extra-bold d-block">Próximas Carreras </span><ul id="lista_carreras">' + html + '</ul>'); 91 } else { 92 $('#next_race').html('<span class="extra-bold d-block">Próxima Carrera </span><ul id="lista_carreras">' + html + '</ul>'); 93 } 94 } 95 } else { 96 $('#next_race').html('<span class="extra-bold d-block">Próxima Carrera Inscrito(a) </span> ' + moment(proxima_carrera.fecha).format('DD-MM-YYYY')); 97 } 98 } 99 100 let tipo = sexo + ',' + color + ',' + (fecha_nacimiento ? calcularEdadFS(fecha_nacimiento) : fecha_nacimiento); 101 102 $('#nombre_ejemplar').html('<span class="extra-bold">' + perfil.nombre + '</span>' + ' (' + tipo.toLowerCase() + ')'); 103 $('#padres_ejemplar').html(pedigree.padre.nombre + ' y ' + pedigree.madre.nombre + ' por ' + pedigree.abuelo_materno.nombre); 104 perfil.rut_stud ? $('#chaquetilla_stud').html('<img style="width: 100%" src=" https://static.clubhipico.cl/chaquetillas/' + perfil.rut_stud + '.jpg">') : $('#chaquetilla_stud').html('<img style="width: 100%" src="https://static.clubhipico.cl/chaquetillas/' + 0 + '.jpg">'); 105 106 107 $('#nombre_preparador').html('<span class="extra-bold">Preparador </span>' + capitalizar(perfil.nombre_preparador)); 108 $('#nombre_stud').html('<span class="extra-bold">Propietario </span>' + capitalizar(perfil.nombre_stud)); 109 $('#nombre_haras').html('<span class="extra-bold">Criador </span>' + capitalizar(perfil.nombre_haras)); 110 if (fatalizacion) { 111 $('#fecha_muerte').html('<span class="extra-bold">Fatalización </span>' + moment(fatalizacion).format('DD-MM-YYYY')); 112 } 113 114 $('.per-loading').remove(); 115} 116 117function renderCampanaCompleta() {
118 let campana_completa = dataCampanaCompleta; 119 let pista_route = 'https://static.clubhipico.cl/web/assets/images/pistas/'; 120 121 $('.cam-loading').remove(); 122 if (campana_completa) { 123 $('#spinner-campanas').hide(); 124 var debutante = null; 125 var start = moment().valueOf(); 126 let campana_completa_rev = campana_completa; 127 campana_completa_rev.forEach(function (campana) { 128 if (moment(campana.fecha).valueOf() < start) { 129 debutante = moment(campana.fecha).valueOf(); 130 return ''; 131 } 132 }); 133 134 135 campana_completa_rev.forEach(function (campana) { 136 137 let video = '<td class="text-center font-20 disabled "><i class="fa fa-youtube-play 4x disabled-yt"></i></td>'; 138 139 if (campana.video_youtube.trim().length) { 140 video = '<td class="text-center font-20 youtube-hover"><i class="fa fa-youtube-play 4x" onclick="showModalYoutube(\'' + campana.video_youtube + '\')"></i></td>' 141 } 142 143 let distancia = campana.distancia_2 ? campana.distancia_2 : '-'; 144 let fecha_rn = moment(campana.fecha); 145 146 let estado = resolveNull(campana.estado_pista, ''); 147 $('#spinner-campanas').hide(); 148 let n_carrera = campana.numero_carrera; 149 let winnerColor; 150 let winnerIcon; 151 if (campana.resultado) { 152 winnerColor = campana.resultado == 1 ? 'bg-secondary text-white' : ''; 153 winnerIcon = campana.resultado == 1 ? '<i class="fa fa-trophy mr-1" title="Ãltima vez que ganó"></i>' : ''; 154 } else { 155 winnerColor = ''; 156 winnerIcon = ''; 157 } 158 159 let _deb = fecha_rn.valueOf() == debutante ? '<img title="Debutante" class="invert" src="' + directory_uri + '/web/assets/img/icons/debutante.svg" style="width: 14px; top: -2px; margin-right: 4px; position: relative;" alt="Debutante">' : ''; 160 161 162 let fs_link = get_site_url + '/perfil-fina-sangre/?fs_rut=' + campana.rut_ejemplar_ganador; 163 let peso_jinete_ganador = campana.peso_jinete_ganador ? campana.peso_jinete_ganador + ' Kg' : '-'; 164 let url_data = campana.resultado != 1 ? '<a href="' + fs_link + '">' + resolveNull(campana.ganador, '-') + '</a>' : resolveNull(campana.ganador, '-'); 165 let peso_ganador = campana.peso_ganador ? campana.peso_ganador + ' Kg' : '-'; 166 167 let _handicap = campana.nombre_carrera == 'Condicional' ? 'Cd.' : resolveNull(campana.handicap, '-'); 168 $('#body_campana_completa').append('<tr class="table-div-striped-green ' + winnerColor + '">' + 169 ' <td class="text-center font-12"> ' + _deb + '' + winnerIcon + '' + getUrlPrograma(fecha_rn.format('YYYY-MM-DD'), n_carrera, campana.hipodromo.toLowerCase()) + '</td>' + 170 ' <td class="text-left font-12 no-wrap">' + 171 ' <img class="pista-img mr-1" src="' + logos[campana.hipodromo.toLowerCase()] + '" rel="nofollow">' + 172 estadoPista(estado, distancia) + ' / ' + 173 ' ' + campana.sup_inf + ' / ' + 174 ' <label class="mini-mandil mandil-' + campana.partidor + '">' + campana.partidor + '</label> ' + 175 ' </td>' + 176 ' <td class="text-center font-12">' + getTipoDistanciaCodigo(campana.resultado, campana.distancia_1) + '</td>' + 177 ' <td class="text-center font-12">' + resolveNull(campana.peso_caballo) + ' Kg</td>' + 178 ' <td class="text-center font-12 no-wrap">' + campana.nombre_jinete + ' / ' + campana.peso_jinete + ' Kg</td>' + 179 ' <td class="text-center font-12">' + resolveNull(campana.distancia_1, '-') + '</td>' + 180 ' <td class="text-center font-12">' + url_data + '</td>' + 181 ' <td class="text-center font-12">' + peso_jinete_ganador + '</td>' + 182 ' <td class="text-center font-12">' + campana.distancia_3 + '</td>' + 183 ' <td class="text-center font-12">' + _handicap + '</td>' + 184 ' <td class="text-center font-12">' + resolveNull(campana.dividendo, '-') + '</td>' + 185 ' <td class="text-center font-12">' + resolveNull(campana.tiempo, '-') + '</td>' + 186 ' ' + video + 187 '</tr>' 188 ); 189 }); 190 191 } else { 192 $('#spinner-campanas').hide(); 193 } 194 195 $('#spinner-campanas').hide(); 196 $('#table_campanas').bootstrapTable(); 197} 198 199function getTipoDistanciaCodigo(codigo, distancia) { 200 if (codigo == 90) { 201 return '<span>RD</span>'; 202 } else if (codigo == 91) { 203 return '<span>NT</span>'; 204 } else if (codigo == 92) { 205 return '<span>SNP</span>'; 206 } else { 207 return codigo; 208 } 209} 210 211 212function estadoPista(estado, distancia) { 213 if (estado) { 214 if (estado == 'CN1') { 215 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Nor.'; 216 } else if (estado == 'CE1') { 217 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Elá.'; 218 } else if (estado == 'CR1') { 219 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Reg.'; 220 } else if (estado == 'CP1') { 221 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Pes.'; 222 } else if (estado == 'CB1') { 223 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Bar.'; 224 } else if (estado == 'CL1') { 225 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Bla.'; 226 } else if (estado == 'CN2') { 227 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Nor.'; 228 } else if (estado == 'CR2') { 229 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Reg.'; 230 } else if (estado == 'CB2') { 231 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bar.'; 232 } else if (estado == 'HN1') { 233 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Nor.'; 234 } else if (estado == 'HR1') { 235 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Reg.'; 236 } else if (estado == 'HB1') { 237 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bar.'; 238 } else if (estado == 'VN1') { 239 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Nor.'; 240 } else if (estado == 'VN2') { 241 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Nor.'; 242 } else if (estado == 'VL1') { 243 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Bla.'; 244 } else if (estado == 'VL2') { 245 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bla.'; 246 } else if (estado == 'VR1') { 247 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Reg.'; 248 } else if (estado == 'VR2') { 249 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Reg.'; 250 } else if (estado == 'VB1') { 251 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Bar.'; 252 } else if (estado == 'VB2') { 253 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bar.'; 254 } else if (estado == 'VE1') { 255 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Elá.'; 256 } else if (estado == 'VE2') { 257 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Elá.'; 258 } else if (estado == 'VP1') { 259 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/p-' + distancia + '.svg"> Pes.'; 260 } else if (estado == 'VP2') { 261 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Pes.'; 262 } else if (estado == 'MN1') { 263 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Nor.'; 264 } else if (estado == 'MB1') { 265 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bar.'; 266 } else if (estado == 'MR1') { 267 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Reg.'; 268 } else if (estado == 'ML1') { 269 return '<img class="img-pista-mini" width="50px" src="' + directory_uri + '/assets/images/pistas-campanas/a-' + distancia + '.svg"> Bla.'; 270 } else { 271 return 'S/inf. estado'; 272 } 273 } 274} 275 276 277function renderActuaciones() { 278 let actuaciones = dataActuaciones; 279 $('.act-loading').remove(); 280 $('#spinner-actuaciones').hide(); 281 if (actuaciones.length > 0) {
282 actuaciones.forEach(function (act) { 283 284 let totalStyle = act.nombre == 'Total' ? 'text-white bg-dark' : ''; 285 let arenaStyle = act.nombre == 'Arena' ? 'bg-light' : ''; 286 if (act.nombre == 'Arena' || act.nombre == 'Pasto' || act.nombre == 'Total') { 287 $('#actuaciones').append('<div class="row no-gutters ' + totalStyle + ' ' + arenaStyle + ' font-12" style="padding: 12px 0;">\n' + 288 ' <div class="col text-center">' + act.nombre.toUpperCase() + '</div>\n' + 289 ' <div class="col text-center">' + act.cc + '</div>\n' + 290 ' <div class="col text-center">' + act.primero + '</div>\n' + 291 ' <div class="col text-center">' + act.segundo + '</div>\n' + 292 ' <div class="col text-center">' + act.tercero + '</div>\n' + 293 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 294 ' <div class="col text-center">' + act.nt + '</div>\n' + 295 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 296 ' </div>'); 297 } 298 }); 299 } else { 300 301 $('#actuaciones').append('<div class="row no-gutters font-16" style="padding: 12px 0;">\n' + 302 ' <div class="col text-center">No se registran datos.</div>\n' + 303 ' </div>'); 304 305 } 306 307 renderActuacionesV2(); 308 renderActuacionesDistancias(); 309} 310 311 312function renderActuacionesV2() { 313 let actuaciones = dataActuaciones; 314 $('.act-loading').remove(); 315 $('#spinner-actuaciones-hipodromos').hide(); 316 if (actuaciones.length > 0) { 317 actuaciones.forEach(function (act) { 318 319 let totalStyle = act.nombre == 'Total' ? 'text-white bg-dark' : ''; 320 let arenaStyle = act.nombre == 'Arena' ? 'bg-light' : ''; 321 322 if (act.nombre == 'Total') { 323 $('#actuaciones-hipodromos').append('<div class="row no-gutters ' + totalStyle + ' ' + arenaStyle + ' font-12" style="padding: 12px 0;">\n' + 324 ' <div class="col text-center">' + act.nombre.toUpperCase() + '</div>\n' + 325 ' <div class="col text-center">' + act.cc + '</div>\n' + 326 ' <div class="col text-center">' + act.primero + '</div>\n' + 327 ' <div class="col text-center">' + act.segundo + '</div>\n' + 328 ' <div class="col text-center">' + act.tercero + '</div>\n' + 329 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 330 ' <div class="col text-center">' + act.nt + '</div>\n' + 331 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 332 ' </div>'); 333 } else if (act.nombre == 'CHS') { 334 $('#actuaciones-hipodromos').append('<div class="row no-gutters bg-light font-12" style="padding: 12px 0;">\n' + 335 ' <div class="col text-center"><img width="18px" src="https://static.clubhipico.cl/assets/img/hipodromos/chs.png"> CHS</div>\n' + 336 ' <div class="col text-center">' + act.cc + '</div>\n' + 337 ' <div class="col text-center">' + act.primero + '</div>\n' + 338 ' <div class="col text-center">' + act.segundo + '</div>\n' + 339 ' <div class="col text-center">' + act.tercero + '</div>\n' + 340 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 341 ' <div class="col text-center">' + act.nt + '</div>\n' + 342 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 343 ' </div>'); 344 } else if (act.nombre == 'VSC') { 345 $('#actuaciones-hipodromos').append('<div class="row no-gutters font-12" style="padding: 12px 0;">\n' + 346 ' <div class="col text-center"><img width="18px" src="https://static.clubhipico.cl/assets/img/hipodromos/vsc.jpg"> VSC</div>\n' + 347 ' <div class="col text-center">' + act.cc + '</div>\n' + 348 ' <div class="col text-center">' + act.primero + '</div>\n' + 349 ' <div class="col text-center">' + act.segundo + '</div>\n' + 350 ' <div class="col text-center">' + act.tercero + '</div>\n' + 351 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 352 ' <div class="col text-center">' + act.nt + '</div>\n' + 353 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 354 ' </div>'); 355 } else if (act.nombre == 'CHC') { 356 $('#actuaciones-hipodromos').append('<div class="row no-gutters bg-light font-12" style="padding: 12px 0;">\n' + 357 ' <div class="col text-center"><img width="18px" src="https://static.clubhipico.cl/assets/img/hipodromos/chc.png"> CHC</div>\n' + 358 ' <div class="col text-center">' + act.cc + '</div>\n' + 359 ' <div class="col text-center">' + act.primero + '</div>\n' + 360 ' <div class="col text-center">' + act.segundo + '</div>\n' + 361 ' <div class="col text-center">' + act.tercero + '</div>\n' + 362 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 363 ' <div class="col text-center">' + act.nt + '</div>\n' + 364 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 365 ' </div>'); 366 } else if (act.nombre == 'HCH') { 367 $('#actuaciones-hipodromos').append('<div class="row no-gutters font-12" style="padding: 12px 0;">\n' + 368 ' <div class="col text-center"><img width="18px" src="https://static.clubhipico.cl/assets/img/hipodromos/hch.jpg"> HCH</div>\n' + 369 ' <div class="col text-center">' + act.cc + '</div>\n' + 370 ' <div class="col text-center">' + act.primero + '</div>\n' + 371 ' <div class="col text-center">' + act.segundo + '</div>\n' + 372 ' <div class="col text-center">' + act.tercero + '</div>\n' + 373 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 374 ' <div class="col text-center">' + act.nt + '</div>\n' + 375 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 376 ' </div>'); 377 } 378 }); 379 } else { 380 $('#actuaciones-hipodromos').append('<div class="row no-gutters font-16" style="padding: 12px 0;">\n' + 381 ' <div class="col text-center">No se registran datos.</div>\n' + 382 ' </div>'); 383 } 384} 385 386function renderActuacionesDistancias() { 387 let actuaciones = dataActuaciones; 388 $('.act-loading').remove(); 389 $('#spinner-actuaciones-distancias').hide(); 390 if (actuaciones.length > 0) {
391 actuaciones.forEach(function (act) { 392 393 let totalStyle = act.nombre == 'Total' ? 'text-white bg-dark' : ''; 394 let arenaStyle = act.nombre == 'Arena' ? 'bg-light' : ''; 395 396 if (act.nombre == 'Total') { 397 $('#actuaciones-distancias').append('<div class="row no-gutters ' + totalStyle + ' ' + arenaStyle + ' font-12" style="padding: 12px 0;">\n' + 398 ' <div class="col text-center">' + act.nombre.toUpperCase() + '</div>\n' + 399 ' <div class="col text-center">' + act.cc + '</div>\n' + 400 ' <div class="col text-center">' + act.primero + '</div>\n' + 401 ' <div class="col text-center">' + act.segundo + '</div>\n' + 402 ' <div class="col text-center">' + act.tercero + '</div>\n' + 403 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 404 ' <div class="col text-center">' + act.nt + '</div>\n' + 405 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 406 ' </div>'); 407 } else if (act.nombre == '1000-1400') { 408 $('#actuaciones-distancias').append('<div class="row no-gutters bg-light font-12" style="padding: 12px 0;">\n' + 409 ' <div class="col text-center">1000m a 1400m</div>\n' + 410 ' <div class="col text-center">' + act.cc + '</div>\n' + 411 ' <div class="col text-center">' + act.primero + '</div>\n' + 412 ' <div class="col text-center">' + act.segundo + '</div>\n' + 413 ' <div class="col text-center">' + act.tercero + '</div>\n' + 414 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 415 ' <div class="col text-center">' + act.nt + '</div>\n' + 416 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 417 ' </div>'); 418 } else if (act.nombre == '1400+') { 419 $('#actuaciones-distancias').append('<div class="row no-gutters font-12" style="padding: 12px 0;">\n' + 420 ' <div class="col text-center">1400m +</div>\n' + 421 ' <div class="col text-center">' + act.cc + '</div>\n' + 422 ' <div class="col text-center">' + act.primero + '</div>\n' + 423 ' <div class="col text-center">' + act.segundo + '</div>\n' + 424 ' <div class="col text-center">' + act.tercero + '</div>\n' + 425 ' <div class="col text-center">' + act.cuarto + '</div>\n' + 426 ' <div class="col text-center">' + act.nt + '</div>\n' + 427 ' <div class="col text-center"> $ ' + new Intl.NumberFormat("es-CL").format(act.sumas) + '</div>\n' + 428 ' </div>'); 429 430 } 431 }); 432 } else { 433 $('#actuaciones-distancias').append('<div class="row no-gutters font-16" style="padding: 12px 0;">\n' + 434 ' <div class="col text-center">No se registran datos.</div>\n' + 435 ' </div>'); 436 } 437} 438 439 440function tiposDeTramos(distancia) { 441 let tramos_data = []; 442 if (distancia >= 1000 && distancia < 1400) { 443 tramos_data['pri_200'] = 200; 444 tramos_data['ult_200'] = distancia - 200; 445 tramos_data['tre_carr'] = 600; 446 if (distancia != 1100) { 447 tramos_data['tipo_cab'] = distancia - 500; 448 } 449 } else if (distancia >= 1400) { 450 tramos_data['pri_200'] = 200; 451 tramos_data['ult_200'] = distancia - 200; 452 tramos_data['tre_carr'] = 600; 453 tramos_data['tipo_cab'] = distancia - 500; 454 } 455 456 return tramos_data; 457} 458 459 460function renderPedigree() { 461 462 let perfil = dataProfile; 463 let pedigree = dataPedigree; 464 $('#p_nombre_ejemplar').html(perfil.nombre); 465 $('#p_sexo_ejemplar').html(getSexoEjemplar(perfil.sexo)); 466 $('#p_color').html(getColorEjemplar(perfil.color)); 467 $('#p_anio_nac_ejemplar').html(moment(perfil.fecha_nacimiento).format('Y')); 468 469 $('#pd_madre').html(pedigree.madre.nombre + ' ' + pedigree.madre.sexo + ', ' + pedigree.madre.color + ', ' + moment(pedigree.madre.fecha_nacimiento).format('Y')); 470 $('#pd_padre').html(pedigree.padre.nombre + ' ' + pedigree.padre.sexo + ', ' + pedigree.padre.color + ', ' + moment(pedigree.padre.fecha_nacimiento).format('Y')); 471 472 $('#pd_abuela_mat').html(pedigree.abuela_materna.nombre + ' ' + pedigree.abuela_materna.sexo + ', ' + pedigree.abuela_materna.color + ', ' + moment(pedigree.abuela_materna.fecha_nacimiento).format('Y')); 473 $('#pd_abuela_pat').html(pedigree.abuela_paterna.nombre + ' ' + pedigree.abuela_paterna.sexo + ', ' + pedigree.abuela_paterna.color + ', ' + moment(pedigree.abuela_paterna.fecha_nacimiento).format('Y')); 474 475 $('#pd_abuelo_mat').html(pedigree.abuelo_materno.nombre + ' ' + pedigree.abuelo_materno.sexo + ', ' + pedigree.abuelo_materno.color + ', ' + moment(pedigree.abuelo_materno.fecha_nacimiento).format('Y')); 476 $('#pd_abuelo_pat').html(pedigree.abuelo_paterno.nombre + ' ' + pedigree.abuelo_paterno.sexo + ', ' + pedigree.abuelo_paterno.color + ', ' + moment(pedigree.abuelo_paterno.fecha_nacimiento).format('Y')); 477 478} 479 480function renderRetiros() { 481 let retiros = dataRetirosFS; 482 $('.ret-loading').remove(); 483 $('#spinner-retiros').hide(); 484 retiros.forEach(function (retiro) { 485 $('#spinner-retiros').hide(); 486 $('#body_retiros').append('<tr class=" table-div-striped-green">' + 487 ' <td class="text-center font-12">' + moment(retiro.fecha_reunion).format('DD-MM-YYYY') + '</td>' + 488 ' <td class="text-center font-12">' + retiro.numero_reunion + '</td>' + 489 ' <td class="text-center font-12">' + retiro.identificador_carrera + '</td>' + 490 ' <td class="text-center font-12">RETIRADO</td>' + 491 '</tr>' 492 ); 493 }); 494 $('#spinner-campanas').hide(); 495 $('#table_retiros').bootstrapTable(); 496 497} 498 499function renderContratiempos() {
500 let contratiempos = dataContratiempos; 501 $('.contra-loading').remove(); 502 $('#spinner-contratiempos').hide(); 503 contratiempos.forEach(function (contratiempo) { 504 $('#spinner-contratiempos').hide(); 505 $('#body_contratiempos').append('<tr class=" table-div-striped-green">' + 506 ' <td class="text-center font-12">' + moment(contratiempo.fecha_reunion).format('DD-MM-YYYY') + '</td>' + 507 ' <td class="text-center font-12">' + contratiempo.numero_reunion + '</td>' + 508 ' <td class="text-center font-12">' + contratiempo.identificador_carrera + '</td>' + 509 ' <td class="text-center font-12">' + contratiempo.glosa + '</td>' + 510 '</tr>' 511 ); 512 }); 513 514 $('#table_contratiempos').bootstrapTable(); 515 516} 517 518function renderAprontes() { 519 let aprontes = dataAprontes; 520 $('.apro-loading').remove(); 521 $('#spinner-aprontes').hide(); 522 aprontes.forEach(function (apronte) { 523 524 let tiempo_final = apronte.tiempos_finales ? apronte.tiempos_finales : '--'; 525 let observaciones = apronte.observacion ? apronte.observacion : '--'; 526 $('#spinner-aprontes').hide(); 527 $('#body_aprontes').append('<tr class=" table-div-striped-green">' + 528 ' <td class="text-center font-12">' + moment(apronte.fecha).format('DD-MM-YYYY') + '</td>' + 529 ' <td class="text-center font-12">' + apronte.nombre_jinete + '</td>' + 530 ' <td class="text-center font-12">' + apronte.distancia + ' ' + apronte.condicion_pista + '</td>' + 531 ' <td class="text-center font-12">' + apronte.tiempo + '</td>' + 532 ' <td class="text-center font-12">' + tiempo_final + '</td>' + 533 ' <td class="text-center font-12">' + observaciones + '</td>' + 534 '</tr>' 535 ); 536 }); 537 538 $('#table_aprontes').bootstrapTable(); 539 540} 541 542function renderHuinchadas(data) { 543 let video = ''; 544 545 if (huinchadas.length > 0) { 546 $('#huinchadas').show(); 547 $('#menu-huinchadas').show(); 548 huinchadas.forEach(function (huinchada) { 549 let image = huinchada.video.replace("http://www.youtube.com/embed/", ""); 550 let link = "'" + huinchada.video + "'"; 551 video += '<div class="col-md-12 box-video-huinchada">\n' + 552 ' <div class="velo-80"\n' + 553 ' style="background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.4)), url(https://img.youtube.com/vi/' + image + '/sddefault.jpg);">\n' + 554 ' <div class="d-flex" style="height: 100%">\n' + 555 ' <button type="button" onclick="showModalYoutube(' + link + ');"\n' + 556 ' class="btn btn-small btn-outline-secondary btn-stream btn-round text-white font-12 semi-bold px-5 py-2 m-auto">\n' + 557 ' <i class="fa fa-play mr-2"></i> VER VIDEO\n' + 558 ' </button>\n' + 559 ' </div>\n' + 560 ' </div>\n' + 561 '</div>'; 562 }); 563 $('#huinchdas_list').html(video); 564 565 } 566 567 if (huinchadas.length > 0) { 568 569 $('#huinchadas-box').show(); 570 let owl = $('#huinchdas_list'); 571 owl.owlCarousel({ 572 loop: false, 573 margin: 10, 574 nav: false, 575 responsive: { 576 0: { 577 items: 1 578 }, 579 576: { 580 items: 2 581 }, 582 768: { 583 items: 2 584 }, 585 992: { 586 items: 3 587 } 588 } 589 }); 590 591 $('.owl-carreras .owl-next').click(function () { 592 owl.trigger('next.owl.carousel'); 593 }); 594 595 $('.owl-carreras .owl-prev').click(function () { 596 owl.trigger('prev.owl.carousel', [300]); 597 }) 598 } 599}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.