https://www.fongphotography.online/sy-inc/store/manage.packages.js?0d6a07403b8fe83ff73a9dcbd3ef7c0eb
1function adjustphotodisplayheightformanagepackage() { 2 // $("#log").show().append("display: "+$("#viewimagemanagepackage").css("display")+" lenngth: "+$("#mainpackagecontainer").length+" <br>"); 3 if($("#mainpackagecontainer").length > 0) { 4 // if($("#vinfo").attr("data-view-photo-height-adjusted") != "1") { 5 $("#vinfo").attr("data-view-photo-height-adjusted",'1'); 6 // alert($("#viewimagemanagepackage").length); 7 mainpackagecontainerheight = Math.round($("#mainpackagecontainer").height()) - 8; 8 /* 9 photoviewactionsheight = $("#thephotocontainer").outerHeight(true); 10 photoviewnameclose = $("#thephotocontainer").offset().top; 11 newheight = Math.round(photoviewactionsheight - mainpackagecontainerheight - 4); 12 */ 13 // $("#log").show().append(" "+photoviewactionsheight+" - "+photoviewnameclose+" "+newheight+"<br>"); 14 15 16 17 carttab = $("#managepackagecarttab").height(); 18 gsbottom = Math.round($("#mainpackagecontainer").height() - carttab); 19 $("#selectgsbackground").css({"bottom": gsbottom+"px"}); 20 21 22 23 ww = $(window).width(); 24 if(ww < 1024) { 25 $(document.body).append('<style>.thephotocontainer { height: 50VH !important; } </style>'); 26 $(".thephotocontainer").css({"height":"50VH"}); 27 } else { 28 $(document.body).append('<style>.thephotocontainer { height: 60VH !important; } </style>'); 29 $(".thephotocontainer").css({"height":"60VH"}); 30 31 } 32 // } 33 } else { 34 ww = $(window).width(); 35 if(ww < 1024) { 36 $(document.body).append('<style>.thephotocontainer { height: 60VH !important; } </style>'); 37 $(".thephotocontainer").css({"height":"60VH"}); 38 } else { 39 $(document.body).append('<style>.thephotocontainer { height: 70VH !important; } </style>'); 40 $(".thephotocontainer").css({"height":"70VH"}); 41 } 42 } 43} 44 45function addphototopackageitemclick(cart_id,prod_id,cart_package_photo,package_limit) { 46 pic_key = $("#vinfo").attr("data-pic-key"); 47 color_id = $("#filter").attr("color_id"); 48 sub_id = $("#photoview-"+pic_key).attr("data-sub-id"); 49 date_id = $("#photoview-"+pic_key).attr("data-date-id"); 50 cart_photo_bg = $("#gs-bgimage-id").val(); 51 52 qty = 1; 53 54 if($("#package-item-"+cart_id).attr("data-has-image") == "1") { 55 return false; 56 } 57 58 if(pic_key == "") { 59 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 60 } else { 61 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=addPackageItem&cart_id="+cart_id+"&pic_key="+pic_key+"&date_id="+date_id+"&qty="+qty+"&color_id="+color_id+"&photo_prod="+prod_id+"&cart_package_photo="+cart_package_photo+"&singleclick=1&package_limit="+package_limit+"&sub_id="+sub_id+"&cart_photo_bg="+cart_photo_bg, function(data) { 62 63 thisdata = data.split("||"); 64 65 66 if(thisdata[0] == "ERROR") { 67 managepackageshowerrormessage(thisdata[1]); 68 69 70 } else { 71 thisdata[1].split(",").forEach(function (cart_id) { 72 $("#package-item-"+cart_id).css({"background-image":"url('"+thisdata[2]+"')","background-size":"contain","background-position":"center center", "width":thisdata[3]+"px"}); 73 // closemanagepackageproduct(); 74 $("#deletepackageitemicon-"+cart_id).show(); 75 $("#package-item-"+cart_id).attr("data-has-image","1"); 76 $("#package-item-"+cart_id).attr("data-pic-id",thisdata[4]); 77 78 }); 79 80 // getpackagestats(cart_package_photo); 81 82 83 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=getPackageStats&cart_id="+cart_package_photo, function(data) { 84 thisdata = data.split("||"); 85 $("#packagestats-"+cart_package_photo).html(thisdata[0]); 86 if(thisdata[1] == "COMPLETE") { 87 if($("#packagecompletehtml-"+cart_package_photo).attr("data-show-addons") == "1") { 88 managePackageExtraPhotos(cart_package_photo); 89 } else { 90 message = $("#packagecompletehtml-"+cart_package_photo).html(); 91 $("#packagemessagebg").fadeIn(50); 92 managepackageshowmessage(message); 93 } 94 } else { 95 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_added_to_package_")); 96 } 97 }); 98 } 99 }); 100 } 101} 102 103 104 105 106 107 108 109 110function addextraphototocart() { 111 stop_process = false; 112 var fields = {}; 113 fields['action'] = "addExtraPhotoToCart"; 114 fields['cart_id'] = $("#package-cart-id").val(); 115 fields['pic_key'] = $("#package-photo-pic-key").val(); 116 fields['color_id'] = $("#filter").attr("color_id"); 117 fields['sub_id'] = $("#photoview-"+$("#package-photo-pic-key").val()).attr("data-sub-id"); 118 fields['date_id'] = $("#photoview-"+$("#package-photo-pic-key").val()).attr("data-date-id"); 119 120 fields['qty'] = $("#package-photo-qty").val(); 121 fields['cart_package_photo'] = $("#package-photo-package-cart-id").val(); 122 fields['photo_prod'] = $("#package-photo-prod-id").val(); 123 fields['list_id'] = $("#package-photo-list-id").val(); 124 fields['cart_photo_bg'] = $("#gs-bgimage-id").val(); 125 126 cart_id = $("#package-cart-id").val(); 127 cart_package_photo = $("#package-photo-package-cart-id").val(); 128 129 $("#managepackagerequiredfieldserror").hide(); 130 131 132 $('.packageimageoption').each(function(){ 133 var $this = $(this); 134 if( $this.attr('type') == "radio") { 135 if($this.attr("checked")) { 136 fields[$this.attr('name')] = $this.val(); 137 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 138 } 139 } else if($this.attr('type') == "checkbox") { 140 if($this.attr("checked")) { 141 fields[$this.attr('name')] = $this.val(); 142 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 143 } 144 145 } else { 146 fields[$this.attr('name')] = $this.val(); 147 // alert($this.attr('name') +" = "+ $this.val() ); 148 } 149 }); 150 $('.packageproductoption').each(function(){ 151 var $this = $(this); 152 $this.removeClass("inputError"); 153 154 if( $this.attr('type') == "radio") { 155 if($this.attr("checked")) { 156 fields[$this.attr('name')] = $this.val(); 157 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 158 } 159 } else if($this.attr('type') == "checkbox") { 160 if($this.attr("checked")) { 161 fields[$this.attr('name')] = $this.val(); 162 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 163 } 164 165 } else { 166 167 if($this.hasClass("required")) { 168 if($this.val() == "") { 169 $this.addClass("inputError"); 170 stop_process = true; 171 // $("#log").show().append($this.attr('name')+" is required"); 172 } 173 } 174 175 fields[$this.attr('name')] = $this.val(); 176 // alert($this.attr('name') +" = "+ $this.val() ); 177 } 178 }); 179 180 181 if(stop_process == true) { 182 $("#managepackagerequiredfieldserror").slideDown(100); 183 } else if($("#package-photo-pic-key").val() == "") { 184 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 185 } else { 186 187 $("#addphototopackageloading").show(); 188 $("#addphototopackagebutton").hide(); 189 190 $.post(tempfolder+'/sy-inc/store/store_manage_package.php', fields, function (data) { 191 cart_id = $("#package-cart-id").val(); 192 thisdata = data.split("||"); 193 194 date_id = $("#vinfo").attr('did'); 195 list_id = ''+$("#list_id").val()+''; 196 197 $.get(tempfolder+"/sy-inc/store/store_manage_package_items.php?date_id="+date_id+"&list_id="+list_id, function(data) { 198 $("#viewimagemanagepackage").html(data).show(); 199 $('#packagecontainer').animate({scrollLeft: $('#package-item-'+cart_id).position().left}, 500); 200 setTimeout(function() { 201 managePackageExtraPhotos(cart_id); 202 }, 100); 203 // closemanagepackageproduct(); 204 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_added_to_package_")); 205 getpackagestats(cart_package_photo); 206 }); 207 208 209 }); 210 } 211} 212 213 214 215 216 217function addextraphototocartpreorder() { 218 stop_process = false; 219 var fields = {}; 220 fields['action'] = "addExtraPhotoToCartPreOrder"; 221 fields['cart_id'] = $("#package-cart-id").val(); 222 223 fields['date_id'] = $("#vinfo").attr("did"); 224 fields['qty'] = $("#package-photo-qty").val(); 225 fields['cart_package_photo'] = $("#package-photo-package-cart-id").val(); 226 fields['photo_prod'] = $("#package-photo-prod-id").val(); 227 fields['list_id'] = $("#package-photo-list-id").val(); 228 fields['cart_photo_bg'] = $("#gs-bgimage-id").val(); 229 fields['reg_key'] = $("#regid").val(); 230 231 cart_id = $("#package-cart-id").val(); 232 cart_package_photo = $("#package-photo-package-cart-id").val(); 233 234 $("#managepackagerequiredfieldserror").hide(); 235 236 237 $('.packageimageoption').each(function(){ 238 var $this = $(this); 239 if( $this.attr('type') == "radio") { 240 if($this.attr("checked")) { 241 fields[$this.attr('name')] = $this.val(); 242 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 243 } 244 } else if($this.attr('type') == "checkbox") { 245 if($this.attr("checked")) { 246 fields[$this.attr('name')] = $this.val(); 247 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 248 } 249 250 } else { 251 fields[$this.attr('name')] = $this.val(); 252 // alert($this.attr('name') +" = "+ $this.val() ); 253 } 254 }); 255 $('.packageproductoption').each(function(){ 256 var $this = $(this); 257 $this.removeClass("inputError"); 258 259 if( $this.attr('type') == "radio") { 260 if($this.attr("checked")) { 261 fields[$this.attr('name')] = $this.val(); 262 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 263 } 264 } else if($this.attr('type') == "checkbox") { 265 if($this.attr("checked")) { 266 fields[$this.attr('name')] = $this.val(); 267 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 268 } 269 270 } else { 271 272 if($this.hasClass("required")) { 273 if($this.val() == "") { 274 $this.addClass("inputError"); 275 stop_process = true; 276 // $("#log").show().append($this.attr('name')+" is required"); 277 } 278 } 279 280 fields[$this.attr('name')] = $this.val(); 281 // alert($this.attr('name') +" = "+ $this.val() ); 282 } 283 }); 284 285 286 if(stop_process == true) { 287 alert("requiredfields"); 288 $("#managepackagerequiredfieldserror").slideDown(100); 289 } else { 290 291 $("#addphototopackageloading").show(); 292 $("#addphototopackagebutton").hide(); 293 294 $.post(tempfolder+'/sy-inc/store/store_manage_package.php', fields, function (data) { 295 cart_id = $("#package-cart-id").val(); 296 thisdata = data.split("||"); 297 298 date_id = $("#vinfo").attr('did'); 299 list_id = ''+$("#list_id").val()+''; 300 301 preOrderManagePackageExtraPhotos(cart_id); 302 /* 303 $.get(tempfolder+"/sy-inc/store/store_manage_package_items_pre_order.php?date_id="+date_id+"&list_id="+list_id, function(data) { 304 $("#viewimagemanagepackage").html(data).show(); 305 $('#packagecontainer').animate({scrollLeft: $('#package-item-'+cart_id).position().left}, 500); 306 setTimeout(function() { 307 // preOrderManagePackageExtraPhotos(cart_id); 308 }, 100); 309 // closemanagepackageproduct(); 310 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_added_to_package_")); 311 getpackagestats(cart_package_photo); 312 }); 313 */ 314 315 }); 316 } 317} 318 319 320function addphototopackageitem() { 321 stop_process = false; 322 var fields = {}; 323 fields['action'] = "addPackageItem"; 324 fields['cart_id'] = $("#package-photo-cart-id").val(); 325 fields['pic_key'] = $("#package-photo-pic-key").val(); 326 fields['color_id'] = $("#filter").attr("color_id"); 327 fields['sub_id'] = $("#photoview-"+$("#package-photo-pic-key").val()).attr("data-sub-id"); 328 fields['date_id'] = $("#photoview-"+$("#package-photo-pic-key").val()).attr("data-date-id"); 329 330 fields['qty'] = $("#package-photo-qty").val(); 331 fields['cart_package_photo'] = $("#package-photo-package-cart-id").val(); 332 fields['photo_prod'] = $("#package-photo-photo-prod").val(); 333 fields['list_id'] = $("#package-photo-list-id").val(); 334 fields['cart_photo_bg'] = $("#gs-bgimage-id").val(); 335 cart_id = $("#package-photo-cart-id").val(); 336 cart_package_photo = $("#package-photo-package-cart-id").val(); 337 338 $("#managepackagerequiredfieldserror").hide(); 339 340 341 $('.packageimageoption').each(function(){ 342 var $this = $(this); 343 if( $this.attr('type') == "radio") { 344 if($this.attr("checked")) { 345 fields[$this.attr('name')] = $this.val(); 346 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 347 } 348 } else if($this.attr('type') == "checkbox") { 349 if($this.attr("checked")) { 350 fields[$this.attr('name')] = $this.val(); 351 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 352 } 353 354 } else { 355 fields[$this.attr('name')] = $this.val(); 356 // alert($this.attr('name') +" = "+ $this.val() ); 357 } 358 }); 359 $('.packageproductoption').each(function(){ 360 var $this = $(this); 361 $this.removeClass("inputError"); 362 363 if( $this.attr('type') == "radio") { 364 if($this.attr("checked")) { 365 fields[$this.attr('name')] = $this.val(); 366 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 367 } 368 } else if($this.attr('type') == "checkbox") { 369 if($this.attr("checked")) { 370 fields[$this.attr('name')] = $this.val(); 371 // alert($this.attr('name')+': '+ $this.attr('type')+' CHECKED- '+$this.val()); 372 } 373 374 } else { 375 376 if($this.hasClass("required")) { 377 if($this.val() == "") { 378 $this.addClass("inputError"); 379 stop_process = true; 380 // $("#log").show().append($this.attr('name')+" is required"); 381 } 382 } 383 384 fields[$this.attr('name')] = $this.val(); 385 // alert($this.attr('name') +" = "+ $this.val() ); 386 } 387 }); 388 389 390 if(stop_process == true) { 391 $("#managepackagerequiredfieldserror").slideDown(100); 392 } else if($("#package-photo-pic-key").val() == "") { 393 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 394 } else { 395 396 $("#addphototopackageloading").show(); 397 $("#addphototopackagebutton").hide(); 398 399 $.post(tempfolder+'/sy-inc/store/store_manage_package.php', fields, function (data) { 400 thisdata = data.split("||"); 401 thisdata[1].split(",").forEach(function (cart_id) { 402 $("#package-item-"+cart_id).attr("data-has-image","1"); 403 $("#package-item-"+cart_id).attr("data-pic-id",thisdata[4]); 404 405 $("#package-item-"+cart_id).css({"background-image":"url('"+thisdata[2]+"')","background-size":"contain","background-position":"center center", "width":thisdata[3]+"px"}); 406 $("#deletepackageitemicon-"+cart_id).show(); 407 $('html, body').animate({ 408 scrollTop: 0 409 }, 200); 410 updateCartMenu(); 411 412 }); 413 // $("#package-item-"+cart_id).css({"background-image":"url('"+thisdata[2]+"')","background-size":"contain","background-position":"center center", "width":thisdata[3]+"px"}); 414 closemanagepackageproduct(); 415 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_added_to_package_")); 416 417 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=getPackageStats&cart_id="+cart_package_photo, function(data) { 418 thisdata = data.split("||"); 419 $("#packagestats-"+cart_package_photo).html(thisdata[0]); 420 if(thisdata[1] == "COMPLETE") { 421 if($("#packagecompletehtml-"+cart_package_photo).attr("data-show-addons") == "1") { 422 setTimeout(function() { 423 managePackageExtraPhotos(cart_package_photo); 424 }, 300); 425 } else { 426 427 message = $("#packagecompletehtml-"+cart_package_photo).html(); 428 $("#packagemessagebg").fadeIn(50); 429 managepackageshowmessage(message); 430 } 431 } else { 432 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_added_to_package_")); 433 } 434 }); 435 436 }); 437 } 438} 439function getpackagestats(cart_id) { 440 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=getPackageStats&cart_id="+cart_id, function(data) { 441 thisdata = data.split("||"); 442 $("#packagestats-"+cart_id).html(thisdata[0]); 443 444 }); 445 446 447} 448 449function managepackageproduct(cart_id) { 450 if($("#package-item-"+cart_id).attr("data-has-image") == "1") { 451 return false; 452 } 453 454 if($("#selectgsbackground").length > 0) { 455 gsbottom = 12; 456 } else { 457 gsbottom = 0; 458 } 459 460 newbottom = Math.round($("#mainpackagecontainer").height()) + 8 + gsbottom; 461 // $("#log").show().append(newbottom+"<br>"); 462 $('html, body').animate({ 463 scrollTop: 0 464 }, 100); 465�
465 466 467 pic_id = $("#vinfo").attr("data-pic-key"); 468 sub_id = $("#photoview-"+pic_id).attr("data-sub-id"); 469 did = $("#photoview-"+pic_id).attr("data-date-id"); 470 cart_photo_bg = $("#gs-bgimage-id").val(); 471 472 473 if(pic_id == "") { 474 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 475 } else { 476 $("#packageitemwindowbg").show(); 477 478 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=managePackageItem&cart_id="+cart_id+"&pic_id="+pic_id+"&did="+did+"&sub_id="+sub_id+"&cart_photo_bg="+cart_photo_bg, function(data) { 479 $("#packageitemcontent").html(data); 480 $("#packageitemwindow").css({"bottom":newbottom+"px", "top":"auto"}).fadeIn(100); 481 482 packagewindowtop = $("#packageitemwindow").offset().top; 483 if(packagewindowtop < 0) { 484 $("#packageitemwindow").css({"bottom":"auto","top":"8px"}); 485 } else { 486 $("#packageitemwindow").css({"top":"auto"}); 487 } 488 // $("#log").show().append(packagewindowtop+"<br>"); 489 490 }); 491 } 492} 493 494function managePackageExtraPhotos(cart_id) { 495 if($("#selectgsbackground").length > 0) { 496 gsbottom = 12; 497 } else { 498 gsbottom = 0; 499 } 500 managepackagecancelmessage(); 501 newbottom = Math.round($("#mainpackagecontainer").height()) + 8 + gsbottom; 502 // $("#log").show().append(newbottom+"<br>"); 503 $('html, body').animate({ 504 scrollTop: 0 505 }, 100); 506 507 508 pic_id = $("#vinfo").attr("data-pic-key"); 509 sub_id = $("#photoview-"+pic_id).attr("data-sub-id"); 510 did = $("#photoview-"+pic_id).attr("data-date-id"); 511 512 513 if(pic_id == "") { 514 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 515 } else { 516 $("#packageitemwindowbg").show(); 517 518 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=managePackageExtraPhotos&cart_id="+cart_id+"&pic_id="+pic_id+"&did="+did+"&sub_id="+sub_id, function(data) { 519 $("#packageitemcontent").html(data); 520 $("#packageitemwindow").css({"bottom":newbottom+"px", "top":"auto"}).fadeIn(100); 521 522 packagewindowtop = $("#packageitemwindow").offset().top; 523 if(packagewindowtop < 0) { 524 $("#packageitemwindow").css({"bottom":"auto","top":"8px"}); 525 } else { 526 $("#packageitemwindow").css({"top":"auto"}); 527 } 528 // $("#log").show().append(packagewindowtop+"<br>"); 529 530 }); 531 } 532} 533 534function managePackageExtraPhotoProduct(prod_id,package_cart_id) { 535 536 newbottom = Math.round($("#mainpackagecontainer").height()) + 8; 537 // $("#log").show().append(newbottom+"<br>"); 538 $('html, body').animate({ 539 scrollTop: 0 540 }, 100); 541 542 543 pic_id = $("#vinfo").attr("data-pic-key"); 544 sub_id = $("#photoview-"+pic_id).attr("data-sub-id"); 545 did = $("#photoview-"+pic_id).attr("data-date-id"); 546 547 548 if(pic_id == "") { 549 managepackageshowerrormessage($("#mainpackagecontainer").attr("data-no-photo-selected")); 550 } else { 551 $("#packageitemwindowbg").show(); 552 553 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=managePackageExtraPhotoProduct&cart_id="+package_cart_id+"&pic_id="+pic_id+"&did="+did+"&sub_id="+sub_id+"&prod_id="+prod_id, function(data) { 554 $("#packageitemcontent").html(data); 555 $("#packageitemwindow").css({"bottom":newbottom+"px", "top":"auto"}).fadeIn(100); 556 557 packagewindowtop = $("#packageitemwindow").offset().top; 558 if(packagewindowtop < 0) { 559 $("#packageitemwindow").css({"bottom":"auto","top":"8px"}); 560 } else { 561 $("#packageitemwindow").css({"top":"auto"}); 562 } 563 // $("#log").show().append(packagewindowtop+"<br>"); 564 565 }); 566 } 567 568} 569 570 571function closemanagepackageproduct() { 572 $("#packageitemwindow").fadeOut(100); 573 setTimeout(function() { 574 $("#packageitemwindowbg").fadeOut(100); 575 }, 100); 576} 577function removephotofrompackageitemconfirm(cart_id) { 578 closemanagepackageproduct(); 579 pic_id = $("#package-item-"+cart_id).attr("data-pic-id"); 580 cart_package_photo = $("#package-item-"+cart_id).attr("data-cart-package-photo"); 581 package_limit = $("#package-item-"+cart_id).attr("data-package-limit"); 582 583 var piccount = 0; 584 $(".availableproduct").each(function() { 585 if($(this).attr("data-pic-id") == pic_id && $(this).attr("data-cart-package-photo") == cart_package_photo) { 586 piccount++; 587 } 588 }); 589 590 if(package_limit == "1") { 591 $(".deletepackageitemallphotoscheckbox").attr("checked",false); 592 $(".deletepackageitemallphotos").hide(); 593 } else { 594 if(piccount > 1) { 595 $(".deletepackageitemallphotos").show(); 596 } else { 597 $(".deletepackageitemallphotos").hide(); 598 } 599 } 600 // $("#log").show().append(piccount+"<br>"); 601 602 message = $("#deletepackageitemhtml-"+cart_id).html(); 603 $("#packagemessagebg").fadeIn(50); 604 managepackageshowmessage(message); 605 606} 607 608 609 610 611function deleteextraphoto(cart_id,cart_package_photo) { 612 613 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=deleteExtraPhoto&cart_id="+cart_id, function(data) { 614 date_id = $("#vinfo").attr('did'); 615 list_id = ''+$("#list_id").val()+''; 616 $.get(tempfolder+"/sy-inc/store/store_manage_package_items.php?date_id="+date_id+"&list_id="+list_id, function(data) { 617 $("#viewimagemanagepackage").html(data).show(); 618 $('#packagecontainer').animate({scrollLeft: $('#package-item-'+cart_package_photo).position().left}, 500); 619 closemanagepackageproduct(); 620 setTimeout(function() { 621 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_removed_from_package_")); 622 }, 100); 623 624 }); 625 626 }); 627 628} 629 630 631function removephotofrompackageitem(cart_id,cart_package_photo) { 632 pic_id = $("#package-item-"+cart_id).attr("data-pic-id"); 633 cart_package_photo = $("#package-item-"+cart_id).attr("data-cart-package-photo"); 634 var cart_ids = ""; 635 var piccount = 0; 636 $(".availableproduct").each(function() { 637 if($(this).attr("data-pic-id") == pic_id && $(this).attr("data-cart-package-photo") == cart_package_photo) { 638 piccount++; 639 if(piccount == 1) { 640 cart_ids = $(this).attr("data-cart-id"); 641 } else { 642 cart_ids = cart_ids+","+$(this).attr("data-cart-id"); 643 } 644 } 645 }); 646 if($("#deletepackageitemallphotos-"+cart_id).attr("checked")) { 647 var removeallphotos = 1; 648 } else { 649 var removeallphotos = 0; 650 } 651 652 // $("#log").show().append("remove all photos: "+removeallphotos+" "+" cart_ids: "+cart_ids+"<br>"); 653 654 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=removePhotoFromPackageItem&cart_id="+cart_id+"&removeallphotos="+removeallphotos, function(data) { 655 656 thisdata = data.split("||"); 657 thisdata[0].split(",").forEach(function (this_cart_id) { 658 // $("#log").show().append(this_cart_id+"<br>"); 659 if($("#package-item-"+this_cart_id).attr("data-cart-extra-photo") > 0) { 660 $("#package-item-"+this_cart_id).remove(); 661 } else { 662 $("#package-item-"+this_cart_id).css({"background-image":"url("+$("#mainpackagecontainer").attr("data-blank-item-graphic")+"","background-size":"contain","background-position":"center center", "width":"80px"}); 663 $("#deletepackageitemicon-"+this_cart_id).hide(); 664 $("#package-item-"+this_cart_id).attr("data-has-image","0"); 665 $("#package-item-"+this_cart_id).attr("data-pic-id",""); 666 } 667 }); 668 getpackagestats(cart_package_photo); 669 updateCartMenu(); 670 managepackageshownotice($("#mainpackagecontainer").attr("data_photo_removed_from_package_")); 671 $("#packagemessagebg").fadeOut(50); 672 673 674 }); 675} 676function managepackagedeletepackage(cart_id) { 677 closemanagepackageproduct(); 678 message = $("#deletepackageconfirmhtml-"+cart_id).html(); 679 $("#packagemessagebg").fadeIn(50); 680 681 managepackageshowmessage(message) 682} 683 684function managepackagedeletepackageconfirm(cart_id) { 685 $.get(tempfolder+"/sy-inc/store/store_manage_package.php?action=managepackagedeletepackage&cart_id="+cart_id, function(data) { 686 data = $.trim(data); 687 updateCartMenu(); 688 picviewed = $("#vinfo").attr("data-pic-key"); 689 if(picviewed !== "") { 690 backtoproductlist('',''); 691 }
692 // $("#log").show().append("Packages: ["+data+"]<br>"); 693 694 if(data == "0") { 695 $("#viewimagemanagepackage").html("").hide(); 696 adjustphotodisplayheightformanagepackage(); 697 698 gsbottom = $(".viewimageshoppingcart:visible").outerHeight(); 699 $("#selectgsbackground").css({"bottom": gsbottom+"px"}); 700 701 702 703 } else { 704 705 date_id = $("#vinfo").attr('did'); 706 list_id = ''+$("#list_id").val()+''; 707 $.get(tempfolder+"/sy-inc/store/store_manage_package_items.php?date_id="+date_id+"&list_id="+list_id, function(data) { 708 $("#viewimagemanagepackage").html(data).show(); 709 adjustphotodisplayheightformanagepackage(); 710 $("#packagemessagebg").fadeOut(50); 711 712 }); 713 } 714 }); 715} 716var timeoutid; 717 718function managepackageshownotice(message) { 719 $("#packageactionerrormessage").hide(); 720 carttab = $("#managepackagecarttab").height(); 721 if($("#selectgsbackground").length > 0) { 722 gsbottom = 8; 723 } else { 724 gsbottom = 0; 725 } 726 newbottom = Math.round($("#mainpackagecontainer").height()) - 8 - carttab; 727 // $("#log").show().append("gs: "+gsbottom+"| "+newbottom+"<br>"); 728 $("#packageactionmessages").css({"bottom":newbottom+"px", "padding-bottom":(carttab*2) + gsbottom+"px"}); 729 $("#packageactionmessages").html(message); 730 731 if($("#packageactionmessages").attr("data-displaying") == "1") { 732 $("#packageactionmessages").attr("data-displaying","0"); 733 $("#packageactionmessages").hide(); 734 if(timeoutid) { 735 clearTimeout(timeoutid); 736 } 737 } 738 739 $("#packageactionmessages").slideDown(100, function() { 740 $("#packageactionmessages").attr("data-displaying","1"); 741 }); 742 743 timeoutid = setTimeout(function() { 744 if($("#packageactionmessages").attr("data-displaying") == "1") { 745 $("#packageactionmessages").slideUp(100, function() { 746 $("#packageactionmessages").attr("data-displaying","0"); 747 }); 748 } 749 }, 1600); 750 751} 752 753 754function managepackageshowmessage(message) { 755 $("#packageactionerrormessage").hide(); 756 carttab = $("#managepackagecarttab").height(); 757 if($("#selectgsbackground").length > 0) { 758 gsbottom = 8; 759 } else { 760 gsbottom = 0; 761 } 762 clearTimeout(timeoutid); 763 764 newbottom = Math.round($("#mainpackagecontainer").height()) - 8- carttab; 765 766 // $("#log").show().append(newbottom+"<br>"); 767 $("#packageactionmessages").css({"bottom":newbottom+"px", "padding-bottom":(carttab*2) + gsbottom+"px"}); 768 $("#packageactionmessages").html(message); 769 770 if($("#packageactionmessages").attr("data-displaying") == "1") { 771 $("#packageactionmessages").attr("data-displaying","0"); 772 $("#packageactionmessages").hide(); 773 clearTimeout(timeoutid); 774 } 775 776 $("#packageactionmessages").slideDown(100, function() { 777 $("#packageactionmessages").attr("data-displaying","1"); 778 }); 779 /* 780 timeoutid = setTimeout(function() { 781 if($("#packageactionmessages").attr("data-displaying") == "1") { 782 $("#packageactionmessages").slideUp(100, function() { 783 $("#packageactionmessages").attr("data-displaying","0"); 784 }); 785 } 786 }, 1000); 787 */ 788} 789function managepackageshowerrormessage(message) { 790 $("#packageactionerrormessage").hide(); 791 carttab = $("#managepackagecarttab").height(); 792 newbottom = Math.round($("#mainpackagecontainer").height()) - 8 - carttab; 793 // $("#log").show().append(carttab+"<br>"); 794 795 if($("#selectgsbackground").length > 0) { 796 gsbottom = 8; 797 } else { 798 gsbottom = 0; 799 } 800 801 $("#packageactionerrormessage").css({"bottom":newbottom+"px", "padding-bottom":(carttab*2) + gsbottom+"px"}); 802 $("#packageactionerrormessagemessage").html(message); 803 804 $("#packageactionerrormessagemessage").html(message); 805 806 if($("#packageactionerrormessage").attr("data-displaying") == "1") { 807 $("#packageactionmessages").attr("data-displaying","0"); 808 $("#packageactionmessages").hide(); 809 clearTimeout(timeoutid); 810 } 811 812 $("#packageactionerrormessage").slideDown(100, function() { 813 $("#packageactionmessages").attr("data-displaying","1"); 814 }); 815 /* 816 timeoutid = setTimeout(function() { 817 if($("#packageactionmessages").attr("data-displaying") == "1") { 818 $("#packageactionmessages").slideUp(100, function() { 819 $("#packageactionmessages").attr("data-displaying","0"); 820 }); 821 } 822 }, 1000); 823 */ 824} 825 826 827function managepackagecancelerrormessage() { 828 $("#packageactionerrormessage").slideUp(100, function() { 829 $("#packageactionmessages").attr("data-displaying","0"); 830 $("#packagemessagebg").fadeOut(50); 831 832 }); 833} 834 835function managepackagecancelmessage() {
836 $("#packageactionmessages").slideUp(100, function() { 837 $("#packageactionmessages").attr("data-displaying","0"); 838 $("#packagemessagebg").fadeOut(50); 839 840 }); 841}
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.