function listChg (lesson_idx) { document.getElementById( 'lesson_pk' ).value = lesson_idx; var form = document.listForm; form.submit(); } function regist () { var sword = document.getElementById( 'sword' ).value; if (!sword) { alert("검색어를 정확히 입력해 주시기 바랍니다."); return; } var form = document.listForm; form.submit(); } function listSearch (idx) { var form = document.getElementById('listForm'); form.method = 'get'; form.action = form.action+'?search_lecture='+idx; form.submit(); } function checkAll( e ) { if ( !e ) return; var srcE = ( e.target ? e.target : e.srcElement ); var tb = srcE.offsetParent.offsetParent.offsetParent; var ipts = tb.getElementsByTagName( 'input' ); for( var i = 0 ; i < ipts.length ; i++ ) { if( ipts[ i ].type != 'checkbox' || ipts[ i ].name!="select_data[]") continue; ipts[ i ].checked = srcE.checked; } } function modifyProcChg() { var tb = document.getElementById( 'table_mm2' ); var ipts = tb.getElementsByTagName( 'input' ); for( var i = 1 , isChked = false ; i < ipts.length ; i++ ) { if( ipts[ i ].type != 'checkbox' ) continue; isChked = isChked || ipts[ i ].checked; } if( !isChked ) return alert( '출결상태를 변경할 항목을 선택해 주세요' ); var form = document.getElementById('listForm'); form.method = 'get'; form.action = '/chtml/institute/attence_administer.php'; form.submit(); } function popupSearch (url , w , h,is_scroll,is_resize) { var features = "width=" + w + ",height=" + h; if (is_scroll) features += ",scrollbars=yes"; if (is_resize) features += ",resizable=yes"; else features += ",resizable=yes"; window.open(url, 'popup' , features); } function dateSetting2(els) { $(document).ready(function() {$(els).datepicker({dateFormat: "yy-mm-dd", showOn: "both", buttonImage: "/default/img/main/btn_carlendar.gif", buttonImageOnly: true, clearText: "초기화", closeText: "닫기", currentText: "오늘", prevText: "이전달", nextText: "다음달", monthNames: ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"], dayNamesMin: ["일", "월", "화", "수", "목", "금", "토"] })}); } function dateSetting(els) { $(document).ready(function() {$(els).datepicker({dateFormat: "yy-mm-dd", showOn: "both", buttonImage: "/default/img/main/btn_carlendar.gif", buttonImageOnly: true, clearText: "초기화", closeText: "닫기", currentText: "오늘", prevText: "이전달", nextText: "다음달", monthNames: ["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"], dayNamesMin: ["일", "월", "화", "수", "목", "금", "토"] })}); } function checkAll2( e) { if ( !e ) return; var srcE = ( e.target ? e.target : e.srcElement ); var tb = srcE.offsetParent.offsetParent.offsetParent; var ipts = tb.getElementsByTagName( 'input' ); var form = document.getElementById('listForm2'); for( var i = 0 ; i < ipts.length ; i++ ) { if( ipts[ i ].type != 'checkbox' || ipts[ i ].name != "select_data[]") continue; ipts[ i ].checked = srcE.checked; } } function modifyProcChg2() { var tb = document.getElementById( 'table_mm3' ); var ipts = tb.getElementsByTagName( 'input' ); var form = document.getElementById('listForm2'); for( var i = 1 , isChked = false ; i < ipts.length ; i++ ) { if( ipts[ i ].type != 'checkbox' ) continue; isChked = isChked || ipts[ i ].checked; } if( !isChked ) return alert( '출결상태를 변경할 항목을 선택해 주세요' ); form.method = 'get'; form.action = '/chtml/institute/attence_administer.php'; form.submit(); } function modifyProc2( idx, attendance_chk) { if (idx) { document.getElementById( 'idx' ).value = idx; document.getElementById( 'attendance_chk' ).value = attendance_chk; var form = document.getElementById('listForm2'); form.action = '/chtml/institute/attence_administer.php?idx='+idx; form.submit(); } } function popupSearch2 (url , w , h,is_scroll,is_resize) { var features = "width=" + w + ",height=" + h; if (is_scroll) features += ",scrollbars=yes"; if (is_resize) features += ",resizable=yes"; else features += ",resizable=yes"; window.open(url, 'popup' , features); } function regist2() { var length = document.forms.length; for(var i=0; i < length;i++){ switch(document.forms[i].name){ case 'selection' : var frm = document.selection; frm.method='get'; frm.action = frm.action; frm.submit(); break; case 'searchForm2' : var frm = document.searchForm2; frm.submit(); break; } } } function writeFormCheck(form_name) { var pay_status_chk = document.getElementById( 'pay_status_chk' ).value; // 납부현황상태 var pay_date = document.getElementById( 'pay_date' ).value; // 납부일자 var discount_apply_price = uncomma(document.getElementById( 'discount_apply_price' ).value); // 할인적용수강료 (최종납부수강료) var chargePrice = uncomma(document.getElementById( 'charge_price' ).value); // 실수납액 var remainPrice = uncomma(document.getElementById( 'remain_price' ).value); // 미납액 // 폼체크 전 할인적용수강료의 음수여부 확인 if (discount_apply_price < 0) { alert("할인적용수강료의 값이 음수값입니다.\n\n할인액을 다시 설정해 주시기 바랍니다."); document.getElementById( 'discount_apply_price' ).value = ''; return false; } // 폼체크 전 납부현황에 따른 ①납부일자 입력여부 확인 ②할인적용수강료 및 실수납액 및 미납액 체크 if (pay_status_chk==1) { if (!pay_date) { alert("납부현황이 완납상태로 설정하셨습니다.\n\n납부일자를 꼭 설정해 주시기 바랍니다."); return false; } if (chargePrice!=discount_apply_price && remainPrice != 0) { alert("실수납액과 할인적용수강료를 확인하신 후 납부현황을 선택해 주세요."); return false; } } else if (pay_status_chk==2) { if (!pay_date) { alert("납부현황을 분납상태로 설정하셨습니다.\n\n납부일자를 꼭 설정해 주시기 바랍니다."); return false; } if (chargePrice==0 || remainPrice == 0 || ((remainPrice+chargePrice)!=discount_apply_price) ) { alert("실수납액과 미납액를 확인하신 후 납부현황을 선택해 주세요."); return false; } } else if (pay_status_chk==3) { if (chargePrice != 0 && remainPrice != discount_apply_price) { alert("미납액과 할인적용수강료를 확인하신 후 납부현황을 선택해 주세요."); return false; } } // 최종적으로 폼체크 return FormCheck.init(form_name); } function comma(x) { var temp = ""; var x = String(uncomma(x)); num_len = x.length; co = 3; while (num_len>0){ num_len = num_len - co; if (num_len<0){ co = num_len + co; num_len = 0; } temp = ","+x.substr(num_len,co)+temp; } return temp.substr(1); } function uncomma(x) { var reg = /(,)*/g; x = parseInt(String(x).replace(reg,"")); return (isNaN(x)) ? 0 : x; } function re_price01 () { var opt = document.getElementById('unit'); var unit = opt.options[opt.selectedIndex].value; var price = document.getElementById('price'); var discount = document.getElementById('discount_price'); var discount_apply_price = document.getElementById('discount_apply_price'); var result =0; //unit 1 금액 할인, 2 // 퍼센트 할인 var org_price = uncomma(price.value); if ( unit == 1) result = org_price - parseInt(uncomma(discount.value)); else if( unit == 2) result = org_price - ( org_price * (parseInt(uncomma(discount.value)) / 100)); discount_apply_price.value = comma(result); } function re_price02 () { var discount_apply_price = uncomma(document.getElementsByName('discount_apply_price')[0].value); // 최종납부할수강료 (할인적용수강료) var charge_price = uncomma(document.getElementsByName('charge_price')[0].value); // 실수납액 var remain_price = discount_apply_price - charge_price; document.getElementsByName('remain_price')[0].value = comma(remain_price); } function viewChg(obj) { if (obj == 1) { var form = document.getElementById('form_setup'); form.method = 'post'; form.action = form.action+'&mode=list'; form.submit(); } if(obj == 2) { var form = document.getElementById('listForm'); form.method = 'post'; form.action = form.action+'&mode=write'; form.submit(); } } function payStatusChk (idx) { document.getElementById('pay_status_chk').value = idx; } function bindSearch_s(key1, key2) { opener.document.getElementById('student_name').value = key1 ; opener.document.getElementById('student_id').value = key2 ; self.close(); } function execReg(f) { var frm =f; var result = FormCheck.init('frmtearchter'); if(result) frm.submit(); } function openWindowImage(img_url) { img1= new Image(); img1.src=(img_url); W=img1.width; H=img1.height; O="width="+W+",height="+H; imgWin=window.open("","",'width=800,height=160,scrollbars=yes,resizable=no'); imgWin.document.write("
"); imgWin.document.write("