해피나눔::통합결제서비스 "; //$("#pay_dt").append(pay_dt_var); if(""=='E'){ self.cmsPayDt.push({code:pd[i], value:pd[i]+"th"}); }else{ self.cmsPayDt.push({code:pd[i], value:pd[i]+"일"}); } } } self.hpPayDt = [{code:"05", value:"05일"}]; self.cardPayDt = [{code:"05", value:"05일"}]; if("BWGNLDLMZ5" == "6XT5KQ8WY0"){ if("null"=="null"){ alert("올바른 문자충전 접근방식이 아닙니다.\n문자충전은 로그인 후 이용해주시기 바랍니다.") window.close(); self.memNm =ko.observable("").extend({required:true,NotWithSpecialCharPattern:true,minLength:2,maxLength:20}); }else{ self.memNm =ko.observable("null").extend({required:true,NotWithSpecialCharPattern:true,minLength:2,maxLength:20}); } }else{ self.memNm =ko.observable("").extend({required:true,NotWithSpecialCharPattern:true,minLength:2,maxLength:20}); } self.memNm.displayName = "회원명"; self.memNm.eid="memNm";	self.memTel1 = ko.observable("").extend({required:true,NumLimitedLengthPattern:{required:true,min:3,max:3}}); self.memTel1.displayName = "연락처"; self.memTel1.eid = "memTel1"; self.memTel2 = ko.observable("").extend({required:true,NumLimitedLengthPattern:{required:true,min:3,max:4}}); self.memTel2.displayName = "연락처"; self.memTel2.eid = "memTel2"; self.memTel3 = ko.observable("").extend({required:true,NumLimitedLengthPattern:{required:true,min:4,max:4}}); self.memTel3.displayName = "연락처"; self.memTel3.eid = "memTel3"; self.payEndDate = ko.observable("99991231").extend({required:false, NumLimitedLengthPattern:{required:true,min:8,max:8}}) self.memTel = ko.computed(function(){ return self.memTel1()+self.memTel2()+self.memTel3(); }).extend({required:true,HpTelPattern:{required:true},onlyHpPattern:{condition:function(){return self.payWayCode()=="CAR";}, msg:"카드자동결제의 경우 연락처에 휴대폰번호만 해주세요"}}); self.memTel.displayName = "연락처"; self.memTel.eid = "memTel1"; self.targetMemGrpCode=""; self.memGrps = []; self.memGrpsValues = [];	self.memGrps.push({code:"002", value:"사업자"}); self.memGrpsValues.push("002"); self.memGrps.push({code:"003", value:"개인"}); self.memGrpsValues.push("003"); self.memGrps.push({code:"004", value:"박미정"}); self.memGrpsValues.push("004"); self.memGrp = ko.observable("001").extend({required:(function() { return self.memGrpType=="R"; }())}); if("BWGNLDLMZ5" == "ZXV6VR26X0") { self.memGrp.displayName="후원종류"; } else { self.memGrp.displayName="회원구분";	} self.memGrp.eid="memGrp"; self.memDonationJuminNum=ko.observable(""); //self.memDonationJuminNum=ko.observable("").extend({required:false, DonationJuminNoPattern:true}); self.memDonationJuminNum.displayName = "주민번호 또는 사업자번호"; /* self.memDonationJuminNum=ko.observable(""); self.memJuminNum2=ko.observable(""); self.memJuminNum= ko.computed(function(){ return self.memDonationJuminNum() +self.memJuminNum2(); }).extend({required:(function(){ return self.receiptFlag=="Y" && self.receiptType=="R";}()),DonationJuminNoPattern:{required:(function(){return self.receiptFlag=="Y" && self.receiptType=="R";}())}}); self.memJuminNum.displayName="회원주민번호"; self.memJuminNum.eid="memDonationJuminNum"; */ /* self.memDonationJuminNum =ko.observable("").extend({required:false, DonationJuminNoPattern:{required:(function(){return self.receiptFlag=="Y" && self.receiptType=="R";}())}}); self.memDonationJuminNum.displayName = "회원주민번호"; self.memDonationJuminNum.eid="memDonationJuminNum"; */ self.emailId=ko.observable("").extend({required:false,NormalLengthPattern:{required:false,min:1,max:50}}); self.emailId.displayName = "Email주소"; self.emailId.eid = "emailId"; self.emailDomain=ko.observable("").extend({required:false,minLength:1,NormalLengthPattern:{required:false,min:1,max:50}});	self.emailDomain.displayName = "Email주소"; self.emailDomain.eid = "emailId"; self.emailAddr = ko.computed(function(){ if(self.emailId()!="" && self.emailDomain() !="") { return self.emailId() +"@"+self.emailDomain(); }else { return ""; } //}).extend({required:(function(){return self.emailFlag=="Y" && self.emailType=="R";}()),EmailPattern:{required:(function(){return self.emailtFlag=="Y" && self.emailType=="R";}())}}); }).extend({required:(function(){return self.emailFlag=="Y" && self.emailType=="R";}())}); self.emailAddr.displayName = "Email주소"; self.emailAddr.eid = "emailId"; self.memZipCode3 = ko.observable("").extend({required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),NumLimitedLengthPattern:{required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),min:5,max:6}}); self.memZipCode3.displayName = "주소"; self.memZipCode3.eid = "memZipCode3"; /* self.memZipCode2 = ko.observable("").extend({required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),NumLimitedLengthPattern:{required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),min:3,max:3}}); self.memZipCode2.displayName = "주소"; self.memZipCode2.eid = "memZipCode2"; */ self.memAddr1 = ko.observable("").extend({required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),NotWithSpecialCharPattern:true,NormalLengthPattern:{required:(function(){return self.addrFlag=="Y" && self.addrType=="R";}()),min:1,max:100}}); self.memAddr1.displayName = "주소"; self.memAddr1.eid = "memAddr1"; self.memAddr2 = ko.observable("").extend({ required:(function(){ return self.addrFlag=="Y" && self.addrType=="R"; }()), NotWithSpecialCharPattern:true, NormalLengthPattern:{ required:(function(){ return self.addrFlag=="Y" && self.addrType=="R"; }()), min:0,max:100 } }); self.memAddr2.displayName = "주소"; self.memAddr2.eid = "memAddr2"; if(option1Info.form=="tel"){ self.option1ContentText= ""; self.option1Content1 = ko.observable("").extend({required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),min:2,max:3}}); self.option1Content1.displayName = ""; self.option1Content2 = ko.observable("").extend({required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),min:3,max:4}}); self.option1Content2.displayName = ""; self.option1Content3 = ko.observable("").extend({required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option1Flag=="Y" && self.option1Type=="R";})(),min:4,max:4}}); self.option1Content3.displayName = ""; }else{ self.option1ContentText= ko.observable("").extend({ required:(function(){ return self.option1Flag=="Y" && self.option1Type=="R"; })() }) self.option1ContentText.displayName = ""; self.option1Content1=""; self.option1Content2=""; self.option1Content3=""; } self.option1Content = ko.computed(function(){ if(option1Info.form=="tel"){ return self.option1Content1()+self.option1Content2()+self.option1Content3() }else{ return self.option1ContentText() } }) if(option2Info.form=="tel"){ self.option2ContentText= ""; self.option2Content1 = ko.observable("").extend({required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),min:2,max:3}}); self.option2Content1.displayName = ""; self.option2Content2 = ko.observable("").extend({required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),min:3,max:4}}); self.option2Content2.displayName = ""; self.option2Content3 = ko.observable("").extend({required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option2Flag=="Y" && self.option2Type=="R";})(),min:4,max:4}}); self.option2Content3.displayName = ""; }else{ self.option2ContentText= ko.observable("").extend({ required:(function(){ return self.option2Flag=="Y" && self.option2Type=="R"; })() }) self.option2ContentText.displayName = ""; self.option2Content1=""; self.option2Content2=""; self.option2Content3=""; } self.option2Content = ko.computed(function(){ if(option2Info.form=="tel"){ return self.option2Content1()+self.option2Content2()+self.option2Content3() }else{ return self.option2ContentText() } }) if(option3Info.form=="tel"){ self.option3ContentText= ""; self.option3Content1 = ko.observable("").extend({required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),min:2,max:3}}); self.option3Content1.displayName = ""; self.option3Content2 = ko.observable("").extend({required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),min:3,max:4}}); self.option3Content2.displayName = ""; self.option3Content3 = ko.observable("").extend({required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option3Flag=="Y" && self.option3Type=="R";})(),min:4,max:4}}); self.option3Content3.displayName = ""; }else{ self.option3ContentText= ko.observable("").extend({ required:(function(){ return self.option3Flag=="Y" && self.option3Type=="R"; })() }) self.option3ContentText.displayName = ""; self.option3Content1=""; self.option3Content2=""; self.option3Content3=""; } self.option3Content = ko.computed(function(){ if(option3Info.form=="tel"){ return self.option3Content1()+self.option3Content2()+self.option3Content3() }else{ return self.option3ContentText() } }) if(option4Info.form=="tel"){ self.option4ContentText= ""; self.option4Content1 = ko.observable("").extend({required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),min:2,max:3}}); self.option4Content1.displayName = ""; self.option4Content2 = ko.observable("").extend({required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),min:3,max:4}}); self.option4Content2.displayName = ""; self.option4Content3 = ko.observable("").extend({required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),NumLimitedLengthPattern:{required:(function(){return self.option4Flag=="Y" && self.option4Type=="R";})(),min:4,max:4}}); self.option4Content3.displayName = ""; }else{ self.option4ContentText= ko.observable("").extend({ required:(function(){ return self.option4Flag=="Y" && self.option4Type=="R"; })() }) self.option4ContentText.displayName = ""; self.option4Content1=""; self.option4Content2=""; self.option4Content3=""; } self.option4Content = ko.computed(function(){ if(option4Info.form=="tel"){ return self.option4Content1()+self.option4Content2()+self.option4Content3() }else{ return self.option4ContentText() } }) self.recommend = ko.observable("").extend({required:(function(){return self.recommendFlag=="Y" && self.recommendType=="R";}()),NotWithSpecialCharPattern:true,NormalLengthPattern:{required:(function(){return self.recommendFlag=="Y" && self.recommendType=="R";}()),min:1,max:100}}); self.recommend.displayName = "추천인"; self.recommend.eid = "recommend"; self.payGrps = []; self.payGrpsValues = []; self.payGrps.push({code:"002", value:"cms"}); self.payGrpsValues.push("002"); self.payGrp = ko.observable("001").extend({required:(function() { return self.payGrpType=="R"; }())}); self.payGrp.displayName="납부유형"; self.payGrp.eid="payGrp"; self.memTypes = []; self.memTypesValues = []; if(""=='E'){ self.memTypes.push({code:"01", value:"Individual"}); self.memTypes.push({code:"02", value:"Enterprise"}); self.memTypes.push({code:"03", value:"Group"}); }else{ self.memTypes.push({code:"01", value:"개인"}); self.memTypes.push({code:"02", value:"기업"}); self.memTypes.push({code:"03", value:"단체"}); } self.memTypesValues.push("01"); self.memTypesValues.push("02"); self.memTypesValues.push("03"); self.memType = ko.observable("01").extend({required:(function() { return self.memTypeType=="R"; }())}); self.memType.displayName="회원분류"; self.memType.eid="memType"; self.memTitle = ko.observable("").extend({required:(function(){return self.memTitleFlag=="Y" && self.memTitleType=="R";}()),NotWithSpecialCharPattern:true,NormalLengthPattern:{required:(function(){return self.memTitleFlag=="Y" && self.memTitleType=="R";}()),min:1,max:100}}); self.memTitle.displayName = "직함"; self.memTitle.eid = "memTitle"; self.companyStation = ko.observable("").extend({required:(function(){return self.companyStatFlag=="Y" && self.companyStatType=="R";}()),NotWithSpecialCharPattern:true,NormalLengthPattern:{required:(function(){return self.companyStatFlag=="Y" && self.companyStatType=="R";}()),min:1,max:100}}); self.companyStation.displayName = "부서"; self.companyStation.eid = "companyStation"; self.params ={}; self.params.memPayTypes = ['R','T']; self.memPayType = ko.observable("").extend({RadioSelectCheckPattern:self.params.memPayTypes, EqualsPattern:{ testVal:"R", condition:function() {return self.payWayCode()=="CMS";}, showMsg:"해당 결제수단의 경우 정기결제만 가능합니다" } }); // TODO	self.memPayType.displayName="결제방식"; self.memPayType.eid= ""; self.params.payType = ['CMS','MOB','CAR','VAC']; self.payWayCode = ko.observable("").extend({RadioSelectCheckPattern:self.params.payType}); self.payWayCode.displayName="결제수단"; self.payWayCode.eid="payway_code"; self.memPayType("R"); self.params.isCms = ko.computed(function(){ return self.payWayCode()=="CMS"; }); self.params.isHp = ko.computed(function(){ return self.payWayCode()=="MOB"; }); self.params.isCard = ko.computed(function(){ return self.payWayCode()=="CAR"; }); self.params.isVac = ko.computed(function(){ return self.payWayCode()=="VAC"; }); //TODO CMS이며 일시인 경우만 체크 self.bankCd = ko.observable(""); self.vacBankCd = ko.observable(""); self.cardCd = ko.observable(""); self.hpCd = ko.observable("").extend({ RadioSelectCheckPattern: { params: self.hpOnlyPayCode, onlyIf: function () { return self.params.isHp(); } } }); self.hpCd.displayName=ko.computed(function() { if(self.payWayCode()=="CMS" || self.payWayCode()=="VAC") { if(""=='E'){ return "Bank"; }else{ return "은행"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "News agency"; }else{ return "통신사"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit card company"; }else{ return "신용카드사"; } } //return self.payWayCode()=="CMS"?"은행":"통신사"; } ); self.hpCd.eid="pay_code"; self.payCd = ko.computed(function(){ if(self.payWayCode()=="CMS"){ return self.bankCd(); } else if(self.payWayCode()=="VAC") { return self.vacBankCd(); } else if(self.payWayCode()=="MOB") { return self.hpCd(); } else if(self.payWayCode()=="CAR") { return self.cardCd(); } }); self.hpCdNm = ko.computed(function(){ if(self.hpCd()=="SKT") { return "SK텔레콤"; } else if(self.hpCd()=="KTF") { return "KT"; } else if(self.hpCd()=="LGT") { return "LG U+"; } }); self.hpNm= ko.observable("").extend({required:true,NotWithSpecialCharPattern:true,minLength:1, maxLength:30}); /* self.hpNm= ko.observable("").extend({required:{onlyIf:function(){ return self.payWayCode()=="CMS" || self.payWayCode()=="CAR" || self.payWayCode()=="MOB"; }}, NotWithSpecialCharPattern:true,minLength:1, maxLength:10}); */ self.hpNm.displayName=ko.computed(function() { if(self.payWayCode()=="CMS" || self.payWayCode()=="VAC") { if(""=='E'){ return "Deposit Account Name"; }else{ return "예금주명"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Name"; }else{ return "가입자명"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Name of Subscriber"; }else{ return "명의자명"; } } }); self.hpNm.eid="hpNm"; self.hpNo1 = ko.observable(""); self.hpNo1.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; }); self.hpNo1.eid="hpNo2"; self.hpNo2 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isHp(); }}, NumLimitedLengthPattern:{required:false,min:3,max:4}}); self.hpNo2.displayName=ko.computed(function() { return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; }); self.hpNo2.eid="hpNo2"; self.hpNo3 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isHp(); }}, NumLimitedLengthPattern:{required:false,min:4,max:4}}); self.hpNo3.displayName=ko.computed(function() { return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; }); self.hpNo3.eid="hpNo2"; self.cardNo1 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isCard(); }}, NumLimitedLength2Pattern:{required:false,min:4,max:4}}); self.cardNo1.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; } ); self.cardNo1.eid="cardNo1"; self.cardNo2 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isCard(); }}, NumLimitedLength2Pattern:{required:false,min:4,max:4}}); self.cardNo2.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; } ); self.cardNo2.eid="cardNo2"; self.cardNo3 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isCard(); }}, NumLimitedLength2Pattern:{required:false,min:4,max:4}}); self.cardNo3.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; } ); self.cardNo3.eid="cardNo3"; self.cardNo4 = ko.observable("").extend({required:{onlyIf: function () { return self.params.isCard(); }}, //카드 자리수는 14~16자리 NumLimitedLengthPattern:{required:false,min:2,max:4}}); self.cardNo4.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"결제휴대폰"; } ); self.cardNo4.eid="cardNo4"; self.yearOfCard=ko.observable(""); self.monthOfCard=ko.observable(""); self.validCard = ko.computed(function(){ return self.yearOfCard()+""+self.monthOfCard(); }).extend({ MinMonthOfDatePattern:{condition:function(){return self.payWayCode()=="CAR"}, minMonth:parent.parent.month, msg:"유효기간이 경과한 카드는 등록할 수 없습니다."}}); self.acctNo = ko.observable("").extend({required:{onlyIf: function () { return self.params.isCms(); }}, NumLimitedLengthPattern:{required:false,min:8,max:15}}); self.acctNo.displayName="계좌번호"; self.acctNo.eid="acctNo"; self.hpNum= ko.computed(function(){ if(self.payWayCode()=="MOB") { self.cardNo1(""); self.cardNo2(""); self.cardNo3(""); self.cardNo4(""); self.acctNo(""); self.juminNum1(""); return self.hpNo1()+""+self.hpNo2()+""+self.hpNo3();	} else if(self.payWayCode()=="CAR") { self.hpNo1(""); self.hpNo2(""); self.hpNo3(""); self.acctNo(""); self.juminNum1(""); return self.cardNo1()+""+self.cardNo2()+""+self.cardNo3()+""+self.cardNo4();	} else if(self.payWayCode()=="CMS") { self.cardNo1(""); self.cardNo2(""); self.cardNo3(""); self.cardNo4(""); self.hpNo1(""); self.hpNo2(""); self.hpNo3(""); self.juminNum1(""); return self.acctNo();	} else if(self.payWayCode()=="VAC") { self.cardNo1(""); self.cardNo2(""); self.cardNo3(""); self.cardNo4(""); self.hpNo1(""); self.hpNo2(""); self.hpNo3(""); self.juminNum1(""); self.acctNo("1111111111"); return self.acctNo(); } }); self.hpNum.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Account Number"; }else{ return "계좌번호"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Payment Mobile Phone"; }else{ return "결제휴대폰"; } } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Credit Card"; }else{ return "신용카드"; } } //return self.payWayCode()=="CMS"?"계좌번호":"휴대폰번호"; }); //self.hpNum.eid="pay_tel1"; self.hpNumFormat= ko.computed(function(){ return self.hpNo1()+"-"+self.hpNo2()+"-"+self.hpNo3(); }); self.cardNumFormat= ko.computed(function(){ return self.cardNo1()+"-"+self.cardNo2()+"-"+self.cardNo3()+"-"+self.cardNo4(); }); /********************************************************************************************************************/ self.juminNum1=ko.observable("").extend({NumLimitedLengthPatternForVac:{condition:function(){return self.payWayCode()!="VAC";},required:true,min:6,max:10}}); self.juminNum1.displayName = "생년월일"; self.juminNum2=ko.observable("").extend({NumLimitedLengthPatternForVac:{condition:function(){return self.payWayCode()!="VAC";},min:0,max:1}}); self.juminNum2.displayName = "주민번호 뒤 1자리"; self.juminNum= ko.computed(function(){ if(self.payWayCode()=="CMS") { self.juminNum2(""); return self.juminNum1(); } else if(self.payWayCode()=="MOB") { return self.juminNum1() +self.juminNum2(); } else if(self.payWayCode()=="CAR") { self.juminNum2(""); return self.juminNum1(); } else if(self.payWayCode()=="VAC") { self.juminNum1("111111"); self.juminNum2(""); return self.juminNum1(); } }).extend({required:true,NewJuminNoPattern2:{paywayCode:self.payWayCode}}); self.juminNum.displayName=ko.computed(function() { if(self.payWayCode()=="CMS") { if(""=='E'){ return "Date of Birth"; }else{ return "생년월일"; } } else if(self.payWayCode()=="MOB") { if(""=='E'){ return "Date of Birth"; }else{ return "생년월일"; } //return "주민번호"; } else if(self.payWayCode()=="CAR") { if(""=='E'){ return "Date of Birth or
사업자번호"; } } });	self.juminNum.eid="juminNum1";	//정기후원일 체크 self.payDt = ko.observable("").extend({required: { onlyIf: function () { return self.memPayType()=="R"; } }}); if(""=='E'){ self.payDt.displayName ="Regular Payment Date"; }else{ self.payDt.displayName ="정기결제일"; } self.moneyRange={}; self.moneyRange.min=ko.computed(function(){ /* if(self.payWayCode()=="CMS") { return parseInt("5000",10); } else if(self.payWayCode()=="MOB") { return parseInt("5000",10); } else if(self.payWayCode()=="CAR") { return parseInt("5000",10); } */	return parseInt("5000",10); //return self.payWayCode()=="CMS"?parseInt("5000",10):parseInt("5000",10); }); self.moneyRange.minText=ko.computed(function(){ /* if(self.payWayCode()=="CMS") { return root.commNumberFormat("5000"); } else if(self.payWayCode()=="MOB") { return root.commNumberFormat("5000"); } else if(self.payWayCode()=="CAR") { return root.commNumberFormat("5000"); } */	return root.commNumberFormat("5000"); //return self.payWayCode()=="CMS"?parseInt("5000",10):parseInt("5000",10); }); self.moneyRange.max= ko.computed(function(){ if(self.payWayCode()=="CMS") { return parseInt("10000000",10); } else if(self.payWayCode()=="MOB") { return parseInt("10000000",10); } else if(self.payWayCode()=="CAR") { return parseInt("10000000",10); } else if(self.payWayCode()=="VAC") { return 1000000000; } //return self.payWayCode()=="CMS"?parseInt("10000000",10):parseInt("10000000",10); }); self.params.confirmAmountRange = []; self.params.confirmAmountValues = []; if(_.isNaN(self.moneyRangeS)==false && self.moneyRangeS!="0") { if(""=='E'){ self.params.confirmAmountRange.push({code:self.moneyRangeS,value:root.commNumberFormat(self.moneyRangeS)+"won"}); }else{ self.params.confirmAmountRange.push({code:self.moneyRangeS,value:root.commNumberFormat(self.moneyRangeS)+"원"}); } self.params.confirmAmountValues.push(self.moneyRangeS); } if(_.isNaN(self.moneyRangeM)==false && self.moneyRangeM!="0") { if(""=='E'){ self.params.confirmAmountRange.push({code:self.moneyRangeM,value:root.commNumberFormat(self.moneyRangeM)+"won"}); }else{ self.params.confirmAmountRange.push({code:self.moneyRangeM,value:root.commNumberFormat(self.moneyRangeM)+"원"}); } self.params.confirmAmountValues.push(self.moneyRangeM); } if(_.isNaN(self.moneyRangeL)==false && self.moneyRangeL!="0") { if(""=='E'){ self.params.confirmAmountRange.push({code:self.moneyRangeL,value:root.commNumberFormat(self.moneyRangeL)+"won"}); }else{ self.params.confirmAmountRange.push({code:self.moneyRangeL,value:root.commNumberFormat(self.moneyRangeL)+"원"}); } self.params.confirmAmountValues.push(self.moneyRangeL); } if(""=='E'){ self.params.confirmAmountRange.push({code:"0",value:"Direct Input"}); }else{ self.params.confirmAmountRange.push({code:"0",value:"직접입력"}); } self.params.confirmAmountValues.push("0"); self.tmpConfirmAmount = ko.observable(""); self.tmpConfirmAmount2 = ko.observable(""); self.tmpConfirmAmountCheck = ko.computed(function(){ if(self.moneyType=="C") { if(self.tmpConfirmAmount()!="0" && self.tmpConfirmAmount()!="") { self.tmpConfirmAmount2("0"); self.confirmAmount(root.stripFormat(self.tmpConfirmAmount())); } if(self.tmpConfirmAmount2()!="0" && self.tmpConfirmAmount2()!="") { self.confirmAmount(root.stripFormat(self.tmpConfirmAmount2())); } } }); self.confirmAmount = ko.observable("").extend({required:true,MoneyRangePattern:self.moneyRange}); self.confirmAmount.displayName="결제금액"; self.confirmAmount.eid="pay_amount"; self.transactionuniqNum = ko.observable(""); self.transactionKey = ko.observable(""); self.validCancelDate = ko.observable(""); self.resultYn = ko.observable(""); self.resultCode = ko.observable(""); self.inMemNo= ko.observable(""); self.payWayAvailableTmp = []; self.payWayAvailable = []; if(self.cmsOpen=="Y" && self.cmsFlag=="Y") { if(""=='E'){ self.payWayAvailable.push({code:"CMS",value:"Direct Debit(CMS)"}); }else{ self.payWayAvailable.push({code:"CMS",value:"자동이체(CMS)"}); } } if(self.cardOpen=="Y" && self.cardFlag=="Y") { if(self.cardPayType=="A") { if(""=='E'){ self.payWayAvailable.push({code:"CAR",value:"Paying Credit"}); self.payWayAvailableTmp.push({code:"CAR",value:"Paying Credit"}); }else{ self.payWayAvailable.push({code:"CAR",value:"카드결제"}); self.payWayAvailableTmp.push({code:"CAR",value:"카드결제"}); } } else if(self.cardPayType=="R") { if(""=='E'){ self.payWayAvailable.push({code:"CAR",value:"Paying Credit"}); }else{ self.payWayAvailable.push({code:"CAR",value:"카드결제"}); } } else if(self.cardPayType=="T") { if(""=='E'){ self.payWayAvailableTmp.push({code:"CAR",value:"Paying Credit"}); }else{ self.payWayAvailableTmp.push({code:"CAR",value:"카드결제"}); } } } if(self.hpOpen=="Y" && self.hpFlag=="Y") { if(self.hpPayType=="A") { if(""=='E'){ self.payWayAvailable.push({code:"MOB",value:"Mobile Phone Billing"}); self.payWayAvailableTmp.push({code:"MOB",value:"Mobile Phone Billing"}); }else{ self.payWayAvailable.push({code:"MOB",value:"휴대폰"}); self.payWayAvailableTmp.push({code:"MOB",value:"휴대폰"}); } } else if(self.hpPayType=="R") { if(""=='E'){ self.payWayAvailable.push({code:"MOB",value:"Mobile Phone Billing"}); }else{ self.payWayAvailable.push({code:"MOB",value:"휴대폰"}); } } else if(self.hpPayType=="T") { if(""=='E'){ self.payWayAvailableTmp.push({code:"MOB",value:"Mobile Phone Billing"}); }else{ self.payWayAvailableTmp.push({code:"MOB",value:"휴대폰"}); } } } // 가상계좌 if(self.vacOpen=="Y" && self.vacFlag == "Y") { if(""=='E'){ self.payWayAvailableTmp.push({code:"VAC",value:"Virtual Account"}); }else{ self.payWayAvailableTmp.push({code:"VAC",value:"가상계좌"}); } } self.payWayCode(self.payWayAvailable.length >0?self.payWayAvailable[0].code:self.payWayAvailableTmp[0].code); self.payWayCode.subscribe(function(newValue){ self.payDt(""); if(newValue == "VAC") { self.hpNm(self.memNm()); } else if(newValue == "MOB") { /* self.juminNum2("1"); */ self.hpNm(""); } else { self.hpNm(""); } }); self.memPayType(self.payWayAvailable.length >0?"R":"T"); self.memPayType.subscribe(function(newValue){	if(newValue=="T") { self.payWayCode(self.payWayAvailableTmp[0].code); self.payDt(""); } else if(newValue=="R") { self.payWayCode(self.payWayAvailable[0].code); }	}); self.bannerId = ko.observable("BWGNLDLMZ5"); self.token = ko.observable("").extend({required: { onlyIf: function () { return self.payWayCode()=="MOB" && self.introMode(); } }});	self.smsVal = ko.observable("").extend({required:{ onlyIf: function () { return self.payWayCode()=="MOB" && self.introMode(); } },minLength:6,maxLength:6}); self.smsVal.displayName = "인증번호"; self.smsVal.eid="smsVal"; self.agree1Param = new Object(); self.agree1Param["condition"] = function() {return self.memPayType()=="R";}; self.agree1Param["testVal"] = "true"; self.agree1Param["message"] ="자동결제에 동의해 주세요"; self.agree1 = ko.observable("").extend({EqualsPattern: {testVal:true,condition:function() {return self.memPayType()=="R";},showMsg:"자동결제에 동의해 주세요"} }); self.agree1.displayName ="자동결제동의"; self.agree1.eid ="agree1"; self.agree2Param = new Object(); self.agree2Param["condition"] = function() {return true;}; self.agree2Param["testVal"] = true; self.agree2Param["showMsg"] ="이용약관과 개인정보 취급방침에 동의해 주세요. "; self.agree2 = ko.observable("").extend({EqualsPattern: self.agree2Param});	self.agree2.displayName ="이용약관과 개인정보"; self.agree2.eid ="agree2"; //모금가협회 예외처리 self.checkAgree = ko.computed(function(){ //TODO 동의 체크 }); self.hpAuthMD = new function() { var subSelf = this; subSelf.mediaType = ko.observable("B"); subSelf.bannerId = ko.observable("BWGNLDLMZ5"); subSelf.smsVal = ko.computed(function(){ return self.smsVal(); }).extend({required:true,NumLimitedLengthPattern:{required:true,min:6,max:6}}); subSelf.smsVal.displayName = "인증번호"; subSelf.smsVal.eid= "smsVal"; subSelf.payWayCode = ko.computed(function(){ return self.payWayCode(); }); subSelf.hpNm = ko.computed(function(){ return self.hpNm(); }); subSelf.confirmAmount = ko.computed(function(){ return self.confirmAmount(); }); subSelf.hpCd = ko.computed(function(){ return self.hpCd(); }); subSelf.hpNo1 = ko.computed(function(){ return self.hpNo1(); }); subSelf.hpNo2 = ko.computed(function(){ return self.hpNo2(); }); subSelf.hpNo3 = ko.computed(function(){ return self.hpNo3(); }); subSelf.hpNum= ko.computed(function(){ return self.hpNum(); }); subSelf.juminNum = ko.computed(function(){ return self.juminNum(); });	subSelf.token = ko.computed(function(){ return self.token(); });	/* subSelf.gender = ko.computed(function(){ return self.gender(); }); */ subSelf.memGrp = ko.computed(function(){ return self.memGrp(); }); subSelf.memTel1 = ko.computed(function(){ return self.memTel1(); });	subSelf.memTel2 = ko.computed(function(){ return self.memTel2(); });	subSelf.memTel3 = ko.computed(function(){ return self.memTel3(); }); /* subSelf.memDonationJuminNum = ko.computed(function(){ return self.memDonationJuminNum(); });	subSelf.memJuminNum2 = ko.computed(function(){ return self.memJuminNum2(); });	*/ subSelf.payEndDate = ko.computed(function(){ return self.payEndDate(); });	// subSelf.mem_post_cd3 = ko.computed(function(){ return self.memZipCode3(); }); subSelf.mem_addr1 = ko.computed(function(){ return self.memAddr1(); }); subSelf.mem_addr2 = ko.computed(function(){ return self.memAddr2(); }); /* subSelf.mem_id = ko.computed(function(){ return self.memId(); }); */ /* subSelf.mem_mng_no = ko.computed(function(){ return self.memManageNo(); }); */ /* subSelf.mem_memo = ko.computed(function(){ return self.memMemo(); }); */ subSelf.mem_paytype = ko.computed(function(){ return self.memPayType(); }); subSelf.pay_dt = ko.computed(function(){ return self.payDt(); }); subSelf.donation_jumin_num = ko.computed(function(){ return self.memDonationJuminNum(); }); subSelf.mem_email = ko.computed(function(){ return self.emailAddr(); }); subSelf.mem_email_id = ko.computed(function(){ return self.emailId(); }); subSelf.mem_email_domain = ko.computed(function(){ return self.emailDomain(); }); subSelf.recommend = ko.computed(function(){ return self.recommend(); }); subSelf.paygrp_grp_code = ko.computed(function(){ return self.payGrp(); }); subSelf.mem_type = ko.computed(function(){ return self.memType(); }); subSelf.mem_title = ko.computed(function(){ return self.memTitle(); }); subSelf.company_station = ko.computed(function(){ return self.companyStation(); }); }; self.cardConfirmMD = new function() { var subSelf = this; subSelf.mediaType = ko.observable("B"); subSelf.bannerId = ko.observable("BWGNLDLMZ5"); subSelf.smsVal = ""; subSelf.payWayCode = ko.computed(function(){ return self.payWayCode(); }); subSelf.hpNm = ko.computed(function(){ return self.hpNm(); }); subSelf.confirmAmount = ko.computed(function(){ return self.confirmAmount(); }); subSelf.hpCd = ko.computed(function(){ return self.payCd(); });	subSelf.telNo = ko.computed(function(){ return self.memTel(); });	subSelf.hpNum= ko.computed(function(){ return self.hpNum(); }); subSelf.juminNum = ko.computed(function(){ return self.juminNum(); });	/* subSelf.gender = ko.computed(function(){ return self.gender(); }); */ subSelf.token = ko.computed(function(){ return self.token(); }); subSelf.yearOfCard = ko.computed(function(){ return self.yearOfCard(); }); subSelf.monthOfCard = ko.computed(function(){ return self.monthOfCard(); }); subSelf.validCancelDate= ko.computed(function(){ return self.validCancelDate(); }); subSelf.memGrp = ko.computed(function(){ return self.memGrp(); }); subSelf.memTel1 = ko.computed(function(){ return self.memTel1(); });	subSelf.memTel2 = ko.computed(function(){ return self.memTel2(); });	subSelf.memTel3 = ko.computed(function(){ return self.memTel3(); }); /* subSelf.memDonationJuminNum = ko.computed(function(){ return self.memDonationJuminNum(); });	subSelf.memJuminNum2 = ko.computed(function(){ return self.memJuminNum2(); });	*/ subSelf.payEndDate = ko.computed(function(){ return self.payEndDate(); });	subSelf.mem_post_cd3 = ko.computed(function(){ return self.memZipCode3(); }); subSelf.mem_addr1 = ko.computed(function(){ return self.memAddr1(); }); subSelf.mem_addr2 = ko.computed(function(){ return self.memAddr2(); }); /* subSelf.mem_id = ko.computed(function(){ return self.memId(); }); */ /* subSelf.mem_mng_no = ko.computed(function(){ return self.memManageNo(); }); */ /* subSelf.mem_memo = ko.computed(function(){ return self.memMemo(); }); */ subSelf.mem_paytype = ko.computed(function(){ return self.memPayType(); }); subSelf.pay_dt = ko.computed(function(){ return self.payDt(); }); subSelf.donation_jumin_num = ko.computed(function(){ return self.memDonationJuminNum(); }); subSelf.mem_email = ko.computed(function(){ return self.emailAddr(); }); subSelf.mem_email_id = ko.computed(function(){ return self.emailId(); }); subSelf.mem_email_domain = ko.computed(function(){ return self.emailDomain(); }); subSelf.recommend = ko.computed(function(){ return self.recommend(); }); subSelf.paygrp_grp_code = ko.computed(function(){ return self.payGrp(); }); subSelf.mem_type = ko.computed(function(){ return self.memType(); }); subSelf.mem_title = ko.computed(function(){ return self.memTitle(); }); subSelf.company_station = ko.computed(function(){ return self.companyStation(); }); }; // 가상계좌 self.vacConfirmMD = new function() { var subSelf = this; subSelf.mediaType = ko.observable("B"); subSelf.bannerId = ko.observable("BWGNLDLMZ5"); subSelf.smsVal = ""; subSelf.payWayCode = ko.computed(function(){ return self.payWayCode(); }); subSelf.hpNm = ko.computed(function(){ return self.hpNm(); }); subSelf.confirmAmount = ko.computed(function(){ return self.confirmAmount(); }); subSelf.hpCd = ko.computed(function(){ return self.vacBankCd(); }); subSelf.telNo = ko.computed(function(){ return self.memTel(); }); subSelf.hpNum= ko.computed(function(){ return self.hpNum(); }); subSelf.juminNum = ko.computed(function(){ return self.juminNum(); }); /* subSelf.gender = ko.computed(function(){ return self.gender(); }); */ subSelf.token = ko.computed(function(){ return self.token(); }); /* subSelf.yearOfCard = ko.computed(function(){ return self.yearOfCard(); }); subSelf.monthOfCard = ko.computed(function(){ return self.monthOfCard(); }); */ /* subSelf.validCancelDate= ko.computed(function(){ return self.validCancelDate(); }); */ subSelf.memGrp = ko.computed(function(){ return self.memGrp(); }); subSelf.memTel1 = ko.computed(function(){ return self.memTel1(); }); subSelf.memTel2 = ko.computed(function(){ return self.memTel2(); }); subSelf.memTel3 = ko.computed(function(){ return self.memTel3(); }); /* subSelf.memDonationJuminNum = ko.computed(function(){ return self.memDonationJuminNum(); }); subSelf.memJuminNum2 = ko.computed(function(){ return self.memJuminNum2(); }); */ subSelf.payEndDate = ko.computed(function(){ return self.payEndDate(); }); subSelf.mem_post_cd3 = ko.computed(function(){ return self.memZipCode3(); }); subSelf.mem_addr1 = ko.computed(function(){ return self.memAddr1(); }); subSelf.mem_addr2 = ko.computed(function(){ return self.memAddr2(); }); /* subSelf.mem_id = ko.computed(function(){ return self.memId(); }); */ /* subSelf.mem_mng_no = ko.computed(function(){ return self.memManageNo(); }); */ /* subSelf.mem_memo = ko.computed(function(){ return self.memMemo(); }); */ subSelf.mem_paytype = ko.computed(function(){ return self.memPayType(); }); subSelf.pay_dt = ko.computed(function(){ return self.payDt(); }); subSelf.donation_jumin_num = ko.computed(function(){ return self.memDonationJuminNum(); }); subSelf.mem_email = ko.computed(function(){ return self.emailAddr(); }); subSelf.mem_email_id = ko.computed(function(){ return self.emailId(); }); subSelf.mem_email_domain = ko.computed(function(){ return self.emailDomain(); }); subSelf.recommend = ko.computed(function(){ return self.recommend(); }); subSelf.paygrp_grp_code = ko.computed(function(){ return self.payGrp(); }); subSelf.mem_type = ko.computed(function(){ return self.memType(); }); subSelf.mem_title = ko.computed(function(){ return self.memTitle(); }); subSelf.company_station = ko.computed(function(){ return self.companyStation(); }); }; } function formMD(parent) { var self = this; var submitProgress = "N"; self.parent = parent; self.formValueMD = new formValueMD(self);	self.returnData = ko.observable({}); self.processStatus = ko.observable(false); ko.utils.extend(self.formValueMD,CustomValidator); ko.utils.extend(self.formValueMD.hpAuthMD,CustomValidator); self.tmpJuminNum2 = ko.observable(""); self.goSign = function(){	$("#sign-layer").dialog("close"); popupFrame.location.href="/Nanum/nanum/comm/esign/kcbSignBase?ssn="+self.formValueMD.juminNum1()+self.tmpJuminNum2(); }; self.registMember = function(){ function isValidDate(date){ if(date.length!=8){ return false; } cDate = new Date(); cDate.setFullYear(date.substring(0,4)); cDate.setMonth(parseInt(date.substring(4,6))-1); cDate.setDate(date.substring(6)); if(cDate.getFullYear()!=date.substring(0,4)|| cDate.getMonth()+1!=date.substring(4,6)|| cDate.getDate()!=date.substring(6)){ return false; } else{ var a = new Date(); var now = a.getFullYear()*10000+(a.getMonth()+1)*100+a.getDate(); if(now>date){ return false; }else{ return true; } } } if(isValidDate($("#payEndDate").val())){ }else{ alert("결제종료일을 가입일보다 앞선 8자리 날짜로 맞춰주세요.") return false; } function dateCheck(date){ var year = date.substr(0,2); var month = date.substr(2,2); var day = date.substr(4,2); var now = new Date(); var nYear = now.getFullYear(); if(month<1||month>12){ alert("생년월일/사업자번호 오류입니다.") return false; } if(day<1||day>31){ alert("생년월일/사업자번호 오류입니다.") return false; } if((month==4||month==6||month==9||month==11)&&day==31){ alert("생년월일/사업자번호 오류입니다.") return false; } if(month==2&&day>29){ alert("생년월일/사업자번호 오류입니다.") return false; } return true; } $("#confirmAmount").trigger("change"); $("#hpCd").trigger("change"); $("#juminNum1").trigger("change"); $("#juminNum2").trigger("change"); $("#emailDomain").trigger("change"); $("#emailId").trigger("change"); /* $("#memZipCode1").trigger("change"); */ /* $("#memZipCode2").trigger("change"); */ $("#memZipCode3").trigger("change"); $("#memAddr1").trigger("change"); $("#memAddr2").trigger("change"); $("#hpNo1").trigger("change"); $("#hpNo2").trigger("change"); $("#hpNo3").trigger("change"); if(self.formValueMD.emailId()!=""&&self.formValueMD.emailDomain()==""){ alert("이메일을 모두 입력해주세요."); return false; } if(self.formValueMD.emailId()==""&&self.formValueMD.emailDomain()!=""){ alert("이메일을 모두 입력해주세요."); return false; } if(self.formValueMD.emailDomain()!=""&&!self.formValueMD.emailDomain().match(/^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i)){ alert("이메일 도메인이 양식에 맞지 않습니다.") return false; } if(self.formValueMD.payWayCode() == 'VAC') { self.formValueMD.hpNm(self.formValueMD.memNm()); } var jsonStr = root.toJsonOnlyObservable(self.formValueMD); //console.log(jsonStr); if(self.formValueMD.memDonationJuminNum().length==10||self.formValueMD.memDonationJuminNum().length==0||self.formValueMD.memDonationJuminNum().length==13){ }else{ alert("기부금 영수증 발급을 위한 주민번호/사업자번호는 10자 또는 13자를 적어주셔야합니다.") return false; } var isValid = self.formValueMD.validate(false); if(isValid==false) return false;	////console.log(submitProgress); if(self.formValueMD.payWayCode()!='VAC') { if($("#juminNum1").val().length==6){ if(dateCheck($("#juminNum1").val())){ }else{ return false; } }else if($("#juminNum1").val().length==10){ }else if(self.formValueMD.payWayCode()=='CAR'){ alert("생년월일 6자리와 또는 법인번호 10자리를 정확히 입력해주세요.") return false; }else{ alert("생년월일 6자리를 정확히 입력해주세요.") return false; } } if(submitProgress == "Y") { alert("결제가 진행중입니다. 잠시 기다려주세요"); return false; } ////console.log("callFunction: "+submitProgress); submitProgress = "Y"; ////console.log("setVar: "+submitProgress); //alert(1); if(self.formValueMD.payWayCode()=='CMS') {//계좌조회 //customBlockUI(); ////console.log($.blockUI); $.ajax({ type: 'POST', url: "/Nanum/nanum/comm/makeSureAccount.nanum", data: { strResId: self.formValueMD.juminNum().substr(0,6), strNm:self.formValueMD.hpNm(), strBankCode:self.formValueMD.payCd(), strAccountNo:self.formValueMD.hpNum() }, beforeSend: function(data){ waitingDialog({}); //alert(); }, success: function(data){	if(data.resultCode!="0000") { alert("다음과 같은 사유로 입력하신 계좌에 오류가 발견되었습니다.\n계좌조회결과 :["+data.resultMsg+"("+data.resultCode+")]"); } else { self.processStatus(true); self.submit(); } /*테스트용코드**************************************************************************************/ /* self.processStatus(true); self.submit(); */ /*테스트용코드**************************************************************************************/ }, complete: function(data){ closeWaitingDialog(); }, dataType: "json", async:false }); ////console.log($.blockUI); // TODO 2014/01/22 } else if(self.formValueMD.payWayCode()=='MOB') { //휴대폰 후원 /nanum/banner/hpAuthStep1 , appAmount hpCd hpNo hpJuminNo orgaNm appAmountVal = self.formValueMD.confirmAmount().replace(/,/gi,''); hpCdVal = self.formValueMD.payCd(); hpNoVal = self.formValueMD.hpNum(); hpJuminNoVal = self.formValueMD.juminNum(); //alert(hpJuminNoVal); orgaNmVal = self.formValueMD.orgaNm; processOkay=false;	$.ajax({ type: 'POST', url: "/Nanum/nanum/banner/hpauth/BWGNLDLMZ5/auth.nanum", data: { vanCode:"HY", amount: appAmountVal, hpCd:hpCdVal, rphone:hpNoVal, hpJuminNoVal:hpJuminNoVal, orgaNm:orgaNmVal}, beforeSend: function(data){ waitingDialog({}); }, success: function(data){ if(data.resultFlag=="N") { alert("인증 메시지 발송에 실패하였습니다. 잠시 후 다시 시도하여 주시기 바랍니다"); } else { var smsVal=data.etcValue; pass.viewMD.formMD.formValueMD.token(smsVal); $("#token").trigger("change"); $("#smsVal").val(""); $("#smsVal").trigger("change"); accResult="false"; // Dialog창 openHpAuth(); } }, complete: function(data){ closeWaitingDialog(); }, dataType: "json", async:false }); //TODO 2014/01/22 - 승인처리 } else if(self.formValueMD.payWayCode()=='CAR') {	var isValid = self.formValueMD.validate(false); if(isValid==false) return false; //모바일 브라우져가 아니고 공인인증 사용업체 //카드는 공인인증서 대상에서 제외. 20151231 self.cardConfirm(); // 가상계좌 } else if(self.formValueMD.payWayCode()=='VAC') { //alert(2); //var jsonStr = root.toJsonOnlyObservable(self.formValueMD); ////console.log(jsonStr); var isValid = self.formValueMD.validate(false); if(isValid==false) return false; //alert(3); self.vacConfirm(); } submitProgress = "N"; ////console.log("Function End: "+submitProgress); }; //휴대폰 인증 후 결제 self.regist = function() { //var jsonStr = root.toJsonOnlyObservable(self.formValueMD); ////console.log(jsonStr); var isValid = self.formValueMD.hpAuthMD.validate(false); if(isValid==false) return false;	var jsonStr = root.toJsonOnlyObservable(self.formValueMD.hpAuthMD); ////console.log(jsonStr); $.ajax({ type: 'POST', url: "/Nanum/nanum/banner/hpauth/BWGNLDLMZ5/verifyAndConfirm", data: jsonStr, contentType: "application/json", beforeSend: function(data){ waitingDialog({}); }, success: function(data){ // TODO 선택목록에서 처리된rownum(unique value) 삭제 - self.selectedListData(_.without(pass.viewMD.listMD.selectedListData(),'1'))	////console.log(data.transactionStatus); if(data.transactionStatus==false) { alert("결제신청진행 불가\n=========\n"+data.errorMsg.join(",").replace(/,/g,"\n"));	aJaxResult = false; if(data.errorMsg.join(",").replace(/,/g,"\n").indexOf("인증번호")<0) { closeHpAuth(); } } else { self.formValueMD.resultYn(data.body.resultYn); self.formValueMD.resultCode(data.body.resultCode); self.formValueMD.transactionKey(data.body.transactionKey); self.formValueMD.transactionuniqNum(data.body.transactionuniqNum); self.formValueMD.inMemNo(data.body.inMemNo); aJaxResult = true; closeHpAuth(); smsCheckFlag ="true"; self.processStatus(true); self.submit(); } }, complete: function(data){ closeWaitingDialog(); }, dataType: "json", async:false });	}; self.cardConfirm = function() { var jsonStr = root.toJsonOnlyObservable(self.formValueMD.cardConfirmMD); var chargeCnt="0"; switch(self.formValueMD.cardConfirmMD.confirmAmount()){ /* case "11000": chargeCnt = "10000"; break; case "33000": chargeCnt = "30000"; break; case "55000": chargeCnt = "50000"; break; case "110000": chargeCnt = "100000"; break; case "220000": chargeCnt = "200000"; break; case "330000": chargeCnt = "300000"; break; */	case "11000": chargeCnt = "1000"; break; case "33000": chargeCnt = "3000"; break; case "55000": chargeCnt = "5000"; break; case "110000": chargeCnt = "10000"; break; case "220000": chargeCnt = "20000"; break; case "330000": chargeCnt = "30000"; break; } //console.log(jsonStr); $.ajax({ type: 'POST', url: "/Nanum/nanum/banner/hpauth/BWGNLDLMZ5/cardConfirm", data: jsonStr, contentType: "application/json", beforeSend: function(data){ waitingDialog({}); }, success: function(data){ // TODO 선택목록에서 처리된rownum(unique value) 삭제 - self.selectedListData(_.without(pass.viewMD.listMD.selectedListData(),'1'))	////console.log(data.transactionStatus); if(data.transactionStatus==false) { alert("결제신청진행 불가\n=========\n"+data.errorMsg.join(",").replace(/,/g,"\n"));	aJaxResult = false; } else { if("BWGNLDLMZ5"=="6XT5KQ8WY0"&&("null"!="null" && "null"!="")){ var smsData = { orgaUniqNum:"null", orgaId:"null", chargeCnt:chargeCnt } var sSmsData = JSON.stringify(smsData); // TODO POST $.ajax({ type: 'POST', url: "/Nanum/nanum/user/orga/setSmsCharge", data: sSmsData, contentType: "application/json", success: function(sdata){ if(sdata.transactionStatus==false) { alert("즉시 충전에 실패했습니다. \n유선번호를 통해 충전을 완료해주세요.");	} else { alert("성공적으로 문자충전이 등록되었습니다"); }	/* btnSearchOrga(); */ }, dataType: "json", async:false });	} self.formValueMD.resultYn(data.body.resultYn); self.formValueMD.resultCode(data.body.resultCode); self.formValueMD.transactionKey(data.body.transactionKey); self.formValueMD.transactionuniqNum(data.body.transactionuniqNum); self.formValueMD.inMemNo(data.body.inMemNo); self.formValueMD.validCancelDate(data.body.validCancelDate); aJaxResult = true; self.processStatus(true); self.submit(); } }, complete: function(data){ closeWaitingDialog(); }, /* error: function(data){ //console.log("error:"+data) }, */ dataType: "json", async:false }); }; self.vacConfirm = function() { var jsonStr = root.toJsonOnlyObservable(self.formValueMD.vacConfirmMD); $.ajax({ type: 'POST', url: "/Nanum/nanum/banner/hpauth/BWGNLDLMZ5/vacConfirm", data: jsonStr, contentType: "application/json", beforeSend: function(data){ waitingDialog({}); }, success: function(data){ //console.log(data); // TODO 선택목록에서 처리된rownum(unique value) 삭제 - self.selectedListData(_.without(pass.viewMD.listMD.selectedListData(),'1')) ////console.log(data.transactionStatus); if(data.transactionStatus==false) { alert("결제신청진행 불가\n=========\n"+data.errorMsg.join(",").replace(/,/g,"\n")); aJaxResult = false; } else { /* self.formValueMD.resultYn(data.body.resultYn); self.formValueMD.resultCode(data.body.resultCode); self.formValueMD.transactionKey(data.body.transactionKey); self.formValueMD.transactionuniqNum(data.body.transactionuniqNum); self.formValueMD.inMemNo(data.body.inMemNo); self.formValueMD.validCancelDate(data.body.validCancelDate); aJaxResult = true; self.processStatus(true); */ alert(data.body.resultMsg); //alert("성공적으로 결제등록 되었습니다."); //alert(1); if(root.mobilecheck()==true) { //window.close(); window.open("about:blank","_self").close(); } else { //window.close(); window.open("about:blank","_self").close(); location.reload(); } /* 가상계좌는 회원가입처리 안함 */ /* self.submit(); */ } }, complete: function(data){ closeWaitingDialog(); }, dataType: "json", async:false }); }; self.submit = function() { var jsonStr = root.toJsonOnlyObservable(self.formValueMD,"tmpConfirmAmount","tmpConfirmAmount2","tmpConfirmAmountCheck","topImg", "topImgFlag","selfCertFlag","vacBankCd"); //var jsonStr = root.toJsonOnlyObservable(self.formValueMD,"tmpConfirmAmount","tmpConfirmAmount2","tmpConfirmAmountCheck","topImg", "topImgFlag","selfCertFlag"); //console.log(jsonStr); var isValid = self.formValueMD.validate(false); if(isValid==false) return false; // TODO POST $.ajax({ type: 'POST', url: "/Nanum/nanum/banner/BWGNLDLMZ5/insert", data: jsonStr, contentType: "application/json", beforeSend: function(data){ $("#btnRegist").attr("disabled", true); $("#btnRegist2").attr("disabled", true); waitingDialog({}); }, success: function(data){ if(data.transactionStatus==false) { alert(data.errorMsg.join(",").replace(/,/g,"\n"));	} else { // CMS인 경우 콜백문자에 대한 언급 필요 /* if(root.mobilecheck()==false && self.formValueMD.esignUseFlag()=="Y" && self.formValueMD.memPayType()=="R" && (self.formValueMD.payWayCode()=='CMS' || self.formValueMD.payWayCode()=='CAR' )	) { alert("전자동의 확인완료 및 자동이체 신청이 되었습니다."); } else { alert("성공적으로 결제등록 되었습니다."); } */ alert("성공적으로 결제등록 되었습니다."); //alert(1); if(root.mobilecheck()==true) { //window.close(); window.open("about:blank","_self").close(); } else { //window.close(); window.open("about:blank","_self").close(); location.reload(); } //alert(2); }	}, complete: function(data){ closeWaitingDialog(); }, dataType: "json", async:false });	}; self.reset = function(){ };	self.closeAuth = function(){ closeHpAuth(); }; $("#memTel2").on('keyup', function(){ if($("#memTel2").val().length==4){ $("#memTel3").focus(); } }) /* self.blockUI = { update: function (element, valueAccessor, allBindingsAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); if (value) $(element).block(); else $(element).unblock(); } }; */ }; //email 자동설정 function OnSelectMailDomain(obj) { if($(obj).val()=="") { $("#emailDomain").val("");	$("#emailDomain").attr("readonly",true); } else if($(obj).val()=="none") { $("#emailDomain").removeAttr("readonly"); } else { $("#emailDomain").attr("readonly",true); $("#emailDomain").val($(obj).val()); } } //일반함수영역 // 주소세팅 function setAddr(data) { var ri = $(data).attr("ri"); if(ri=="null") ri=""; /* $("#memZipCode1").val($(data).attr("zipcode1")); $("#memZipCode2").val($(data).attr("zipcode2")); */ $("#memZipCode3").val($(data).attr("zipcode3")); $("#memAddr1").val($(data).attr("sido")+" "+$(data).attr("gugun")+" "+$(data).attr("dong")+" "+ri); $("#dialog-form").dialog( "close" );	} function setAddress(zipCodeFirst, zipCodeLast, address, extraAddress) { $("#memZipCode3").val(zipCodeFirst); //$("#memZipCode2").val(zipCodeLast); $("#memAddr1").val(address); $("#memAddr2").val(extraAddress); } function openHpAuth(){ $("#pay_amount").trigger("change"); $("#pay_code").trigger("change"); $("#pay_jumin_num").trigger("change"); $("#hpNo1").trigger("change"); $("#hpNo2").trigger("change"); $("#hpNo3").trigger("change"); $("#hpAuth").dialog("open");	showCountdown(180); } function closeHpAuth(){ $("#hpAuth").dialog("close"); clearTimeout(timeoutId); } function showCountdown(timeToExpiration) { remain = timeToExpiration - 1; if (remain >= -1 ){ day = Math.floor(timeToExpiration / (3600 * 24)); mod = timeToExpiration % (24 * 3600); hour = Math.floor(mod / 3600); mod = mod % 3600; min = Math.floor(mod / 60); sec = mod % 60; count = " " + min + " 분 " + sec + " 초 "; $("#countdown").val(count); if ( remain == -1 ){ alert("[22]승인유효시간이 초과되었습니다!"); closeHpAuth();	} else {	timeoutId = setTimeout("showCountdown(remain)", 1000); } } } function getTopImg(){ $.ajax({ type: 'POST', url: "/Nanum/nanum/user/mem/getSignFile", data: {authKey:row.authKey,fileName:"BODY"}, success: function(data){ var img = new Image(); img.src = data.body; var width = img.width; var height = img.height; $("
사회복지법인 선덕원