1var clear_profile = function(){ 2 $('#profile_username').text('...'); 3 $('#profile_tabs a[href="#profile_tab_pers"]').tab('show'); 4 $('#profile_li_pro').hide(); 5 $('#profile_li_agenda').hide(); 6 $('#profile_li_checkin').hide(); 7 $('#profile_li_logboek').hide(); 8 $('#profile_inhoud_lid').hide(); 9 $('#profile_inhoud_pers').hide(); 10 $('#profile_msg_onderwerp').val(''); 11 $('#profile_msg_bericht').val(''); 12 $('#profile_loader').show(); 13 $('#profile_body').hide(); 14 $('#profile_bevoegdheden').empty(); 15 $('#profile_info_pers_materieel_hl').empty(); 16 $('#profile_info_pers_materieel_ms').empty(); 17 $('#profile_info_pers_materieel_hvr').empty(); 18 $('#profile_info_pers_materieel_hst').empty(); 19 $('#profile_info_pers_materieel_ext').empty(); 20 $('#profile_agenda_table > tbody').empty(); 21 $('#profile_checkin_table > tbody').empty(); 22 23 window.profile_trackback = ""; 24 window.profile_load_agenda = false; 25 window.profile_load_checkin = false; 26 window.profile_load_logboek = false; 27}; 28 29var show_profile = function(type, id, pernr, tab){ 30 clear_profile(); 31 $('#profile_modal').modal('show'); 32 33 var formData = { 34 'type' : type, 35 'id' : id, 36 'pernr' : pernr 37 }; 38 39 $.ajax({ 40 type : "POST", 41 url : "/login/profiel/get.php", 42 beforeSend : function() {$('#profile_loader').show(); $('#profile_body').hide();}, 43 complete : function() {$('#profile_loader').hide(); $('#profile_body').show();}, 44 data : formData, 45 tryCount : 0, 46 retryLimit : 3, 47 success : function(data) { 48 var result = $.parseJSON(data); 49 50 //WEERGAVE VOOR LID 51 if(result.type === "L"){ 52 $('#profile_inhoud_lid').show(); 53 window.profile_trackback = "L-" + result.id + "-L"; 54 55 $('#profile_username').text(result.username); 56 $('#profile_info_lid_naam').text(result.voornaam + " " + result.achternaam); 57 var geboortedatum = result.geboortedatum.split("-"); 58 $('#profile_info_lid_geboortedatum').text(geboortedatum[2] + "-" + geboortedatum[1] + "-" + geboortedatum[0]); 59 $('#profile_info_lid_status').text(result.status); 60 $('#profile_info_lid_mom').html(result.mom); 61 $(".profielfoto").attr("src", result.foto); 62 63 //WEERGAVE VOOR PERSONEELSLID 64 }else if(result.type === "P"){ 65 $('#profile_inhoud_pers').show(); 66 $('#profile_li_pro').show(); 67 $('#profile_tabs a[href="#profile_tab_pro"]').tab('show'); 68 window.profile_pernr = result.pernr; 69 window.profile_trackback = "P-" + result.id + "-P"; 70 71 //persoonlijk 72 if(window.profile_pernr === window.pernr){ 73 $(".profielfoto").attr("src", result.foto + "?ran=" + Math.random()); 74 }else{ 75 $(".profielfoto").attr("src", result.foto); 76 } 77 $('#profile_username').text(result.username); 78 $('#profile_info_pers_naam').text(result.voornaam + " " + result.achternaam); 79 if(result.geslacht === "M"){ 80 $('#profile_info_pers_geslacht').html('<i class="fa fa-mars"></i>'); 81 }else{ 82 $('#profile_info_pers_geslacht').html('<i class="fa fa-venus"></i>'); 83 } 84 $('#profile_info_pers_taal').text(result.taal); 85 var geboortedatum = result.geboortedatum.split("-"); 86 $('#profile_info_pers_geboortedatum').text(geboortedatum[2] + "-" + geboortedatum[1] + "-" + geboortedatum[0]); 87 $('#profile_info_pers_provincie').text(result.provincie); 88 $('#profile_info_pers_mom').html(result.mom); 89 $('#profile_info_pers_gsm').html('<a href="tel:' + result.gsm_prive + '">' + result.gsm_prive + '</a>'); 90 $('#profile_info_pers_tel').html('<a href="tel:' + result.tel_prive + '">' + result.tel_prive + '</a>'); 91 $('#profile_info_pers_website').html('<a href="' + result.website + '" target="_blank">' + result.website + '</a>'); 92 93 //professioneel 94 $('#profile_prof_naam').text(result.voornaam + " " + result.achternaam); 95 $('#profile_prof_functie').text(result.functie); 96 var aanwerving = result.aanwerving.split("-"); 97 $('#profile_prof_aanwerving').text(aanwerving[2] + "-" + aanwerving[1] + "-" + aanwerving[0]); 98 $('#profile_prof_dienstjaren').text(result.dienstjaren); 99 $('#profile_prof_depot').text(result.depot); 100 $('#profile_prof_depotnr').text(result.depotnr); 101 $('#profile_prof_reeks').text(result.reeks); 102 if(result.monitor === "JA"){ 103 $('#profile_prof_monitor').html('<i class="icon-ok" style="color: green;"></i>'); 104 }else{ 105 $('#profile_prof_monitor').html('<i class="icon-remove" style="color: red;"></i>'); 106 } 107 $('#profile_prof_mail').html('<a href="mailto:' + result.mail_werk + '">' + result.mail_werk + '</a>'); 108 $('#profile_prof_gsm').html('<a href="tel:' + result.gsm_werk + '">' + result.gsm_werk + '</a>'); 109 $('#profile_prof_tel').html('<a href="tel:' + result.tel_werk + '">' + result.tel_werk + '</a>'); 110 111 //Bevoegdheden: 112 var bevoegdheden = result.bevoegdheden.split("/"); 113 var bevoegdheden_html = ''; 114 for (var i=0; i<bevoegdheden.length; ++i) { 115 var value = bevoegdheden[i].split("="); 116 if(value[1] === '1'){ 117 bevoegdheden_html += '<i class="icon-ok" style="color: orange;"></i> ' + value[0] + '<br />'; 118 }else if(value[1] === '2'){ 119 bevoegdheden_html += '<i class="icon-ok" style="color: green;"></i> ' + value[0] + '<br />'; 120 } 121 } 122 $('#profile_bevoegdheden').html(bevoegdheden_html); 123 124 //Materieel: 125 var materieel_split = result.materieel.split(", "); 126 var materieel_HL = []; 127 var materieel_MR = []; 128 var materieel_HVR = []; 129 var materieel_HST = []; 130 var materieel_EXT = []; 131 132 for (var i = 0; i < materieel_split.length; i++) { 133 if (materieel_split[i].indexOf("HLE") >= 0 || materieel_split[i].indexOf("HLD") >= 0){ 134 materieel_HL.push(materieel_split[i]); 135 } 136 if (materieel_split[i].indexOf("MR") >= 0 || materieel_split[i].indexOf("MW") >= 0){ 137 materieel_MR.push(materieel_split[i]); 138 } 139 if (materieel_split[i].indexOf("HVR") >= 0){ 140 materieel_HVR.push(materieel_split[i]); 141 } 142 if (materieel_split[i].indexOf("HST") >= 0){ 143 materieel_HST.push(materieel_split[i]); 144 } 145 if (materieel_split[i].indexOf("EXT") >= 0){ 146 materieel_EXT.push(materieel_split[i]); 147 } 148 } 149 150 for (var i = 0; i < materieel_HL.length; i++) { 151 $('#profile_info_pers_materieel_hl').append('<i class="icon-ok" style="color: green;"></i> ' + materieel_HL[i] + "<br />"); 152 } 153 for (var i = 0; i < materieel_MR.length; i++) { 154 $('#profile_info_pers_materieel_ms').append('<i class="icon-ok" style="color: green;"></i> ' + materieel_MR[i] + "<br />"); 155 } 156 for (var i = 0; i < materieel_HVR.length; i++) { 157 $('#profile_info_pers_materieel_hvr').append('<i class="icon-ok" style="color: green;"></i> ' + materieel_HVR[i] + "<br />"); 158 } 159 for (var i = 0; i < materieel_HST.length; i++) { 160 $('#profile_info_pers_materieel_hst').append('<i class="icon-ok" style="color: green;"></i> ' + materieel_HST[i] + "<br />"); 161 } 162 for (var i = 0; i < materieel_EXT.length; i++) { 163 $('#profile_info_pers_materieel_ext').append('<i class="icon-ok" style="color: green;"></i> ' + materieel_EXT[i] + "<br />"); 164 } 165 166 //PRIVACY 167 if(result.privacy.agenda === true){ 168 $('#profile_li_agenda').show(); 169 } 170 if(result.privacy.checkin === true){ 171 $('#profile_li_checkin').show(); 172 } 173 if(result.privacy.logboek === true){ 174 $('#profile_li_logboek').show(); 175 } 176 } 177 178 //SHOW ANDERE TAB INDIEN NODIG: 179 if(tab === "message"){ 180 $('.nav-tabs a[href="#profile_tab_message"]').tab('show'); 181 } 182 }, 183 error : function(xhr, textStatus, errorThrown){ 184 if (textStatus === 'timeout') { 185 this.tryCount++; 186 if (this.tryCount <= this.retryLimit) { 187 //try again 188 $.ajax(this); 189 return; 190 } 191 return; 192 } 193 } 194 }); 195}; 196 197 198 199 200var agenda_profile = function(){ 201 if(window.profile_load_agenda === false){ 202 var formData = { 203 'pernr' : window.profile_pernr, 204 'maand' : $('#profile_agenda_maand').val(), 205 'jaar' : $('#profile_agenda_jaar').val() 206 }; 207 208 $.ajax({ 209 type : "POST", 210 url : "/login/profiel/get_agenda.php", 211 beforeSend : function() {$('#profile_agenda_loader').show(); $('#profile_agenda_table').hide();}, 212 complete : function() {$('#profile_agenda_loader').hide(); $('#profile_agenda_table').show();}, 213 data : formData, 214 tryCount : 0, 215 retryLimit : 3, 216 success : function(data) { 217 var result = $.parseJSON(data); 218 window.profile_load_agenda = true; 219 $('#profile_agenda_table > tbody').empty(); 220 221 if(result === "privacy"){ 222 if(window.lang === "FR"){ 223 $('#profile_agenda_table > tbody').append('<tr><td colspan="6">Calendrier caché par les paramètres de confidentialité.</td></tr>'); 224 }else{ 225 $('#profile_agenda_table > tbody').append('<tr><td colspan="6">Agenda verborgen door privacy settings.</td></tr>'); 226 } 227 }else if(result === "verleden"){ 228 if(window.lang === "FR"){ 229 $('#profile_agenda_table > tbody').append('<tr><td colspan="6">Le calendrier ne peuvent pas voir dans le passé.</td></tr>'); 230 }else{ 231 $('#profile_agenda_table > tbody').append('<tr><td colspan="6">Agenda in het verleden bekijken niet toegestaan.</td></tr>'); 232 } 233 }else{ 234 if (!$.isEmptyObject(result)) { 235 $.each(result, function(dag, dienst) { 236 var style = ''; 237 if(dienst.r === '6'){ 238 style = 'style="background-color: #FFF6F6;"'; 239 }else if(dienst.r === '7'){ 240 style = 'style="background-color: #FFEFEF;"'; 241 } 242 243 var row = '<tr>'; 244 row += '<td ' + style + '>' + dag + '</td>'; 245 if(dienst.type === 'dienst'){ 246 row += '<td ' + style + '>' + dienst.titel + '</td>'; 247 row += '<td ' + style + '>' + dienst.depot + ' ' + dienst.dienst + '</td>'; 248 row += '<td ' + style + '>' + dienst.van + '</td>'; 249 row += '<td ' + style + '>' + dienst.tot + '</td>'; 250 if(dienst.br === 1){ 251 row += '<td ' + style + '><i class="icon-ok" style="color: green;"></td>'; 252 }else{ 253 row += '<td ' + style + '><i class="icon-remove" style="color: red;"></i></td>'; 254 } 255 }else{ 256 row += '<td colspan="5" ' + style + '>' + dienst.verlof + '</td>'; 257 } 258 row += '</tr>'; 259 $('#profile_agenda_table > tbody').append(row); 260 }); 261 } 262 } 263 }, 264 error : function(xhr, textStatus, errorThrown){ 265 if (textStatus === 'timeout') { 266 this.tryCount++; 267 if (this.tryCount <= this.retryLimit) { 268 //try again 269 $.ajax(this); 270 return; 271 } 272 return; 273 } 274 } 275 }); 276 } 277}; 278 279 280 281 282 283 284 285var checkin_profile = function(){ 286 if(window.profile_load_checkin === false){ 287 $.ajax({ 288 type : "POST", 289 url : "/login/profiel/get_checkin.php", 290 beforeSend : function() {$('#profile_checkin_loader').show(); $('#profile_checkin_table').hide();}, 291 complete : function() {$('#profile_checkin_loader').hide(); $('#profile_checkin_table').show();}, 292 data : {'pernr' : window.profile_pernr}, 293 tryCount : 0, 294 retryLimit : 3, 295 success : function(data) { 296 var result = $.parseJSON(data); 297 window.profile_load_checkin = true; 298 $('#profile_checkin_table > tbody').empty(); 299 300 if(result === "privacy"){ 301 if(window.lang === "FR"){ 302 $('#profile_checkin_table > tbody').append('<tr><td colspan="6">Check-ins caché par les paramètres de confidentialité.</td></tr>'); 303 }else{ 304 $('#profile_checkin_table > tbody').append('<tr><td colspan="6">Check-ins verborgen door privacy settings.</td></tr>'); 305 } 306 }else{ 307 if (!$.isEmptyObject(result)) { 308 $.each(result, function(dag, checkin) { 309 $('#profile_checkin_table > tbody').append('<tr><th colspan="6" style="text-align: center; background-color: #FFEFEF">' + checkin.dag + '</th></tr>'); 310 $.each(checkin, function(i, trein) { 311 if(i !== 'dag'){ 312 var row = '<tr>'; 313 row += '<td>' + trein.nr + '</td>'; 314 row += '<td>' + trein.van + '</td>'; 315 row += '<td>' + trein.start + '</td>'; 316 row += '<td>' + trein.naar + '</td>'; 317 row += '<td>' + trein.stop + '</td>'; 318 row += '<td>' + trein.type + '</td>'; 319 row += '</tr>'; 320 $('#profile_checkin_table > tbody').append(row); 321 } 322 }); 323 }); 324 } 325 } 326 }, 327 error : function(xhr, textStatus, errorThrown){ 328 if (textStatus === 'timeout') { 329 this.tryCount++; 330 if (this.tryCount
330<= this.retryLimit) { 331 //try again 332 $.ajax(this); 333 return; 334 } 335 return; 336 } 337 } 338 }); 339 } 340}; 341 342 343 344 345 346 347 348 349 350var logboek_profile = function(){ 351 if(window.profile_load_logboek === false){ 352 $.ajax({ 353 type : "POST", 354 url : "/login/profiel/get_logboek.php", 355 beforeSend : function() {$('#profile_logboek_loader').show(); $('#profile_logboek_table').hide();}, 356 complete : function() {$('#profile_logboek_loader').hide(); $('#profile_logboek_table').show();}, 357 data : {'pernr' : window.profile_pernr}, 358 tryCount : 0, 359 retryLimit : 3, 360 success : function(data) { 361 var result = $.parseJSON(data); 362 window.profile_load_logboek = true; 363 364 $("#profile_logboek_treinen").text(result.aantal); 365 $("#profile_logboek_optijd").text(result.optijd); 366 $("#profile_logboek_stiptperc").text(result.stiptheid + "%"); 367 $("#profile_logboek_rt").text(result.rttot + " min."); 368 $("#profile_logboek_rttrein").text(result.rtgmtrein + " min."); 369 $("#profile_logboek_rtgem").text(result.rtgm + " min."); 370 $("#profile_logboek_rtaankomst").text(result.rtmaxa + " min."); 371 $("#profile_logboek_rtmax").text(result.rtmax + " min."); 372 $("#profile_logboek_rtverloren").text(result.rtverloren + " min."); 373 $("#profile_logboek_rtingehaald").text(result.rtingehaald + " min."); 374 $("#profile_logboek_rtperc").text(result.rtperc + "%"); 375 $("#profile_logboek_reistijd").text(result.reistijd); 376 $("#profile_logboek_vmax").text(result.gmsnelheid + " km/h"); 377 $("#profile_logboek_stops").text(result.stops); 378 $("#profile_logboek_km").text(result.km + " km"); 379 }, 380 error : function(xhr, textStatus, errorThrown){ 381 if (textStatus === 'timeout') { 382 this.tryCount++; 383 if (this.tryCount <= this.retryLimit) { 384 //try again 385 $.ajax(this); 386 return; 387 } 388 return; 389 } 390 } 391 }); 392 } 393}; 394 395 396 397 398 399 400 401 402var sendmsg_profile = function(){ 403 if(window.profile_trackback === ""){ 404 if(window.lang === 'FR'){ 405 alert('Aucun profil chargé.'); 406 }else{ 407 alert('Geen profiel geladen.'); 408 } 409 return false ; 410 } 411 if($("#profile_msg_onderwerp").val() === ""){ 412 if(window.lang === 'FR'){ 413 alert('Entrer un sujet svp.'); 414 }else{ 415 alert('Gelieve een onderwerp in te vullen.'); 416 } 417 return false ; 418 } 419 if($("#profile_msg_bericht").val() === ""){ 420 if(window.lang === 'FR'){ 421 alert('Ecrire un message svp.'); 422 }else{ 423 alert('Gelieve een bericht te schrijven.'); 424 } 425 return false ; 426 } 427 428 $('#profile_send_btn').addClass('disabled'); 429 430 var formData = { 431 'to' : window.profile_trackback, 432 'onderwerp' : $("#profile_msg_onderwerp").val(), 433 'bericht' : $("#profile_msg_bericht").val() 434 }; 435 436 $.ajax({ 437 type : "POST", 438 url : "/login/inbox/send_nieuw.php", 439 beforeSend : function() {$("#profile_tab_message").isLoading({text: "Loading", position: "overlay"});}, 440 complete : function() {$("#profile_tab_message").isLoading("hide");}, 441 data : formData, 442 tryCount : 0, 443 retryLimit : 3, 444 success : function(data) { 445 var result = $.parseJSON(data); 446 447 $('#profile_send_btn').removeClass('disabled'); 448 $("#profile_msg_onderwerp").val(''); 449 $("#profile_msg_bericht").val(''); 450 451 if(window.lang === 'FR'){ 452 alert('Message envoyé avec succès.'); 453 }else{ 454 alert('Bericht succesvol verzonden.'); 455 } 456 }, 457 error : function(xhr, textStatus, errorThrown){ 458 if (textStatus === 'timeout') { 459 this.tryCount++; 460 if (this.tryCount <= this.retryLimit) { 461 //try again 462 $.ajax(this); 463 return; 464 } 465 return; 466 } 467 $('#profile_send_btn').removeClass('disabled'); 468 } 469 }); 470};
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.