⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createcircular_pop.java

📁 一个日本流行的,功能较全的开源Web办公管理(Groupware)系统。
💻 JAVA
字号:
package jp.co.sjts.gsession.circular;

/**
 * 夞棗斅堦棗夋柺嶌惉  Createcircular_pop.java
 * Copyright (C) 1999-2000 Japan Total System Co,LTD
 *	  Junichi K		<kaneuchi@sjts.co.jp>
 */

import java.io.PrintWriter;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Arrays;
import jp.co.sjts.gsession.tools.*;

public class Createcircular_pop {
	Hashtable hsPara;
	CIReceirveFile ciFile;
	CIReceirveData ciData;
	String dataDIR;
	GSDate date;
	String mapURL;
	String helpURL; //
	String userID;
	CINoteFile cnData;

	static final String bgcolor = "#ffffff";
	static final String text = "#000000";
	static final String link = "#0000ff";
	static final String alink = "#ff0000";
	static final String vlink = "#00ffff";

	static final int WKDATE = 0;
	static final int TITLE = 1;
	static final int DATEKEY = 2;
	static final int YMD = 3;
	static final int CIRCID = 4;
	static final int USER = 5;
	static final int UMU = 6;
	static final int ROW_MAX = 5;

	public Createcircular_pop(Hashtable hsPara,String userID) {
		this.hsPara = hsPara;
		this.mapURL = (String)hsPara.get(CICmd.CI_MAP);
		this.dataDIR = (String)hsPara.get(CICmd.CI_DIR);
		this.userID = userID;
	}

	/**
	 * <P>夞棗斅堦棗夋柺傪嶌惉偟傑偡丅
	 *
	 * @param req - 儕僋僄僗僩
	 * @param res - 儗僗億儞僗
	 */
	protected void write(PrintWriter pw,String url) throws GSException {

		pw.println("<!--夞棗斅 START-->");
		pw.println("  <TABLE WIDTH=\"100%\" BORDER=\"2\" CELLSPACING=\"0\" CELLPADDING=\"0\">");
		pw.println("  <TR>");
		pw.println("  <TD BGCOLOR=\"#000080\"><FONT COLOR=\"#ffffff\"><B>夞棗斅</B></FONT></TD>");
		pw.println("  </TR>");
		pw.println("  <TR>");
		pw.println("  <TD>");
		pw.println("    <TABLE WIDTH=\"100%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"0\">");
		ciFile = new CIReceirveFile(dataDIR,userID);
		if(ciFile.size() == 0){
			pw.println("    <TR>");
			pw.println("    <TD><FONT COLOR=\"#888888\"><B>夞棗偼撏偄偰偄傑偣傫丅</B></FONT></TD>");
			pw.println("    </TR>");
		}
		else {
			pw.println("    <TR BGCOLOR=\"#8080ff\">");
			pw.println("    <TH WIDTH=\"70%\" NOWRAP><FONT COLOR=\"#ffffff\">僞僀僩儖</FONT></TH>");
			pw.println("    <TH WIDTH=\"15%\" NOWRAP><FONT COLOR=\"#ffffff\">擔晅</FONT></TH>");
			pw.println("    <TH WIDTH=\"15%\" NOWRAP><FONT COLOR=\"#ffffff\">搳峞幰</FONT></TH>");
			pw.println("    </TR>");

			date = new GSDate();
			int Today = Integer.parseInt(date.getYMD());
			Vector vecCircular = new Vector();
			Object[] Circulars = null;
			for(int i = 0; i < ciFile.size(); i++){
				Vector cirdata = new Vector(7);
				ciData = ciFile.Getmod(i);	// 柧嵶撉傒崬傒
				date.setYMDHMS(ciData.GetDate());
				cnData = new CINoteFile(dataDIR,ciData.GetCircid(),0);
				int wkdate = Integer.parseInt(date.getYMD());
				wkdate = wkdate + Integer.parseInt( ciData.GetLimit() );
				cirdata.add(Integer.toString(wkdate));
				cirdata.add(ciData.GetTitol());
				cirdata.add(new Long(date.getTime()));
				cirdata.add( date.getstrYear() + "擭" +
							 date.getstrMonth() + "寧" + 
							 date.getstrDay() + "擔 ");
				cirdata.add(ciData.GetCircid());
				cirdata.add(ciData.GetUname());
				cirdata.add(ciData.GetUmu());
				vecCircular.add(cirdata);
			}
			Circulars = vecCircular.toArray();
			// 僜乕僩
			GSSort cirsort = new GSSort(false,DATEKEY);
			Arrays.sort(Circulars,cirsort);

			//柧嵶峴
			boolean mode = true;
			for(int i=0; i < ROW_MAX && i < Circulars.length; i++){
				Vector cirdata = (Vector)Circulars[i];
				// BGCOLOR傪愝掕
			//	if(Today > Integer.parseInt((String)cirdata.get(WKDATE)))
			//		pw.println("    <TR BGCOLOR=\"#ff00ff\">");
			//		pw.println("<B></B>");
			//	else if(mode)
				if(mode)
					pw.println("    <TR BGCOLOR=\"#f0f0f0\">");
				else
					pw.println("    <TR BGCOLOR=\"#bebebe\">");

				mode = !mode;

				// 妋擣僼儔僌傪庢摼
				int check = Integer.parseInt((String)cirdata.get(UMU));

				// 桳岠婜尷敾掕
				boolean eff = true;
				if(Today > Integer.parseInt((String)cirdata.get(WKDATE))) {
					eff = false;
					check = 0;
				}

				// 僞僀僩儖
				pw.println("    <TD>" + ((check == 0)?"<B>":""));
				pw.println("    <A HREF=\"#\" onClick=\"window.open('" + url + "?" + CICmd.PA_CMD + "=" + CICmd.CI_MSG
						   + "&" + CICmd.PA_CID + "=" + ((String)cirdata.get(CIRCID))
						   + "&" + CICmd.PA_PAG + "=" + Integer.toString(1)
						   + "&" + CICmd.PA_MOD + "=" + "0"
						   + "&miniwindow=1"
						   + "','sample','width=620,height=300,scrollbars=1,resizable=1')\">" 
						   + ((!eff)?"<FONT COLOR=\"#ff0000\">":"")
						   + (String)cirdata.get(TITLE)
						   + ((!eff)?"</FONT></A>":"</A>"));
				pw.println(((check == 0)?"    </B>":"    ") + "</TD>");

				// 擭寧擔
				pw.println("    <TD ALIGN=\"center\" NOWRAP>" + ((check == 0)?"<B>":"")
						   + ((!eff)?"<FONT COLOR=\"#ff0000\">":"")
						   + (String)cirdata.get(YMD) + ((check == 0)?"</B>":"")
						   + ((!eff)?"</FONT></TD>":"</TD>"));
				// 搳峞幰
		//		pw.println("    <TD NOWRAP>" + ((check == 0)?"<B>":"") + (String)cirdata.get(USER) + ((check == 0)?"</B>":"") + "</TD>");
				pw.println("    <TD NOWRAP>" + ((check == 0)?"<B>":"") 
						   + ((!eff)?"<FONT COLOR=\"ff0000\">":"")
						   + (String)cirdata.get(USER) + ((check == 0)?"</B>":"")
						   + ((!eff)?"</FONT></TD>":"</TD>"));

				pw.println("    </TR>");
			}
		}
		pw.println("    </TABLE>");
		pw.println("  </TD>");
		pw.println("  </TR>");
		pw.println("  </TABLE>");
		pw.println("<!--夞棗斅 END-->");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -