package com.eactive.eai.rms.onl.dashboard.controller;

public class MobileMonitorController {
	
	public String transValue() {
		MobileMonitorShareMemory ms = MobileMonitorShareMemory.getInstance();

		return ms.getTranCount();
	}

	public String comma_add(String num){
		String original = num;
		String convert = "";
		int count = 1;
		for (int i=original.length()-1; i>-1; i--){
			if((count%3)==0 && i<original.length()-1 && i>0){
				convert = ","+original.charAt(i) + convert;
			}else{
				convert = original.charAt(i) + convert;
			}
			count++;
		}
		return convert;
	}

	public String returnFilterString(String str){
	    if (str == null || "".equals(str))
	       return "";
	    String rstr = str;
	   // int iStr = rstr.length();
	    rstr = rstr.replace("<", "&lt;");
	    rstr = rstr.replace(">", "&gt;");
	    rstr = rstr.replace("#", "&ns;");
	    rstr = rstr.replace("(", "&lp;");
	    rstr = rstr.replace(")", "&rp;");
	    rstr = rstr.replace("{", "&lcb;");
	    rstr = rstr.replace("}", "&rcb;");
	    rstr = rstr.replace("%", "&ps;");
	             
	    return rstr;
	}

	
//	private int getDayOfWeekNum() {
//		Calendar c = Calendar.getInstance();
//		return c.get(Calendar.DAY_OF_WEEK);
//	}
	
	
	

//	public static void main(String[] args){ //취약점소스 수정 2020.08.24
//		System.out.println("dd");
//		String msg = "1234567890abcdefghijklmn";
//		String returnMsg = "";
//		if(msg.length() < 10){
//			System.out.println(msg);
//		}else if(msg.length() < 15){
//			returnMsg = msg.substring(0,14) + "\n" + msg.substring(14,20);
//			System.out.println(returnMsg);
//		}else{
//			returnMsg = msg.substring(0,14) + "\n" + msg.substring(14,20) + "\n" + msg.substring(20, msg.length());
//			System.out.println(returnMsg);
//		}
//		//HelloController a = new HelloController();
//		//a.checkTransValue();
//		//itsmCheckListInfo.selectCheckListInfo();
//	}
}