1var underscore = angular.module('underscore', []); 2 3underscore.factory('_', function () { 4 return window._; 5}) 6 7 8angular.module('WSGlobalApp', ['pikaday', 'ui.bootstrap']).run(["$rootScope", "$http", "$timeout", "$q", 9 function ($rootScope, $http, $timeout, $q) { 10 $rootScope.credentials = {}; 11 $rootScope.signupModel = {}; 12 $rootScope.ForgotModel = {}; 13 $rootScope.GCDetails_Path = GCDetails_Path; 14 $rootScope.GCHS_Path = GCHS_Path; 15 $rootScope.GLHP_Path = GLHP_Path; 16 $rootScope.TransfersHP_Path = TransfersHP_Path 17 $rootScope.HotelHP_Path = HotelHP_Path;; 18 $rootScope.SightSeeingHP_Path = SightSeeingHP_Path; 19 $rootScope.HotelDest_Path = HotelDest_Path; 20 $rootScope.TransfersDest_Path = TransfersDest_Path; 21 $rootScope.SightSeeingDest_Path = SightSeeingDest_Path; 22 $rootScope.GTDest_Path = GTDest_Path; 23 $rootScope.GTHP_Path = GTHP_Path; 24 $rootScope.loginError = false; 25 $rootScope.isWishList = false; 26 $rootScope.CurrPage_Review = 1; 27 $rootScope.RecPerPage_Review = 2; 28 $rootScope.errorClass = ''; 29 $rootScope.loginClass = ""; 30 $rootScope.signUpClass = "hide"; 31 $rootScope.forgotClass = "hide"; 32 $rootScope.GeneralEnquiry = {}; 33 $rootScope.isRevFormSubmit = false; 34 35 $rootScope.isContactUsFlag = false; 36 $rootScope.toSaveUsdXchangeRate = null; 37 $rootScope.toSaveAnyXchangeRate = null; 38 $rootScope.loading = false; 39 $rootScope.GeneralEnqInfoValid = false 40 $rootScope.ContactUsInfoValid = false; 41 $rootScope.flag = true; 42 $rootScope.BYHGiftFlag = false; 43 $rootScope.Deal = {}; 44 $rootScope.GuestLogOffFlag = false; 45 $rootScope.SessionCurrency = SessionCurrency; // || 'USD'; 46 $rootScope.RegionCurrency = angular.copy(RegionCurrency); // || 'USD'; 47 $rootScope.drdCurrencyCode = $rootScope.SessionCurrency; 48 $rootScope.BYH = false;//sravan 49 50 51 if (window.location.href.indexOf("ReturnUrl") > -1) 52 if (window.location.href.split("ReturnUrl")[1].indexOf('build-your-holiday') > -1 || 53 window.location.href.split("ReturnUrl")[1].indexOf('gift-a-holiday') > -1) { 54 document.getElementById("btnlogin").click(); 55 $rootScope.BYHGiftFlag = true; 56 } else 57 $rootScope.BYHGiftFlag = false; 58 59 60 $rootScope.GlobalImagePaths = { 61 "Gallery_Ads_Path": "/Gallery/Global/ADs/", 62 "Gallery_News_Path": "/Gallery/Global/News/", 63 "Gallery_Brochure_Path": "/Gallery/Global/Brochures/", 64 "Gallery_CorporateMaster_Path": "/Gallery/Global/CorporateMaster/", 65 "Gallery_Facility_Path": "/Gallery/Facility/", 66 "Gallery_HomePageSlider_Path": "/Gallery/Global/HomePageSlider/", 67 "Gallery_ContentSlider_Path": "/Gallery/Content/Slider/", 68 "Gallery_GolfLesson_Path": "/Gallery/GolfLesson/", 69 "Gallery_CustomPages_Path": "/Gallery/CustomPages/", 70 "Gallery_ProfilePics_Path": "/Gallery/ProfilePics/" 71 } 72 73 // $rootScope.GlobalImagePaths = vbImagePaths; 74 75 $rootScope.ReadMore = function () { 76 if ($('#divCont').text().length > 400) 77 $rootScope.flag = false; 78 else 79 $rootScope.flag = true; 80 } 81 82 //$http.get("/Common/GetAds").then(function (res) { 83 84 // $rootScope.Ads = res.data; 85 //}, function (error) { 86 87 //}).finally(function () { 88 89 //}); 90 91 $rootScope.getCaptcha = function () { 92 93 $http.get("/Common/ShowCaptchaImage" + '?hash_id='
93+ Math.random(), { headers: { 'Cache-Control': 'no-cache' }, responseType: "arraybuffer" }).success(function (data) { 94 95 var arrayBufferView = new Uint8Array(data); 96 var blob = new Blob([arrayBufferView], { type: "image/jpeg" }); 97 var urlCreator = window.URL || window.webkitURL; 98 99 var imageUrl = urlCreator.createObjectURL(blob); 100 var img = document.querySelector(".gtCaptcha"); 101 102 103 var reader = new window.FileReader(); 104 reader.readAsDataURL(blob); 105 reader.onloadend = function () { 106 img.setAttribute('src', reader.result); 107 } 108 }); 109 } 110 111 $rootScope.getCaptcha(); 112 113 $rootScope.Navigate = function (route, url) { 114 window.location.href = route + url; 115 } 116 117 //$rootScope.GotoAds = function (AdURL) { 118 119 // if (AdURL && $.trim(AdURL).length > 0) { 120 // window.open(AdURL, '_blank') 121 // } else 122 // return false; 123 //} 124 125 if (IsAuthenticated) { 126 $rootScope.authenticated = true; 127 $rootScope.AuthUserId = AuthUserId; 128 $rootScope.IsGuest = (AuthUserId == 0 && $rootScope.authenticated) ? true : false; 129 $rootScope.userName = userName; 130 } else { 131 $rootScope.authenticated = false; 132 $rootScope.AuthUserId = 0; 133 $rootScope.IsGuest = false; 134 } 135 136 137 138 $http.get("/Common/GetCountries", { cache: true }).then(function (res) { 139 $rootScope.Countries = res.data; 140 }, function (error) { 141 142 }).finally(function () { 143 144 }); 145 $http.get("/Common/GetAllCountry", { cache: true }).then(function (res) { 146 $rootScope.AllCountry = res.data; 147 }, function (error) { 148 149 }).finally(function () { 150 151 }); 152 153 $rootScope.authenticate = function (credentials, callback) { 154 //authorization: "Basic " + btoa(credentials.Email + ":" + credentials.Password), 155 $rootScope.loading = true; 156 157 if ($rootScope.GuestLogOffFlag == false) { 158 $http.defaults.headers.common['RequestVerificationToken'] = $('.homepage').attr('anti-forgery-token') || "no request verification token"; 159 } 160 161 $http({ 162 method: 'POST', 163 url: '/Acc/Login', 164 data: JSON.stringify(credentials) 165 }).success(function (data) { 166 if (data.msg == "OK") { 167 window.localStorage.clear(); 168 if (window.location.href.indexOf("ReturnUrl") > -1) { 169 if (window.location.href.split("ReturnUrl")[1].indexOf('build-your-holiday') > -1) 170 window.location.href = "/build-your-holiday"; 171 if (window.location.href.split("ReturnUrl")[1].indexOf('gift-a-holiday') > -1) 172 window.location.href = "/gift-a-h
172oliday"; 173 174 } else { 175 $rootScope.userName = data.userName; 176 userName = data.userName; 177 $rootScope.authenticated = true; 178 $rootScope.IsGuest = false; 179 $rootScope.AuthUserId = data.AuthUserId; 180 document.getElementById('btnLoginClose').click(); 181 $rootScope.GuestLogOffFlag = false; 182 } 183 184 } else { 185 186 $rootScope.errorMsg = ''; 187 $rootScope.loginError = true; 188 $rootScope.AuthUserId = 0; 189 $rootScope.errors = null; 190 191 $rootScope.errEML = ''; 192 $rootScope.errPwdL = ''; 193 194 if (data.Errors != undefined) { 195 196 data.Errors.forEach(function (val) { 197 198 if (val.indexOf('Email') > -1) 199 $rootScope.errEML = val.replace('.', ''); 200 if (val.indexOf('Pass') > 0) 201 $rootScope.errPwdL = val.replace('.', ''); 202 }) 203 } 204 else 205 $rootScope.errorMsg = data.msg; 206 $rootScope.authenticated = false; 207 } 208 $rootScope.loading = false; 209 210 if (redirectPath == "/build-your-holiday") { 211 if ($rootScope.BYH == true) 212 if ($rootScope.authenticated == true) 213 $rootScope.IsBYHCallback(); 214 } 215 else { 216 callback && callback(); 217 } 218 }).error(function (err) { 219 $rootScope.authenticated = false; 220 $rootScope.loading = false; 221 $rootScope.AuthUserId = 0; 222 callback && callback(); 223 }); 224 225 } 226 227 $rootScope.Guest = function (url) { 228 229 if (window.location.href.indexOf("ReturnUrl") > -1) 230 if (window.location.href.split("ReturnUrl")[1].indexOf('build-your-holiday') > -1) { 231 alert('Only registered user can access this page'); 232 return false; 233 } 234 235 236 $http.defaults.headers.common['RequestVerificationToken'] = $('.homepage').attr('anti-forgery-token') || "no request verification token"; 237 238 $http({ 239 method: 'GET', 240 url: '/Acc/GuestLogin', 241 data: url 242 }).success(function (data) { 243 if (data.msg == "OK") { 244 245 $rootScope.userName = data.userName; 246 userName = data.userName; 247 $rootScope.AuthUserId = 0; 248 $rootScope.authenticated = true; 249 $rootScope.IsGuest = true; 250 document.getElementById('btnLoginClose').click(); 251 //window.location.href = url; 252 } else { 253 $rootScope.errorMsg = data.msg; 254 $rootScope.AuthUserId = 0; 255 $rootScope.authenticated = false; 256 } 257 //callback && callback(); 258 }).error(function (err) { 259 $rootScope.authenticated = false; 260 $rootScope.AuthUserId = 0; 261 $rootScope.IsGuest = false; 262 // callback && callback(); 263 }); 264 }; 265 266 $rootScope.login = function () { 267 268 $rootScope.authenticate($rootScope.credentials, function () { 269 270 if ($rootScope.authenticated) { 271 272 if (!$rootScope.isWishList) { 273 if (redirectPath != undefined) 274 window.location.href = redirectPath; 275 } 276 277 } else { 278 $rootScope.loginError = true; 279 } 280 }); 281 }; 282 283 $rootScope.Forgot = function () { 284 $rootScope.loading = true; 285 $http.defaults.headers.common['RequestVerificationToken'] = $('.homepage').attr('anti-forgery-token') || "no request verification token"; 286 287 $http({ 288 method: 'POST', 289 url: '/Acc/ForgotPassword', 290 data: JSON.stringify($rootScope.ForgotModel) 291 }).success(function (data) { 292 if (data.msg == "OK") { 293 //$rootScope.userName = data.userName; 294 //$rootScope.authenticated = true; 295 // document.getElementById('btnLoginClose').click(); 296 //window.location.href = url; 297 $rootScope.loading = false; 298 $rootScope.loginError = true; 299 $rootScope.errorMsg = "Please check your email to get login details"; 300 $rootScope.errors = null; 301 $rootScope.errEMF = ''; 302 } else { 303 $rootScope.loginError = true; 304 $rootScope.errorMsg = ''; 305 $rootScope.errors = null; 306 $rootScope.loading = false; 307 $rootScope.errEMF = ''; 308 309 if (data.Errors != undefined) { 310 311 //$rootScope.errors = data.Errors;
312 data.Errors.forEach(function (val) { 313 if (val.indexOf('Email') > -1) 314 $rootScope.errEMF = val.replace('.', ''); 315 }) 316 } 317 else 318 $rootScope.errorMsg = data.msg; 319 320 //$rootScope.authenticated = false; 321 } 322 323 //callback && callback(); 324 }).error(function (err) { 325 $rootScope.loading = false; 326 $rootScope.authenticated = false; 327 // callback && callback(); 328 }); 329 330 }; 331 332 $rootScope.SignUp = function () { 333 334 $rootScope.loading = true; 335 $http.defaults.headers.common['RequestVerificationToken'] = $('.homepage').attr('anti-forgery-token') || "no request verification token"; 336 337 $http({ 338 method: 'POST', 339 url: '/Acc/Register', 340 data: JSON.stringify($rootScope.signupModel) 341 }).success(function (data) { 342 343 if (data.msg == "OK") { 344 345 $rootScope.userName = data.userName; 346 $rootScope.AuthUserId = data.AuthUserId; 347 $rootScope.authenticated = true; 348 $rootScope.IsGuest = false; 349 // $rootScope.loading = false; 350 document.getElementById('btnLoginClose').click(); 351 //window.location.href = url; 352 } else { 353 $rootScope.loginError = true; 354 $rootScope.errors = null; 355 $rootScope.AuthUserId = 0; 356 $rootScope.errorMsg = ''; 357 358 $rootScope.errFN = ''; 359 $rootScope.errLN = ''; 360 $rootScope.errEM = ''; 361 $rootScope.errPwd = ''; 362 $rootScope.errCntry = ''; 363 //$rootScope.loading = false; 364 365 if (data.Errors != undefined) { 366 367 data.Errors.forEach(function (val) { 368 if (val.indexOf('First') != -1) 369 $rootScope.errFN = val.replace('.', ''); 370 if (val.indexOf('Last') > -1) 371 $rootScope.errLN = val.replace('.', ''); 372 if (val.indexOf('Email') > -1) 373 $rootScope.errEM = val.replace('.', ''); 374 if (val.indexOf('Pass') > 0) 375 $rootScope.errPwd = val.replace('.', ''); 376 if (val.indexOf('Country') > -1) 377 $rootScope.errCntry = val.replace('.', ''); 378 if (val.indexOf('Passwords') > -1) 379 $rootScope.errPwd = "Password must have Combination of [0'-'9','a'-'z','A'-'Z'] and Special Characters"; 380 381 382 }) 383 //$rootScope.errors = data.Errors; 384 // $rootScope.loading = false; 385 } 386 else 387 $rootScope.errorMsg = data.msg; 388 389 390 $rootScope.loading = false; 391 $rootScope.authenticated = false; 392 } 393 394 $rootScope.loading = false; 395 //callback && callback(); 396 }).error(function (err) { 397 $rootScope.authenticated = false; 398 $rootScope.loading = false; 399 // callback && callback(); 400 }); 401 402 }; 403 404 405 //Added by rahul on 20180926 to save guest details 406 $rootScope.OpenLoginPopUp = function () { 407 document.getElementById("btnlogin").click(); 408 409 } 410 //end 411 412 $rootScope.GuestLogOff = function (callfrom) { 413 if( $rootScope.IsGuest == true) 414 { 415 $http({ 416 method: 'GET', 417 url: '/Acc/GuestLogOff' 418 }).success(function (data) { 419 420 if (data.msg == "LoggedOutAsGuest") { 421 422 423 $rootScope.userName = ""; 424 userName = ""; 425 $rootScope.AuthUserId = 0; 426 $rootScope.authenticated = false; 427 $rootScope.IsGuest = false; 428 429 //document.getElementById('btnlogin').click(); 430 localStorage.setItem("loginFalg", true); 431 $rootScope.GuestLogOffFlag = true; 432 //Commented by Rahul on 20180926 433 434 //if (callfrom == 'layout') { 435 // document.getElementById("btnlogin").click(); 436 437 //} else { 438 439 // if (!$rootScope.isWishList) { 440 // if (redirectPath != undefined) 441 // window.location.href = redirectPath; 442 // else 443 // window.location.href = window.location.href; 444 // } else { 445 446 // document.getElementById("btnlogin").click(); 447 // } 448 //} 449 450 //end of comment by rahul 451 452 if (callfrom == 'login') { 453 $rootScope.login(); 454 } 455 if (callfrom == 'forgot') { 456 $rootScope.Forgot(); 457 } 458 if (callfrom == 'signup') { 459 $rootScope.SignUp(); 460 } 461 462 } else { 463 $rootScope.errorMsg = data.msg; 464 $rootScope.authenticated = false; 465 } 466 //callback && callback(); 467 }).error(function (err) { 468 $rootScope.authenticated = false; 469 $rootScope.IsGuest = false; 470 // callback && callback(); 471 }); 472 } 473 else { 474 475 if (callfrom == 'login') { 476 $rootScope.login(); 477 } 478 if (callfrom == 'forgot') { 479 $rootScope.Forgot(); 480 } 481 if (callfrom == 'signup') { 482 $rootScope.SignUp(); 483 } 484 } 485 }; 486 487 488 $rootScope.SignUpToggle = function () { 489 $rootScope.loginClass = "hide"; 490 $rootScope.forgotClass = "hide"; 491 $rootScope.signUpClass = "userForm"; 492 $rootScope.loginError = false; 493 }; 494 $rootScope.LoginToggle = function () { 495 $rootScope.loginClass = "userForm"; 496 $rootScope.signUpClass = "hide"; 497 $rootScope.forgotClass = "hide"; 498 $rootScope.loginError = false; 499 }; 500 $rootScope.ForgotToggle = function () { 501 $rootScope.loginClass = "hide"; 502 $rootScope.signUpClass = "hide"; 503 $rootScope.forgotClass = "userForm"; 504 $rootScope.loginError = false; 505 }; 506 507 $rootScope.HandleError = function (error) { 508 509 if (error == "_SessionTimeout_") 510 window.location = "login location"; 511 else { 512 // $rootScope.loading = false; 513 } 514 } 515 516 $rootScope.GetBuddiesList = function (origin, index1, index2, index3) { 517 $http({ method: "GET", url: MyAccount + "/GetMyBuddyListbyId" }) 518 .then(function (res) { 519 if (origin != undefined) { 520 521 if (origin == 'GC-Golfer' || origin == 'GL-Golfer' || origin == 'HT-RaGC' || origin == 'HT-RaGL') 522 $rootScope.GCorigin = true; 523 else 524 $rootScope.GCorigin = false; 525 526 $rootScope.BuddyType = origin; 527 $rootScope.BuddyIndex1 = index1; 528 $rootScope.BuddyIndex2 = index2; 529 $rootScope.BuddyIndex3 = index3; 530 } 531 532 _.map(res.data, function (obj) { 533 obj.isChecked = false; 534 }) 535 $rootScope.MyBuddies = res.data; 536 $('#buddiesList').modal('show'); 537 }, function (error) { 538 }).finally(function () { 539 }); 540 } 541 542 //$http.get("/Testimonials/GetRandomTestimonial").then(function (res) { 543 // $rootScope.WSTestimonial = res.data; 544 // $timeout(function () { 545 // if (($("#paraTestimonial").height()) > 75) { 546 // $("#paraTestimonial").addClass("changed"); 547 // }; 548 // }, 100); 549 550 //}, function (error) { 551 //}).finally(function () { });
552 553 554 555 $rootScope.IsWishListExists = function (ServiceId, ServiceType) { 556 $rootScope.WishList = { RefServiceId: ServiceId, ServiceTypeCode: ServiceType }; 557 if (!$rootScope.authenticated) 558 document.getElementById("btnlogin").click(); 559 else { 560 $http({ method: "POST", data: { _GTWishList: $rootScope.WishList }, url: MyAccount + "/IsWishListExists" }) 561 .then(function (res) { 562 alert("Already added to WishList."); 563 }, function (error) { 564 }).finally(function () { }); 565 } 566 } 567 568 $rootScope.TrackDetails = function (ReferenceID, CIEmail) { 569 $http({ method: "POST", data: { ID: ReferenceID, _Email: CIEmail }, url: "/TrackDetails/IsTrackDetailsExists" }) 570 .success(function (data) { 571 if (data == "0") 572 alert("Invalid Track details"); 573 else { 574 document.getElementById('BookingData').submit(); 575 } 576 }).error(function (err) { 577 }); 578 } 579 580 //$rootScope.GotoGiftaHoliday = function () { 581 // //debugger; 582 583 // if (!$rootScope.IsGuest && ($rootScope.AuthUserId == 0)) { 584 // document.getElementById("btnlogin").click(); 585 // $rootScope.isWishList = true;
586 // redirectPath = "/gift-a-holiday"; 587 // } 588 // else if ($rootScope.IsGuest) { 589 // alert("Only registered users can use gifting feature, Please Login..."); 590 // redirectPath = "/gift-a-holiday"; 591 // $rootScope.isWishList = true; 592 // $rootScope.GuestLogOff(); 593 594 // } else { 595 // window.location.href = "/gift-a-holiday"; 596 // } 597 598 //} 599 600 $rootScope.DefaultReviewFormData = function (ServiceType, ServiceId) { 601 602 $rootScope.ReviewsNew = {}; 603 $rootScope.ReviewsNew.URReviewAndCommentsList = {}; 604 $rootScope.ReviewsNew.URReviewAndCommentsList = { 605 ServiceTypeCode: ServiceType, RefServiceId: ServiceId, GTUserReviewComments: "", 606 UserDisplayName: "", UserCountryName: "", UserEmail: "" 607 }; 608 $rootScope.ReviewsNew.URRatings = []; 609 }; 610 611 $rootScope.ValidateReviews = function ($event) { 612 if ($rootScope.ReviewsNew.URReviewAndCommentsList.GTUserReviewComments == "" && $rootScope.ReviewsNew.URRatings.length == 0) { 613 $rootScope.RemoveRatingClass(); 614 alert("Please give your Rating."); 615 616 return; 617 } 618 619 else { 620 $('#UserDetails').modal('show'); 621 if ($rootScope.AuthUserId != 0) { 622 $rootScope.ReviewsNew.URReviewAndCommentsList.UserId = $rootScope.AuthUserId; 623 $rootScope.SaveRevComments(true); 624 } 625 } 626 }; 627 $rootScope.GetReviews = function (ServiceType, ServiceId, Page, RecPerPage, Ratings, USRRating) { 628 $rootScope.DefaultReviewFormData(ServiceType, ServiceId); 629 $rootScope.CurrPage_Review = Page; 630 $rootScope.RecPerPage_Review = RecPerPage; 631 if (Page > 1) { 632 $("#divMVCRevHead").removeClass("show").addClass("hide"); 633 $("#divAngularRevHead").removeClass("hide").addClass("show"); 634 } 635 $http.get(Review_Path + "/GetReviewsByServiceID/" + ServiceType + "/" + ServiceId + "/" + Page + "/" + RecPerPage) 636 .then(function (res) { 637 if ($rootScope.Reviews.length > 0) { 638 $rootScope.Reviews = $rootScope.Reviews.concat(res.data.URReviewAndCommentsList); 639 } 640 else { 641 $rootScope.Reviews = res.data.URReviewAndCommentsList; 642 } 643 //if ($rootScope.Reviews) { 644 // $rootScope.Reviews.RecommendRating = Ratings; 645 // $rootScope.Reviews.OverallUSRRating = USRRating; //_.reduce(_.pluck($rootScope.Reviews, 'USRRating'), function (memmo, num) { return memmo + num; }, 0); 646 //} 647 $rootScope.Rev_Ratings = _.uniq(res.data.URCategoriesWithConfig, function (item, key, RatingCode) { return item.RatingCode; }); 648 $rootScope.Rev_Categories = _.uniq(res.data.URCategoriesWithConfig, function (item, key, CategoryCode) { return item.CategoryCode; }); 649 if ((res.data.URReviewAndCommentsList == undefined || res.data.URReviewAndCommentsList == null) || res.data.URReviewAndCommentsList.length == 0) 650 $rootScope.MoreItems = "No Records foun
650d"; 651 else 652 $rootScope.MoreItems = "LOAD MORE"; 653 654 }, function (error) { 655 656 }).finally(function () { }); 657 }; 658 659 $rootScope.RemoveRatingClass = function () { 660 $("span[class*=startHilight]").each(function () { 661 $(this).removeClass('startHilight'); 662 }) 663 }; 664 665 $rootScope.setRating = function (CatCode, RateCode, RateVal) { 666 var IsCatExists = 0; 667 var v = $(this)[0].RevRateItem.RatingOrder; 668 var i = 0; 669 $("span[name^=" + CatCode + "]").each(function () { 670 if (i < v) 671 $(this).addClass('startHilight'); 672 else 673 $(this).removeClass('startHilight'); 674 i = i + 1; 675 }) 676 677 if ($rootScope.ReviewsNew.URRatings.length > 0) { 678 for (var i = 0; i <= $rootScope.ReviewsNew.URRatings.length - 1; i++) { 679 if ($rootScope.ReviewsNew.URRatings[i].GTURCategoryCode == CatCode) { 680 $rootScope.ReviewsNew.URRatings[i].GTURRatingCode = RateCode; 681 $rootScope.ReviewsNew.URRatings[i].GTUserRatingValue = RateVal; 682 IsCatExists = 1; 683 } 684 } 685 } 686 687 if (IsCatExists == 0) { 688 var URRatingsT = {}; 689 URRatingsT.GTURCategoryCode = CatCode; 690 URRatingsT.GTURRatingCode = RateCode; 691 URRatingsT.GTUserRatingValue = RateVal; 692 $rootScope.ReviewsNew.URRatings[$rootScope.ReviewsNew.URRatings.length] = URRatingsT; 693 } 694 } 695 696 $rootScope.SaveRevComments = function (isRevValid) { 697 698 if (isRevValid) { 699 $http({ 700 method: "POST", data: { objURRatingsVM: $rootScope.ReviewsNew.URReviewAndCommentsList, objURRatings: $rootScope.ReviewsNew.URRatings }, 701 url: Review_Path + "/SaveReviewComment" 702 }) 703 .then(function (res) { 704 alert("Thank you for your review"); 705 $rootScope.isRevFormSubmit = false; 706 $rootScope.DefaultReviewFormData($rootScope.ReviewsNew.URReviewAndCommentsList.ServiceTypeCode, $rootScope.ReviewsNew.URReviewAndCommentsList.RefServiceId); 707 $rootScope.RemoveRatingClass(); 708 $('#UserDetails').modal('hide'); 709 $("#btnClose").click(); 710 //$rootScope.GetReviews("GC", $rootScope.ReviewsNew.URReviewAndCommentsList.RefServiceId, $scope.CurrPage_Review, $scope.RecPerPage_Review); 711 }, function (error) { 712 }).finally(function () { });
713 714 715 } 716 else { 717 $rootScope.isRevFormSubmit = true; 718 return; 719 } 720 } 721 722 $rootScope.ApplyCouponCode = function (BookingId, CouponCode) { 723 //$scope.IsExist = true; 724 //if (CouponCode == undefined) { 725 // $rootScope.Deal.DealMsg = ""; 726 // return; 727 //} 728 if (CouponCode == "") { 729 alert("Please enter Coupon code to discounted"); 730 return; 731 } 732 return $http( 733 { 734 method: "POST", 735 data: { BookingId: parseInt(BookingId), USRCurrencyCode: $rootScope.SessionCurrency, DealCode: CouponCode }, 736 url: "/Common/ApplyCouponCode" 737 }).then(function (res) { 738 739 if (res.data.Deals) { 740 $rootScope.Deal = res.data.Deals; 741 //$rootScope.Deal.DealCurrencyCode = $rootScope.Deal.ServCurrencyCode; 742 $timeout(function () { 743 $rootScope.ConvertCurrency('Totals,DealTotals'); 744 }, 500); 745 } 746 else 747 $rootScope.Deal.DealMsg = ""; 748 }, function (error) { 749 }).finally(function () { 750 }); 751 752 } 753 754 $rootScope.DeleteCouponCode = function (BookingId) { 755 756 var confirm = window.confirm("Are you sure, you want to delete deal?"); 757 if (confirm) { 758 return $http( 759 { 760 method: "POST", 761 data: { BookingId: parseInt(BookingId) }, 762 url: "/Common/DeleteCouponCode" 763 }).then(function (res) { 764 $rootScope.Deal = {}; 765 $rootScope.Deal.DealDiscountAmt = ""; 766 $timeout(function () { 767 $rootScope.ConvertCurrency('Totals,DealTotals'); 768 }, 500); 769 alert(res.data); 770 }, function (error) { 771 }).finally(function () { 772 }); 773 774 } 775 } 776 777 $http.get("/GetCountryCityForAutoComp", { cache: true }).then(function (res) { 778 $rootScope.CountryList = _.uniq(_.filter(res.data, { DESTTYPE: 'CTRY' }), function (item, key, CountryId) { return item.CountryId }); 779 $rootScope.AutoListDestinations = _.uniq(_.filter(res.data, { SerType: 'GHAutoListDest' })); 780 $rootScope.GHAutoList = _.filter(res.data, { SerType: 'GHAutoList' }); 781 $rootScope.GCAutoList = _.filter(res.data, { SerType: 'GCAutoList' }); 782 $rootScope.GLAutoList = _.filter(res.data, { SerType: 'GLAutoList' }); 783 $rootScope.GBYHAutoList = _.filter(res.data, { SerType: 'GBYHAutoList' }); 784 $rootScope.HotelAutoList = _.filter(res.data, { SerType: 'HotelAutoList' }); 785 $rootScope.TransfersAutoList = _.filter(res.data, { SerType: 'TransfersAutoList' }); 786 $rootScope.SightSeeingAutoList = _.filter(res.data, { SerType: 'SightSeeingAutoList' }); 787 //golfHoliday 788 _.map($rootScope.GHAutoList, function (obj) { 789 if (obj.DESTTYPE == "CITY") { 790 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.GHAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 791 } 792 else { 793 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 794 } 795 796 return obj;
797 }) 798 799 $rootScope.GHAutoListSlug = _.pluck($rootScope.GHAutoList, 'CountryOrCityWithComma') 800 //Destinations 801 _.map($rootScope.AutoListDestinations, function (obj) { 802 803 if (obj.DESTTYPE == "CITY") { 804 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.AutoListDestinations, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 805 } 806 else { 807 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 808 } 809 810 return obj; 811 }) 812 813 $rootScope.GHAutoListSlugDestinations = _.pluck($rootScope.AutoListDestinations, 'CountryOrCityWithComma') 814 //end 815 //golfCourse 816 817 _.map($rootScope.GCAutoList, function (obj) { 818 if (obj.DESTTYPE == "CITY") { 819 820 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.GCAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 821 } 822 else { 823 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 824 } 825 826 return obj; 827 }) 828 829 $rootScope.GCAutoListSlug = _.pluck($rootScope.GCAutoList, 'CountryOrCityWithComma') 830 831 //golflesson 832 833 _.map($rootScope.GLAutoList, function (obj) { 834 if (obj.DESTTYPE == "CITY") { 835 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.GLAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 836 } 837 else { 838 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 839 } 840 841 return obj; 842 }) 843 844 $rootScope.GLAutoListSlug = _.pluck($rootScope.GLAutoList, 'CountryOrCityWithComma') 845 846 //Hotels 847 848 _.map($rootScope.HotelAutoList, function (obj) { 849 if (obj.DESTTYPE == "CITY") { 850 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.HotelAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 851 } 852 else { 853 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 854 } 855 856 return obj; 857 }) 858 859 $rootScope.HotelAutoListSlug = _.pluck($rootScope.HotelAutoList, 'CountryOrCityWithComma') 860 861 862 //Transfers 863 864 _.map($rootScope.TransfersAutoList, function (obj) { 865 if (obj.DESTTYPE == "CITY") { 866 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.TransfersAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 867 } 868 else { 869 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 870 } 871 872 return obj; 873 }) 874 875 $rootScope.TransfersAutoListSlug = _.pluck($rootScope.TransfersAutoList, 'CountryOrCityWithComma') 876 877 //Sight Seeing 878 879 _.map($rootScope.SightSeeingAutoList, function (obj) { 880 if (obj.DESTTYPE == "CITY") { 881 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.SightSeeingAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 882 } 883 else { 884 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 885 } 886 887 return obj; 888 }) 889 890 $rootScope.SightSeeingAutoListSlug = _.pluck($rootScope.SightSeeingAutoList, 'CountryOrCityWithComma') 891 //golf Build Your Holiday 892 893 _.map($rootScope.GBYHAutoList, function (obj) { 894 if (obj.DESTTYPE == "CITY") { 895 obj.CountryOrCityWithComma = obj.COUNTRYORCITY + ', ' + _.where($rootScope.GBYHAutoList, { CountryId: obj.CountryId, DESTTYPE: "CTRY" })[0].COUNTRYORCITY; 896 } 897 else { 898 obj.CountryOrCityWithComma = obj.COUNTRYORCITY 899 } 900 901 return obj;
902 }) 903 904 $rootScope.GBYHAutoListSlug = _.pluck($rootScope.GBYHAutoList, 'CountryOrCityWithComma') 905 906 907 908 // $rootScope.destinationList = _.pluck(res.data, 'COUNTRYORCITY') 909 // $rootScope.destinationList1 = _.pluck($rootScope.destinationListSlug, 'CountryOrCityWithComma') 910 911 }, function (error) { 912 913 }).finally(function () { 914 915 }); 916 917 //$http.get("/GetExploreDiscover").then(function (res) { 918 919 920 // $rootScope.WSContinentsGT = []; 921 // $rootScope.WSContinentsGC = []; 922 // $rootScope.WSContinentsGL = []; 923 // $rootScope.WSContinentsBYH = []; 924 // $rootScope.EDGCList = _.where(res.data, { ServTypeCode: 'GC' }); 925 // $rootScope.EDGLList = _.where(res.data, { ServTypeCode: 'GL' }); 926 // $rootScope.EDGTList = _.where(res.data, { ServTypeCode: 'GT' }); 927 // $rootScope.EDBYHList = _.where(res.data, { ServTypeCode: 'BYH' }); 928 // var GTContId = _.uniq(_.pluck($rootScope.EDGTList, 'ContinentId')); 929 // var GCContId = _.uniq(_.pluck($rootScope.EDGCList, 'ContinentId')); 930 // var GLContId = _.uniq(_.pluck($rootScope.EDGLList, 'ContinentId')); 931 // var BYHContId = _.uniq(_.pluck($rootScope.EDBYHList, 'ContinentId')); 932 933 // if (GTContId.length > 0) { 934 // GTContId.forEach(function (obj) { 935 // $rootScope.WSContinentsGT.push(_.where(res.data, { DESTTYPE: 'CONT', ContinentId: obj })[0]); 936 // }) 937 // } 938 // if (GCContId.length > 0) { 939 // GCContId.forEach(function (obj) { 940 // $rootScope.WSContinentsGC.push(_.where(res.data, { DESTTYPE: 'CONT', ContinentId: obj })[0]); 941 // }) 942 // } 943 // if (GLContId.length > 0) { 944 // GLContId.forEach(function (obj) { 945 // $rootScope.WSContinentsGL.push(_.where(res.data, { DESTTYPE: 'CONT', ContinentId: obj })[0]); 946 // }) 947 // } 948 // if (BYHContId.length > 0) { 949 // BYHContId.forEach(function (obj) { 950 // $rootScope.WSContinentsBYH.push(_.where(res.data, { DESTTYPE: 'CONT', ContinentId: obj })[0]); 951 // }) 952 953 // } 954 955 956 //}, function (error) { 957 958 //}).finally(function () { 959 960 //}); 961 962 //$http.get("/GetCustomPagesList").then(function (res) { 963 // $rootScope.CustomPageList = res.data; 964 //}, function (error) { 965 966 //}).finally(function () { 967 968 //}); 969 970 $http.get("/GetGTWScurrency").then(function (res) { 971 972 $rootScope.currencyList = res.data; 973 974 //if ($rootScope.SessionCurrency != undefined && $rootScope.SessionCurrency != "") 975 // $rootScope.drdCurrencyCode = $rootScope.SessionCurrency; 976 //else { 977 // $rootScope.drdCurrencyCode = (res.data.length != 0) ? _.where(res.data, { CurrencyCode: "USD" })[0].CurrencyCode : ''; 978 // } 979 980 981 }, function (error) { 982 983 }).finally(function () { 984 985 }); 986 987 $rootScope.ChangeCurrency = function (CurrencyCode) { 988 989 990 $rootScope.SessionCurrency = CurrencyCode; 991 SessionCurrency = CurrencyCode; 992 $http.post("/Common/ChangeCurrency", { currcode: CurrencyCode }).then(function (res) { 993 994 $rootScope.ConvertCurrency(); 995 }); 996 997 } 998 999 $rootScope.ConvertCurrency = function (priceBlock) { 1000 //debugger; 1001 1002 1003 var currencyCode = []; 1004 var currencyValue = []; 1005 var fromCode = []; 1006 var InValue = []; 1007 var tocurrencyCode = []; 1008 var tocurrencyValue = []; 1009 $rootScope.drdCurrencyCode = $rootScope.SessionCurrency; 1010 1011 1012 if (priceBlock != undefined) { 1013 1014 // alert(priceBlock) 1015 if (priceBlock.split(',').length > 1) { 1016 1017 var mulArray = priceBlock.split(','); 1018 1019 for (var i = 0; i < mulArray.length; i++) { 1020 1021 (currencyCode.length > 0) ? currencyCode = $.merge($('#' + mulArray[i] + " .currencyCode"), currencyCode) : currencyCode = $('#' + mulArray[i] + " .currencyCode"); 1022 1023 1024 (currencyValue.length > 0) ? currencyValue = $.merge($('#' + mulArray[i] + " .currencyValue"), currencyValue) : currencyValue = $('#' + mulArray[i] + " .currencyValue"); 1025 1026 1027 (tocurrencyCode.length > 0) ? tocurrencyCode = $.merge($('#' + mulArray[i] + " .tocurrencyCode"), tocurrencyCode) : tocurrencyCode = $('#' + mulArray[i] + " .tocurrencyCode"); 1028 1029 (tocurrencyValue.length > 0) ? tocurrencyValue = $.merge($('#' + mulArray[i] + " .tocurrencyValue"), tocurrencyValue) : tocurrencyValue = $('#' + mulArray[i] + " .tocurrencyValue"); 1030 } 1031 } else { 1032 1033 currencyCode = $('#' + priceBlock + " .currencyCode"); 1034 currencyValue = $('#' + priceBlock + " .currencyValue"); 1035 tocurrencyCode = $('#' + priceBlock + " .tocurrencyCode"); 1036 tocurrencyValue = $('#' + priceBlock + " .tocurrencyValue"); 1037 } 1038 1039 1040 1041 } else { 1042 currencyCode = $(".currencyCode"); 1043 currencyValue = $(".currencyValue"); 1044 tocurrencyCode = $(".tocurrencyCode"); 1045 tocurrencyValue = $(".tocurrencyValue"); 1046 } 1047 1048 // console.log(currencyCode.length); 1049 1050 1051 if (currencyCode.length > 0) { 1052 for (var i = 0; i < currencyCode.length; i++) { 1053 fromCode.push(currencyCode[i].textContent); 1054 InValue.push(currencyValue[i].textContent); 1055 } 1056 1057 $http.post("/Common/ConvertCurrency", { incurrcode: fromCode, incurrvalue: InValue, outcurrcode: $rootScope.SessionCurrency }).then(function (res) { 1058 // $rootScope.SessionCurrency = $rootScope.SessionCurrency; 1059 for (var j = 0; j < tocurrencyCode.length; j++) { 1060 if (res.data[j] != undefined && res.data[j] != "") { // && parseInt(res.data[j]) != 0 1061 tocurrencyCode[j].textContent = $rootScope.SessionCurrency; 1062 if (parseInt(res.data[j]) != 0) 1063 tocurrencyValue[j].textContent = res.data[j]; //.toFixed(2); // Jyothi: Removed decimal part from the price 1064 else 1065 tocurrencyValue[j].textContent = res.data[j]; 1066 1067 tocurrencyCode[j].style.display = "inline-block"; 1068 tocurrencyValue[j].style.display = "inline-block"; 1069 //tocurrencyValue[j].textContent = res.data[j].toFixed(0); 1070 } 1071 else { 1072 1073 tocurrencyCode[j].textContent = ''; 1074 tocurrencyValue[j].textContent = "On Request"; 1075 tocurrencyCode[j].style.display = "none"; 1076 tocurrencyValue[j].style.display = "inline-block"; 1077 } 1078 } 1079 1080 $rootScope.loading = false; 1081 1082 }, function (error) { 1083 $rootScope.loading = false; 1084 }).finally(function () { 1085 }); 1086 1087 } else { 1088 $rootScope.loading = false; 1089 } 1090 } 1091 1092 $rootScope.GetUsdXchangeRate = function (fromCurrvalue, value) { 1093 $rootScope.fromCurrCode = []; 1094 $rootScope.Value = []; 1095 //$rootScope.toCurrCode = []; 1096 1097 $rootScope.fromCurrCode.push(fromCurrvalue); 1098 $rootScope.Value.push(value); 1099 //$rootScope.toCurrCode.push(toValue); 1100 $http.post("/Common/ConvertCurrency", { incurrcode: $rootScope.fromCurrCode, incurrvalue: $rootScope.Value, outcurrcode: 'USD' }).then(function (res) { 1101 //$rootScope.SessionCurrency = $rootScope.SessionCurrency; 1102 $rootScope.toSaveUsdXchangeRate = res.data[0]; 1103 }, function (error) { 1104 1105 }).finally(function () { 1106 1107 }); 1108 } 1109 1110 $rootScope.GetAnyXchangeRate = function (fromCurrvalue, value, toCurrvalue) { 1111 // debugger; 1112 $rootScope.fromCurrCode = []; 1113 $rootScope.Value = []; 1114 //$rootScope.toCurrCode = []; 1115 1116 $rootScope.fromCurrCode.push(fromCurrvalue); 1117 $rootScope.Value.push(value); 1118 //$rootScope.toCurrCode.push(toCurrvalue); 1119 $http.post("/Common/AnyConvertCurrency", { incurrcode: $rootScope.fromCurrCode, incurrvalue: $rootScope.Value, outcurrcode: toCurrvalue }).then(function (res) { 1120 //$rootScope.SessionCurrency = $rootScope.SessionCurrency; 1121 $rootScope.toSaveAnyXchangeRate = res.data[0]; 1122 }, function (error) { 1123 1124 }).finally(function () { 1125 1126 }); 1127 } 1128 1129 //Map Implementation -- Start 1130 $rootScope.ShowMap = function (data, fromPage) { 1131 var mapOptions = { 1132 zoom: 8, 1133 center: new google.maps.LatLng(40.0000, -98.0000), 1134 mapTypeId: google.maps.MapTypeId.TERRAIN 1135 } 1136 1137 $rootScope.map = new google.maps.Map(document.getElementById('map'), mapOptions); 1138 1139 $rootScope.markers = []; 1140 1141 var infoWindow = new google.maps.InfoWindow(); 1142 1143 var latlngbounds = new google.maps.LatLngBounds(); 1144 var createMarker = function (info) { 1145 1146 latlngbounds.extend(new google.maps.LatLng(info.lat, info.long)); 1147 1148 var marker = new google.maps.Marker({ 1149 map: $rootScope.map, 1150 position: new google.maps.LatLng(info.lat, info.long), 1151 title: info.city 1152 }); 1153 marker.content = info.desc; 1154 if (fromPage == "GLSearch" || fromPage == "GCSearch" || fromPage == "HotelSearch" || fromPage == "TransfersSearch" || fromPage == "SSSearch" || fromPage == "GHSearch") { 1155 google.maps.event.addListener(marker, 'click', function () { 1156 infoWindow.setContent(marker.content); 1157 infoWindow.open($rootScope.map, marker); 1158 }); 1159 } 1160 $rootScope.map.fitBounds(latlngbounds); 1161 //$rootScope.markers.push(marker); 1162 if (fromPage == 'GLSearch') { 1163 if (data.GolfLessonListByCountry.GLSerachList.GLList.length == 1) 1164 $rootScope.map.setZoom(8); 1165 } 1166 else if (fromPage == 'GCSearch') { 1167 if (data.GolfCourseListByCountry.GCSerachList.GCList.length == 1) 1168 $rootScope.map.setZoom(8); 1169 } 1170 else if (fromPage == 'HotelSearch') { 1171 if (data.HotelListByCountry.HotelSerachList.HotelList.length == 1) 1172 $rootScope.map.setZoom(8); 1173 } 1174 else if (fromPage == 'TransfersSearch') { 1175 if (data.TransfersListByCountry.TransfersSerachList.TransfersList.length == 1) 1176 $rootScope.map.setZoom(8); 1177 } 1178 else if (fromPage == 'SSSearch') { 1179 if (data.SightSeeingListByCountry.SightSeeingSerachList.SightSeeingList.length == 1) 1180 $rootScope.map.setZoom(8); 1181 } 1182 else if (fromPage == 'GHSearch') { 1183 if (data.GolfHolidayListByCountry.GHSerachList.GHList.length == 1) 1184 $rootScope.map.setZoom(8); 1185 } 1186 else { 1187 $rootScope.map.setZoom(8); 1188 } 1189 //$rootScope.map.setZoom(8); 1190 1191 } 1192 1193 var b = {}; 1194 1195 var cities = []; 1196 1197 1198 if (fromPage == "GLSearch") { 1199 1200 data.GolfLessonListByCountry.GLSerachList.GLList.forEach(function (column) { 1201 1202 if (column.FeaturedImgURL != null) 1203 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + column.FeaturedImgURL; 1204 else 1205 imageURL = ''; 1206 1207 1208 1209 var saveUpto; 1210 var hotDeal; 1211 var timefrom;
1212 var proDetails; 1213 var USRRating; 1214 1215 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1216 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + ' % </button></div>'; 1217 else 1218 saveUpto = ''; 1219 1220 if (column.HasHotDeal != null) 1221 hotDeal = '<div class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></div>'; 1222 else 1223 hotDeal = ''; 1224 1225 if (column.GLTimeFrom != null) 1226 timefrom = '| ' + column.GLTimeFrom + ''; 1227 else 1228 timefrom = ''; 1229 1230 if (column.ProName != null) 1231 proDetails = '<div style="margin-top: 70px; line-height:17px; color:#737373">Pro Details<br /><b>' + column.ProName + '</b></div>'; 1232 else 1233 proDetails = ''; 1234 if (column.USRRating != null) 1235 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1236 else 1237 UserRating = ''; 1238 if (column.StartPrice == null) { 1239 var ShowText = 'Price'; 1240 var StartPrice = 'On Request'; 1241 1242 } else { 1243 var ShowText = 'STARTING FROM'; 1244 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1245 } 1246 1247 cities.push({ 1248 city: column.CityName, 1249 1250 desc: '<div id="divMain" class="mapZoomed">' 1251 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.GLHP_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1252 //+ saveUpto 1253 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1254 + '</div>' 1255 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><div class="h3"><a href="' + $rootScope.GLHP_Path + '/' + column.Slug + '" style="color:black">' + column.GolfLessonName + '</a> </div>' + hotDeal + '' 1256 + '<div class="hidden-md hidden-lg"><span>' + UserRating + '</span></div>' 1257 + '<div class="txtOverflow" style="margin:4px 0;"><span style="color:#6ba800">' + column.CityName + ', ' + column.CountryName + '</span><span class="hidden-sm hidden-xs"> ' + timefrom + '</span> </div>' 1258 //+ '<div>' + column.BriefDesc + '</div>' 1259 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1260 + '<div class="price">' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1261 + '</div>' 1262 //+ '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><h4 style="float:right;">' + column.Ratings + '</h4>' 1263 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><div class="pull-right text-black" style="font-size:13px; margin-top:15px; font-weight:400">' + UserRating + '</div>'
1264 + proDetails 1265 + '<div class="price" style="bottom:10px;position:absolute;"><a href="' + $rootScope.GLHP_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1266 + '</div>' 1267 + '<div class="clear">' 1268 + '</div>' 1269 + '</div>', 1270 1271 lat: column.MapLatitude, 1272 long: column.MapLongitude 1273 1274 }); 1275 1276 }); 1277 var i; 1278 for (i = 0; i < data.GolfLessonListByCountry.GLSerachList.GLList.length; i++) { 1279 1280 createMarker(cities[i]); 1281 } 1282 } 1283 else if (fromPage == "GCSearch") { 1284 data.GolfCourseListByCountry.GCSerachList.GCList.forEach(function (column) { 1285 if (column.FeaturedImgURL != null) 1286 var imageURL = column.FeaturedImgURL; 1287 else 1288 imageURL = ''; 1289 1290 var saveUpto; 1291 var hotDeal; 1292 var timefrom; 1293 var Designer; 1294 1295 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1296 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + '% </button></div>'; 1297 else 1298 saveUpto = ''; 1299 1300 if (column.HasHotDeal != null) 1301 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1302 else 1303 hotDeal = ''; 1304 1305 if (column.GCTimeFrom != null) 1306 timefrom = '| ' + column.GCTimeFrom + ''; 1307 else 1308 timefrom = ''; 1309 1310 if (column.StartPrice == null) { 1311 var ShowText = 'Price'; 1312 var StartPrice = 'On Request'; 1313 1314 } else { 1315 var ShowText = 'STARTING FROM'; 1316 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1317 } 1318 1319 if (column.Designer != null) 1320 Designer = '<div style="margin-top: 70px; line-height:17px; color:#737373">Designed By<br /><b>' + column.Designer + '</b></div>'; 1321 else 1322 Designer = ''; 1323 1324 if (column.USRRating != null) 1325 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1326 else 1327 UserRating = ''; 1328 1329 if (column.NoOfHoles != null) 1330 holes = column.NoOfHoles + ' Holes'; 1331 else 1332 holes = ''; 1333 if (column.Par != null) 1334 Par = ' | ' + column.Par + ' Par'; 1335 else 1336 Par = ''; 1337 if (column.YardsMeters != null) 1338 YardsMeters = ' | ' + column.YardsMeters; 1339 else 1340 YardsMeters = ''; 1341 1342 if (column.Rankings != null && column.Rankings != 0) 1343 Rankings = column.Rankings; 1344 else 1345 Rankings = ''; 1346 1347 cities.push({ 1348 1349 city: column.CityName, 1350 desc: '<div id="divMain" class="mapZoomed">' 1351 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.GCDetails_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1352 //+ saveUpto 1353 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1354 + '</div>' 1355 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3 style="max-height: 55px; overflow:hidden;"><a href="' + $rootScope.GCDetails_Path + '/' + column.Slug + '" style="color:black">' + column.GolfCourseName + '</a> </h3> <div>' + hotDeal + '</div>' 1356 + '<div class="hidden-md hidden-lg"><span class="text-semibold" style="color:#6ba800; float:left;">' + Rankings + '</span><span style="float:right;">' + UserRating + '</span><div class="clear"></div></div>' 1357 + '<div class="txtOverflow" style="margin:4px 0;"><span style="color:#6ba800">' + column.CityName + ', ' + column.CountryName + '</span> ' + timefrom + ' </div>' 1358 //+ '<div>' + column.BriefDesc + '</div>' 1359 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1360 + '<div class="hidden-sm hidden-xs txtOverflow">' + holes + Par + YardsMeters + '</div>' 1361 + '<div class="price">
1361' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1362 + '</div>' 1363 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%; padding-right:0"><h4 style="float:right;">' + Rankings + '</h4><br /><span style="float:right;">' + UserRating + '</span>' 1364 + Designer 1365 + '<div class="price" style="bottom:10px; position:absolute; width:100%;"><a href="' + $rootScope.GCDetails_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1366 + '</div>' 1367 + '<div class="clear">' 1368 + '</div>' 1369 + '</div>', 1370 lat: column.MapLatitude, 1371 long: column.MapLongitude 1372 1373 }); 1374 1375 }); 1376 var i; 1377 for (i = 0; i < cities.length; i++) { 1378 createMarker(cities[i]); 1379 } 1380 1381 } 1382 else if (fromPage == "HotelSearch") { 1383 1384 data.HotelListByCountry.HotelSerachList.HotelList.forEach(function (column) { 1385 1386 if (column.FeaturedImgURL != null) { 1387 1388 if (column.FeaturedImgURL.indexOf('/Gallery/') < 0) 1389 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + column.FeaturedImgURL 1390 1391 } 1392 else { 1393 column.FeaturedImgURL = ''; 1394 } 1395 1396 1397 var saveUpto; 1398 var hotDeal; 1399 var timefrom; 1400 var UserRating; 1401 var proDetails; 1402 var Locality; 1403 1404 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1405 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + ' % </button></div>'; 1406 else 1407 saveUpto = ''; 1408 1409 if (column.HasHotDeal != null) 1410 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1411 else 1412 hotDeal = ''; 1413 1414 if (column.USRRating != null) 1415 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1416 else 1417 UserRating = ''; 1418 1419 if (column.Locality != null) 1420 Locality = column.Locality + ' | '; 1421 else 1422 Locality = ''; 1423 1424 if (column.StartPrice == null) { 1425 var ShowText = 'Price'; 1426 var StartPrice = 'On Request'; 1427 1428 } else { 1429 var ShowText = 'STARTING FROM'; 1430 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1431 } 1432 1433 cities.push({ 1434 1435 city: column.CityName, 1436 desc: '<div id="divMain" class="mapZoomed">' 1437 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.HotelHP_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1438 //+ saveUpto 1439 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1440 + '</div>' 1441 //+ '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3>' + column.HotelName + ' ' + hotDeal + ' </h3>' 1442 1443 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3><a href="' + $rootScope.HotelHP_Path + '/' + column.Slug + '" style="color:black">' + column.HotelName + '</a></h3><div>' + hotDeal + '</div>' 1444 + '<div class="hidden-md hidden-lg"><span>' + UserRating + '</span></div>' 1445 + '<div style="margin:4px 0;"><span class="hidden-sm hidden-xs">' + Locality + '</span><span style="color:#6ba800">' + column.CityName + ', ' + column.CountryName + ' </div>' 1446 //+ '<div>' + column.BriefDesc + '</div>' 1447 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1448 + '<div class="price">
1448' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1449 + '</div>' 1450 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><div class="pull-right text-black" style="font-size:13px; margin-top:15px; font-weight:400">' + UserRating + '</div>' 1451 //+ proDetails 1452 + '<div class="price" style="bottom:10px; right:0;position:absolute;"><a href="' + $rootScope.HotelHP_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1453 + '</div>' 1454 + '<div class="clear">' 1455 + '</div>' 1456 + '</div>', 1457 lat: column.MapLatitude, 1458 long: column.MapLongitude 1459 1460 }); 1461 1462 }); 1463 var i; 1464 for (i = 0; i < cities.length; i++) { 1465 createMarker(cities[i]); 1466 } 1467 1468 } 1469 else if (fromPage == "TransfersSearch") { 1470 data.TransfersListByCountry.TransfersSerachList.TransfersList.forEach(function (column) { 1471 if (column.FeaturedImgURL != null) 1472 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + column.FeaturedImgURL; 1473 else 1474 imageURL = ''; 1475 1476 var saveUpto; 1477 var hotDeal; 1478 var timefrom; 1479 var proDetails; 1480 var UserRating; 1481 1482 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1483 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + ' % </button></div>'; 1484 else 1485 saveUpto = ''; 1486 1487 if (column.HasHotDeal != null) 1488 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1489 else 1490 hotDeal = ''; 1491 if (column.USRRating != null) { 1492 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1493 } 1494 else { 1495 UserRating = ""; 1496 } 1497 if (column.StartPrice == null) { 1498 var ShowText = 'Price'; 1499 var StartPrice = 'On Request'; 1500 1501 } else { 1502 var ShowText = 'STARTING FROM'; 1503 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1504 } 1505 1506 cities.push({ 1507 city: column.CityName, 1508 desc: '<div id="divMain" class="mapZoomed">' 1509 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.TransfersHP_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1510 //+ saveUpto 1511 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1512 + '</div>' 1513 //+ '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3>' + column.TransferTitle + ' ' + hotDeal + ' </h3>' 1514 1515 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3><a href="' + $rootScope.TransfersHP_Path + '/' + column.Slug + '" style="color:black">' + column.TransferTitle + '</a></h3><div>' + hotDeal + ' </div>' 1516 + '<div class="hidden-md hidden-lg"><span>' + UserRating + '</span></div>' 1517 + '<div style="margin:4px 0;"><span style="color:#6ba800">' + column.CityName + ', ' + column.CountryName + '</span> ' + ' </div>' 1518 //+ '<div>' + column.BriefDesc + '</div>' 1519 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1520 + '<div class="price">
1520' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1521 + '</div>' 1522 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><div class="pull-right text-black" style="font-size:13px; margin-top:15px; font-weight:400">' + UserRating + '</div>' 1523 //+ proDetails 1524 + '<div class="price" style="bottom:10px; right:0;position:absolute;"><a href="' + $rootScope.TransfersHP_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1525 + '</div>' 1526 + '<div class="clear">' 1527 + '</div>' 1528 + '</div>', 1529 lat: column.MapLatitude, 1530 long: column.MapLongitude 1531 1532 }); 1533 1534 }); 1535 var i; 1536 for (i = 0; i < cities.length; i++) { 1537 createMarker(cities[i]); 1538 } 1539 1540 } 1541 else if (fromPage == "SSSearch") { 1542 data.SightSeeingListByCountry.SightSeeingSerachList.SightSeeingList.forEach(function (column) { 1543 if (column.FeaturedImgURL != null) 1544 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + column.FeaturedImgURL; 1545 else 1546 imageURL = ''; 1547 1548 var saveUpto; 1549 var hotDeal; 1550 var timefrom; 1551 var proDetails; 1552 var UserRating; 1553 1554 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1555 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + ' % </button></div>'; 1556 else 1557 saveUpto = ''; 1558 1559 if (column.HasHotDeal != null) 1560 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1561 else 1562 hotDeal = ''; 1563 1564 if (column.USRRating != null) { 1565 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1566 } 1567 else { 1568 UserRating = ""; 1569 } 1570 if (column.StartPrice == null) { 1571 var ShowText = 'Price'; 1572 var StartPrice = 'On Request'; 1573 1574 } else { 1575 var ShowText = 'STARTING FROM'; 1576 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1577 } 1578 1579 1580 cities.push({ 1581 1582 city: column.CityName, 1583 desc: '<div id="divMain" class="mapZoomed">' 1584 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.SightSeeingHP_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1585 //+ saveUpto 1586 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1587 + '</div>' 1588 //+ '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3>' + column.SSTitle + ' ' + hotDeal + ' </h3>' 1589 1590 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3><a href="' + $rootScope.SightSeeingHP_Path + '/' + column.Slug + '" style="color:black">' + column.SSTitle + '</a></h3><div> ' + hotDeal + ' </div>' 1591 1592 + '<div class="hidden-md hidden-lg"><span>' + UserRating + '</span></div>' 1593 + '<div style="margin:4px 0;"><span style="color:#6ba800">' + column.CityName + ', ' + column.CountryName + '</span></div>' 1594 //+ '<div>' + column.BriefDesc + '</div>' 1595 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1596 + '<div class="price">
1596' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1597 + '</div>' 1598 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><div class="pull-right text-black" style="font-size:13px; margin-top:15px; font-weight:400">' + UserRating + '</div>' 1599 //+ proDetails 1600 + '<div class="price" style="bottom:10px; right:0;position:absolute;"><a href="' + $rootScope.SightSeeingHP_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1601 + '</div>' 1602 + '<div class="clear">' 1603 + '</div>' 1604 + '</div>', 1605 lat: column.MapLatitude, 1606 long: column.MapLongitude 1607 1608 }); 1609 1610 }); 1611 var i; 1612 for (i = 0; i < cities.length; i++) { 1613 createMarker(cities[i]); 1614 } 1615 1616 } 1617 else if (fromPage == "GHSearch") { 1618 data.GolfHolidayListByCountry.GHSerachList.GHList.forEach(function (column) { 1619 if (column.FeaturedImgURL != null) 1620 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + column.FeaturedImgURL; 1621 else 1622 imageURL = ''; 1623 var saveUpto; 1624 var hotDeal; 1625 var UserRating; 1626 var proDetails; 1627 1628 if (column.SaveUptoPerc != null && column.SaveUptoPerc >= 5) 1629 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + column.SaveUptoPerc + ' % </button></div>'; 1630 else 1631 saveUpto = ''; 1632 1633 if (column.HasHotDeal != false && column.HasHotDeal != null) 1634 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + column.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1635 else 1636 hotDeal = ''; 1637 1638 if (column.USRRating != null) { 1639 UserRating = 'User Rating: <span class="text-semibold" style="color:#6ba800;">' + column.USRRating + '</span>'; 1640 } 1641 else { 1642 UserRating = ""; 1643 } 1644 if (column.StartPrice == null) { 1645 var ShowText = 'Price'; 1646 var StartPrice = 'On Request'; 1647 1648 } else { 1649 var ShowText = 'STARTING FROM'; 1650 var StartPrice = column.CurrencyCode + " " + column.StartPrice; 1651 } 1652 1653 cities.push({ 1654 1655 city: column.CtryCityName, 1656 desc: '<div id="divMain" class="mapZoomed">' 1657 + '<div class="col-md-4 col-sm-3 col-xs-3 courseImage" onclick=location.href="' + $rootScope.GTHP_Path + '/' + column.Slug + '" style="background-image: url(' + imageURL + '); height:100%; background-size:cover;">' 1658 //+ saveUpto 1659 + '<div class="hidden-sm hidden-xs">' + saveUpto + '</div>' 1660 + '</div>' 1661 //+ '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3>' + column.HolidayName + ' ' + hotDeal + ' </h3>' 1662 + '<div class="col-md-5 col-sm-9 col-xs-9" style="height:100%"><h3><a href="' + $rootScope.GTHP_Path + '/' + column.Slug + '" style="color:black">' + column.HolidayName + '</a></h3><div> ' + hotDeal + ' </div>' 1663 + '<div class="hidden-md hidden-lg"><span>' + UserRating + '</span></div>' 1664 + '<div class="TxtOverflow"><span style="color:#6ba800">' + column.CtryCityName + '</span></div>' 1665 //+ '<div>' + column.BriefDesc + '</div>' 1666 + '<div class="hidden-md hidden-lg smSaveUpto">' + saveUpto + '</div>' 1667 + '<div class="price">
1667' + ShowText + '<h2> ' + StartPrice + '</h2></div>' 1668 + '</div>' 1669 + '<div class="col-md-3 hidden-sm hidden-xs" style="height:100%;"><div class="pull-right text-black" style="font-size:13px; margin-top:15px; font-weight:400">' + UserRating + '</div>' 1670 //+ proDetails 1671 + '<div class="price" style="bottom:10px; right:0;position:absolute;"><a href="' + $rootScope.GTHP_Path + '/' + column.Slug + '" class="btn btn-primary" style="width:100%;">SELECT & BOOK ></a></div>' 1672 + '</div>' 1673 + '<div class="clear">' 1674 + '</div>' 1675 + '</div>', 1676 lat: column.MapLatitude, 1677 long: column.MapLongitude 1678 1679 }); 1680 1681 }); 1682 var i; 1683 for (i = 0; i < cities.length; i++) { 1684 createMarker(cities[i]); 1685 } 1686 1687 } 1688 else { 1689 cities.city = data.CityName 1690 cities.lat = data.MapLatitude 1691 cities.long = data.MapLongitude 1692 createMarker(cities); 1693 } 1694 1695 1696 1697 $rootScope.openInfoWindow = function (e, selectedMarker) { 1698 e.preventDefault(); 1699 google.maps.event.trigger(selectedMarker, 'click'); 1700 } 1701 } 1702 1703 1704 $rootScope.ShowMinMap = function (data, fromPage) { 1705 1706 var myCenter = new google.maps.LatLng(data.MapLatitude, data.MapLongitude); 1707 1708 function initialize() { 1709 var mapProp = { 1710 center: myCenter, 1711 zoom: 5, 1712 mapTypeId: google.maps.MapTypeId.TERRAIN 1713 }; 1714 1715 $rootScope.map = new google.maps.Map(document.getElementById('map'), mapProp); 1716 1717 var marker = new google.maps.Marker({ 1718 position: myCenter, 1719 }); 1720 1721 marker.setMap($rootScope.map); 1722 //following code added to show the content on mark up click 1723 //var infowindow = new google.maps.InfoWindow({ 1724 // content: "Hello World!" 1725 //}); 1726 1727 //google.maps.event.addListener(marker, 'click', function () { 1728 // infowindow.open(map, marker); 1729 //}); 1730 //End Code for MarkUp Click 1731 } 1732 initialize(); 1733 1734 1735 } 1736 1737 $rootScope.CloseGeneralEnquiryForm = function () { 1738 1739 $rootScope.GeneralEnquiry = ''; 1740 $('#ManageBooking').modal('hide'); 1741 $('#UserDetails').modal('hide'); 1742 } 1743 1744 $rootScope.SaveGeneralContactDetails = function (BookingType, IsValid) { 1745 if (IsValid) { 1746 $rootScope.GeneralEnquiry.SourceURL = window.location.href; 1747 $rootScope.GeneralEnquiry.USRViewCurrencyCode = $rootScope.SessionCurrency; 1748 // Added For CountryCode for Phonenumber 20240415 1749 var countryCode = $('.iti__selected-dial-code').html(); 1750 $('.iti__selected-dial-code').html(countryCode); 1751 $rootScope.GeneralEnquiry.CountryCode = countryCode; 1752 //End 1753 //Added code for Zoho Lead api to get the Nationalityname 1754 if ($rootScope.GeneralEnquiry.CINationality) { 1755 1756 var selectedCountry = $rootScope.Countries.find(function (c) { 1757 return c.CountryId == $rootScope.GeneralEnquiry.CINationality; 1758 }); 1759 1760 if (selectedCountry) { 1761 $rootScope.GeneralEnquiry.CINationalityName = selectedCountry.CountryName; 1762 } 1763 } 1764 1765 if ($rootScope.GeneralEnquiry.CountryId) { 1766 1767 var selectedPrefCountry = $rootScope.AllCountry.find(function (c) { 1768 return c.CountryId == $rootScope.GeneralEnquiry.CountryId; 1769 }); 1770 1771 if (selectedPrefCountry) { 1772 $rootScope.GeneralEnquiry.CICountryName = selectedPrefCountry.CountryName; 1773 } 1774 } 1775 //End Rajitha 1776 1777 $rootScope.loading = true; 1778 return $http( 1779 { 1780 method: "POST", 1781 data: JSON.stringify($rootScope.GeneralEnquiry), 1782 url: "/Common/SaveGeneralContactDetails" 1783 }).then(function (res) { 1784 1785 if (res.data.capRes != undefined) { 1786 alert(res.data.capRes); 1787 $rootScope.loading = false; 1788 } else { 1789 $rootScope.GeneralEnquiry = ''; 1790 window.location.href = "/thank-you" + "/"
1790+ res.data.BookingRefID + "/" + BookingType; 1791 } 1792 }, function (error) { 1793 $rootScope.loading = false; 1794 }).finally(function () { 1795 }); 1796 } 1797 else { 1798 $rootScope.ContactUsInfoValid = true; 1799 alert("Please enter all mandatory details..."); 1800 $rootScope.loading = false; 1801 return false; 1802 } 1803 $rootScope.loading = false; 1804 } 1805 1806 $rootScope.SaveGeneralEnquiryDetails = function (BookingType, Isvalid) { 1807 if (Isvalid) { 1808 $rootScope.GeneralEnquiry.SourceURL = window.location.href; 1809 $rootScope.GeneralEnquiry.USRViewCurrencyCode = $rootScope.SessionCurrency; 1810 $rootScope.loading = true; 1811 return $http( 1812 { 1813 method: "POST", 1814 data: JSON.stringify($rootScope.GeneralEnquiry), 1815 url: "/Common/SaveGeneralEnquiryDetails" 1816 }).then(function (res) { 1817 1818 if (res.data.capRes != undefined) { 1819 alert(res.data.capRes); 1820 $rootScope.loading = false; 1821 } else { 1822 $rootScope.GeneralEnquiry = ''; 1823 $rootScope.GeneralEnqInfoValid = false; 1824 window.location.href = "/thank-you" + "/" + res.data.BookingRefID + "/" + BookingType; 1825 } 1826 1827 }, function (error) { 1828 $rootScope.loading = false; 1829 }).finally(function () { 1830 1831 }); 1832 } 1833 else { 1834 $rootScope.GeneralEnqInfoValid = true; 1835 alert("Please enter all mandatory details..."); 1836 $rootScope.loading = false; 1837 return false; 1838 } 1839 $rootScope.loading = false; 1840 } 1841 1842 $rootScope.TrackBookingID = function () { 1843 1844 return $http( 1845 { 1846 1847 method: "POST", 1848 data: JSON.stringify($rootScope.Bookingdata), 1849 url: "/Common/TrackBookingID" 1850 1851 }).then(function (res) { 1852 if (res.data.isRedirect) { 1853 window.location.href = res.data.redirectUrl; 1854 } 1855 1856 1857 }, function (error) { 1858 1859 }).finally(function () { 1860 1861 }); 1862 } 1863 1864 1865 $rootScope.ShowviewMap = function (data, fromPage) { 1866 $rootScope.ResForMap = data; 1867 $rootScope.PageName = fromPage; 1868 var mapOptions = { 1869 center: new google.maps.LatLng(40.0000, -98.0000), 1870 zoom: 8, 1871 mapTypeId: google.maps.MapTypeId.TERRAIN 1872 } 1873 1874 $rootScope.map1 = new google.maps.Map(document.getElementById('viewMap'), mapOptions); 1875 1876 var infoWindow = new google.maps.InfoWindow(); 1877 1878 var latlngbounds = new google.maps.LatLngBounds(); 1879 var createMarker = function (info) { 1880 1881 latlngbounds.extend(new google.maps.LatLng(info.lat, info.long)); 1882 1883 var marker = new google.maps.Marker({ 1884 map: $rootScope.map1, 1885 position: new google.maps.LatLng(info.lat, info.long), 1886 //title: info.city 1887 }); 1888 1889 //commented by udaya to hide marker content in details pages 1890 marker.content = info.desc; 1891 //google.maps.event.trigger(map, 'resize', {}); 1892 google.maps.event.addListener(marker, 'click', function () { 1893 infoWindow.setContent(marker.content); 1894 infoWindow.open($rootScope.map1, marker); 1895 }); 1896 $rootScope.map1.fitBounds(latlngbounds); 1897 //$rootScope.markers1.push(marker);
1898 if (fromPage == "GHDetails") { 1899 if (data.length == 1) { 1900 $rootScope.map1.setZoom(8); 1901 } 1902 else { 1903 $rootScope.map1.setZoom(3); 1904 } 1905 } else if (fromPage == "CountryDetails") { 1906 $rootScope.map1.setZoom(4); 1907 } else { 1908 $rootScope.map1.setZoom(8); 1909 } 1910 } 1911 1912 var b = {}; 1913 1914 var cities = []; 1915 1916 if (data.FeaturedImgURL != null && data.FeaturedImgURL != undefined) 1917 var imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + data.FeaturedImgURL; 1918 else 1919 imageURL = ''; 1920 1921 1922 var saveUpto; 1923 var hotDeal; 1924 var timefrom; 1925 var proDetails; 1926 var rating; 1927 1928 if (data.SaveUptoPerc != null && data.SaveUptoPerc >= 5) 1929 saveUpto = '<div class="saveUpto"><button type="button" class="btn bg-red">SAVE UP TO ' + data.SaveUptoPerc + ' % </button></div>'; 1930 else 1931 saveUpto = ''; 1932 1933 if (data.StartPrice == null) 1934 data.StartPrice = ''; 1935 1936 if (fromPage == "GLDetails") { 1937 1938 if (data.HasHotDeal != null) 1939 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1940 else 1941 hotDeal = ''; 1942 1943 if (data.GLTimeFrom != null) 1944 timefrom = '| ' + data.GLTimeFromAP + ''; 1945 else 1946 timefrom = ''; 1947 1948 if (data.ProName != null) 1949 proDetails = '<div style="margin-top: 65px;">Pro Details<br /><b>' + data.ProName + '</b></div>'; 1950 else 1951 proDetails = ''; 1952 1953 cities.city = data.CityName 1954 cities.desc = '<div class="text-semibold">' + data.GolfLessonName + '</div>' 1955 1956 } 1957 1958 if (fromPage == "GADetails") { 1959 1960 if (data.GATimeFromAP != null) 1961 timefrom = '| ' + data.GATimeFromAP + ''; 1962 else 1963 timefrom = ''; 1964 1965 cities.city = data.CityName 1966 cities.desc = '<div class="text-semibold">' + data.GolfAcademyName + '</div>' 1967 1968 } 1969 1970 1971 if (fromPage == "GCDetails") { 1972 if (data.HasHotDeal != null) 1973 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1974 else 1975 hotDeal = ''; 1976 1977 if (data.GCTimeFromAP != null) 1978 timefrom = '| ' + data.GCTimeFromAP + ''; 1979 else 1980 timefrom = ''; 1981 if (data.Ratings != null && data.Ratings != undefined) { 1982 rating = data.Ratings; 1983 } 1984 else { 1985 rating = "NR"; 1986 } 1987 1988 cities.city = data.CityName 1989 cities.desc = '<div class="text-semibold">' + data.GolfCourseName + '</div>' 1990 1991 } 1992 if (fromPage == "TransfersDetails") { 1993 if (data.HasHotDeal != null) 1994 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 1995 else 1996 hotDeal = ''; 1997 1998 if (data.Ratings != null) 1999 rating = '| ' + data.Ratings + ''; 2000 else 2001 rating = ''; 2002 2003 cities.city = data.CityName 2004 cities.desc = '<div class="text-semibold">' + data.TransferTitle + '</div>' 2005 2006 } 2007 if (fromPage == "HotelDetails") { 2008 if (data.HasHotDeal != null) 2009 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 2010 else 2011 hotDeal = ''; 2012 2013 if (data.Ratings != null) 2014 rating = data.Ratings; 2015 else 2016 rating = ''; 2017 2018 cities.city = data.CityName 2019 cities.desc = '<div class="text-semibold">' + data.HotelName + '</div>' 2020 2021 } 2022 if (fromPage == "SightSeeingDetails") { 2023 if (data.HasHotDeal != null) 2024 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 2025 else 2026 hotDeal = ''; 2027 2028 if (data.Ratings != null) 2029 rating = '| ' + data.Ratings + ''; 2030 else 2031 rating = ''; 2032 2033 cities.city = data.CityName 2034 cities.desc = '<div class="text-semibold">' + data.SSTitle + '</div>' 2035 2036 2037 }
2038 if (fromPage == "GHDetails") { 2039 data.forEach(function (data) { 2040 imageURL = $rootScope.GlobalImagePaths.Gallery_ContentSlider_Path + data.FeaturedImgURL 2041 if (data.HasHotDeal != null) 2042 hotDeal = '<span class="btn-group hotDeal" ng-hide="!' + data.HasHotDeal + '"><button type="button" class="btn bg-red"><span class="fa fa-diamond"></span></button><button type="button" class="btn bg-orange" data-toggle="tooltip" data-placement="bottom" title="Awesome Value for Money & Special �Discounted Offers Inside!">HOT DEAL</button></span>'; 2043 else 2044 hotDeal = ''; 2045 2046 if (data.USRRating != null) 2047 rating = '| ' + data.USRRating + ''; 2048 else 2049 rating = ''; 2050 cities.city = data.CityName 2051 cities.country = data.CountryName; 2052 cities.desc = '<div class="text-semibold">' + data.HolidayName + '</div>' 2053 2054 }); 2055 }; 2056 if (fromPage == "CountryDetails") { 2057 cities.city = data.CountryName; 2058 cities.desc = '<div class="text-semibold">' + data.CountryName + '</div>' 2059 } 2060 if (fromPage == "CityDetails") { 2061 cities.city = data.CityName 2062 cities.desc = '<div class="text-semibold">' + data.CityName + '</div>' 2063 } 2064 if (fromPage != "GHDetails") { 2065 cities.lat = data.MapLatitude 2066 cities.long = data.MapLongitude 2067 createMarker(cities); 2068 } 2069 else { 2070 var i = 0; 2071 for (i = 0; i < data.length; i++) { 2072 cities.lat = data[i].MapLatitude; 2073 cities.long = data[i].MapLongitude; 2074 cities.city = data[i].CityName; 2075 cities.country = data[i].CountryName; 2076 createMarker(cities); 2077 } 2078 } 2079 2080 google.maps.event.trigger($rootScope.map1, 'resize', {}); 2081 $rootScope.openInfoWindow = function (e, selectedMarker) { 2082 2083 e.preventDefault(); 2084 google.maps.event.trigger(selectedMarker, 'click'); 2085 2086 $rootScope.map1.setCenter(myLatlng); 2087 } 2088 } 2089 $rootScope.Count = 0; 2090 $('#mapView').on('click', function () { 2091 $rootScope.Count = $rootScope.Count + 1; 2092 $("#mapModal").show(); 2093 if ($rootScope.Count == 1) { 2094 $rootScope.ShowviewMap($rootScope.ResForMap, $rootScope.PageName); 2095 } 2096 }); 2097 2098 $rootScope.ClearBookingCancelRequest = function () { 2099 $rootScope.GTCancelBookingId = undefined; 2100 $("#btnClose").click(); 2101 } 2102 2103 $rootScope.ViewCancelBookingRequest = function (BookingId, BookingType, IsMyAccount, frmmain) { 2104 $rootScope.BookingType = BookingType; 2105 if (frmmain == undefined || frmmain==null) 2106 { 2107 $rootScope.frmmain ="Isriview"; 2108 } 2109 else { 2110 $rootScope.frmmain = frmmain; 2111 } 2112 2113 $http({ url: "/Common/ViewCancelBookingRequest", data: { BookingId: BookingId, BookingType: $rootScope.BookingType }, method: "POST" }) 2114 .then(function (res) { 2115 $rootScope.CancelBookingInfo = res.data; 2116 2117 var x = _.where(res.data, { IsPrimary: true })[0]; 2118 2119 if (Util.isDataExists(x) && (x.ServiceTypeCode == 'GC' || x.ServiceTypeCode == 'GL')) { 2120 if ($rootScope.authenticated && $rootScope.AuthUserId != 0) { 2121 $rootScope.CancelPolicyInfo = _.where(res.data, { IsPrimary: true, CustomerClassificationCode: 'M' })[0]; 2122 } 2123 else { 2124 $rootScope.CancelPolicyInfo = _.where(res.data, { IsPrimary: true, CustomerClassificationCode: 'V' })[0]; 2125 } 2126 } 2127 else { 2128 $rootScope.CancelPolicyInfo = $rootScope.CancelBookingInfo[0]; 2129 } 2130 2131 $rootScope.CancelBookingInfoGCCount_M = _.where(res.data, { ServiceTypeCode: 'GC', CustomerClassificationCode: 'M' }).length; 2132 $rootScope.CancelBookingInfoGCCount_V = _.where(res.data, { ServiceTypeCode: 'GC', CustomerClassificationCode: 'V' }).length; 2133 $rootScope.CancelBookingInfoGCCount_O = _.where(res.data, { ServiceTypeCode: 'GC', CustomerClassificationCode: 'O' }).length; 2134 2135 $rootScope.CancelBookingInfoGC = _.uniq(_.where(res.data, { ServiceTypeCode: 'GC' }), function (item, key, ServiceID) { return item.ServiceID }); 2136 $rootScope.CancelBookingInfoGCProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'GC' }), function (item, key, ProductId) { return item.ProductId }); 2137 2138 $rootScope.CancelBookingInfoHOTEL = _.uniq(_.where(res.data, { ServiceTypeCode: 'HOTEL' }), function (item, key, ServiceID) { return item.ServiceID }); 2139 $rootScope.CancelBookingInfoHOTELProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'HOTEL' }), function (item, key, ProductId) { return item.ProductId }); 2140 2141 $rootScope.CancelBookingInfoSS = _.uniq(_.where(res.data, { ServiceTypeCode: 'SS' }), function (item, key, ServiceID) { return item.ServiceID }); 2142 $rootScope.CancelBookingInfoSSProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'SS' }), function (item, key, ProductId) { return item.ProductId }); 2143 2144 $rootScope.CancelBookingInfoTRANS = _.uniq(_.where(res.data, { ServiceTypeCode: 'TRANS' }), function (item, key, ServiceID) { return item.ServiceID }); 2145 $rootScope.CancelBookingInfoTRANSProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'TRANS' }), function (item, key, ProductId) { return item.ProductId }); 2146 2147 $rootScope.CancelBookingInfoGLCount_M = _.where(res.data, { ServiceTypeCode: 'GL', CustomerClassificationCode: 'M' }).length; 2148 $rootScope.CancelBookingInfoGLCount_V = _.where(res.data, { ServiceTypeCode: 'GL', CustomerClassificationCode: 'V' }).length; 2149 $rootScope.CancelBookingInfoGLCount_O = _.where(res.data, { ServiceTypeCode: 'GL', CustomerClassificationCode: 'O' }).length; 2150 2151 $rootScope.CancelBookingInfoGL = _.uniq(_.where(res.data, { ServiceTypeCode: 'GL' }), function (item, key, ServiceID) { return item.ServiceID }); 2152 $rootScope.CancelBookingInfoGLProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'GL' }), function (item, key, ProductId) { return item.ProductId }); 2153 2154 $rootScope.CancelBookingInfoGT = _.uniq(_.where(res.data, { ServiceTypeCode: 'GT' }), function (item, key, ServiceID) { return item.ServiceID }); 2155 $rootScope.CancelBookingInfoGTProd = _.uniq(_.where(res.data, { ServiceTypeCode: 'GT' }), function (item, key, ProductId) { return item.ProductId }); 2156 2157 if (IsMyAccount != undefined) { 2158 $timeout(function () { 2159 $rootScope.ConvertCurrency('CPolicy'); 2160 }, 500); 2161 } 2162 2163 }, function (error) { 2164 }).finally(function () { });
2165 } 2166 //Added for removing Special Remarks 2167 $rootScope.RemoveSpecialRemark = function (GTTxBookingServicesId) { 2168 $http({ url: "/Common/RemoveSpecialRemark", data: { GTTxBookingServicesId: GTTxBookingServicesId }, method: "POST" }) 2169 .then(function (res) { 2170 if (res.data == "Success") { 2171 alert("Special Remarks or Request removed Successfully"); 2172 } else { 2173 alert("Unable to delete Special Remarks or Request"); 2174 } 2175 }, function (error) { 2176 }).finally(function () { }); 2177 } 2178 2179 $rootScope.SaveCancelBookingRequest = function (BookingId, BookingType) { 2180 $rootScope.loading = true; 2181 $http({ url: "/Common/SaveGTBookingReqCancellation", data: { BookingId: BookingId, BookingType: BookingType }, method: "POST" }) 2182 .then(function (res) { 2183 alert("Request Cancelled Successfully."); 2184 $rootScope.loading = false; 2185 $("#btnClose").click(); 2186 window.location.reload(); 2187 }, function (error) { 2188 $rootScope.loading = false; 2189 }).finally(function () { });
2190 } 2191 //End of Cancellation Policy 2192 2193 2194 //$rootScope.GoToDeals = function (ServiceTypeCode) { 2195 // //debugger; 2196 // var ServiceCode = $("<input type='hidden' name='ServiceTypeCode' value='" + ServiceTypeCode + "'></input>"); 2197 // document.getElementById('FrmDealsAndDiscount').appendChild(ServiceCode[0]); 2198 // document.getElementById('FrmDealsAndDiscount').method = "post"; 2199 // document.getElementById('FrmDealsAndDiscount').action = "/deals-discounts"; 2200 // document.getElementById('FrmDealsAndDiscount').submit(); 2201 //} 2202 2203 2204 }]).filter('html', ['$sce', function ($sce) { 2205 return function (val) { 2206 return $sce.trustAsHtml(val); 2207 }; 2208 }]).config(['pikadayConfigProvider', function (pikaday) { 2209 pikaday.setConfig({ 2210 //format: "MM/DD/YYYY" 2211 format: "DD-MMM-YYYY", 2212 yearRange: 70 2213 }); 2214 }]) 2215 .filter('toArray', function () { 2216 return function (obj, addKey) { 2217 if (!(obj instanceof Object)) { 2218 return obj; 2219 } 2220 2221 if (addKey === false) { 2222 return Object.values(obj); 2223 } else { 2224 return Object.keys(obj).map(function (key) { 2225 return Object.defineProperty(obj[key], '$key', { enumerable: false, value: key }); 2226 }); 2227 } 2228 }; 2229 }) 2230 2231 .filter('range', function () { 2232 2233 return function (input, total) { 2234 total = parseInt(total); 2235 for (var i = 0; i < total; i++) 2236 input.push(i); 2237 return input; 2238 }; 2239 2240 }) 2241 .filter('rawHtml', ['$sce', function ($sce) { 2242 return function (val) { 2243 return $sce.trustAsHtml(val); 2244 }; 2245 }]).filter("FormatDate", function () { 2246 2247 return function (dtDate) { 2248 if (dtDate != null) 2249 return Util.parseJsonDate(dtDate, true); 2250 }; 2251 2252 }).directive('currency', function () { 2253 2254 return { 2255 restrict: 'AEC', 2256 scope: { 2257 code: '@', 2258 value: '@' 2259 2260 }, 2261 template: '<h4 ng-show="false"><span class="currencyCode">{{code}}</span> <span class="currencyValue">{{value}}</span></h4> <span class="tocurrencyCode" style="display:none">{{code}}</span> <span style="display:none" class="tocurrencyValue">{{value}}</span>' 2262 } 2263 }).directive('loading', function () { 2264 return { 2265 restrict: 'AE', 2266 replace: 'true', 2267 template: '<div ng-show="loading"><div class="loader"> <div style="margin-left:40px;">Loading...</div></div><div class="modal-backdrop fade in" style="z-index:1054; background-color:rgba(0,0,0,0.5)"></div></div>' 2268 }; 2269 }); 2270//.directive('dealcode', function () { 2271 2272// return { 2273// restrict: 'AEC', 2274// scope: { 2275// code: '@', 2276// value: '@' 2277 2278// }, 2279// template: '<div class="size13 text-gray" style="margin:5px 0 15px 0;" ng-repeat="dealItem in dealCodeList>{{dealItem.DCDesc}}</div>' 2280// }) 2281 2282 2283 2284 2285(function () { 2286 'use strict'; 2287 2288 angular.module('HomeApp', ['WSGlobalApp']) 2289 .controller('defaultController', defaultController); 2290 2291 defaultController.$inject = ['$scope']; 2292 2293 2294 function defaultController($scope) { 2295 2296 } 2297})(); 2298 2299//Angular Cache Code 2300 2301//$http.get(url, { cache: true}).success(...); 2302 2303//$http({ cache: true, url: url, method: 'GET'}).success(...); 2304 2305//var cache = $cacheFactory('myCache'); 2306 2307//var data = cache.get(someKey); 2308 2309//if (!data) { 2310// $http.get(url).success(function(result) { 2311// data = result; 2312// cache.put(someKey, data); 2313// });
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.