최초커밋
This commit is contained in:
623
js/common.js
Normal file
623
js/common.js
Normal file
@@ -0,0 +1,623 @@
|
||||
// input[type=number]<5D><><EFBFBD><EFBFBD> e, E, - <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> maxLength <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$(document).off("input", "input[type=number]:not(.useMinus)").on("input", "input[type=number]:not(.useMinus)", function(){
|
||||
this.value = this.value.replace(/e|E|-/g, '');
|
||||
console.log(this.maxLength);
|
||||
if((this.maxLength || -1) > -1){
|
||||
if(this.value.length > this.maxLength){
|
||||
this.value = this.value.slice(0, this.maxLength);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5>Ϲ<EFBFBD>ȣ <20>Է<EFBFBD>
|
||||
$(document).off("keyup blur", ".compRegNum").on("keyup blur", ".compRegNum", function(){
|
||||
this.value = this.value.replace(/[^0-9]|-/g, '');
|
||||
if(this.value.length >= 6){
|
||||
this.value = this.value.replace(/(\d{3})(\d{2})(\d{1,5})/, '$1-$2-$3');
|
||||
}else if(this.value.length >= 4){
|
||||
this.value = this.value.replace(/(\d{3})(\d{1,2})/, '$1-$2');
|
||||
}
|
||||
});
|
||||
|
||||
if($.datepicker){
|
||||
$.datepicker.setDefaults({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
prevText: '<27><><EFBFBD><EFBFBD> <20><>',
|
||||
nextText: '<27><><EFBFBD><EFBFBD> <20><>',
|
||||
monthNames: ['1<><31>', '2<><32>', '3<><33>', '4<><34>', '5<><35>', '6<><36>', '7<><37>', '8<><38>', '9<><39>', '10<31><30>', '11<31><31>', '12<31><32>'],
|
||||
monthNamesShort: ['1<><31>', '2<><32>', '3<><33>', '4<><34>', '5<><35>', '6<><36>', '7<><37>', '8<><38>', '9<><39>', '10<31><30>', '11<31><31>', '12<31><32>'],
|
||||
dayNames: ['<27><>', '<27><>', 'ȭ', '<27><>', '<27><>', '<27><>', '<27><>'],
|
||||
dayNamesShort: ['<27><>', '<27><>', 'ȭ', '<27><>', '<27><>', '<27><>', '<27><>'],
|
||||
dayNamesMin: ['<27><>', '<27><>', 'ȭ', '<27><>', '<27><>', '<27><>', '<27><>'],
|
||||
showMonthAfterYear: true,
|
||||
yearSuffix: '<27><>'
|
||||
});
|
||||
}
|
||||
if(jQuery.fn.dataTable !== undefined){
|
||||
jQuery.fn.dataTable.render.ellipsis = function ( cutoff, wordbreak, escapeHtml ) {
|
||||
var esc = function ( t ) {
|
||||
return t
|
||||
.replace( /&/g, '&' )
|
||||
.replace( /</g, '<' )
|
||||
.replace( />/g, '>' )
|
||||
.replace( /"/g, '"' );
|
||||
};
|
||||
|
||||
return function ( d, type, row ) {
|
||||
// Order, search and type get the original data
|
||||
if ( type !== 'display' ) {
|
||||
return d;
|
||||
}
|
||||
|
||||
if ( typeof d !== 'number' && typeof d !== 'string' ) {
|
||||
return d;
|
||||
}
|
||||
|
||||
d = d.toString(); // cast numbers
|
||||
|
||||
if ( d.length <= cutoff ) {
|
||||
return d;
|
||||
}
|
||||
|
||||
var shortened = d.substr(0, cutoff-1);
|
||||
|
||||
// Find the last white space character in the string
|
||||
if ( wordbreak ) {
|
||||
shortened = shortened.replace(/\s([^\s]*)$/, '');
|
||||
}
|
||||
|
||||
// Protect against uncontrolled HTML input
|
||||
if ( escapeHtml ) {
|
||||
shortened = esc( shortened );
|
||||
}
|
||||
|
||||
return '<span class="ellipsis" title="'+esc(d)+'">'+shortened+'…</span>';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
$.fn.serializeObject = function() {
|
||||
var obj = null;
|
||||
try {
|
||||
if (this[0].tagName && this[0].tagName.toUpperCase() == "FORM") {
|
||||
var arr = this.serializeArray();
|
||||
if (arr) {
|
||||
obj = {};
|
||||
jQuery.each(arr, function() {
|
||||
obj[this.name] = this.value;
|
||||
});
|
||||
}//if ( arr ) {
|
||||
}
|
||||
} catch (e) {
|
||||
alert(e.message);
|
||||
} finally {
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5>Ϲ<EFBFBD>ȣ <20><>ȿ<EFBFBD><C8BF> üũ
|
||||
function checkCompRegNum(number){
|
||||
var numberMap = number.replace(/-/gi, '').split('').map(function (d){
|
||||
return parseInt(d, 10);
|
||||
});
|
||||
|
||||
if(numberMap.length == 10){
|
||||
var keyArr = [1, 3, 7, 1, 3, 7, 1, 3, 5];
|
||||
var chk = 0;
|
||||
|
||||
keyArr.forEach(function(d, i){
|
||||
chk += d * numberMap[i];
|
||||
});
|
||||
|
||||
chk += parseInt((keyArr[8] * numberMap[8])/ 10, 10);
|
||||
console.log(chk);
|
||||
return Math.floor(numberMap[9]) === ( (10 - (chk % 10) ) % 10);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isNaNV(num, ret){
|
||||
if(isNaN(num)){
|
||||
return ret;
|
||||
}else{
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
function isBlank(v, rep){
|
||||
return v == "" ? rep : (v || rep);
|
||||
}
|
||||
|
||||
function fup(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
function cof(pnum, fixVal) {
|
||||
var num = pnum + "";
|
||||
var retNum = num.replace(/[^-\.0-9]/gi, "");
|
||||
if(isNaN(retNum)) return "";
|
||||
var option = new Object();
|
||||
option.minimumFractionDigits = fixVal;
|
||||
option.maximumFractionDigits = fixVal;
|
||||
return (+retNum).toLocaleString(undefined, option);
|
||||
}
|
||||
|
||||
/*
|
||||
* <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ 64<36><34><EFBFBD>̽<EFBFBD> <20><>ȣȭ
|
||||
*/
|
||||
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
function encode64(input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
do {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
|
||||
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
|
||||
keyStr.charAt(enc3) + keyStr.charAt(enc4);
|
||||
} while (i < input.length);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function decode64(input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
|
||||
do {
|
||||
enc1 = keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = keyStr.indexOf(input.charAt(i++));
|
||||
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << 6) | enc4;
|
||||
|
||||
output = output + String.fromCharCode(chr1);
|
||||
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
} while (i < input.length);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function encode64Han(str) {
|
||||
return encode64(escape(str))
|
||||
}
|
||||
|
||||
function decode64Han(str) {
|
||||
return unescape(decode64(str))
|
||||
}
|
||||
|
||||
/*
|
||||
* <20><>ũ<EFBFBD><C5A9>Ʈ 1000<30><30> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> , <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
function commify(n, comm)
|
||||
{
|
||||
var minus = n.toString().substring(0, 1);
|
||||
var reg=/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g;
|
||||
var regBlank=/,|[^0-9]/g;
|
||||
if((comm || false) === true) regBlank = /,|[^0-9.]/g;
|
||||
return (minus == "-" ? "-" : "") + n.toString().replace(regBlank, "").replace(reg, ",");
|
||||
}
|
||||
|
||||
//<2F≯<EFBFBD><CCB8><EFBFBD> <20><>ȿ<EFBFBD><C8BF> <20>˻<EFBFBD>
|
||||
function emailCheck(email_address){
|
||||
email_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i;
|
||||
if(!email_regex.test(email_address)){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//Ʈ<><C6AE>
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/(^\s*)|(\s*$)/gi, "");
|
||||
}
|
||||
|
||||
// date format
|
||||
Date.prototype.format = function (f) {
|
||||
if (!this.valueOf()) return " ";
|
||||
var weekKorName = ["<22>Ͽ<EFBFBD><CFBF><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "ȭ<><C8AD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22>ݿ<EFBFBD><DDBF><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"];
|
||||
var weekKorShortName = ["<22><>", "<22><>", "ȭ", "<22><>", "<22><>", "<22><>", "<22><>"];
|
||||
var weekEngName = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
||||
var weekEngShortName = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
var d = this;
|
||||
return f.replace(/(yyyy|yy|MM|dd|KS|KL|ES|EL|HH|hh|mm|ss|a\/p)/gi, function ($1) {
|
||||
switch ($1) {
|
||||
case "yyyy": return d.getFullYear(); // <20><> (4<>ڸ<EFBFBD>)
|
||||
case "yy": return (d.getFullYear() % 1000).zf(2); // <20><> (2<>ڸ<EFBFBD>)
|
||||
case "MM": return (d.getMonth() + 1).zf(2); // <20><> (2<>ڸ<EFBFBD>)
|
||||
case "dd": return d.getDate().zf(2); // <20><> (2<>ڸ<EFBFBD>)
|
||||
case "KS": return weekKorShortName[d.getDay()]; // <20><><EFBFBD><EFBFBD> (ª<><C2AA> <20>ѱ<EFBFBD>)
|
||||
case "KL": return weekKorName[d.getDay()]; // <20><><EFBFBD><EFBFBD> (<28><> <20>ѱ<EFBFBD>)
|
||||
case "ES": return weekEngShortName[d.getDay()]; // <20><><EFBFBD><EFBFBD> (ª<><C2AA> <20><><EFBFBD><EFBFBD>)
|
||||
case "EL": return weekEngName[d.getDay()]; // <20><><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD>)
|
||||
case "HH": return d.getHours().zf(2); // <20>ð<EFBFBD> (24<32>ð<EFBFBD> <20><><EFBFBD><EFBFBD>, 2<>ڸ<EFBFBD>)
|
||||
case "hh": return ((h = d.getHours() % 12) ? h : 12).zf(2); // <20>ð<EFBFBD> (12<31>ð<EFBFBD> <20><><EFBFBD><EFBFBD>, 2<>ڸ<EFBFBD>)
|
||||
case "mm": return d.getMinutes().zf(2); // <20><> (2<>ڸ<EFBFBD>)
|
||||
case "ss": return d.getSeconds().zf(2); // <20><> (2<>ڸ<EFBFBD>)
|
||||
case "a/p": return d.getHours() < 12 ? "<22><><EFBFBD><EFBFBD>" : "<22><><EFBFBD><EFBFBD>"; // <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
default: return $1;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
String.prototype.string = function (len) { var s = '', i = 0; while (i++ < len) { s += this; } return s; };
|
||||
|
||||
String.prototype.zf = function (len) { return "0".string(len - this.length) + this; };
|
||||
|
||||
Number.prototype.zf = function (len) { return this.toString().zf(len); };
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>̼<EFBFBD> <20>Լ<EFBFBD>
|
||||
function rotate(array, times){
|
||||
array = array.slice();
|
||||
while(times--){
|
||||
var temp = array.shift();
|
||||
array.push(temp)
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 1<><31><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20><>ȯ<EFBFBD>ϴ<EFBFBD> <20>Լ<EFBFBD>
|
||||
//n1 <20><> "<22><><EFBFBD>Ѱ<EFBFBD>", n2 <20><> "<22><><EFBFBD>Ѱ<EFBFBD>"
|
||||
function randomRange(n1, n2) {
|
||||
return Math.floor( (Math.random() * (n2 - n1 + 1)) + n1 );
|
||||
}
|
||||
|
||||
function htmlSpecialChars(text) {
|
||||
return text.replace(/&/g, "&").replace(/'/g, "'").replace(/</g, "<").replace(/,/g, ",").replace(/>/g, ">");
|
||||
}
|
||||
|
||||
function htmlSpecialChars2(text) {
|
||||
return text.replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/,/g, ",").replace(/>/g, ">");
|
||||
}
|
||||
|
||||
function replaceAll(text,fv,rv) {
|
||||
return text.split(fv).join(rv);
|
||||
}
|
||||
|
||||
function left(s, c) {
|
||||
return (s+"").substr(0, c);
|
||||
}
|
||||
|
||||
function right(s, c) {
|
||||
return (s+"").substr(-c);
|
||||
}
|
||||
|
||||
function mid(s, c, l) {
|
||||
return (s+"").substr(c, l);
|
||||
}
|
||||
|
||||
function avg(arr){
|
||||
if(arr.length == 0){
|
||||
return -10;
|
||||
}
|
||||
var total = arr.reduce(function(a, b){ return +a + +b; });
|
||||
var avg = (total / arr.length);
|
||||
return avg;
|
||||
}
|
||||
|
||||
function groupBySum(jsonArr, groupArr, sumArr_opt){
|
||||
var sumArr = sumArr_opt || [];
|
||||
var newJsonArr = groupArr.length != 0 ? uniq(jsonArr, groupArr) : [{}];
|
||||
$.each(newJsonArr, function(i, obj){
|
||||
$.each(sumArr, function(idx, sumCol){
|
||||
obj[sumCol] = 0;
|
||||
});
|
||||
obj["groupByCount"] = 0;
|
||||
});
|
||||
|
||||
$.each(newJsonArr, function(idx, obj){
|
||||
$.each($.grep(jsonArr, function(o, i){
|
||||
var nStr = "";
|
||||
var pStr = "";
|
||||
$.each(groupArr, function(ix, groupCol){
|
||||
nStr += obj[groupCol] + "|";
|
||||
pStr += o[groupCol] + "|";
|
||||
});
|
||||
return nStr == pStr;
|
||||
}), function(i, o){
|
||||
$.each(sumArr, function(ix, sumCol){
|
||||
obj[sumCol] += +o[sumCol];
|
||||
});
|
||||
obj["groupByCount"]++;
|
||||
});
|
||||
});
|
||||
|
||||
return newJsonArr;
|
||||
}
|
||||
|
||||
function groupByAvg(jsonArr, groupArr, avgArr_opt, fixedNum){
|
||||
var fixedVal = fixedNum || 1;
|
||||
var avgArr = avgArr_opt || [];
|
||||
var newJsonArr = groupArr.length != 0 ? uniq(jsonArr, groupArr) : [{}];
|
||||
$.each(newJsonArr, function(i, obj){
|
||||
$.each(avgArr, function(idx, avgCol){
|
||||
obj[avgCol] = 0;
|
||||
});
|
||||
obj["groupByCount"] = 0;
|
||||
});
|
||||
|
||||
$.each(newJsonArr, function(idx, obj){
|
||||
$.each($.grep(jsonArr, function(o, i){
|
||||
var nStr = "";
|
||||
var pStr = "";
|
||||
$.each(groupArr, function(ix, groupCol){
|
||||
nStr += obj[groupCol] + "|";
|
||||
pStr += o[groupCol] + "|";
|
||||
});
|
||||
return nStr == pStr;
|
||||
}), function(i, o){
|
||||
$.each(avgArr, function(ix, avgCol){
|
||||
obj[avgCol] += +o[avgCol];
|
||||
});
|
||||
obj["groupByCount"]++;
|
||||
});
|
||||
});
|
||||
$.each(newJsonArr, function(idx, obj){
|
||||
$.each(avgArr, function(ix, avgCol){
|
||||
obj[avgCol] = (obj[avgCol] / obj["groupByCount"] * 1.0).toFixed(fixedVal);
|
||||
if(isNaN(obj[avgCol])) obj[avgCol] = 0;
|
||||
});
|
||||
});
|
||||
return newJsonArr;
|
||||
}
|
||||
|
||||
function uniq(arr, item){
|
||||
var retArr = [];
|
||||
if(Array.isArray(item) == true){
|
||||
retArr = unique($.map(arr, function(obj){
|
||||
var tmpArr = [];
|
||||
for(var i=0; i<item.length; i++){
|
||||
tmpArr.push(obj[item[i]]);
|
||||
}
|
||||
return tmpArr.join("|");
|
||||
}).sort());
|
||||
retArr = $.map(retArr, function(obj){
|
||||
var tmpObj = {};
|
||||
var tmpVal = obj.split("|");
|
||||
for(var i=0; i<item.length; i++){
|
||||
tmpObj[item[i]] = tmpVal[i];
|
||||
}
|
||||
return tmpObj;
|
||||
});
|
||||
return retArr;
|
||||
}else{
|
||||
retArr = unique($.map(arr, function(obj){ return obj[item]; }).sort());
|
||||
}
|
||||
return retArr;
|
||||
}
|
||||
|
||||
function unique(array) {
|
||||
return $.grep(array, function(el, index) {
|
||||
return index == $.inArray(el, array);
|
||||
});
|
||||
}
|
||||
|
||||
function ajaxCall(urlx, datax, other) {
|
||||
var data;
|
||||
var ajax_option = {
|
||||
url: urlx,
|
||||
data: datax || {},
|
||||
method: "POST",
|
||||
cache: false,
|
||||
async: false,
|
||||
dataType: "json",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (response) {
|
||||
if(response === "timeout") window.location.href = "/logout.asp"
|
||||
data = response
|
||||
},
|
||||
error: function (x, h, r) {
|
||||
console.log(x);
|
||||
console.log(h);
|
||||
console.log(r);
|
||||
}
|
||||
}
|
||||
if (other !== undefined) {
|
||||
Object.assign(ajax_option, other);
|
||||
}
|
||||
$.ajax(ajax_option);
|
||||
return data;
|
||||
}
|
||||
|
||||
function sortJsonArray(arr, col, orderBy){
|
||||
return arr.sort(function(a, b){
|
||||
var aCol = isNaN(a[col]) ? a[col] : +a[col];
|
||||
var bCol = isNaN(b[col]) ? b[col] : +b[col];
|
||||
if(aCol > bCol) return orderBy;
|
||||
if(aCol < bCol) return orderBy*-1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
// <20>Ѿ<EFBFBD><D1BE><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC>մϴ<D5B4>.
|
||||
// !value <20>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> value == <20><><EFBFBD><EFBFBD>
|
||||
// [], {} <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
|
||||
function isEmpty(value) {
|
||||
if (value == "" || value == null || value == undefined || (value != null && typeof value == "object" && !Object.keys(value).length)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// cutmenu <20><><EFBFBD><EFBFBD> (<28>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20>ֺ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD> <20><>)
|
||||
function cutmenu(bool){
|
||||
if(bool == undefined || bool){
|
||||
$(".main-header, .main-sidebar, .main-footer, .content-header").hide();
|
||||
$(".content-wrapper").addClass("ml-0");
|
||||
$(".content-wrapper").css("background-color", "#EFF3F6");
|
||||
$(".content-wrapper .content-body, .content-wrapper .content").addClass("p-0 py-1");
|
||||
}
|
||||
}
|
||||
|
||||
///////// <20><><EFBFBD><EFBFBD> common.js<6A><73><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
function new_project_2014(p_sn){
|
||||
var tmp = p_sn.substring(0,4)
|
||||
if (tmp < '1407' || tmp == '9999') {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
function winopn(urlstr) {
|
||||
wins = open(urlstr,"wins","width=210,height=230");
|
||||
wins.focus();
|
||||
}
|
||||
|
||||
function projectwinopn(p_child_sn, p_method_cd) {
|
||||
var tmp_width = 1400;
|
||||
var tmp_height = 800;
|
||||
var p_sn = p_child_sn.substring(0, 7);
|
||||
var p_sub_type = p_child_sn.substring(8, 9);
|
||||
|
||||
var url = '/project/project_list2_dep_2014.asp?p_sn=' + p_sn;
|
||||
url = url + "&p_sub_type=" + p_sub_type + "&p_method_cd=" + p_method_cd + "&p_child_sn=" + p_child_sn;
|
||||
|
||||
window.open(url, '', 'left=0,top=0,width=' + tmp_width + ',height=' + tmp_height + ',scrollbars=yes,resizable=yes')
|
||||
}
|
||||
|
||||
function OnlyNumber(objarg){
|
||||
if(isNumeral(objarg.value) == false) {
|
||||
if(objarg.value.length <= 1){
|
||||
objarg.value = "";
|
||||
}else{
|
||||
var valName = removeHipun(objarg.value)
|
||||
var cName = new String();
|
||||
for(i = 0; i < valName.length; i++){
|
||||
var sName = valName.substr(i,1);
|
||||
|
||||
if(isNumeral(sName)){
|
||||
cName = cName + sName.toString();
|
||||
}
|
||||
}
|
||||
objarg.value = cName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isNumeral(str){
|
||||
for(var i=0; i<str.length; i++) {
|
||||
var uniCode = str.charCodeAt(i);
|
||||
|
||||
if(!(uniCode >= 48 && uniCode <= 57))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function removeHipun(strSrc) {
|
||||
return strSrc.replace(/-/gi,"");
|
||||
}
|
||||
|
||||
function allTrim(str) {
|
||||
var ch;
|
||||
var len = str.length;
|
||||
var retStr = "";
|
||||
if (str=="" || len == 0) return retStr;
|
||||
for (var n = 0; n < len; n++) {
|
||||
ch = str.charAt(n);
|
||||
if (ch == " " || ch == "\r" || ch == "\n")
|
||||
continue;
|
||||
retStr += ch;
|
||||
}
|
||||
return retStr;
|
||||
}
|
||||
|
||||
function vat_auto(i) {
|
||||
if ($("#sebu").val() == "185" || $("#expence_way").val() == "<22><><EFBFBD><EFBFBD>ī<EFBFBD><C4AB>" || $("#expence_way").val() == "<22><><EFBFBD><EFBFBD>") {
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>γ<EFBFBD><CEB3><EFBFBD> <20>Ǵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD> 0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.");
|
||||
} else {
|
||||
if (i * 1 > 0) {
|
||||
var supply_value = document.getElementById("val_supply"+i).value.replace(/\,/gi, "");
|
||||
|
||||
if (supply_value != "" && supply_value * 1 > 9) {
|
||||
check_comma(supply_value.substring(0, supply_value.length - 1), '2', i);
|
||||
} else {
|
||||
check_comma("0", '2', i);
|
||||
}
|
||||
} else {
|
||||
var supply_value = document.getElementById("val_supply").value.replace(/\,/gi, "");
|
||||
|
||||
if (supply_value != "" && supply_value * 1 > 9) {
|
||||
check_comma(supply_value.substring(0, supply_value.length - 1), '2');
|
||||
} else {
|
||||
check_comma("0", '2');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function vat_check() {
|
||||
if ($("#sebu").val() == "185" || $("#expence_way").val() == "<22><><EFBFBD><EFBFBD>ī<EFBFBD><C4AB>" || $("#expence_way").val() == "<22><><EFBFBD><EFBFBD>") {
|
||||
} else {
|
||||
var supply_value = new Array();
|
||||
var vat_value = new Array();
|
||||
|
||||
if (document.getElementById("expence_vat1") == undefined || document.getElementById("expence_vat1") == null) {
|
||||
supply_value[0] = document.getElementById("val_supply").value.replace(/\,/gi, "");
|
||||
vat_value[0] = document.getElementById("expence_vat").value.replace(/\,/gi, "");
|
||||
} else if (document.getElementById("expence_vat1") != undefined && document.getElementById("expence_vat1") != null) {
|
||||
for (var i = 0; i < 50; i++) {
|
||||
if (document.getElementById("expence_vat" + (i + 1)) != undefined && document.getElementById("expence_vat" + (i + 1)) != null) {
|
||||
supply_value[i] = document.getElementById("val_supply" + (i + 1)).value.replace(/\,/gi, "");
|
||||
vat_value[i] = document.getElementById("expence_vat" + (i + 1)).value.replace(/\,/gi, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < supply_value.length; i++) {
|
||||
if (supply_value[i] != "" && supply_value[i] * 1 > 9) {
|
||||
if (supply_value[i].substring(0, supply_value[i].length - 1) != vat_value[i]) {
|
||||
var alert_str = "<22>Է<EFBFBD><D4B7>Ͻ<EFBFBD> <20>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD> " + commify(vat_value[i]) + "<22><><EFBFBD><EFBFBD> <20>½<EFBFBD><C2BD>ϱ<EFBFBD>?";
|
||||
if (i > 0) {
|
||||
alert_str = (i+1) + "<22><>° " + alert_str;
|
||||
}
|
||||
if (confirm(alert_str)) {
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user