1globalValue={ 2 add:"", 3 option:"", 4 add_count:"" 5} 6function GSM_go_url(form,target,flag,uid,oid){ 7 var objform=document.getElementById(form); 8 9 if (flag && objform.gsp_flag) objform.gsp_flag.value = flag; 10 if (uid && objform.gsp_uid) objform.gsp_uid.value = uid; 11 if (oid && objform.gsp_oid) objform.gsp_oid.value = oid; 12 13 if(target=="proc") objform.method = "post"; 14 15 objform.gsp_pg.value = target; 16 17 GSC_null_disable(objform); 18 19 objform.submit(); 20} 21 22//ì¥ë°êµ¬ë ìëë³ê²½ 23function GSM_shop_cart_cou(form,flag,uid,gid,chgval,action){ 24 var objform=document.getElementById(form); 25 26 objform.gsp_md.value = "shop_cart"; 27 objform.gsp_pg.value = "proc"; 28 objform.gsp_flag.value = flag; 29 objform.gsp_uid.value = uid; 30 objform.gsp_gid.value = gid; 31 objform.gsp_chgval.value = chgval; 32 objform.method = "post"; 33 objform.action = action; 34 35 GSC_null_disable(objform); 36 37 objform.submit(); 38} 39 40//ì¥ë°êµ¬ë ìµì ìëë³ê²½ 41function GSM_shop_cart_option_cou(form,flag,uid,gid,chgval,action,cnt){ 42 43 var objform=document.getElementById(form); 44 45 objform.gsp_md.value = "shop_cart"; 46 objform.gsp_pg.value = "proc"; 47 objform.gsp_flag.value = flag; 48 objform.gsp_uid.value = uid; 49 objform.gsp_gid.value = gid; 50 objform.gsp_chgval.value = chgval; 51 objform.gsp_chg.value = cnt; 52 objform.method = "post"; 53 objform.action = action; 54 55 GSC_null_disable(objform); 56 57 objform.submit(); 58} 59 60//ì¥ë°êµ¬ë ë´ì© 61function GSM_shop_cart_deli_ment(form,flag,uid,gid,chgval,action,chg){ 62 63 var objform=document.getElementById(form); 64 65 objform.gsp_md.value = "shop_cart"; 66 objform.gsp_pg.value = "proc"; 67 objform.gsp_flag.value = flag; 68 objform.gsp_uid.value = uid; 69 objform.gsp_gid.value = gid; 70 objform.gsp_chgval.value = chgval; 71 objform.gsp_chg.value = chg; 72 objform.method = "post"; 73 objform.action = action; 74 75 GSC_null_disable(objform); 76 77 $.ajax({ 78 url : "/gs/gs_empty.php", 79 type : "POST", 80 data : $(objform).serialize()+"&gsp_return_datatype=json", 81 dataType : "json", 82 success : function(data){ 83 if(data.result == "success"){ 84 console.log("ì ì¥ìë£"); 85 } 86 } 87 }); 88// objform.submit(); 89} 90 91function GSM_shop_cateadd(uid,name,type){ 92 //íì¬ ì²ë¦¬í ì¸ë±ì¤ 93 var cou=document.getElementById("hd_gs_add_cate_cou").value; 94 if (cou == "") cou=0; 95 96 //ì ì²´ ì²ë¦¬ê°ë¥í ì«ì 97 var max=document.getElementsByName("gsp_gs_category[]").length; 98 99 if (type=="add"){//ì¶ê° 100 var i=parseInt(cou); 101 cou++; 102 103 if (cou > max) 104 105 alert ("ëì´ì ì¶ê°ê° ë¶ê°ë¥ í©ëë¤."); 106 else{ 107 document.getElementsByName("gsp_gs_category[]")[i].value="0"+uid; 108 document.getElementById("hd_gs_add_cate_cou").value=cou; 109 110 document.getElementById("addcate"+cou).innerHTML = name; 111 document.getElementById("cate_layer"+cou).style.display = ""; 112 document.getElementById("cate_layer").style.display = "none"; 113 } 114 }else{ //ìì 115 if (cou==0) 116 alert ("ë§ì§ë§ì ëë¤."); 117 else{ 118 var i=parseInt(uid)-1; 119 120 //document.getElementById("cate_layer"+cou).style.display = "none"; 121 ret_cou = cou-1; 122 123 document.getElementById("addcate"+uid).innerHTML = ""; 124 document.getElementsByName("gsp_gs_category[]")[i].value=""; 125 document.getElementById("hd_gs_add_cate_cou").value=ret_cou; 126 127 //ìì í ìì ë ì´íì ì ì¥ë ê° íì¹¸ì© ë¹ê²¨ ì´ 128 for (j=uid;j<max ;j++ ){ 129 next=parseInt(j)+1; 130 index=parseInt(j)-1; 131 132 //alert(next + " , " + index); 133 134 //ìì ë ì´í ê° 135// alert("addcate"+next); 136 upname=document.getElementById("addcate"+next).innerHTML; 137 upid=document.getElementsByName("gsp_gs_category[]")[j].value; 138 139 //ìì ë ê³³ì ì ì¥ 140 document.getElementById("addcate"+j).innerHTML = upname; 141 document.getElementsByName("gsp_gs_category[]")[index].value=upid; 142 143 //ë¶ë¬ìì ì ì¥ë ì´íê° ìì 144 document.getElementById("addcate"+next).innerHTML = ""; 145 document.getElementsByName("gsp_gs_category[]")[j].value=""; 146 147 i++; //í¬ì¸í° ì´ë 148 } 149 150 //alert("cate_layer"+cou); 151 document.getElementById("cate_layer"+cou).style.display = "none"; 152 } 153 154 if (cou == 1) 155 document.getElementById("cate_layer").style.display = ""; 156 } 157} 158 159function GSM_shop_goods_list(uid,url){ 160 var objform=document.getElementById("gs_form"); 161 162 objform.gsp_srch_cate.value = uid; 163 164 if(url){ 165 objform.action = url; 166 objform.gsp_pg.value = ""; 167 } 168 169 GSC_null_disable(objform); 170 171 objform.submit(); 172} 173 174function GSM_shop_buyer_copy(){ 175 var objform=document.getElementById("gs_form"); 176 177 objform.gsp_gs_name.value = objform.gsp_gs_name_buyer.value; 178 if(objform.elements['gsp_gs_email']){ 179 objform.elements['gsp_gs_email'].value = objform.elements['gsp_gs_email_buyer'].value; 180 }else{ 181 objform.elements['gsp_gs_email[]'][0].value = objform.elements['gsp_gs_email_buyer[]'][0].value; 182 objform.elements['gsp_gs_email[]'][1].value = objform.elements['gsp_gs_email_buyer[]'][1].value; 183 } 184 if(objform.elements['gsp_gs_mobile']){ 185 objform.elements['gsp_gs_mobile'].value = objform.elements['gsp_gs_mobile_buyer'].value; 186 }else{ 187 objform.gsp_gs_mobile_sel.value = objform.gsp_gs_mobile_sel_buyer.value; 188 objform.elements['gsp_gs_mobile[]'][0].value = objform.elements['gsp_gs_mobile_buyer[]'][0].value; 189 objform.elements['gsp_gs_mobile[]'][1].value = objform.elements['gsp_gs_mobile_buyer[]'][1].value; 190 } 191 if(objform.elements['gsp_gs_phone']){ 192 objform.elements['gsp_gs_phone'].value = objform.elements['gsp_gs_phone_buyer'].value; 193 }else if(objform.gsp_gs_phone_sel){ 194 objform.gsp_gs_phone_sel.value = objform.gsp_gs_phone_sel_buyer.value; 195 objform.elements['gsp_gs_phone[]'][0].value = objform.elements['gsp_gs_phone_buyer[]'][0].value; 196 objform.elements['gsp_gs_phone[]'][1].value = objform.elements['gsp_gs_phone_buyer[]'][1].value; 197 } 198// objform.elements['gsp_gs_zipcode[]'][0].value = objform.elements['gsp_gs_zipcode_buyer[]'][0].value; 199// objform.elements['gsp_gs_zipcode[]'][1].value = objform.elements['gsp_gs_zipcode_buyer[]'][1].value; 200 objform.elements['gsp_gs_zipcode'].value = objform.elements['gsp_gs_zipcode_buyer'].value; 201 //objform.elements['gsp_gs_zipcode5'].value = objform.elements['gsp_gs_zipcode5_buyer'].value; 202 objform.elements['gsp_gs_address[]'][0].value = objform.elements['gsp_gs_address_buyer[]'][0].value; 203 objform.elements['gsp_gs_address[]'][1].value = objform.elements['gsp_gs_address_buyer[]'][1].value; 204} 205 206function GSM_shop_calculation(){ 207 208 //ì´ê¸ì¡ 209 price = document.getElementById("total_price").innerHTML; 210 price_re = price.replace(",",""); 211 price_re = parseInt(price_re); 212 213 //ì¬ì©ê°ë¥í í¬ì¸í¸ 214 spoint = document.getElementById("save_point").innerHTML; 215 spoint_re = spoint.replace(",",""); 216 spoint_re = parseInt(spoint_re); 217 218 //ì¬ì©í í¬ì¸í¸ 219 point = document.getElementById("gs_use_point").value; 220 if(point == "") point = 0; 221 point = parseInt(point); 222 223 if(spoint_re < point){ //ì¬ì©ê°ë¥í ì 립ê¸ë³´ë¤ ë§ì´ ì ë ¥íìê²½ì° 224 point = spoint_re; //ì¬ì©í í¬ì¸í¸ë¥¼ ìµëê¸ì¡ì¼ë¡ ê³ ì 225 document.getElementById("gs_use_point").value = point; 226 } 227 228 if(price_re < point){ //ì¬ì©í í¬ì¸í¸ê° 구매ì¡ë³´ë¤ ë§ìê²½ì° 229 point = price_re; //ì¬ì©í í¬ì¸í¸ë¥¼ ìµëê¸ì¡ì¼ë¡ ê³ ì 230 document.getElementById("gs_use_point").value = point; 231 } 232 233 result = price_re - point; 234 235 document.getElementById("tprice").innerHTML= GSC_comma(result); 236} 237 238//ê°ê²©ë³ë 239function GSM_shop_price_set(trs_price){ 240 var objform=document.getElementById("buy"); 241 var uid = objform.gsp_uid.value; 242 var count = objform.gsp_gs_buy_count.value; 243 var add = ""; 244 var opt = ""; 245 246 if(objform.gsp_gs_trance_price){ 247 var tprice = objform.gsp_gs_trance_price.value; 248 trs_price = tprice; 249 } 250 251 var obj=document.getElementsByName("gsp_gs_add[]"); 252 if(obj){ 253 var len=obj.length; 254 255 for(var i=0;i<len;i++){ 256 if(obj[i].checked) 257 add = add + obj[i].value + ","; 258 globalValue.add = add; 259 // globalValue.add = globalValue.add + obj[i].value + ","; 260 } 261 } 262 263 var obj=document.getElementsByName("gsp_gs_option[]"); 264 if(obj){ 265 var len=obj.length; 266 267 for(var i=0;i<len;i++){ 268 if(obj[i].value) 269 opt = opt + obj[i].value + ","; 270 globalValue.opt = opt; 271 // globalValue.opt = globalValue.opt + obj[i].value + ","; 272 } 273 } 274 275 //alert(trs_price+" / "+uid); 276 //GSC_setCookie("testck",escape(document.body.scrollTop),1); 277 gs_hiddenframe.location.href="/gs/gs_empty.php?gsp_md=shop_goods&gsp_pg=price&gsp_uid="+uid+"&gsp_trs_price="+trs_price+"&gsp_add="+globalValue.add+"&gsp_option="+globalValue.opt+"&gsp_gs_buy_count="+count+"&gsp_add_count="+globalValue.add_count; 278} 279 280 281//ë³ê²½ë ê°ê²©ë³ë ( ìì¸íì´ì§ 구ì±ì´ ë³ê²½ëë¯ë¡ì¨ ì¶ê° ë¨)
282function GSM_shop_price_set_new(trs_price){ 283 284 var objform=document.getElementById("buy"); 285 var uid = objform.gsp_uid.value; 286 var count = objform.gsp_gs_buy_count.value; 287 var add = ""; 288 var opt = ""; 289 var add_count = ""; 290 291 if(objform.gsp_gs_trance_price){ 292 var tprice = objform.gsp_gs_trance_price.value; 293 trs_price = tprice; 294 } 295 296 var obj=document.getElementsByName("gsp_gs_add[]"); 297 if(obj){ 298 var len=obj.length; 299 for(var i=0;i<len;i++){ 300 //if(obj[i].checked) 301 if(obj[i].value != '__add__'){ 302 add = add + obj[i].value + ","; 303 // globalValue.add = globalValue.add + obj[i].value + ","; 304 globalValue.add = add; 305 add_count = add_count + document.getElementsByName("gsp_gs_buy_count_add_"+obj[i].value+"")[0].value + ","; 306 307 // globalValue.add_count = globalValue.add_count + document.getElementsByName("gsp_gs_buy_count_add_"+obj[i].value+"")[0].value + ","; 308 globalValue.add_count = add_count + document.getElementsByName("gsp_gs_buy_count_add_"+obj[i].value+"")[0].value + ","; 309 } 310 311 312 } 313 } 314 315 var obj=document.getElementsByName("gsp_gs_option[]"); 316 if(obj){ 317 var len=obj.length; 318 319 for(var i=0;i<len;i++){ 320 if(obj[i].value) 321 opt = opt + obj[i].value + ","; 322 // globalValue.opt = globalValue.opt + obj[i].value + ","; 323 globalValue.opt = opt + obj[i].value + ","; 324 } 325 } 326 //alert(trs_price+" / "+uid); 327 //GSC_setCookie("testck",escape(document.body.scrollTop),1); 328 gs_hiddenframe.location.href="/gs/gs_empty.php?gsp_md=shop_goods&gsp_pg=price&gsp_uid="+uid+"&gsp_trs_price="+trs_price+"&gsp_add="+globalValue.add+"&gsp_option="+globalValue.opt+"&gsp_gs_buy_count="+count+"&gsp_add_count="+globalValue.add_count; 329} 330 331 332//ìµì구매ìë ì¡°ì 333function GSM_shop_min_buy(ele,cou){ 334 if(ele.value=="" || ele.value <cou) 335 ele.value = cou; 336 else{ 337 var objform=document.getElementById("buy"); 338 var uid = objform.gsp_uid.value; 339 340 gs_hiddenframe.location.href="/gs/gs_empty.php?gsp_md=shop_goods&gsp_pg=price&gsp_uid="+uid+"&gsp_gs_buy_count="+ele.value; 341 } 342} 343 344//구매ì ì í íì¸ 345function GSM_shop_buy_chk(cou,ment){ 346 var obj=document.getElementsByName("gsp_gs_add[]"); 347 348 if(cou > 0){ 349 for (i=0;i<cou ;i++ ){ 350 if(obj[i].checked){ 351 var res="true"; 352 break; 353 } 354 } 355 356 if(res) 357 return true; 358 else{ 359 alert(ment + "ì¤ 1ê°ë¥¼ ì íí´ ì£¼ì¸ì."); 360 return false; 361 } 362 }else{ 363 return true; 364 } 365} 366 367//ì¬ê³ ê´ë¦¬ ê³ì ì í ì´ê¸°í 368function GSC_goods_choice_set(field,index){ 369 if (!index) index=0; 370 371 if(field=="gs_trs_inventory"){ 372 if(document.getElementsByName("gsp_gs_trs_inventory[]")[index]) document.getElementsByName("gsp_gs_trs_inventory[]")[index].value = ""; 373 if(document.getElementById("trs_goodsinfo--"+index)) document.getElementById("trs_goodsinfo--"+index).innerHTML = ""; 374 375 }else if(field=="gs_add_inventory"){ 376 if(document.getElementsByName("gsp_gs_add_inventory[]")[index]) document.getElementsByName("gsp_gs_add_inventory[]")[index].value = ""; 377 if(document.getElementById("add_goodsinfo--"+index)) document.getElementById("add_goodsinfo--"+index).innerHTML = ""; 378 379 }else{ 380 if(document.getElementById("gsp_gs_gid")) document.getElementById("gsp_gs_gid").value = ""; 381 if(document.getElementById("gsp_gs_subject")) document.getElementById("gsp_gs_subject").value = ""; 382 document.getElementById("gs_choise_goods").innerHTML = ""; 383 } 384 385 alert("ìíì ë³´ê° ì´ê¸°í ëììµëë¤."); 386} 387 388//ì¹´í ê³ ë¦¬ select ì´ë 389function GSC_category_select_move(url,value){ 390 location.replace(url+"?gsp_srch_cate="+value); 391} 392 393//multi ì¥ë°êµ¬ë 구매 í¨ì 394function GSM_shop_cart_multi(ment,url){ 395 if(confirm(ment)){ 396 top.location.replace(url); 397 }else{ 398 top.location.reload(); 399 } 400} 401 402//arrow ìí ì§ì´ 403function GSM_shop_arrow(key,move,cou,url1,cou1,url2,cou2,key2){ 404 405 var nowpage = document.getElementById(key + "_01").innerHTML; 406 var totalpage = document.getElementById(key + "_02").innerHTML; 407 var item = document.getElementById(key + "_item").innerHTML; 408 var item_arr = item.split(","); 409 410 if(move=="l"){ 411 var movepage = parseInt(nowpage)-1; 412 if(movepage == 0) movepage = totalpage; 413 414 }else{ 415 var movepage = parseInt(nowpage)+1; 416 if(movepage > totalpage) movepage = 1; 417 418 } 419 420 //1ì°¨ uid 421 var uid1= ""; 422 var uid1_first_index = (parseInt(movepage)-1)*cou; 423 for(var i=0;i<cou1;i++){ 424 uid1 = uid1 + item_arr[uid1_first_index] + ","; 425 426 uid1_first_index = parseInt(uid1_first_index) + 1; 427 } 428 429 GSC_loadXMLDoc(url1 + "?gsp_uid=" + uid1,key); 430 431 if(url2){ 432 //2ì°¨ uid 433 var uid2= ""; 434 var uid2_first_index = parseInt(uid1_first_index); 435 436 for(var i=0;i<cou2;i++){ 437 uid2 = uid2 + item_arr[uid2_first_index] + ","; 438 439 uid2_first_index = parseInt(uid2_first_index)+1; 440 } 441 442 GSC_loadXMLDoc(url2 + "?gsp_uid=" + uid2,key2); 443 } 444 445 document.getElementById(key+"_01").innerHTML = movepage; 446} 447 448//rank ìí ì§ì´ 449function GSM_shop_ranking(key,cate,index,url){ 450 //ì¸ë¶ìì ì²ë¦¬ 451 if(!cate) 452 cate = document.getElementById("rank_cate").innerHTML; 453 454 //span ê° ë°°ì 455 document.getElementById("rank_cate").innerHTML = cate; 456 document.getElementById("rank_index").innerHTML = index; 457 458 //alert(url + "?gsp_category=" + cate + "&gsp_index=" + index); 459 460 GSC_loadXMLDoc(url + "?gsp_category=" + cate + "&gsp_index=" + index, key); 461} 462 463//ë¡ê·¸ì¸ íì (íì, ë¹íì) 464function GSM_shop_login_type(value){ 465 if(value=="01"){ 466 document.getElementById("membership").style.display=""; 467 document.getElementById("guest").style.display="none"; 468 }else{ 469 document.getElementById("membership").style.display="none"; 470 document.getElementById("guest").style.display=""; 471 } 472} 473 474//ë¹íì구매ë²í¼ 475function GSM_shop_guest_buy(url){ 476 var obj=document.getElementsByName("gsp_gs_guest_agree"); 477 var len=obj.length; 478 479 if(obj[0].checked==true){ 480 location.replace(url); 481 }else{ 482 alert("ë¹íì ìíë°°ì¡ì ê´í ëì를 íì¬ ì£¼ììì."); 483 } 484} 485 486//ëí¹ë¦¬ì¤í¸ 487function GSM_shop_rank_list(url,value_key){ 488 var cate = document.getElementById(value_key).innerHTML; 489 490 location.replace(url + "?gsp_srch_cate=" + cate + "&gsp_list_mode=rank"); 491 //alert(url); 492 493} 494 495function GSM_get_Latest_Zip(url,form){ 496 var win=window.open(url,"latest_zip","width=800,height=500,scrollbars=yes,toolbars=no,top=0,left=0"); 497 var objform=document.getElementById(form); 498} 499 500/* 501ìì¸ì¤ - íë¼ìë´í ë§ë¤ë íìí í¨ì 502*/ 503 504function GSC_open_goods_list(form){ 505 var form = document.getElementById(form); 506 var relation_goods_list = form.gsp_gs_relation_goods.value; 507 window.open('/gs/pop_goods.php?gsp_gs_relation_goods='+relation_goods_list,'popup_goods','height=600,width=500'); 508} 509 510function GSC_open_coupon_list(uid){ 511 var getParam =""; 512 if(uid !== undefined){ 513 getParam = "?gsp_uid="+uid; 514 } 515 window.open('/shop_coupon.php'+getParam,'popup_goods','height=600,width=500,scrollbars=yes'); 516} 517 518function GSC_open_mileage_list(uid){ 519 var getParam =""; 520 if(uid !== undefined){ 521 getParam = "?gsp_uid="+uid; 522 } 523 window.open('/sub_step_mileage.php'+getParam,'popup_goods','height=900,width=800,scrollbars=yes'); 524} 525 526function AddRelationGoods(openerForm){ 527 var form = document.getElementById('gourl'); 528 var endPopupCallback = function(){ 529 alert('ì ì©ëììµëë¤.'); 530 self.close() 531 } 532 formValue = form.gsp_gs_relation_goods.value; 533 opener.document.getElementById(openerForm).gsp_gs_relation_goods.value = formValue; 534 return (function(){ 535 set_relation_goods_info('gourl',endPopupCallback); 536 })() 537} 538 539function AddMileageGoods(openerForm){ 540 var endPopupCallback = function(){ 541 alert('ì ì©ëììµëë¤.'); 542 self.close() 543 } 544 545 mileage_uid = []; 546 mileage_count = []; 547 opener_div_str = ""; 548 var chkBox = document.querySelectorAll("input[name='gsp_chk[]']:checked"); 549 for(var i = 0; i<chkBox.length; i++ ){ 550 551 var selectBox = document.querySelectorAll("select[name='gsp_gs_mileage_item_count_"+chkBox[i].value+"[]']")[0]; 552 var count = Number(selectBox.value); 553 mileage_uid.push(chkBox[i].value); 554 mileage_count.push(count); 555 subject = chkBox[i].parentNode.parentNode.children[3].textContent; 556 opener_div_str += "<div class='mileage_list'>"+subject+" ("+count+"ê°)"+"</div>"; 557 } 558 559 mileage_uid_str = mileage_uid.join("/:gs:/"); 560 mileage_count_str = mileage_count.join("/:gs:/"); 561 opener.document.getElementById(openerForm).gsp_gs_mileage_uid.value = mileage_uid_str; 562 opener.document.getElementById(openerForm).gsp_gs_mileage_count.value = mileage_count_str; 563 opener.document.getElementById("binding_box").innerHTML=opener_div_str; 564 565 window.close(); 566} 567 568 569function relation_goods_click(obj){ 570 var formValue; 571 var get_value = function(){ 572 var form = document.getElementById('gourl'); 573 formValue = form.gsp_gs_relation_goods.value; 574 } 575 var set_value = function(value){ 576 var form = document.getElementById('gourl'); 577 if(form) form.gsp_gs_relation_goods.value = value; 578 var form = document.getElementById('gs_form'); 579 if(form) form.gsp_gs_relation_goods.value = value; 580 } 581 var change_array = function(val){ 582 var result = val.split(","); 583 return result; 584 } 585 get_value(); 586 if(Boolean(obj.checked) == true){ // ì¶ê° 587 resultArray = change_array(formValue); 588 resultArray.push(obj.value); 589 }else{ //ì ê±° 590 resultArray = change_array(formValue); 591 deleteIndex = resultArray.indexOf(obj.value); 592 if(deleteIndex >= 0){ 593 resultArray.splice(deleteIndex,1); 594 } 595 } 596 resultStr = resultArray.join(','); 597 set_value(resultStr); 598} 599 600//íì ìì ì íì í´ë¹ í ì¤í¸ ê°ì ¸ìì 주문ìì ë¿ë ¤ì¤ 601function GSC_coupon_select(uid,obj){ 602 var td_list = obj.children; 603 var couponName = td_list[0].children["coupon_name"].textContent; 604 var couponDis = td_list[2].children["coupon_dis"].textContent; 605 var parent = window.opener; 606 parent.GSC_popup_coupon_use(couponName,couponDis,this,uid) 607 parent.GSC_use_coupon(uid); 608} 609 610//íì ìì ì íë ìíì openerì í ì¤í¸ ë¿ë¦¬ê³ uid를 parentì ì ì¡ìí´ 611function GSC_popup_coupon_use(name,dis,popup,uid){ 612 var textBox = document.getElementById("coupon_text"); 613 var buttons = document.getElementById("coupon_buttons"); 614 buttons.style.display="inline-block"; 615 // var useButton = document.getElementById("use_coupon");//coupon_buttons 616 617 textBox.textContent = name+" ( " + dis + "%í ì¸ ) "; 618 // useButton.setAttribute("data-coupon",uid); 619 620 //í¬ì¸í¸ ì´ê¸°í 621 document.getElementById("gs_use_point").value=0; 622 $("#btn_use_point").trigger("click"); 623 624 popup.close(); 625} 626 627var _couponUid //ì§ì ì²´í¬ë¥¼ ë°©ì§í기ìí ì ìí 628function GSC_use_coupon(uid){ 629 //ì¬ì©íì기ì ì primeì _addìì tprceì ì ë³ì를 ê¼ íì¸íì¸ì. 630 couponUid = uid 631 if(_couponUid == couponUid) return; 632 633 $.ajax({
634 url : "/gs/gs_empty.php", 635 method:"POST", 636 datatype:"json", 637 data:{gsp_pg:"ajax_coupon_proc",gsp_md:"shop_order_prime",coupon_uid:couponUid}, 638 success:function(res){ 639 var data = JSON.parse(res); 640 if(data.result == true){ 641 _couponUid = couponUid 642 var calDiscount = data.dis/100; 643 var chgGoodsPrice = Number(delComma($("#only_goods_price").text())) * calDiscount; // ëº ìíê° 644 var usePoint = Number(delComma($("#used_point").text())); 645 var totalPrice = Number(delComma(tprice)) //ì´ ìíê° 646 var chgtotalPrice = oTotalPrice = totalPrice - chgGoodsPrice - usePoint; 647 648 649 chgGoodsPrice = Math.round(chgGoodsPrice) //ìì«ì ë°ì¬ë¦¼ 650 chgGoodsPrice = formatnumber(chgGoodsPrice,3); // number_format 651 chgtotalPrice = formatnumber(chgtotalPrice,3); // number_format 652 $("#totalPrice").text(chgtotalPrice); 653 $("#coupon_dis").text(chgGoodsPrice); 654 document.LGD_PAYINFO.LGD_AMOUNT.value = oTotalPrice; 655 }else{ 656 alert("ìë¬ì½ë :[ " +data.code + " ]"); 657 } 658 } 659 }) 660} 661 662function GSC_cancle_coupon(){ 663 _couponUid = ""; 664 var totalPrice = Number(delComma(tprice)) //ì´ ìíê° 665 var usePoint = Number(delComma($("#used_point").text())); 666 var chgtotalPrice = oTotalPrice = totalPrice - usePoint; 667 chgtotalPrice = formatnumber(chgtotalPrice,3); 668 $("#totalPrice").text(chgtotalPrice); 669 document.LGD_PAYINFO.LGD_AMOUNT.value = oTotalPrice; 670 $("#coupon_buttons").hide(); 671 $("#coupon_text").text(''); 672 $("#coupon_dis").text(''); 673 $.ajax({ 674 url : "/gs/gs_empty.php", 675 method:"POST", 676 datatype:"json", 677 data:{gsp_pg:"ajax_coupon_del",gsp_md:"shop_order_prime"}, 678 success:function(res){ 679 } 680 }) 681} 682 683function set_relation_goods_info(form,callback){ 684 if(callback === undefined){ 685 callback = function(){} 686 } 687 $.ajax({ 688 url : "/gs/gs_empty.php?gsp_md=shop_goods&gsp_pg=ajax_get_relation_goods", 689 method:"POST", 690 datatype:"json", 691 data:{gsp_gs_relation_goods:document.getElementById(form).gsp_gs_relation_goods.value}, 692 success:function(res){ 693 var parseArray = JSON.parse(res); 694 subjectText = parseArray.join(""); 695 obj = form == "gourl" ? opener.document : document; 696 697 obj.getElementById('binding_box').innerHTML = subjectText; 698 return callback(); 699 } 700 }) 701}; 702 703var mileage = { 704 preValue : 0, 705 cal_mileage:function(obj){ 706 var usePoint = 0; 707 var basePoint = document.getElementById('mine_mileage').textContent; 708 var chkBox = document.querySelectorAll("input[name='gsp_chk[]']:checked"); 709 for(var i = 0; i<chkBox.length; i++ ){ 710 var mileage = chkBox[i].getAttribute("data-mileage"); 711 var selectBox = document.querySelectorAll("select[name='gsp_gs_mileage_item_count_"+chkBox[i].value+"[]']")[0]; 712 usePoint += mileage*Number(selectBox.value); 713 } 714 if(basePoint < usePoint){if(obj.tagName=="SELECT") obj.value = this.preValue; return false;} 715 document.getElementById('use_mileage').textContent = usePoint; 716 document.getElementById('rest_mileage').textContent = basePoint - usePoint; 717 }, 718 getPreValue:function(obj){ 719 this.preValue = obj.value; 720 } 721 722} 723 724function formatnumber(v1,v2){ 725 var str = new Array(); 726 v1 = String(v1); 727 for(var i=1;i<=v1.length;i++){ 728 if(i % v2) str[v1.length-i] = v1.charAt(v1.length-i); 729 else str[v1.length-i] = ','+v1.charAt(v1.length-i); 730 } 731 return str.join('').replace(/^,/,''); 732} 733 734 735function delComma(str){ 736 return str.replace(/,/g, ''); 737} 738/* 739 740== ìì¸ì¤ í¨ì ë == 741 742*/
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.