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(""); imgWin.document.write(""); //imgWin.document.close(); } function writeFormCheck2(form_name) { var sdate = document.getElementById( 'startdate' ).value; var edate = document.getElementById( 'enddate' ).value; if (sdate > edate) { alert("°­ÀǽÃÀÛÀÏÀÌ °­ÀÇÁ¾·áÀϺ¸´Ù ´ÊÀº³¯Â¥ÀÔ´Ï´Ù..\n\n°­ÀDZⰣÀ» ´Ù½Ã ¼³Á¤ÇØ Áֽñ⠹ٶø´Ï´Ù"); document.getElementById( 'startdate' ).value = ''; document.getElementById( 'enddate' ).value = ''; return false; } return FormCheck.init(form_name); } function viewChg2(obj, url) { if(obj == 1) { var form = document.getElementById('form_setup'); form.method = 'post'; form.action = form.action+url; form.submit(); } } function bindSearch(key1, key2, key3, key4, key5, key6, key7, key8) { opener.document.getElementById('lecture_name').value = key1; opener.document.getElementById('lecture_pk').value = key2; opener.document.getElementById('price').value = key3; opener.document.getElementById('discount_apply_price').value = key3; opener.document.getElementById('lesson_pk').value = key4; opener.document.getElementById('lesson_name').value = key5; opener.document.getElementById('charge_price').value = key6; opener.document.getElementById('remain_price').value = key7; opener.document.getElementById('discount_price').value = key8; self.close(); } function strlen_escape(obj) { var i = 0; var lenNum = obj.value.length; var tmp = 0; var tmpbyte = 0; var displayObj = document.getElementById('txtDiplay'); var tmpStr=""; for(i=0;i 3 ) tmpbyte++; //ÇѱÛÀÏ°æ¿ì if(tmpbyte >200){ alert(' 200ÀÚ ÀÌ»ó ÀÔ·Â ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. '); obj.value = tmpStr; break; }else{ tmpStr += obj.value.charAt(i) ; displayObj.value = tmpbyte; } tmpbyte++ } }